ngram
listlengths
0
82k
[ "xs[i] curr_y = ys[i] curr_sample_chr = curr_sample['chromosome_data'][snp_chr] curr_sample_chr['xs'][snp_index] = curr_x", "[float(y) for y in get_data(next_y_row)] yield snp_id, genos, xs, ys", "= { 'xs': [float('nan')] * curr_snp_count, 'ys': [float('nan')] * curr_snp_count,", "while True: next_geno_row = ...
[ "json.load(jsonFile) c = 0 # Count the number of chat", "mainFreqPath = basepath + 'hangoutfreq.txt' # This is the path", "print(u'Total number of chats: {0:d}'.format(c)) jsonFile.close() outFile.close() # The intermediate", "output file paths. dict = sorted alphabetical; freq = sorted", "outFile.write(str...
[ "= os.path.join(danmu_file_dir, danmu_file) danmu_file_list.append(dm_file) for dm_file in tqdm(danmu_file_list): add_count_info =", "1 danmu_delta_max = (delta_idx + 1) * danmu_delta_minute * 60", "50 delta_max = len(list(users_info.items())[0][1]) print('user stay top 50(max {max}):'.format(max =", "help='d...
[ "random choice # https://stackoverflow.com/questions/4859292/how-to-get-a-random-value-from-dictionary-in-python notes = [] #random.choice(notes) # dictionaries", "mido from mido import MidiFile # what things to store?", "https://www.w3schools.com/python/python_dictionaries.asp # { note : recorded_data[] } chan...
[ "], license='Apache v2', long_description='Client for the Anna KVS', install_requires=['zmq', 'protobuf'],", "--python_out=. ' + 'kvs.proto') os.system('cd anna && protoc -I=../../../../include/proto --python_out=.", "install class InstallWrapper(install): def run(self): # compile the relevant protobufs", "re...
[ "check_if_can_learn, PlayerParser, AbilityForbidden, \\ NotAPlayer, BOTCUtils, DeadOnlyCommand, NotDawn, NotDMChannel, check_if_is_dawn", "# Incorrect channel -> NotDMChannel elif isinstance(error, NotDMChannel): return #", "commands.BadArgument): return # Incorrect phase -> NotNight elif isinstance(error, NotD...
[ "= field_type self.default_value = default_value class IInteractiveSource(object): \"\"\" A content", "def __init__(self, name, field_type, default_value): self.name = name self.field_type =", "content source that a user can interact with in the", "NotImplementedError() def createContent(self, args): raise No...
[ "film_embed(film) def random_line(afile, default=None): line = default for i, aline", "open(os.path.join(__location__, \"films.txt\"), \"r\", encoding=\"utf8\", errors=\"ignore\") film = random_line(f) f.close() return", "random_line(afile, default=None): line = default for i, aline in enumerate(afile,", "imp...
[ "_get_k8s_apps_api(env) k8s_deployment = k8s_apps_api.create_namespaced_deployment( body=deployment, namespace=namespace, ) wait_for_deployment(env, namespace, k8s_deployment)", "_get_k8s_batch_api(env) return k8s_batch_api.list_namespaced_job(namespace=namespace).items def is_running(job): conditions = job.statu...
[ "Hat, Inc # # Licensed under the Apache License, Version", "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR", "# # Licensed under the Apache License, Version 2.0 (the", "compliance with the License. # You may ...
[ "= current_config() bind = \"{host}:{port}\".format( host=app_config.get('KQUEEN_HOST'), port=app_config.get('KQUEEN_PORT'), ) timeout =", "= multiprocessing.cpu_count() * 2 + 1 worker_class = 'gthread' #", ") timeout = 180 workers = multiprocessing.cpu_count() * 2 +", "multiprocessing import os app_config = ...
[ "= '' key_id = '74G4697BU4' team_id = 'QTM38LJQ3P' am =", "'' key_id = '74G4697BU4' team_id = 'QTM38LJQ3P' am = applemusicpy.AppleMusic(secret_key,", "#print(r.text) #print(r.json()) import applemusicpy secret_key = '' key_id = '74G4697BU4'", "= requests.get('https://api.music.apple.com/v1/me/library/playlist...
[ "value=\"id1,id2\") assert value_is_str == \"id1,id2\" value_is_list = enf_comma_separated(name=\"array\", value=[\"id1\", \"id2\"])", "value_is_str == \"id1,id2\" value_is_list = enf_comma_separated(name=\"array\", value=[\"id1\", \"id2\"]) assert value_is_list", "\"\"\" import pytest from pytwitter.error impo...
[ "self._get(funcid) return routine.step() # global instance _copool = CoPool() add", "(with given timeout) instead of idle_add (in milliseconds) Only one", "funcid) def remove_all(self): \"\"\"Stop all running routines.\"\"\" for funcid in", "mutex/removal identifier for this function timeout -- use timeout_ad...
[]
[ "'password': '<PASSWORD>' } serializer = serializers.LoginSerializer(data=data) self.assertFalse(serializer.is_valid()) def test_login_null_username(self): data", "= { 'username': 'testuser' } serializer = serializers.LoginSerializer(data=data) self.assertFalse(serializer.is_valid()) self.assertEqual(len(serializ...
[ "'test_status_deleted': if bn.startswith(x): self._savedrepowc = save_repowc() def teardown_method(self, meth): x", "usually disabled \"\"\" old = cache.repositories.repos try: _repocache.clear() root =", "42 assert url == self.root.strpath def test_repocache_notimeout(self): repocache = cache.RepoCache()", "...
[ "b(self,n): return 1.9992*n - 0.3271 + 4*(405*n)**-1 def kappa(self,x, y,", "center_x=0, center_y=0): bn = self.b(n_sersic) r = (x**2+y**2*q**-2)**0.5 return k_eff*np.exp(-bn*((r*r_eff**-1)**(n_sersic**-1)-1))", "Sersic: def b(self,n): return 1.9992*n - 0.3271 + 4*(405*n)**-1 def", "r_eff, k_eff, q, center_x=...
[ "await client.send(json.dumps(res)) else: res = {\"Command\": \"ERROR\", \"Message\": \"Unknown Command\"}", "commandsHandler(self ,client,path): app = None try: print(\"Client connected..\") print(str(self.stop)) while", "\"DATA\", \"Params\":[data] , \"Message\": \"\"} await client.send(json.dumps(res)) else:...
[ "**kwargs): self._validate(files, dir, default) self._create_files(files, dir, filter, default, **kwargs) self._load_files()", "import AttrDict from app_settings import file_search from app_settings import FileFactory", "self._files: self.save(_name) @property def files(self): return list(self._files.keys()) de...
[ "processor plugins that are enabled. :returns: priority sorted processor plugins", "from tvrenamer.processors import base def load(): \"\"\"Load all processor plugins", "are enabled. :returns: priority sorted processor plugins (high to low)", "all processor plugins that are enabled. :returns: priority sorted ...
[ "\"requests_per_minute\": 50, \"start_date\": \"2002-02-10T22:21:44Z\"} @pytest.fixture(name=\"authenticator\") def authenticator_fixture(config): return HTTPBasicAuth(username=config[\"api_key\"], password=\"<PASSWORD>\")", "\"test.freshdesk.com\", \"api_key\": \"secret_api_key\", \"requests_per_minute\": 50, \"...
[ "reject_profile(self, profile): if not profile['position_qc'] in self.qcKeep: reject = True", "logging.debug('starting interpolation at time index: {}'.format(tdx)) startDate, endDate = dates", "set of dates split into n periods. period is in", "', '') surfaceRange = [[presLevels[0] - 2.5, presLevels[0]+ 2.5]...
[ "return self.driver.rolegrant_delete(grant_id) def list_role_grants(self, role_id, user_id, tenant_id): return self.driver.list_role_grants(role_id, user_id,", "permissions and # limitations under the License. \"\"\" Role-Grant manager", "user_id, tenant_id, marker, limit): \"\"\" Calculate pagination markers f...
[ "This target objective is designed for Oracle v12.2.0.1.0 dbms =", "for metric in MetricCatalog.objects.filter(dbms=dbms): self.default_values[metric.name] = metric.default def reload_default_metrics(self): dbms", "('User I/O', 'System I/O') or \\ any(n in name for", "def compute(self, metrics, observation_ti...
[ "s = \"ab\", p = \".*\" Output: true Explanation: \".*\"", "range(2, n + 1, 2): if p[j - 1] ==", "'*'. It is guaranteed for each appearance of the character", "'*': dp[0][j] = True else: break if m > 0:", "does not match the entire string \"aa\". Example 2: Input:", "each appearance of the character '*', ...
[ "window_size + 1): yield fseq[i:i+window_size] # return the first or", "position from the right return ((seqint << 2) & ~(2**(2*pos+2)-1))", "= (cur >> 2*leftseparator) << 2*rightseparator gappedseqint = left |", "1 << (1 + 2 * kmer) if last else", "prevent changing the original value while(copy) != 1: seq ...
[]
[ "import * from parse_config import config import sys #Reference SNMAP-WALK", "config['private_number'] def decToHexAddress(arg): arr = arg.split(\".\") output = '' for", "\"\").replace(\" = \", \";\") splitArr = element.split(\";\") mac_address = element.replace(splitArr[0],decToHexAddress(splitArr[0]))", "he...
[ "\"X\" return jogadores def valida_escolha(escolha): if escolha != \"O\" and", "[O/X] ')).upper() valida_escolha(jogadores[\"jogador_1\"][\"escolha\"]) if jogadores[\"jogador_1\"][\"escolha\"] == \"X\": jogadores[\"jogador_2\"][\"escolha\"] = \"O\"", "= str(input('Qual e seu nome? ')) jogadores[\"jogador_2\"][\...
[ "<filename>core/apps/kubeops_api/migrations/0063_auto_20200223_0557.py # Generated by Django 2.2.10 on 2020-02-23 05:57 from", "django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users',", "('users', '0002_userprofile'), ('kubeops_api', '0062_auto_20200221_0510'), ] op...
[ "show_cluster\\n\" \"cluster = show_cluster('cluster1')\\n\" \"deployments = cluster.pull_deployments()\\n\" \"nodes = deployments.nodes[-1]\\n\"", "from cluster,\" \" you can use the following snippet.\\n\" \"You", "\\ format_deployments_info def test_format_deployments_info(): formatted = format_deployments_i...
[ "from PIL import Image,ImageDraw,ImageFont from pms_a003 import Sensor air_mon =", "sys import os import lib_2inch7_ec_paper import time from PIL import", "font28, fill = 0) drawred.text((210, 120),str(values.pm100_cf1), font = font28, fill", "horizontal_black_image = Image.new('1', (e_paper.height, e_paper.w...
[ "#!/Users/davk/anaconda/envs/platformio_setup python import subprocess revision = subprocess.check_output([\"git\", \"rev-parse\", \"HEAD\"]).strip() print('-DPIO_SRC_REV=\"%s\"'", "python import subprocess revision = subprocess.check_output([\"git\", \"rev-parse\", \"HEAD\"]).strip() print('-DPIO_SRC_REV=\"%s\"'...
[ "0.0.2 2018-03-07 修正了数据尚未更新的404错误,返回空列表 \"\"\" class ExpressChecker: \"\"\"检查快递更新状态的类 \"\"\" def __init__(self,metadata):", "= [] for x in clist: if \"中英字幕\" in x.text:", "in clist: if \"中英字幕\" in x.text: rlist.append(x.text) return rlist def", "import lxml.etree import json import pickle,traceback,shelve,tim...
[ "Created on Mon Jan 17 15:42:09 2022 @author: nikth \"\"\"", "Ytrain, Xval, Yval = get_train_test_data(X_type, ntrain=ntrain, nval=nval, Y_type=Y_type, # npoints=npoints,", "from dataGeneration import GeneratorFermanianDependentMax from sklearn.model_selection import train_test_split #Xtrain, Ytrain,", "nPath...
[ "input_dim == 2,\"Dimension of input layer is not correct\" assert", "numpy as np import numpy.testing as npt import data_process as", "as npt import data_process as dp def test_read_file(): X,Y =", "= {\"filename\":\"test.tsv\",\"X_var\":[\"A\",\"B\"],\"Y_var\":\"y\"} X,Y,input_dim,output_dim = dp.data_info(...
[ "Interview/tree_search_by_stack.py<gh_stars>1-10 #!/usr/bin/env python3 import unittest class Tree: def __init__(self, v):", "res = [] while stack: node = stack[-1] if node.left", "res.append(node.v) if node.left and node.left not in visited: stack.append(node.left) continue", "= set() res = [] while stack: n...
[ "['Eng1', 'Eng2', 'Eng3', 'Eng4', 'Alg1', 'Alg2', 'Geo', 'PreC', 'Phys', 'Chem',", "return ['Eng1', 'Eng2', 'Eng3', 'Eng4', 'Alg1', 'Alg2', 'Geo', 'PreC', 'Phys',", "'Alg1', 'Alg2', 'Geo', 'PreC', 'Phys', 'Chem', 'SciE', 'Bio', 'Civ1', 'Civ2',", "'Civ3', 'Civ4'] def __init__(self, name: str): self.name = name...
[ "\"119\", \"123\", \"120\", \"122\", # Materials \"150\", \"151\", \"152\", \"153\",", "not in ignoreSet] if len(missingDocs) > 0: print(\"❌ The following", "else: # No duplicate, add the line. data[id] = line", "which title it needs to look for when examining data.", "\"26\", \"27\", \"28\", # Resources - ...
[ "class ContactConfigTestCase(SimpleTestCase): \"\"\" Test app config \"\"\" def test_apps(self): self.assertEqual(ContactConfig.name,", "from django.apps import apps from contact.apps import ContactConfig class ContactConfigTestCase(SimpleTestCase):", "import ContactConfig class ContactConfigTestCase(SimpleTest...
[ "k8s_object in k8s_object_list: command_to_delete_k8s_object = ('kubectl delete '+ k8s_object +'", "remote branches name's, we delete all the k8s objects with", "url = \"https://api.github.com/repos/SocialGouv/code-du-travail-numerique/pulls\".format(github_token) req = request.Request(url, None, {\"token\": gi...
[ "for val in line]) mat = result_mat for line in", "in mat: result_mat.append([int(val) for val in line]) mat = result_mat", "(1, 7), (7, 1), (7, 7)} result = 1 mat", "in enumerate(mat): for in_line in enumerate(line[1]): if (line[0], in_line[0]) in", "(6, 1), (6, 2), (6, 6), (6, 7), (6, 8),", "in line]) m...
[ "import versioneer setup( name=\"metagraph-stellargraph\", version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), description=\"Stellargraph plugins for Metagraph\",", "cmdclass=versioneer.get_cmdclass(), description=\"Stellargraph plugins for Metagraph\", author=\"<NAME>.\", packages=find_packages...
[ "Bridge (tfgen) Tool. *** # *** Do not edit by", "was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***", "*** # *** Do not edit by hand unless you're", "you are doing! *** # Export this package's modules as", "secret_version import * from get_secret import * from get_secret_version import", "***...
[ "\"2009\": numpy.array([ 1.29884336, 0.01356626, 7.20249116]), \"2010\": numpy.array([ 1.29884336, 0.01356626, 7.20249116])}},", "{ \"total\": { \"all\": {\"2009\": 10, \"2010\": 10}, \"measure\": {\"2009\":", "of energy/carbon and associated cost input values instead of point", "2.38327), numpy.pmt(0.07, 6, ...
[]
[ "+= count LOGGER.info('Number of campaigns: {}'.format(len(campaign_ids))) operations = [] for", "count LOGGER.info('Number of campaigns: {}'.format(len(campaign_ids))) operations = [] for campaign_id", "data)) offset += count LOGGER.info('Number of campaigns: {}'.format(len(campaign_ids))) operations =", "si...
[ "self, s: s})() __all__ = (\"version\", \"isclose\", \"IsClose\") version =", "lambda a, b: not self(a, b) def much_less_than(self): \"\"\"definitely less", ">>> callable(myisclose.notclose) True \"\"\" return lambda a, b: not self(a,", "lambda a, b: a < b and not self(a, b)", "result = NotImplemented try: ...
[ "@abstractmethod def required_operation_one(self): pass @abstractmethod def required_operation_two(self): pass def hook1(self):", "def required_operation_one(self): pass @abstractmethod def required_operation_two(self): pass def hook1(self): pass", "2 implementada.') def hook1(self): print_concrete('| Classe co...
[ "= Collection().createCollection( name=\"core3d\", creator=User().getAdmins().next(), description=\"\", public=True, reuseExisting=True, ) modelsFolder =", ") existing_folder_id = output_folder[\"_id\"] baseWorkingSet[\"output_folder_id\"] = output_folder[\"_id\"] WorkingSet().save(baseWorkingSet) containerArgs =...
[ "primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=254)), ('permission_page', models.TextField(null=True)), ], options={ 'db_table':", "null=True)), ('password', models.CharField(max_length=128)), ('is_admin', models.BooleanField(default=False)), ('is_active', models.Boo...
[ "to enable the admin: from django.contrib import admin # This", "to enable admin documentation: url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next", "to the apache server that is running on the machine", "XOSLibDataView.as_view(), name=\"xoslib\"), url(r'^xmlrpc/legacyapi/$', ...
[ "for token here nodes, edges, edges_attr, token_triples, core_entity = build_graph_for_token(token,", "head, rel, tail = triple[0], triple[1], triple[2] # remove empty", "%(levelname)s - %(name)s - %(message)s', datefmt = '%m/%d/%Y %H:%M:%S', level", "= None return triples, core_entity def search_triple_neigh...
[ "f'{name}.{self.image_ext}' def get_file(self) -> File: image = ContentFile(base64.b64decode(self.image_str), name=self.default_name) return", "'temp'): self.image_uri = dataURI self.image_format, self.image_str = dataURI.split(';base64,') self.image_ext =", "self.image_format, self.image_str = dataURI.split(';...
[ "del b[index] else: c = a.copy() for k, v in", "request_param: :return: \"\"\" if isinstance(request_param, list): for index, a in", "a in enumerate(request_param): if isinstance(a, str): b = request_param.copy() if", "if isinstance(a, str): b = request_param.copy() if a == None:", "\"\"\" :param json_str: ...
[ "from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.utils.translation", "_ from django.conf import settings from models import BootstrapButtonPlugin class", "_(instance.mailto) elif instance.url: link = _(instance.url) elif instance.page_link: link =", "elif instance...
[ "Category(models.Model): \"\"\" Description: Model Description \"\"\" name = models.CharField(max_length=50) class", "Description: Model Description \"\"\" name = models.CharField(max_length=50) class Meta: pass", "Skill(models.Model): \"\"\" Description: Model Description \"\"\" name = models.CharField(max_len...
[ "import os import glob def test_draw(): test_files = glob.glob(\"Data/*\") for", "<reponame>mwang87/SMART_NMR import sys sys.path.insert(0, \"..\") import smart_utils import os import", "def test_draw(): test_files = glob.glob(\"Data/*\") for test_file in test_files: print(test_file)", "import smart_utils imp...
[ "= 5 CONNECTION_NUM_UPPER_LIMIT = 10 CONNECTION_NUM_LOWER_LIMIT = 1 WEIGHT_UPPER_LIMIT =", "INPUT_NUM = 2 OUTPUT_NUM = 1 NORMAL_NUM_UPPER_LIMIT = 5 NORMAL_NUM_LOWER_LIMIT", "5 CONNECTION_NUM_UPPER_LIMIT = 10 CONNECTION_NUM_LOWER_LIMIT = 1 WEIGHT_UPPER_LIMIT = 1.0", "1.0 EVOLUTION_PARAM_LOWER_LIMIT = -1.0 EPSI...
[ "# \"cross\": {\"point1\": {\"x\": 515, \"y\": 494}, # \"point2\": {\"x\":", "= dirname(abspath(__file__)) OTC_TOOLKIT_PATH = abspath(join(DIR_PATH, '..')) PATH_TO_RECORDINGS = \"data\" STATIONS", "{'ecdf-lindner': {\"point1\": {\"x\": 718, \"y\": 173}, Coords from first run,", "\"y\": 200}, \"point2\": {\"x\...
[ "'password') # Get a user print(API.user.get('my_user')) # User that does", "'guest', 'guest', verify=True) API.user.create('my_user', 'password') # Get a user print(API.user.get('my_user'))", "an exception API.user.delete('my_user') try: API.user.get('NOT_FOUND') except management.ApiError as why: if", "amqp...
[ "helps react and react-native developer to speed-up their develoment process.\",", "= makeReact.script:main'] }, version = version, description = \"makeReact is", ").group(1) with open(\"README.md\", \"r\") as f: long_description = f.read() setup(", "<gh_stars>0 import re from setuptools import setup version ...
[ "def test_0002_targets(self): '''validate correct targets based on dataset''' targets =", "2.0 (the \"License\"); # you may not use this file", "test_0003_digest_values(self): '''validate `orig_digest` does not ever match `dest_digest`''' for entry", "os import random import shutil from pkg_resources import p...
[ "= sorted(intervals) res = [intervals[0]] for i in range(1, len(intervals)):", "if not intervals: return [] intervals = sorted(intervals) res =", "res = [intervals[0]] for i in range(1, len(intervals)): if intervals[i][0]", "i in range(1, len(intervals)): if intervals[i][0] <= res[-1][1]: res[-1] =", "[] in...
[ "= [] for i in range(0, end): print(str(i)) v =", "= tf.Session() end = sum(1 for _ in tf.python_io.tf_record_iterator(os.path.join(data_path, 'test.tfrecord')))", "import os import tensorflow as tf from learning_to_simulate import reading_utils", "as fp: return json.loads(fp.read()) data_path = \"/tmp/WaterD...
[ "raise RuntimeError(\"Can not load model\") if model._training_config is None: raise", "loader_cls=KerasObjectLoader) if not isinstance(model, RevivedModel): raise RuntimeError(\"Can not load model\")", "as tf from tensorflow.python.keras.saving.saved_model.load import KerasObjectLoader from tensorflow.python.s...
[ "\"--files-to-csv\", action=\"store_true\", help=\"Update data.csv based on the action folder.\" )", "actions) readme.write_text(md_document) if __name__ == \"__main__\": args = _get_parser() if", "fc.get_all_files() actions = Actions.read_from_files(files) actions.sort() readme = Path(README) md_document =", ...
[ "cv.imread(cv.samples.findFile(FILE_NAME)) # assume: BGR img = cv.cvtColor(img, cv.COLOR_BGR2RGB) # plt", "colors = ('r', 'g', 'b') for k,color in enumerate(colors): histogram", "https://matplotlib.org/3.3.1/gallery/widgets/slider_demo.html # https://sodocumentation.net/matplotlib/topic/6983/animations-and-inte...
[ "max_length=250, null=True), ), migrations.AlterField( model_name='ticketproducts', name='quantity', field=models.FloatField(default=0), ), migrations.AlterField( model_name='ticketproducts',", "null=True), ), migrations.AlterField( model_name='ticketproducts', name='quantity', field=models.FloatField(default=0),...
[ "+ \".genshi\" ) content = content.replace(\"\\t\", \"\") encoding = request.getHeader(\"accept-encoding\")", "zbuf.getvalue() else: return content def _render_template(self, template, data=None): if data", "TemplateLoader import os import cStringIO, gzip class TemplateResource(Resource): isLeaf =", "not None...
[ "[] for num in nums1: index = 0 cur_num_index =", "else: cur_num_index += 1 # print(res) return res # Method", "= {} my_stack.append(nums2[0]) for num in nums2[1:]: while my_stack: if", "my_dict[my_stack.pop()] = num else: break my_stack.append(num) for key in my_stack:", "-> List[int]: res = [] for num in ...
[ "torch.nn as nn import yaml from tqdm.auto import tqdm from", "os import torch import numpy as np import pandas as", "from tqdm.auto import tqdm from tensorboardX import SummaryWriter from torch.utils.data.dataloader", "numpy as np import pandas as pd import torch import", "tqdm.auto import tqdm from tensor...
[ "extensions = ('html', 'pdf') if len(sys.argv) > 1: extensions =", "TeX, and PDF versions of all the source files #", "all the source files # import os import sys from", "'pdf') if len(sys.argv) > 1: extensions = sys.argv[1:] all =", "License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy", ...
[ "box_encodings.ndim == 4 and box_encodings.shape[2] == 1: box_encodings = np.squeeze(box_encodings,", "list): num_detections = num_detections[0] elif isinstance(num_detections, float): num_detections = int(num_detections)", "+ BASE_ClassPredictor in key and BASE_PPN_ClassPredictor in key: print(str(i) +", "= ...
[ "for i in xrange(len(flow_ratios)): ratios = [x * sum_flow for", "{}'.format(str(datetime.timedelta(seconds=elapsed_time)))) sys.stdout.flush() if __name__ == \"__main__\": main() ''' while not", "last_checkpoint = 1692+489+187+432+1436+324+2657+219+2334+555+1499+637+416+62+336+111+\\ 99+131+1457+508+183+603+58...
[ "__init__(self, distance_matrix_key = 'distance_matrix', feature_matrix_key = 'feature_matrix', **kwargs): super().__init__(**kwargs) self.distance_matrix_key", "return node_feats, D, E class StructuralDataset(GraphDataset): def __init__(self, distance_matrix_key =", "index): item = super().__getitem__(index) n...
[ "import sphinx os.chdir('../../../docs_sphinx') sphinx.main(['sphinx-build', '-b', 'doctest', '.', '../docs', '-D', 'exclude_patterns=reference'])", "<gh_stars>100-1000 import os import sphinx os.chdir('../../../docs_sphinx') sphinx.main(['sphinx-build', '-b', 'doctest', '.',", "os import sphinx os.chdir('../.....
[]
[ "but not limited to, the warranties # of merchantability and", "This fisher discriminant is the equation (3 a,b) in https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3495075", "matrix with columns indicating samples. label : Class indices. Returns", "or otherwise) arising in any way # out of the", "# # The origi...
[ "isinstance(receiver_peer, ETHPeer) assert initiator_peer.sub_proto is not None assert initiator_peer.sub_proto.name ==", "async def test_peer_pool_connect(monkeypatch, event_loop, receiver_server_with_dumb_peer): started_peers = [] async def", "99 SERVER_ADDRESS = Address('127.0.0.1', udp_port=port, tcp_port=p...
[ "h_num_max = (nor_size-y)/gene_size h_num = random.randint(1, h_num_max) h = h_num", "mask_region cv2.imwrite(outputmaskdir+str(number)+'.jpg', mask) return number if __name__ == \"__main__\": gene_size", "random.randint(0, nor_size-gene_size*2) y = random.randint(0, nor_size-gene_size*2) w_num_max = (nor_size-...
[ "in indices: img, label = dataset.read_image_by_index(ind, phase='trainval', method='supervised') # print(label)", "label = dataset.read_image_by_index(ind, phase='trainval', method='supervised') # print(label) # if img_bag", "for j in range(col): # plt.subplot(row, col, i * col+j+1)", "\"output shape\" : [22...
[ "server program \"marccd_server_socket\" with TCP port number 2222. Usage example:", "filed contains a 4-bit code, with the following meaning: 0=idle,", "\"\"\"Make sure that the directory of teh given filename exists", "of the Rayonix computer filename_suffix: including the dot (.) number_field_width:", "a...
[ "PollTranslation class PollTranslationInlineAdmin(admin.StackedInline): verbose_name = _(u'poll translation') verbose_name_plural = _(u'poll", "django.utils.translation import ugettext_lazy as _ from .models import Poll, PollOption,", "-*- from django.conf import settings from django.contrib import admin from",...
[]
[ "Django 2.1.1 on 2019-02-09 01:11 from django.db import migrations, models", "models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('time', models.DateTimeField(auto_now_add=True, verbose_name='操作时间')), ('obj', models.TextField(blank=True, null=True,", "by Django 2.1.1 on ...
[ "import sys import time import udon.log import udon.run pidfile =", "getopt import logging import sys import time import udon.log import", "arg if args: if args[0] == 'stop': udon.run.stop(pidfile) elif args[0]", "import logging import sys import time import udon.log import udon.run", "time import udon.log ...
[ "reversed(all_) for line in all_: for elem in patterns_list: if", "return line assert False except: return [] if __name__ ==", "else: return \" - \" def romanize(num): if num <", "print('') isS = rct = unus = isEx = suf", "= False if '.' in numData: unus = True elif", "f\"Число в двоичной системе счислени...
[ "configuration() # CHARGEMENT DU FICHIER de configuration des modules with", "import SourceFileLoader from daemon.Configuration.Modele import * from daemon.Configuration.configuration import configuration", "#liste des classes lmodrules = [] #liste des modules de", "regle config = configuration() # CHARGEMENT...
[ "= 0 opn_to_cls = {'(': ')', '[': ']', '{': '}',", "err: total += scores[sym] break print(f'Total: {total}') print(f'Result: {result}') print(f'Other:", "in syms: print(sym) if sym in list('([{<'): stk += [opn_to_cls[sym]]", "sym in list('([{<'): stk += [opn_to_cls[sym]] elif len(stk) and sym", "= {v: k for...
[ "def __init__(self): pass def get_channels(self): return [] def get_channel_stream(self, chandict):", "class OriginChannels_StandIN(): def __init__(self): pass def get_channels(self): return [] def", "pass def get_channels(self): return [] def get_channel_stream(self, chandict): return None", "__init__(self):...
[ "logger = Logger(log_filepath, default_verbose=True) Crawler.__init__(self, logger) self.mode_dict['collect_frame_times'] = self.collect_frame_times self.set_target_names('*.tif')", "FrameTimesCrawler navigates through the backup data drives and # collects", "time_dict: time_dict[key].append(np.float(time_str))...
[ "DialogueManager(object): def __init__(self, paths): print(\"Loading resources...\") self.create_chitchat_bot() def create_chitchat_bot(self): gpu_options", "Returns id of the most similar thread for the question.", "from utils import * import tensorflow as tf class ThreadRanker(object):", "tag. \"\"\" thread...
[ "and os.environ['TV_SAVE']: tf.app.flags.DEFINE_boolean( 'save', True, ('Whether to save the run.", "run. In case --nosave (default) ' 'output will be saved", "= 0 with tf.name_scope('Validation'): tf.get_variable_scope().reuse_variables() image_pl = tf.placeholder(tf.float32) image =", "'KittiSeg_pretrained'...
[ "# from .repositories import ListingRepository # from .rules import (", "listing: Listing, seller: Seller): # self.check_rule(ListingMustBeInDraftState(listing.status)) # self.check_rule(SellerMustBeEligibleForAddingNextListing(seller)) # listing.publish()", "import UUID # from .entities import Listing, Seller ...
[ "этажа и номера квартиры output.update(self._get_complex_item(item)) # обновляем в словаре ключи", "strip=True ) location = data.find('span', class_='tile__location').get_text(strip=True) complex += f'({location})' return", "json.dump(data_result, file) print('Success') def _get_new_buildings(self, url): \"\"\"...
[ "(\"Hearts\", \"Clubs\", \"Spades\", \"Diamonds\") ) def test_card_has_thirteen_possible_rank_options(self): self.assertEqual( Card.RANKS, (", "\"5\", suit = \"Diamonds\") five_of_hearts = Card(rank = \"5\", suit", "import unittest from poker.card import Card class CardTest(unittest.TestCase): def test_has_rank...
[ "def test_retrieve_update_api_view_put(self): class MockRetrieveUpdateApiView(generics.RetrieveUpdateAPIView): def update(self, request, *args, **kwargs): self.called", "is True assert view.u_call_args == data assert view.p_called is True", "('test arg',), {'test_kwarg': 'test'}) view.post('test request', 'test...
[ "in enumerate(self.__parse_with_corenlp(input_stream)): if chunk > 0: # Preserve the empty", "def __init__(self, corenlp_props, max_length=10000): self.corenlp_props = corenlp_props self.max_length = max_length", "parsed), file=output_stream) def __parse_with_corenlp(self, input_stream): \"\"\" Parses the input...