id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
103613 | """
Octave
======
Module for working with octaves.
The following is an example on how to use :class:`acoustics.octave.Octave`.
.. literalinclude:: ../examples/octave.py
"""
from __future__ import division
import numpy as np
REFERENCE = 1000.0
"""
Reference frequency.
"""
def band_of_frequency(f, order=1, ref=REF... | StarcoderdataPython |
39821 | <filename>examples/old-examples/pygame/01_hello_world.py
import struct
import ModernGL
import pygame
from pygame.locals import DOUBLEBUF, OPENGL
pygame.init()
pygame.display.set_mode((800, 600), DOUBLEBUF | OPENGL)
ctx = ModernGL.create_context()
vert = ctx.vertex_shader('''
#version 330
in vec2 vert;
v... | StarcoderdataPython |
12690 | <gh_stars>10-100
cantidad= input("Cuantas personas van a cenar?")
cant = int(cantidad)
print(cant)
if cant > 8:
print("Lo siento, tendran que esperar")
else:
print("La mesa esta lista")
| StarcoderdataPython |
146986 | from .pytorch_optimizer import * | StarcoderdataPython |
3289496 | <filename>astroquery/mast/cutouts.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
MAST Tesscut
============
Cutout queries on TESS FFIs.
"""
import warnings
import time
import json
import zipfile
import os
from io import BytesIO
import numpy as np
import astropy.units as u
from astropy.co... | StarcoderdataPython |
140461 | <filename>main.py
import sys
import logging
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='femorph')
parser.add_argument('--full_screen',
help='Run in full screen',
action="store_true")
parser.add_argument(
... | StarcoderdataPython |
55909 | <filename>extensions/exclusive/exclusive.py
#!/usr/bin/env python
from extensions.bas_extension import BaseExtension
from config import Config
from utils import Utils
from record import Record
from knowledgegraph import KnowledgeGraph
import os
class Exclusive(BaseExtension):
def __init__(self):
BaseExte... | StarcoderdataPython |
1729080 | from django import forms
from .models import (InputResult,
RowToColumn,
ColumnToRow,
DeleteDuplicates,
NumbersInWords,
ListSorting,
ChangeCase,
Autofill,
... | StarcoderdataPython |
1713639 | import os
import sys
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
warnings.simplefilter(action='ignore', category=Warning)
import torch | StarcoderdataPython |
138679 | # -*- coding: utf-8 -*-
"""The APFS container path specification resolver helper implementation."""
from dfvfs.lib import definitions
from dfvfs.resolver_helpers import manager
from dfvfs.resolver_helpers import resolver_helper
from dfvfs.vfs import apfs_container_file_system
class APFSContainerResolverHelper(resolv... | StarcoderdataPython |
1754267 | <gh_stars>0
from __future__ import print_function
import sys
import os
import argparse
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torchvision.transforms as transforms
from torch.autograd import Variable
from data import VOC_ROOT, VOC_CLASSES, SH... | StarcoderdataPython |
3374906 | <reponame>UESTC-Liuxin/SkmtSeg<filename>modeling/head/danet.py
###########################################################################
# Created by: <NAME>
# Email: <EMAIL>
# Copyright (c) 2018
###########################################################################
from __future__ import division
import torch.... | StarcoderdataPython |
3391369 | from datetime import datetime
# from errno import ENOENT
from json import dump as json_dump
from json import load
# from os import environ, strerror
from os import environ
# from os.path import isfile, join
from os.path import join
from platform import system
def get_data_dir() -> str:
dir_path: str = {
'... | StarcoderdataPython |
1643238 | <gh_stars>10-100
import re
import requests
def get_duplicates(lists):
seen = set()
repeated = set()
for values in lists:
for value in values: # set(values)
repeated.add(value) if value in seen else seen.add(value)
return repeated
def get_extensions(all_extensions, excluded_exte... | StarcoderdataPython |
1792949 | <gh_stars>0
import typing
from decimal import Decimal
import pydantic
import stackprinter
stackprinter.set_excepthook(style="darkbg2")
from crypto_dom.kraken.definitions import ASSETCLASS, ASSET
# ============================================================
# DEPOSIT METHODS
# =====================================... | StarcoderdataPython |
183900 | import torch
from torch._C import _parse_source_def
import torch.nn as nn
import torch.nn.functional as F
import gym
import random
from collections import deque
import numpy as np
class SimpleNet(nn.Module):
def __init__(self, input_size, hidden_size, action_size):
super(SimpleNet, self).__init__()
... | StarcoderdataPython |
114680 | <filename>test/TestCompare.py
import unittest
import os
from mock import patch,MagicMock
from albackup.compare import DbCompare
_baseDir=os.path.abspath(os.path.join(os.path.dirname(__file__),'..'))
class TestDbCompare(unittest.TestCase):
def setUp(self):
super(TestDbCompare,self).setUp()
ref_cfg={
"name": "... | StarcoderdataPython |
12484 | <filename>dbSchema.py
import datetime
from sqlalchemy import Column, Integer, Boolean, ForeignKey, String, DateTime, UniqueConstraint, ForeignKeyConstraint
from sqlalchemy.orm import relationship
from dbConfig import Base, engine
class GroupStatus(Base):
__tablename__ = "groupstatus"
id = Column(Integer, pri... | StarcoderdataPython |
83620 | from pyweidentity.weidentityService import weidentityService
URL = "http://172.16.58.3:6001"
# WeIdentity RestService URL
weid = weidentityService(URL)
# create_weid = weid.create_weidentity_did()
# print(create_weid)
_weid = "did:weid:3:0xbce3653371dd7d77aebd17a6832dca8eb8c8a212"
# 创建cpt
# cptJsonSchema = {
# ... | StarcoderdataPython |
3341508 | from __future__ import absolute_import
from __future__ import division
import os.path
import numpy as np
from nipype.interfaces.base import (
TraitedSpec, BaseInterface, File, traits, isdefined)
try:
import matplotlib.pyplot as plt
except ImportError:
plt = None
import nibabel as nib
from nianalysis.excepti... | StarcoderdataPython |
3328490 | from pandas import read_csv
from numpy import set_printoptions
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import chi2
from sklearn.feature_selection import RFE
from sklearn.linear_model import LogisticRegression
from sklearn.decomposition import PCA
from sklearn.ensemble import Ext... | StarcoderdataPython |
3243997 | from __future__ import division, print_function
from itertools import combinations
import numpy as np
from joblib import Parallel, delayed
from oddt.docking.internal import generate_rotor_vector
from oddt import random_seed
class GeneticAlgorithm(object):
def __init__(self, engine, n_population=100, n_generations... | StarcoderdataPython |
1738699 | <gh_stars>1-10
import unittest
import greenstack
import _test_extension_cpp
class CPPTests(unittest.TestCase):
def test_exception_switch(self):
greenstacks = []
for i in range(4):
g = greenstack.greenstack(_test_extension_cpp.test_exception_switch)
g.switch(i)
g... | StarcoderdataPython |
133230 | from airflow.providers.postgres.hooks.postgres import PostgresHook
from airflow.models.baseoperator import BaseOperator
from airflow.utils.decorators import apply_defaults
class RedshiftRunOperator(BaseOperator):
ui_color = '#F98866'
template_fields = ["sql"]
@apply_defaults
def __init__(self,
... | StarcoderdataPython |
169061 | <gh_stars>0
import torch
import torch.optim as optim
import torch.utils.data as data_utils
import os
from pointnetae.model import PointNetAE
from pointnetae.config import *
from pointnetae.utils import *
from pointnetae.dataset import SceneDataset
# from torch.utils.data.dataloader import default_collate # for batchin... | StarcoderdataPython |
3363444 | <gh_stars>1-10
from i3Deep import utils
import numpy as np
from tqdm import tqdm
import os
gt_path = "/gris/gris-f/homelv/kgotkows/datasets/nnUnet_datasets/nnUNet_raw_data/nnUNet_raw_data/Task070_guided_all_public_ggo/refinement_test/labels/"
gt_filenames = utils.load_filenames(gt_path)
names, severity_scores... | StarcoderdataPython |
1691898 | <filename>open_spiel/python/examples/tic_tac_toe_nfsp_eval_au_bp.py<gh_stars>0
# Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at... | StarcoderdataPython |
3218385 | <filename>PyFlow/Packages/DepthAI_Host/Nodes/FrameOps/BBoxOverlayNode.py
import cv2
import numpy as np
from common import HostNode, get_property_value
from PyFlow.Core.Common import *
from PyFlow.Core.NodeBase import NodePinsSuggestionsHelper
from config import DEBUG
def hex_to_rgb(hex_string):
r_hex = hex_strin... | StarcoderdataPython |
1657298 | from resource_management.libraries.script.script import Script
from resource_management.core.resources.system import Execute
from resource_management.libraries.resources.xml_config import XmlConfig
from hdfs import hdfs, install_hadoop
from resource_management.libraries.functions.check_process_status import check_proce... | StarcoderdataPython |
85878 | import clusto
from clusto.schema import Attribute
from clusto.drivers.base import ResourceManager, ResourceTypeException, Driver
from clusto.exceptions import ResourceNotAvailableException, ResourceException
import IPy
class IPManager(ResourceManager):
"""Resource Manager for IP spaces
roughly follows t... | StarcoderdataPython |
3304497 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###
# Name: <NAME> and <NAME>
# Email: <EMAIL> and <EMAIL>
# Student ID: 2258875 and 1818306
# Class: PHYS220
# Assignment: CW12
###
import numpy as np
import nose
import sombrero as sb
"""This module constains three test functions for three simple cases of the system""... | StarcoderdataPython |
3348996 | <filename>test/test_template.py
import os
from mako import exceptions
from mako import runtime
from mako import util
from mako.ext.preprocessors import convert_comments
from mako.lookup import TemplateLookup
from mako.template import ModuleInfo
from mako.template import ModuleTemplate
from mako.template import Templat... | StarcoderdataPython |
1778984 | # Copyright (c) 2016, <NAME> <<EMAIL>>
# All rights reserved.
from interfaces._util import get_json
def ksp_versions():
return [e["friendly_version"] for e in get_json("https://spacedock.info/api/kspversions")]
def mod_info(mod_id):
return get_json("https://spacedock.info/api/mod/%i" % mod_id)
| StarcoderdataPython |
1651725 | #! flask/bin/python
from os.path import abspath
from flask import current_app
from flask.ext.script import Manager
from flask.ext.assets import ManageAssets
from flask.ext.migrate import Migrate, MigrateCommand
from bluespot import create_app
app = create_app(mode= 'development')
app.run(host='0.0.0.0',debug = Tr... | StarcoderdataPython |
3355439 | # -*- coding: utf-8 -*-
import openerp
from openerp.osv import fields
from openerp.osv.orm import Model
class test_uninstall_model(Model):
"""
This model uses different types of columns to make it possible to test
the uninstall feature of OpenERP.
"""
_name = 'test_uninstall.model'
_columns = ... | StarcoderdataPython |
3267496 | """
CutBlur
Copyright 2020-present NAVER corp.
MIT license
"""
import importlib
import numpy as np
import skimage.color as color
import skimage.io as io
import torch
import utils
def generate_loader(phase, opt):
cname = opt.dataset.replace("_", "")
if "DIV2K" in opt.dataset:
mname = importlib.import... | StarcoderdataPython |
3214979 | <gh_stars>0
import unittest
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC
from yyskmultilearn.problem_transform import BinaryRelevance
from yyskmultilearn.tests.classifier_basetest import ClassifierBaseTest
class BRTest(ClassifierBaseTest):
def test_if_sparse_classification_works_on_non... | StarcoderdataPython |
155003 | import json
import os
import sys
from pathlib import Path
from django.core.management.base import BaseCommand
from django.db import transaction
from mycarehub.screeningtools.models import ScreeningToolsQuestion
class Command(BaseCommand):
help = "Loads the screening tool questions to the database"
@transac... | StarcoderdataPython |
76575 | <reponame>mbr/portflakes
import sys
from itertools import product
import json
import re
import time
from xml.etree import ElementTree as ET
import click
import serial
from .io import Echo, RandomDataGenerator, SerialIO
from .gui import run_gui
from .util import parse_8bit, decode_8bit
PARITIES = ['none', 'even', 'odd... | StarcoderdataPython |
7689 | <reponame>myelin/appengine-python-standard<gh_stars>0
#!/usr/bin/env python
#
# Copyright 2007 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | StarcoderdataPython |
196935 | from django.db import models
from django.contrib.auth import get_user_model
from django.utils.text import slugify
from django.urls import reverse
# Create your models here.
User = get_user_model()
class Course(models.Model):
"""Model instance to represent a course on the website"""
created_by = models.Fore... | StarcoderdataPython |
1771514 | <reponame>icmpnorequest/URL_Reputation_Classification
'''
Whois Feature Set
Tthe registration, update, and expiration dates,
a bag-of- words representation of the registrar and registrant.
'''
import whois
from dns import query
from urllib.parse import urlparse
import whois
import tldextract
import pandas as pd
import... | StarcoderdataPython |
1623359 | <filename>monitoria-ilp/lista5/k7.py
n = int(input())
arr = [int(e) for e in input().split()]
bar = [int(e) for e in input().split()]
count = 0
for carta in bar:
for i in arr:
if carta == i:
count += 1
break
print("Exodia Obliterar" if count == len(bar) else "Voce perdeu Yugi")
| StarcoderdataPython |
3293281 | <reponame>echaussidon/desispec<filename>py/desispec/scripts/qa_night.py<gh_stars>10-100
# Script for analyzing QA from a Night
from __future__ import absolute_import, division
import argparse
from desispec.qa import __offline_qa_version__
def parse(options=None):
parser = argparse.ArgumentParser(description="Ana... | StarcoderdataPython |
125692 | <filename>BigDataMicroMajor/Python/DailyHomework/Lesson10_numpy/2_numpyNorm.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# @Time : 2020/11/10 18:22
# @Author : 咸鱼型233
# @File : 2_numpyNorm.py
# @Software: PyCharm
# @Function: 用numpy求欧氏距离
import numpy as np
import math # 用于比对的包
a = np.array([0, 0, 0])
b = np.arr... | StarcoderdataPython |
1631451 | # _*_coding:utf-8_*
import string
from random import *
import codecs
from math import sqrt
import time
#fichier = open("ResultatsRSA.txt", "w")
def euclide(a,b):
#Return the higher common divider of a and b. Used to test if a and b are firts together.
if (b==0) :
return a
else :
r=a%b
return euclide(b,r)
de... | StarcoderdataPython |
1612121 | <reponame>SemaphoreSolutions/hl7apy<gh_stars>0
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2015, CRS4
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including witho... | StarcoderdataPython |
1633380 | <filename>tests/helpers/test_auto_wiring.py<gh_stars>0
import functools
from typing import Callable
import pytest
from antidote import (factory, inject, LazyConstantsMeta, new_container, provider,
register, wire)
from antidote.core import DependencyContainer, DependencyProvider
from antidote.exc... | StarcoderdataPython |
1784035 | # Copyright 2021 Radio Moreeni
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | StarcoderdataPython |
1750791 | import torch
import numpy as np
import dnnutil.network as network
import time
__all__ = ['calculate_accuracy', 'Trainer', 'ClassifierTrainer', 'AutoencoderTrainer']
def calculate_accuracy(prediction, label, axis=1):
'''calculate_accuracy(prediction, label)
Computes the mean accuracy over a batch of pre... | StarcoderdataPython |
4819745 | """Setup script.
Run "python3 setup --help-commands" to list all available commands and their
descriptions.
"""
import os
from subprocess import call
from setuptools import Command, find_packages, setup
class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
user_options = []
... | StarcoderdataPython |
3306218 | from setuptools import setup, find_packages, Extension
setup(
name = "InDumpCo",
version = "0.100",
packages = ['indumpco'],
scripts = ['bin/indumpco-create', 'bin/indumpco-extract', 'bin/indumpco-repack'],
ext_modules = [Extension("indumpco.fletcher_sum_split", sources=["fletcher_sum_split.c"])],
... | StarcoderdataPython |
1759930 | from PySide.QtGui import QDialog
from ..gui.new_image_dialog import Ui_NewImageDialog
class NewImageDialog(QDialog):
def __init__(self, parent=None):
super(NewImageDialog, self).__init__(parent)
self.ui = Ui_NewImageDialog()
self.ui.setupUi(self)
self.size = None
self.ui... | StarcoderdataPython |
69980 | <gh_stars>0
#!/usr/bin/python
import netifaces
from ..register import FpgaReg
class TxMac:
# Class constructor
def __init__(self):
# Initialize register management class
self.FpgaReg = FpgaReg.FpgaReg()
def SetTxEnable(self, Enable):
self.FpgaReg.FpgaMem.WriteBits("eth_mac", "T... | StarcoderdataPython |
3267482 | <reponame>Wuradclan/programming-course
HEADER = """---
marp: true
---
"""
def change_code_format(text):
text = text.replace("{.python .listing}", "python")
text = text.replace("{.python}", "python")
return text
def split_slides(text):
slides = []
latest_slide = ""
for line in text.split('\n'):... | StarcoderdataPython |
87458 | <filename>src/apps/address/__init__.py
default_app_config = 'apps.address.apps.AddressConfig'
| StarcoderdataPython |
30731 | # Generated by Django 3.1.7 on 2021-03-19 15:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("track", "0021_auto_20200915_1528"),
]
operations = [
migrations.RemoveField(
model_name="track",
name="parser",
),
... | StarcoderdataPython |
50736 | """
LIST: CHUNKING
"""
__author__ = '<NAME> - <EMAIL>'
__twitter__ = '@solamour'
__version__ = '1.0.0'
# Example of Chunking (Grouping an item with its next)
def chunks(list, number): # Requires a list and a number
for index in range(0, len(list), number): # For every
# index inside of a number range st... | StarcoderdataPython |
1607733 | """Provides the Member class."""
from typing import TYPE_CHECKING, Optional, Dict, Any, Union
from .base import DriveBase
from .file import File
from .folder import Folder
if TYPE_CHECKING:
from .. import TekDrive
class Trash(DriveBase):
"""
Represents a file or folder that has been placed in the trashc... | StarcoderdataPython |
3298661 | <reponame>try21tatsuya/my-perfect-script<gh_stars>0
print("This is a new file.")
| StarcoderdataPython |
26536 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator 2.3.3... | StarcoderdataPython |
3367781 | #!/usr/bin/env python3
"""Print some stats for each benchmark problem"""
import os
from typing import Dict
import numpy as np
import pandas as pd
import petab
markdown_columns = {
'conditions': 'Conditions',
'estimated_parameters': 'Estimated Parameters',
'events': 'Events',
'measurements': 'Measure... | StarcoderdataPython |
1610823 | <gh_stars>0
import sys
required_verion = (3,)
if sys.version_info < required_verion:
raise ValueError('ceilopy needs at least python {}! You are trying to install it under python {}'.format('.'.join(str(i) for i in required_verion), sys.version))
from setuptools import setup, find_packages
setup(
name="ceilo... | StarcoderdataPython |
3253062 | from django.contrib import admin
from ourteam.models import OurTeam
# Register your models here.
admin.site.register(OurTeam)
| StarcoderdataPython |
1655965 | import csv
# Copia solo le colonne desiderate da un file csv e rinomina il campo 'Accepted',
# nel caso ci fosse, in 'Successful'.
#
# parametri:
# input_file: nome del file csv da cui leggere
# output_file: nome del file csv su cui scrivere, il file conterra' tutte le colonne
# di input_file tranne quelle definite ... | StarcoderdataPython |
155140 | <filename>QuizUI/Ui_main.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'c:\Users\mixaj\Documents\Python1_2021\Quiz app\main.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit... | StarcoderdataPython |
3340095 | <reponame>sjsucohort6/openstack
#!/usr/bin/env python
from six import StringIO
import yaml
from cliff.formatters import yaml_format
import mock
def test_yaml_format_one():
sf = yaml_format.YAMLFormatter()
c = ('a', 'b', 'c', 'd')
d = ('A', 'B', 'C', '"escape me"')
expected = {
'a': 'A',
... | StarcoderdataPython |
1795745 | <gh_stars>0
from math import inf
from typing import Iterable, List
from cached_property import cached_property
from cu_pass.dpa_calculator.aggregate_interference_calculator.aggregate_interference_calculator_ntia.helpers.cbsd_interference_calculator.variables import \
InterferenceComponents
from reference_models.i... | StarcoderdataPython |
3315372 | import pytest
from telegram import User, Chat, Video, Audio, Message
@pytest.fixture(scope="function", params=[{'video': Video("my_id", 12, 12, 12)}, {'audio':Audio("audio_id",12)}], ids=['video', 'audio'])
def tester(request):
return Message(1,User(1, "aa"), None, Chat(2, 'private'), **request.param)
... | StarcoderdataPython |
3296367 | #!/usr/bin/env python3
import json
import sys
import requests
# Must be exactly three lines each!
# No trailing newline! (I.e. keep it as backslash-newline-tripleapostrophe.)
TEMPLATE_PUSH = '''\
{commit}{post_commit} (pushed master: {status}) {compare} https://github.com/prana-osOS/prana-os/actions/runs/{run_id}\
''... | StarcoderdataPython |
3332847 | # -*- coding:utf-8 -*-
# !/usr/bin/env python3
"""
get proxy ip in china high anonymous
(need lxml(c-dependencies) or beautifulsoup4(pure python))
"""
from minghu6.internet.proxy_ip import proxy_ip
def main(loop=None,
dbname=None, # None means connect to reserved db
check=False,
... | StarcoderdataPython |
1726161 | <gh_stars>0
import resquiggledFAST5 as rs
import sys
if __name__ == "__main__":
filename = "./data/dac.fast5"
if len(sys.argv) > 1:
filename = sys.argv[1]
f = rs.ResquiggledFAST5(filename)
print(f.get_nucleotide_positions.__doc__)
#print(f.get_fastq())
print(f.get_events())
print(f.g... | StarcoderdataPython |
86728 | <filename>custom_components/teleinformation/dongle.py<gh_stars>1-10
"""Representation of an Teleinformation dongle."""
import asyncio
import glob
import logging
from typing import Dict
import serial
import serial_asyncio
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EVENT_HOMEASS... | StarcoderdataPython |
3298535 | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import mock
from analysis.analysis_testcase import AnalysisTestCase
from analysis.chrome_crash_data import ChromeCrashData
from analysis.chrome_... | StarcoderdataPython |
1741247 | """
Benching joblib pickle I/O.
Warning: this is slow, and the benchs are easily offset by other disk
activity.
"""
import os
import time
import shutil
import numpy as np
import joblib
import gc
from joblib.disk import disk_used
try:
from memory_profiler import memory_usage
except ImportError:
memory_usage =... | StarcoderdataPython |
3225178 | import os
from Bio.SeqUtils import GC
from Bio.SeqUtils import GC123
from Bio import pairwise2
from Bio.pairwise2 import format_alignment
def mainloop():
seq = input("Sequence 1:")
seq2 = input("Sequence 2:")
alignments = pairwise2.align.globalxx(seq, seq2)
print(format_alignment(*alignments[0]))
print(... | StarcoderdataPython |
3309411 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by <NAME>, <EMAIL>, All rights reserved.
# LLNL-CODE-647188
#
# For det... | StarcoderdataPython |
1672032 | <reponame>KohYoungResearchAmerica/MONAI<gh_stars>1-10
# Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#... | StarcoderdataPython |
62267 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
from RecoPixelVertexing.PixelLowPtUtilities.StripSubClusterShapeFilter_cfi import StripSubClusterShapeFilterParams
StripSubClusterShapeSeedFilter = cms.PSet(
StripSubClusterShapeFilterParams,
ComponentName = cms.string('StripSubClusterShapeSeedFilter'... | StarcoderdataPython |
179549 | # Generated by Django 3.1.1 on 2020-09-04 02:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailcore', '0052_pagelogentry'),
]
operations = [
migrations.CreateMo... | StarcoderdataPython |
3386583 | with open('default_select_only') as f:
conn = 0
latency = 0
tps = 0
init_conn_time = 0
for line in f.readlines():
if 'number of clients' in line:
conn = line[18:-1]
if 'latency average = ' in line:
latency = line[17:-3]
if 'initial connection time = ' ... | StarcoderdataPython |
1770675 | from search import Problem
def h(node):
eye, snap, star, wave, exp, hide, ymca, fist, time, goal = node.state
return goal - time
EYE, SNAP, STAR, WAVE, EXP, HIDE, YMCA, FIST, PAUSE = range(9)
TIMES = [500, 800, 360, 700, 408, 500, 936, 800, 1]
class A(Problem):
def value(self, state):
... | StarcoderdataPython |
1601153 | <reponame>KZzizzle/osparc-simcore
# added as minimal integration tests
def test_mock():
assert True
| StarcoderdataPython |
58429 | from django.core.exceptions import ObjectDoesNotExist
from django.db import models
# Create your models here.
class User(models.Model):
sex_choice = (
(0, '男'),
(1, '女'),
)
id = models.AutoField(primary_key=True) # 用户ID
role = models.ForeignKey('Role', on_delete=models.CASCADE, defaul... | StarcoderdataPython |
1793376 |
from credstuffer.db.connector import DBConnector
from credstuffer.db.creator import DBCreator
from credstuffer.db.fetcher import DBFetcher
from credstuffer.db.inserter import DBInserter
| StarcoderdataPython |
1648315 | from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.insert(0,'../powderday/agn_models/')
from hopkins import agn_spectrum as hopkins_agn
from astropy import units as u
from astropy import constants as const
import h5py
fr... | StarcoderdataPython |
151419 | <gh_stars>0
#!/usr/local/bin/python3
#vim: set expandtab:
#vim: tabstop=4:
#vim: ai:
#vim: shiftwidth=4:
from pymarc.field import Field
from pymarc import MARCReader
from pymarc import RecordLengthInvalid
import optparse
import os
class OutputHandler:
def __init__(self, prefix):
self.prefix = prefix
... | StarcoderdataPython |
103416 | from .Dataset import Dataset
from .constants import *
from .DataLoader import DataLoader, create_datasets
from .Dict import Dict | StarcoderdataPython |
99344 | <reponame>Inveracity/flynt<gh_stars>100-1000
a = 2
b = "wuga"
print(f'{a:f} {b}')
| StarcoderdataPython |
103825 | <reponame>ari-viitala/RLDonkeyCar
from .functions import image_to_ascii
| StarcoderdataPython |
1797910 | <reponame>opennode/waldur-openstack
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from rest_framework import decorators, exceptions, response, status, serializers as rf_serializers
from waldur_core.core import validators as core_validators, exceptions as core_exceptions
from ... | StarcoderdataPython |
1612704 | # To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
from ml.nn import *
from datasets.dataset import load_mnist
import matplotlib.pyplot as plt
# %%
(x_train, t_train), (x_test, t_test) = load_mnist()
# %%
img = np.reshape(x_train[1], (28, 28))
# %%
input_size = 784
output_... | StarcoderdataPython |
160747 | <gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-29 15:18
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import i18nfield.fields
import pretalx.common.mixins
class Migration(migrations.Migra... | StarcoderdataPython |
166541 | <reponame>DeToxFox/MidtermSprintGrp22A-5<filename>Grp22A-5 SprintProject 1.py
# Employee Claims Processing System (work trips) at the NL Chocolate Company
# Written by: Group 22A-5, <NAME>, <NAME>, and <NAME>
# Date written: Feb 25, 2022
# Project ID: Midterm Sprint Week. Project 1: NL Chocolate Company, Claims Proces... | StarcoderdataPython |
1746106 | from datetime import datetime, timedelta
from airflow import DAG
from airflow.contrib.hooks.ssh_hook import SSHHook
from airflow.contrib.operators.ssh_operator import SSHOperator
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.goodreads_plugin import DataQualityOperator
from airf... | StarcoderdataPython |
144610 | <reponame>DilwoarH/digitalmarketplace-utils
from dmutils.flask_init import pluralize
import pytest
@pytest.mark.parametrize("count,singular,plural,output", [
(0, "person", "people", "people"),
(1, "person", "people", "person"),
(2, "person", "people", "people"),
])
def test_pluralize(count, singular, plur... | StarcoderdataPython |
167497 | <reponame>cnvrg/keras
import pytest
import numpy as np
from keras import backend as K
from keras.layers import core
from keras.utils.test_utils import layer_test, keras_test
@keras_test
def test_masking():
layer_test(core.Masking,
kwargs={},
input_shape=(3, 2, 3))
@... | StarcoderdataPython |
39456 | <gh_stars>0
import os
import commands
import sys
import json
from optparse import OptionParser
global CROSSWALK_VERSION
with open("../../tools/VERSION", "rt") as pkg_version_file:
pkg_version_raw = pkg_version_file.read()
pkg_version_file.close()
pkg_version_json = json.loads(pkg_version_raw)
CROSSWALK_... | StarcoderdataPython |
3246013 | <reponame>Rory-Sullivan/lambda
from django.urls import path, include
from . import views
urlpatterns = [
path("", views.TaskListView.as_view(), name="all-tasks"),
path("active/", views.ActiveTaskListView.as_view(), name="active-tasks"),
path(
"completed/",
views.CompletedTaskListView.as_vie... | StarcoderdataPython |
1739320 | import logging
from . import Direction, GameObject, SnakeSegment
class Snake(GameObject):
def __init__(self, speed, location, tags, controller = None):
tags.append("snake")
super().__init__(tags)
self.logger = logging.getLogger(__name__)
self.speed = speed
self.score = 0
... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.