ngram
listlengths
0
67.8k
[ "= 20 def import_samples(platform, geno_matrix_csv, x_matrix_csv, y_matrix_csv, sample_tags, db): platform_chrs, snp_count_per_chr, snp_chr_indexes =", "snp_id, genos, xs, ys samples = [] for sample_name in sample_names: chr_dict =", "curr_sample in samples: mds.post_proc_sample(curr_sample) db.samples.insert_o...
[ "input file path jsonPath = basepath + 'Hangouts.json' # OUTPUT: These are the", "# Author: <NAME> import json # JSON to handle Google's format import re", "This is the path to a temporary intermediate file tempPath = basepath +", "n in p['conversation_state']: for e in n['conversation_state']['event']: if 'c...
[ "1 def count_all_info(args): users_count_info = Counter({}) danmu_dir = os.path.join(os.getcwd(), args.countall[0]) danmu_dirs = os.listdir(danmu_dir)", "str, nargs = '+', help='count help') parser.add_argument('-ca', '--countall', type = str, nargs =", "{value}'.format(idx = i + 1, key = key, value = v)) # use...
[ "# initialize lists notes.append(msg.note) note_velocities[msg.note] = [] note_successors[msg.note] = [] note_times[msg.note] = []", "# add data note_velocities[msg.note].append(msg.velocity) note_times[msg.note].append(msg.time) note_successors[msg.note].append(midi[i+1].note) except: i=0 print(f'Notes: {len(not...
[ "os.system('cd anna && protoc -I=../../../../include/proto --python_out=. ' + 'kvs.proto') os.system('cd anna && protoc", "relevant protobufs self.compile_proto() # Run the standard PyPi copy install.run(self) # remove the", "anna && protoc -I=../../../../include/proto --python_out=. ' + 'functions.proto') def ...
[ "class elif isinstance(error, AbilityForbidden): error = getattr(error, 'original', error) await ctx.send(error) # Non-registered", "-> NotNight @commands.check(check_if_dm) # Correct channel -> NotDMChannel @commands.check(check_if_player_really_dead) # Player dead ->", "Missing argument -> commands.MissingReq...
[ "TYPE_INT = 1 def __init__(self, name, field_type, default_value): self.name = name self.field_type =", "default_value): self.name = name self.field_type = field_type self.default_value = default_value class IInteractiveSource(object): \"\"\"", "self.default_value = default_value class IInteractiveSource(object...
[ "default for i, aline in enumerate(afile, start=1): if randrange(i) == 0: # random", "from random import randrange from film import film_embed from api import api_call import", "random_embed(): __location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) f = open(os.path.join(__location...
[ "settings.WAIT_MAX_SLEEPS: raise KubeBuildError(f'Timeout waiting for {name} to be ready') def _wait_for_object(*args): return _wait_for(lambda:", "= k8s_core_api.create_namespace( body=namespace_obj, ) _wait_for_object(k8s_core_api, 'read_namespace', None, namespace_obj) return k8s_namespace def update_namespace...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "Unless required by applicable law or agreed to in writing, sof...
[ "180 workers = multiprocessing.cpu_count() * 2 + 1 worker_class = 'gthread' # check", "kqueen.config import current_config from prometheus_client import multiprocess import multiprocessing import os app_config =", "+ 1 worker_class = 'gthread' # check for prometheus settings if 'prometheus_multiproc_dir' not", ...
[ "key_id = '74G4697BU4' team_id = 'QTM38LJQ3P' am = applemusicpy.AppleMusic(secret_key, key_id, team_id) results =", "'QTM38LJQ3P' am = applemusicpy.AppleMusic(secret_key, key_id, team_id) results = am.search('<NAME>', types=['albums'], limit=5) for item", "'} #r = requests.get('https://api.music.apple.com/v1/me...
[ "value_is_list = enf_comma_separated(name=\"array\", value=[\"id1\", \"id2\"]) assert value_is_list == \"id1,id2\" value_is_tuple = enf_comma_separated(name=\"tuple\", value=(\"id1\",", "\"id1,id2\" with pytest.raises(PyTwitterError) as ex: enf_comma_separated(name=\"other\", value={1, 2, 3}) # noqa assert \"comm...
[ "timeout self._source_id = None def wrap(func, funcid, args, kwargs): for value in func(*args,", "2014 <NAME> # # This program is free software; you can redistribute it", "routine.pause() del self.__routines[funcid] print_d(\"Removed copool function id %r\" % funcid) def remove_all(self): \"\"\"Stop", "def re...
[]
[ "from __future__ import unicode_literals from django.test import TestCase from django.contrib.auth.models import User from", "setUp(self): self.user = User.objects.create_user(username=\"testuser\", email=\"<EMAIL>\", password=\"<PASSWORD>\") def test_login_success(self): data = { 'username': 'testuser',", "def...
[ "= save_repowc() def teardown_method(self, meth): x = getattr(self, '_savedrepowc', None) if x is", "CommonFSTests, setuptestfs from py.__.path.svn import cache, svncommon mypath = py.magic.autopath() repodump = mypath.dirpath('repotest.dump')", "res = url.info() # assert res.size > len(\"samplefile\") and res....
[ "y, n_sersic, r_eff, k_eff, q, center_x=0, center_y=0): bn = self.b(n_sersic) r = (x**2+y**2*q**-2)**0.5", "numpy as np class Sersic: def b(self,n): return 1.9992*n - 0.3271 + 4*(405*n)**-1", "def b(self,n): return 1.9992*n - 0.3271 + 4*(405*n)**-1 def kappa(self,x, y, n_sersic, r_eff,", "import numpy as np c...
[ "handle with client requirements. This client handler is with a strong bond to", "False self.stop = False async def commandsHandler(self ,client,path): app = None try: print(\"Client", "client.send(json.dumps({\"Command\": \"EXIT\"})) elif command == 'DATA': try: if self.initialize: data = app.get_data() res", ...
[ "return self._get_config(key) def _create_files(self, files, dir, filter, default, **kwargs): self._files = {} files", "collections from attrdict import AttrDict from app_settings import file_search from app_settings import FileFactory", "\"_\", filename) def _validate(self, files, dir, resolve_type): if not fi...
[ "def load(): \"\"\"Load all processor plugins that are enabled. :returns: priority sorted processor", "all processor plugins that are enabled. :returns: priority sorted processor plugins (high to", "processor plugins that are enabled. :returns: priority sorted processor plugins (high to low)", "that are enabl...
[ "{\"domain\": \"test.freshdesk.com\", \"api_key\": \"secret_api_key\", \"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\"],", "pytest from requests.auth import HTTPBasicA...
[ "tally = defaultdict(list) for idx,item in enumerate(seq): tally[item].append(idx) dups = [ (key,locs) for", "np.isnan(key) or key not in {-999, None, np.NaN} ] idxs = [] for", "self.presLevels.index(self.pLevelRange[1]) self.presLevels = self.presLevels[ self.startIdx:self.endIdx ] self.presRanges = self.presR...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "one page of role grant list \"\"\" return self.driver.rolegrant_get_page(user_id, tenant_id, marker, limit) def", "KIND, either express or implied...
[ "Carnegie Mellon University Database Group # import logging from website.models import DBMSCatalog, MetricCatalog", "__init__(self): super().__init__(name='custom_db_time', pprint='Custom DB Time', unit='seconds', short_unit='s', improvement=LESS_IS_BETTER) def compute(self, metrics, observation_time): total_wait...
[ "be a previous valid character to match. \"\"\" class Solution1: def __match(self, s:", "p[j - 2] == s[i - 1]) and dp[i - 1][j]) return dp[m][n]", "0 <= p.length <= 30 s contains only lowercase English letters. p contains", "Input: s = \"aa\", p = \"a*\" Output: true Explanation: '*' means zero", "return se...
[ "rc # 392secs with loc,434 secs with the regression. R time, 10secs for", "else 1 << 2 * kmer; def seq_permutation(seqlen): return (range(seqpos(seqlen,False),seqpos(seqlen,True))) def gen_nonreversed_kmer(k): nonrevk", "!= 1: seq = numtonuc[copy&mask] + seq copy >>= 2 if copy ==", "not find the append-left o...
[]
[ "= config['private_number'] def decToHexAddress(arg): arr = arg.split(\".\") output = '' for i in", "s['switch_address'] for (errorIndication, errorStatus, errorIndex, varBinds) in nextCmd(SnmpEngine(), CommunityData('private@'+str(vlan)), UdpTransportTarget((host, 161),timeout = 2,", "VLAN number & Switch addr...
[ "jogadores[\"jogador_2\"][\"escolha\"] = \"X\" return jogadores def valida_escolha(escolha): if escolha != \"O\" and escolha", "valida_escolha(escolha): if escolha != \"O\" and escolha != \"X\": while jogadores[\"jogador_1\"][\"escolha\"] != \"O\"", "} def inicia_jogadores(): jogadores[\"jogador_1\"][\"name\"] ...
[ "from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0002_userprofile'), ('kubeops_api',", "= [ migrations.AddField( model_name='item', name='users', field=models.ManyToManyField(to='users.UserProfile'), ), migrations.AlterField( model_name='clusterhealthhis...
[ "def test_format_deployments_info(): formatted = format_deployments_info(cluster_name='cluster1') assert formatted == ( \"\\nTo access the allocation", "== ( \"\\nTo access the allocation and notebook deployments from cluster,\" \" you", "snippet.\\n\" \"You may need to change the cluster name if it's different...
[ "try: e_paper = lib_2inch7_ec_paper.Ec_Paper() e_paper.init() # Drawing on the image black_image = Image.new('1',", "drawblack.text((10, 120), 'PMS 10 value =', font = font28, fill = 0) drawred.text((210,", "40), str(values.pm10_cf1), font = font28, fill = 0) drawred.text((210, 80), str(values.pm25_cf1), font =...
[ "<gh_stars>1-10 #!/Users/davk/anaconda/envs/platformio_setup python import subprocess revision = subprocess.check_output([\"git\", \"rev-parse\", \"HEAD\"]).strip() print('-DPIO_SRC_REV=\"%s\"' % revision)" ]
[ "request.add_header('Authorization', 'APPCODE ' + appcode) response = urllib.request.urlopen(request) content = response.read() if (content):", "pprint import pprint meta = { \"name\":\"孔夫子书籍\", \"id\":24322234, \"status\":1, \"rate\":30, \"type\":\"express\", \"info\":\"5083078\", \"data\":[\"\"]", "-*- coding...
[ "ntrain=ntrain, nval=nval, Y_type=Y_type, # npoints=npoints, d=d, scale_X=scale_X) dimPath = 5 nPaths = 1000", "= G.Y X_train, X_test, Y_train, Y_test = \\ train_test_split(X,Y,test_size = 0.5) Xtimetrain =", "GeneratorFermanianDependentMax(dimPath = dimPath,nPaths = nPaths,num = num) G.generatePath() X = G.X G...
[ "X,Y = dp.read_file('test.tsv',[\"A\",\"B\"],\"y\") npt.assert_equal(X,np.array[[0,1],[3,2],[4,3]]) npt.assert_equal(Y,np.array[0,1,5]) def test_data_info(): data = {\"filename\":\"test.tsv\",\"X_var\":[\"A\",\"B\"],\"Y_var\":\"y\"} X,Y,input_dim,output_dim = dp.data_info(data)", "npt.assert_equal(X,np.array[[0,1...
[ "stack[-1] if node.left and node.left not in visited: stack.append(node.left) continue if node.right and", "and self.right==None def preorder(root): ''' return [node.v] ''' stack = [root] visited =", "visited = set() res = [] while stack: node = stack[-1] if node", "node = stack[-1] if node not in visited: vi...
[ "get_all_subjects(): return ['Eng1', 'Eng2', 'Eng3', 'Eng4', 'Alg1', 'Alg2', 'Geo', 'PreC', 'Phys', 'Chem', 'SciE',", "'Alg2', 'Geo', 'PreC', 'Phys', 'Chem', 'SciE', 'Bio', 'Civ1', 'Civ2', 'Civ3', 'Civ4'] def __init__(self,", "1) @staticmethod def get_all_subjects(): return ['Eng1', 'Eng2', 'Eng3', 'Eng4', 'Alg...
[ "no duplicate keys in: \"+file) return data def composeCsv(data, target): lines = []", "\"216\", \"217\", \"218\", # Components - Class D \"219\", \"2001\", \"2002\", \"2003\", \"2004\",", "getIdentifierIndex(header, identifier) if identifierIndex == -1: print(\"🛑 couldn't locate '\"+identifier+\"' in '\"+sour...
[ "from django.apps import apps from contact.apps import ContactConfig class ContactConfigTestCase(SimpleTestCase): \"\"\" Test app", "from contact.apps import ContactConfig class ContactConfigTestCase(SimpleTestCase): \"\"\" Test app config \"\"\" def test_apps(self):", "import SimpleTestCase from django.apps im...
[ ".items}}{{.metadata.labels.branch}}{{end}}'\", shell=True).decode(\"utf-8\") k8s_tag_list = raw_k8s_tag_list.replace('<no value>','').split('cdtn-') return [ k8s_tag for k8s_tag in k8s_tag_list", "[ k8s_tag for k8s_tag in k8s_tag_list if k8s_tag ] def delete_k8s_object(label): k8s_object_list =", "= check_outp...
[ "(2, 8), (6, 0), (6, 1), (6, 2), (6, 6), (6, 7), (6,", "0), (6, 1), (6, 2), (6, 6), (6, 7), (6, 8), (7, 0),", "CORNER_ZERO = {(1, 1), (1, 7), (7, 1), (7, 7)} result = 1", "in enumerate(mat): for in_line in enumerate(line[1]): if (line[0], in_line[0]) in CORNER_ONE: if in_line[1]", "in range(9)] result_mat =...
[ "setup( name=\"metagraph-stellargraph\", version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), description=\"Stellargraph plugins for Metagraph\", author=\"<NAME>.\", packages=find_packages( include=[\"metagraph_stellargraph\", \"metagraph_stellargraph.*\"] ),", "setuptools import setup, find_pack...
[ "are doing! *** # Export this package's modules as members: from secret import", "from secret import * from secret_version import * from get_secret import * from", "the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by", "not edit by hand unless you're certain you know what you are doing!", "Do...
[ "\"2009\": None, \"2010\": None}}}, { \"stock cost\": { \"residential\": { \"2009\": numpy.array([95, 100,", "Test that valid input cashflows yield correct output payback values for idx, cf", "'measures_demand' Measure objects. measure_master_msegs_out (dict): Master market microsegments that should be generate...
[]
[ "operation_id=None): transformed = [] for record in response[self.response_key]: for activity in record.get('activity', []):", "BaseStream import singer from datetime import datetime from dateutil.parser import parse LOGGER =", "} response = self.client.make_request(path='/campaigns', method='GET', params=campa...
[ ") result = abs_result or rel_result except Exception: pass if result is NotImplemented", "math.isclose and cmath.isclose.\"\"\" import cmath import logging import math import numbers LOG =", "TypeError(f\"cannot compare {a!r} and {b!r}\") return result isclose.default_rel_tol = 1e-9 isclose.default_abs_tol = 0...
[ "2 | Operação requerida 1 implementada.') def required_operation_two(self): print_concrete('| Classe concreta 2 |", "required_operation_two(self): pass def hook1(self): pass def hook2(self): pass class ConcreteClass1(AbstractClass): def required_operation_one(self): print_concrete('|", "executando a operação 1....
[ "files aoi_section = ( \"[aoi]\\n\" + f\"name = {baseWorkingSet['name'].replace(' ', '_')}\" ) in_config_file.write(f\"{aoi_section}\\n\")", "{models_folder}/Columbia Geon Segmentation Model\\n\" + \"model_prefix = dayton_geon\" ) in_config_file.write(f\"{roof_section}\\n\") # Ensure folder", "only be one point...
[ "models.CharField(max_length=128)), ('is_admin', models.BooleanField(default=False)), ('is_active', models.BooleanField(default=True)), ('date_joined', models.DateField(auto_now=True)), ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api_v1.group')), ], options={", "07:05 f...
[ "core.views.services import ServiceGridView #from core.views.analytics import AnalyticsAjaxView from core.models import * from rest_framework", "request.path) return HttpResponseRedirect(apache_url) urlpatterns = patterns('', # Examples: url(r'^stats', 'core.views.stats.Stats', name='stats'), url(r'^observer', 'c...
[ "= relation_emb[relation2id[rel]] if tail not in entity2emb: entity2emb[tail] = entity_emb[entity2id[tail]] return entity2emb, relation2emb", "= None return triples, core_entity def search_triple_neighbor(cur_triple, conceptnet_triples): \"\"\"检索出三元组的相邻的三元组\"\"\" neighbor_triples = [] cur_head,", "[] part_token...
[ "f'/image.{self.image_ext}' self.default_name = f'{name}.{self.image_ext}' def get_file(self) -> File: image = ContentFile(base64.b64decode(self.image_str), name=self.default_name) return", "list: fauthImage = FauthImage(base64String) # image_path = fauthImage.get_path() # image dir image_file =", "FauthImage(b...
[ "return json_str def json_to_xml(json_str): \"\"\" :param json_str: :return: \"\"\" xml_str = xmltodict.unparse(json_str, pretty=1)", "for index, a in enumerate(b): if a == None: del v[index] if isinstance(request_param,", "del request_param[k] if isinstance(v, list): b = v.copy() for index, a in enumerate(b):"...
[ "from cms.plugin_pool import plugin_pool from django.utils.translation import ugettext as _ from django.conf import", "instance.url: link = _(instance.url) elif instance.page_link: link = instance.page_link.get_absolute_url() else: link = \"\"", "name = _(\"Button\") text_enabled = True render_template = \"plug...
[ "Model Description \"\"\" name = models.CharField(max_length=50) class Meta: pass class Skill(models.Model): \"\"\" Description:", "models # Create your models here. class Category(models.Model): \"\"\" Description: Model Description \"\"\"", "models.CharField(max_length=50) class Meta: pass class Skill(models....
[ "\"..\") import smart_utils import os import glob def test_draw(): test_files = glob.glob(\"Data/*\") for", "sys.path.insert(0, \"..\") import smart_utils import os import glob def test_draw(): test_files = glob.glob(\"Data/*\")", "sys sys.path.insert(0, \"..\") import smart_utils import os import glob def test...
[ "= 1.0 WEIGHT_LOWER_LIMIT = -1.0 BIAS_UPPER_LIMIT = 1.0 BIAS_LOWER_LIMIT = -1.0 EVOLUTION_PARAM_UPPER_LIMIT =", "= 5 NORMAL_NUM_LOWER_LIMIT = 2 MODULATION_NUM_UPPER_LIMIT = 2 MODULATION_NUM_LOWER_LIMIT = 2 NEURON_NUM_UPPER_LIMIT =", "1.0 BIAS_LOWER_LIMIT = -1.0 EVOLUTION_PARAM_UPPER_LIMIT = 1.0 EVOLUTION_PARAM_...
[ "\"point2\": {\"x\": 932, \"y\": 377}}}, {\"bundesstrasse\": {\"point1\": {\"x\": 1046, \"y\": 132}, \"point2\": {\"x\":", "34, \"y\": 740}, \"point2\": {\"x\": 1433, # \"y\": 103}} \"citylab\": { \"platzderluftbruecke\": {\"point1\":", "\"truck\", \"bicycle\", \"bus\", \"motorbike\"] # CLASSES = [\"car\", \"tr...
[ "not exist throws an exception API.user.delete('my_user') try: API.user.get('NOT_FOUND') except management.ApiError as why: if", "API.user.delete('my_user') try: API.user.get('NOT_FOUND') except management.ApiError as why: if why.error_code == 404: print('User not", "exception API.user.delete('my_user') try: AP...
[ "f: long_description = f.read() setup( name = \"makeReact\", packages = [\"makeReact\"], entry_points =", "react-native developer to speed-up their develoment process.\", long_description=long_description, long_description_content_type=\"text/markdown\", author = \"<NAME>\", author_email", "\"makeReact\", packa...
[ "entry in self.pdarchive.patches: self.assertNotEqual(entry.orig_digest, entry.dest_digest) def test_0003_digest_orig(self): '''validate `orig_digest` against files''' for entry", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in w...
[ "\"\"\" if not intervals: return [] intervals = sorted(intervals) res = [intervals[0]] for", "Solution(object): def XXX(self, intervals): \"\"\" 轻松秒杀,根据结果集合最后一个和新的元素之间关系判断是否要修改 \"\"\" if not intervals: return [] intervals", "in range(1, len(intervals)): if intervals[i][0] <= res[-1][1]: res[-1] = [res[-1][0],ma...
[ "reading_utils def _read_metadata(data_path): with open(os.path.join(data_path, 'metadata.json'), 'rt') as fp: return json.loads(fp.read()) data_path =", "sess = tf.Session() end = sum(1 for _ in tf.python_io.tf_record_iterator(os.path.join(data_path, 'test.tfrecord'))) value =", "fp: return json.loads(fp.read(...
[ "model_path = 'output/saved_model/cls/1599723701' loader_impl.parse_saved_model(model_path) model = load_internal(model_path, tags=['serve'], loader_cls=KerasObjectLoader) if not isinstance(model, RevivedModel):", "not load model\") if model._training_config is None: raise RuntimeError(\"Model _training_config is...
[ "export the actions to the readme \"\"\" ), epilog=textwrap.dedent( \"\"\" # Update files", "= FileClient() files = fc.get_all_files() actions = Actions.read_from_files(files) actions.sort() readme = Path(README) md_document", "actions.csv.\" ) args = parser.parse_args() return args def update_files_from_csv():...
[ "cv.cvtColor(img, cv.COLOR_BGR2RGB) # plt assumes RGB # Draw the image # Take the", "cv.merge([h,s,v]) imgrgb = cv.cvtColor(imghsv.astype(\"uint8\"), cv.COLOR_HSV2RGB) # assume: return rgb return imgrgb def brightness(img,", "ax_sat = plt.axes([0.25, .03, 0.50, 0.02]) ax_exp = plt.axes([0.25, 0.01, 0.50, 0.02])...
[ "migrations, models class Migration(migrations.Migration): dependencies = [ ('SV', '0005_auto_20190305_0116'), ] operations = [", "model_name='ticketproducts', name='price', field=models.FloatField(default=0), ), migrations.AlterField( model_name='ticketproducts', name='productName', field=models.CharField(blank=...
[ "template, data=None): if data is None: data = {} t = self.loader.load( template", "= cStringIO.StringIO() zfile = gzip.GzipFile(None, 'wb', 9, zbuf) if isinstance( content, unicode ):", "TemplateLoader import os import cStringIO, gzip class TemplateResource(Resource): isLeaf = True def __init__(self,", "zfil...
[ "cur_num_index += 1 # print(res) return res # Method II: class Solution: def", "= 0 while index <= len(nums2)-1: if nums2[index] == num: cur_num_index = index", "== len(nums2)-1: res.append(-1) break else: cur_num_index += 1 # print(res) return res #", "my_dict = {} my_stack.append(nums2[0]) for num in nums2[...
[ "pd import torch import torch.nn as nn import yaml from tqdm.auto import tqdm", "import numpy as np import pandas as pd import torch import torch.nn as", "<gh_stars>1-10 import os import torch import numpy as np import pandas as pd", "pandas as pd import torch import torch.nn as nn import yaml from tqdm.auto"...
[ "the source files # import os import sys from syscmd import syscmd from", "and distribution is # subject to the Boost Software License, Version 1.0. (See", "if 0: for s in sources: syscmd('boosthtml %s' % s) else: extensions =", "('html', 'pdf') if len(sys.argv) > 1: extensions = sys.argv[1:] all = [ '%s.%s'"...
[ "combined_feature_map_shape = image_feature.shape box_code_size = config.cfg.POSTPROCESSOR.BOX_CODE_SIZE new_shape = np.stack([combined_feature_map_shape[0], combined_feature_map_shape[1] * combined_feature_map_shape[2] *", "image tensor. true_image_shapes: int32 tensor of shape [batch, 3] where each row is", "...
[ "[0.1, .1, .1, .7], [0.2, 0.2, 0.5, 0.1]] first_time = 1 num_simulations =", "- start_time) sys.stdout.write('\\r%.2f%% Completed, ' % (float(count) / float(total_size) * 100.0) + '\\tElapsed", "= [ [0.25, .25, .25, .25], [0.1, 0.4, 0.1, 0.4], [0.2, 0.3, 0.2,", "* sum_flow for x in flow_ratios[i][:]] for sche...
[ "0: D[i,j] = 510 else: D[i,j] = 1 for k in range(n): for", "for k in range(edges.shape[0]): i,j = edges[k,0], edges[k,1] A[i,j] = 1 E[i,j] =", "import numba as nb from .graph_dataset import GraphDataset NODE_FEATURES_OFFSET = 128 EDGE_FEATURES_OFFSET =", "edge_feats = item.pop(self.edge_features_key) node_fea...
[ "<gh_stars>100-1000 import os import sphinx os.chdir('../../../docs_sphinx') sphinx.main(['sphinx-build', '-b', 'doctest', '.', '../docs', '-D', 'exclude_patterns=reference'])" ]
[]
[ "whether in contract, strict # liability or tort (including negligence or otherwise) arising", "1) for k in np.unique(label): N_k = np.sum(k == label) mu_rk_block = np.zeros((0,", "= np.argsort(label) H = H[:,order] label = label[order] numerator, denominator = 0, 0", "or tort (including negligence or otherwi...
[ "for # incoming connections. monkeypatch.setattr(receiver_server_with_dumb_peer, 'peer_pool', MockPeerPool()) pool = PeerPool(DumbPeer, FakeAsyncHeaderDB(MemoryDB()), NETWORK_ID, INITIATOR_PRIVKEY,", "remote=initiator.remote, privkey=initiator.privkey, reader=reader, writer=writer, aes_secret=aes_secret, mac_secr...
[ "= 64 nor_size = 512 number = 0 total = 20 gene_all_list =", "img_part[y:y+h, x:x+w] = img_region number += 1 cv2.imwrite(outputdir+str(number)+'.jpg', img_part) img_part_bbox = cv2.rectangle(img_part, (x,y),", "w_num, h_num) img_part = cv2.imread(inputNordir+nor_list[0]) img_part[y:y+h, x:x+w] = img_region num...
[ "hot\" : True, \"show warning\" : True } dataset = TianChiGuangdongDefect(config) indices =", "224, 3], \"mil\" : False, \"use cache\" : True, \"one hot\" : True,", "Violence from dataset.tianchi_guangdong_defect import TianChiGuangdongDefect if __name__ == '__main__': config = { \"output", "ind in indices: i...
[ "len(message) == 0 or message[-1] != \"\\n\": message += \"\\n\" t = timestamp()", "series of symbilic link complying to the # naming scheme imposed by the", "to \"2222\". Or, alternatively from the command line by the commaand \"hsserver_lagacy\". The", "self.state() != \"idle\": sleep(0.05) # The \"start_se...
[ "1 class PollAdmin(admin.ModelAdmin): inlines = [PollTranslationInlineAdmin, PollOptionInlineAdmin] list_display = ['__unicode__', 'lan'] class PollParticipantAdmin(admin.ModelAdmin):", "= [PollTranslationInlineAdmin, PollOptionInlineAdmin] list_display = ['__unicode__', 'lan'] class PollParticipantAdmin(admin.Mo...
[]
[ "Django 2.1.1 on 2019-02-09 01:11 from django.db import migrations, models import django.db.models.deletion class", "import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('login', '0004_user_settings'), ]", "('time', models.DateTimeField(auto_now_add=True, verb...
[ "if args[0] == 'stop': udon.run.stop(pidfile) elif args[0] == 'kill': udon.run.kill(pidfile) else: udon.log.init(foreground =", "import udon.log import udon.run pidfile = None opts, args = getopt.getopt(sys.argv[1:], \"p:\") for", "False, level = \"DEBUG\") udon.run.daemon(pidfile) logging.info(\"starting\") fo...
[ "= ''.join(all_) all_ = all_.split('\\n') all_ = reversed(all_) for line in all_: for", "def bitize(num): return f\"Число в двоичной системе счисления: {str(bin(num))[2:]}\" def print_all(numData, num): print('Число", "системе счисления\": {romanize(num)[35:]}, \"Число в двоичной системе счисления\": {str(bin(n...
[ "\"r\") as fichier: JSON = fichier.read() config.load(JSON) #import des classes et objet for", "import SourceFileLoader from daemon.Configuration.Modele import * from daemon.Configuration.configuration import configuration ############################################################# # #", "de configuration des...
[ "print(stk) if stk[-1] == sym: stk.pop() else: print('INV', sym) err = True break", "in f.read().strip().split('\\n')] in_nums = [] total = 0 result = 0 other =", "l in f.read().strip().split('\\n')] in_nums = [] total = 0 result = 0 other", "']', '{': '}', '<': '>'} cls_to_opn = {v: k for k, v in", "v in o...
[ "<gh_stars>1-10 class OriginChannels_StandIN(): def __init__(self): pass def get_channels(self): return [] def get_channel_stream(self, chandict):", "OriginChannels_StandIN(): def __init__(self): pass def get_channels(self): return [] def get_channel_stream(self, chandict): return None", "class OriginChannels_S...
[ "i, path in enumerate(paths): if (i / n_paths) >= i_tracker: print_perc(i_tracker) i_tracker +=", "figure out the frame rate for any # particular second. Save the image", "if __name__ == \"__main__\": destination_dir = '/home/alex/feed-timing/data/extracted-lighttable-results/frame-times' crawler = FrameTimesCr...
[ "padding_symbol_id=word2id['[#]']) saver = tf.train.Saver() saver.restore(self.sess, 'checkpoints/model_four_691') def generate_answer(self, question): # Pass question to", "The search is performed across the threads with a given tag. \"\"\" thread_ids,", "question_to_vec(question, self.word_embeddings, self.em...
[ "return def main(_): utils.set_gpus_to_use() try: import tensorvision.train import tensorflow_fcn.utils except ImportError: logging.error(\"Could not", "TV_DIR_RUNS/debug, ' 'hence it will get overwritten by further runs.')) else: tf.app.flags.DEFINE_boolean( 'save',", "it will get overwritten by further runs.'...
[ "# from .entities import Listing, Seller # from .repositories import ListingRepository # from", "# ListingMustBeInDraftState, # SellerMustBeEligibleForAddingNextListing, # ) # class CatalogService: # def publish_listing(self, listing:", "Seller # from .repositories import ListingRepository # from .rules import ...
[ "цену output['price_base'] = self._price_base(item) # записвыем ссылку на план объекта output['plan'] = self._get_image(item)", "и номера квартиры Возвращает словарь с ключами ['section', 'floor', 'number', 'building'] :param data:", "берем следующий ЖК if answer.status_code == 404: continue raw_data = answer.c...
[ "self.assertEqual(card.rank_index, 9) def test_has_string_representation_with_rank_and_suit(self): card = Card(\"5\", \"Diamonds\") self.assertEqual(str(card), \"5 of Diamonds\") def", "= \"Diamonds\") ) def test_figures_out_if_two_cards_are_equal(self): self.assertEqual( Card(rank = \"2\", suit = \"Hearts\"), Ca...
[ "view.called is True assert view.call_args == data def test_destroy_api_view_delete(self): class MockDestroyApiView(generics.DestroyAPIView): def destroy(self,", "assert isinstance(query, Query) def test_get_query_w_override(self): view = UserOverrideView() view.request = self.request query =", "User) assert in...
[ "Preprocessor class CoreNlpPreprocessor(Preprocessor): \"\"\"A preprocessor that invokes a Stanford CoreNLP server for analysis.\"\"\"", "many gate servers must be ' 'specified as there are processes.') return super(CoreNlpPreprocessor,", "not in the main one. \"\"\" if not self.corenlp: self.corenlp = CoreNLP(...