ngram listlengths 0 67.8k |
|---|
[] |
[
"print(output) except Exception as e: print(f\"Error: {e}\\n\") raise except KeyboardInterrupt: print (\"Ctrl+C Pressed.",
"cve_list = get_unprocessed_cves(WATCH_DIR) if len(cve_list) == 0: sys.exit() batches = process_cves(cve_list) # Assumes",
"as error: print(f\"Error: Could not open a CSV. {error}\") print(... |
[
"from mean import mean import pytest def test_ints(): num_list = [1, 2, 3,",
"[0, 2, 4, 6] assert mean(num_list) == 3 def test_empty(): assert mean([]) ==",
"assert mean(num_list) == 3 def test_empty(): assert mean([]) == 0 def test_single_int(): with",
"== 3 def test_empty(): assert mean([]) == 0 def test_si... |
[
"to a single group on another host ''' if src_group: src_group_id = glm._get_namespace_id(src_gitlab_url,",
"archived projects) and write them to a (single-column) csv. WARNING: this will silently",
"''' migrate group variables from 1+ groups on one host to a single",
"target_group_id = glm._get_namespace_id(... |
[
"from . import model log = logging.getLogger(__name__) class Relation(model.ModelEntity): async def destroy(self): raise",
"= logging.getLogger(__name__) class Relation(model.ModelEntity): async def destroy(self): raise NotImplementedError() # TODO: destroy a",
"import model log = logging.getLogger(__name__) cl... |
[
"\"\"\" Please note, this code is only for python 3+. If you are",
"out_size])) biases = tf.Variable(tf.zeros([1, out_size]) + 0.1, ) Wx_plus_b = tf.matmul(inputs, Weights) +",
"this layer Weights = tf.Variable(tf.random_normal([in_size, out_size])) biases = tf.Variable(tf.zeros([1, out_size]) + 0.1, )",
"ste... |
[
"# test commands without arguments info = agnid.rpc_command('getinfo') info_keys = [ 'blocks', 'connections',",
"if line.startswith('testnet=1'): network = 'testnet' is_testnet = True genesis_hash = u'0000085e2ddad54c7313a28c2e96f7437e2ba9df1d5b2f3cdc3c554bf60dbe76' creds =",
"os.path.normpath(os.path.join(os.p... |
[
"\"aggregation\") def testAddRelationshipNoSecondClass(self): collection = ClassCollection() collection.addClass(\"bar\") self.assertRaises(KeyError, collection.addRelationship, \"bar\", \"foo\", \"aggregation\") def",
"def testRenameRelationship(self): collection = ClassCollection() collection.addClass(\"foo\") ... |
[
"# -*- coding: utf-8 -*- \"\"\" greenbyteapi This file was automatically generated by",
"@staticmethod def apply(http_request): \"\"\" Add custom authentication to the request. Args: http_request (HttpRequest):",
"CustomHeaderAuth: @staticmethod def apply(http_request): \"\"\" Add custom authentication to the r... |
[
"time, subtract 2 seconds from the start time updated_time = inital_time - 2",
"return 499.5 @property def ephemeris_start_time(self): inital_time = spice.utc2et(self.utc_start_time.isoformat()) # To get shutter end",
"1)[0] @property def detector_center_sample(self): return 499.5 @property def detector_center_... |
[
"for i in lookup: anslist = [int(char) for char in str(i)] answer.append(sum(anslist)) t",
"char in str(i)] answer.append(sum(anslist)) t = int(input()) while t: t -= 1 n",
"i in range((10**4)+1): lookup.append(lookup[i]*2) answer = [] for i in lookup: anslist =",
"for char in str(i)] answer.append(sum(anslis... |
[
"a minimal successful configuration # \"\"\" # for proxy in vcc_proxies: # proxy.Init()",
"1].rfiFlaggingMask == \"{}\" # # check configured attributes of search windows # #",
"of the configured attributes of VCCs # # first for VCC belonging to",
"fsp_2_proxies.subarray[1].corrBandwidth == 0 # # assert fsp_2_... |
[
"from mmgroup.mm_space import MMSpace, MMV, MMVector from mmgroup.mm_space import characteristics from mmgroup.structures.mm0_group import",
"self.space(*args) def MMTestSpace(p): global spaces_dict try: return spaces_dict[p] except KeyError: spaces_dict[p] = TestSpace(p)",
"spaces_dict = {} g = MM0Group() ref_... |
[
"print_function import feedparser import subprocess import time import re def parse_archive(archive, updates=True, link_to=\"pdf\"):",
"unescape it result = re.sub(r\"\\\\([\\\\$^_*<>])\", r\"\\1\", result) if error: result = result +",
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, # DAMAGES OR OTHER",... |
[
"of height 10\"\"\" __author__ = '<NAME>' import Autodesk.Revit.DB as DB doc = __revit__.ActiveUIDocument.Document",
"Autodesk.Revit.DB as DB doc = __revit__.ActiveUIDocument.Document uidoc = __revit__.ActiveUIDocument height_param_id = DB.ElementId(DB.BuiltInParameter.WALL_USER_HEIGHT_PARAM) height_param_prov",
... |
[
"while(count<limit): flag = 0 for i in range(3,count,2): if (count%i==0): flag = 1",
"1 while(count<limit): flag = 0 for i in range(3,count,2): if (count%i==0): flag =",
"count = 1 while(count<limit): flag = 0 for i in range(3,count,2): if (count%i==0):",
"= 1 while(count<limit): flag = 0 for i in range(3,cou... |
[
"Database(self.configuration['db']) self.storage = raw_storage(self.configuration['storage']) self.process_synchronizer = ProcessSynchronizer( self.configuration['synchronization']) def execute_with(self, message): video_chunk =",
"big_fiubrother_core.synchronization import ProcessSynchronizer from os import path... |
[
"output in _core_generator(solid_def, context, input_dict): if not isinstance(output, AssetMaterialization): if output.output_name in output_values:",
"resource \"{resource_key}\", but no resource ' \"with that key was found on the",
"Any] ) -> tuple: output_values = {} output_names = {output_def.name for outpu... |
[
"Maze from .mountain_car import MountainCar from .random_walk import RandomWalk from .short_corridor import ShortCorridor",
"WindyGridWorld from .maze import Maze from .mountain_car import MountainCar from .random_walk import RandomWalk",
"from .windy_grid_world import WindyGridWorld from .maze import Maze from... |
[
"from random import randint for i in range(5): n = (randint(0,10)) if(i ==",
"= n elif (n < m): m = n print(n, end=' ') print(f'\\nO",
"= n print(n, end=' ') print(f'\\nO maior número foi {M}\\nE o Menor foi",
"m = n print(n, end=' ') print(f'\\nO maior número foi {M}\\nE o Menor",
"n if (n > M): M = n elif... |
[
"Frame(self.elements['editors_frame'], bg='gray') editor_frame.pack(side=TOP, expand=False, fill=X, pady=10) editor_label = Label(editor_frame, font=('Arial', 18), bg='gray', text='%s",
"if not editor_username: self.parent.display_error('You have to enter an editor username.') return response =",
"self.elements... |
[
"(C) 2018 <NAME> # This program is free software: you can redistribute it",
"name in parent._declared_fields.keys(): del child_def['properties'][name] try: child_def['required'].remove(name) except ValueError: pass if not child_def['required']:",
"distributed in the hope that it will be useful, # but WITHOUT AN... |
[
"meta.bind = migrate_engine t = Table(\"demographics_request_column_definition\", meta, autoload=True) uhl_system_number_column_id = Column(\"uhl_system_number_column_id\", Integer) uhl_system_number_column_id.create(t)",
"upgrade(migrate_engine): meta.bind = migrate_engine t = Table(\"demographics_request_column... |
[
"supported *'): spider.soccer.teams(country, league) @pytest.mark.parametrize('country,league', competitions.items()) def test_setattr_competiton(self, spider, country, league): spider.soccer._setattr_competiton(country, league)",
"'england': 'premier_league', 'italy': 'serie_a', 'spain': 'la_liga', } def test_co... |
[
"28), date(2028, 4, 16), date(2029, 4, 1), date(2030, 4, 21), date(2031, 4, 13),",
"date(2041, 4, 21), date(2042, 4, 6), date(2043, 3, 29), date(2044, 4, 17), date(2045,",
"date(1333, 4, 4), date(1351, 4, 17), date(1371, 4, 6), date(1391, 3, 26), date(1402,",
"5, 1), date(1995, 4, 23), date(1996, 4, 14), date... |
[
"str): try: validator = validateYAML() ok, errs = validator.validate_yaml('configs/schema.yaml', config_file) if ok: print(config_file,",
"#Functionality to for reading and using config file # #Author: <NAME> #Date: May",
"import yaml import cerberus class validateYAML: def validate_yaml(self, schemaFile: str, ... |
[
"out))) self.assertTrue(bool(re.search(r'ghdl -e [^\\n]*foo_tc', out))) self.assertTrue(bool(re.search(r'ghdl -e [^\\n]*bar_tc', out))) self.assertTrue(bool(re.search(r'ghdl -e [^\\n]*baz', out)))",
"pattern (`*.tc`)\"\"\" with local.env(PATH=DIR+'/ghdl/fake-ghdl:' + local.env['PATH']): code, out, _ = run_vhdeps(... |
[
"0.5, 'word': 0.5, 'char': 0.5}, ), 'union__word__vect__max_df': (0.7, 0.8, 0.9, 1.0), #0.5, 'union__char__vect__max_df':",
"%0.3fs\" % (time() - t0)) print() print(\"Best score: %0.3f\" % grid_search.best_score_) print(\"Best parameters",
"('tfidf', TfidfTransformer()), ])), ('char', Pipeline([ ('selector', It... |
[
"comb_mod(n,r,mod): if n-r<r: r=n-r N=n R=r u=1 d=1 for i in range(r): u*=N",
"def comb_mod(n,r,mod): if n-r<r: r=n-r N=n R=r u=1 d=1 for i in range(r):",
"N=n R=r u=1 d=1 for i in range(r): u*=N u%=mod N-=1 d*=R d%=mod",
"if n-r<r: r=n-r N=n R=r u=1 d=1 for i in range(r): u*=N u%=mod",
"R=r u=1 d=1 for i i... |
[
"\"\"\"QuestionnarieForm Class. TThis class contains the treatments of the existents forms on create",
"\"\"\" class Meta: \"\"\"Meta Class. This class defines the informations that will be",
"MessageForm(forms.ModelForm): \"\"\"MessageForm Class. TThis class contains the treatments of the existents forms on",
... |
[
"def func(): a = int(input(\"enter a number : \")) if a < 0:",
"number : \")) if a < 0: print(\"Negative\") elif a > 0: print(\"Positive\")",
"if a < 0: print(\"Negative\") elif a > 0: print(\"Positive\") else: print(\"zero\") func()",
": \")) if a < 0: print(\"Negative\") elif a > 0: print(\"Positive\") else... |
[
"tf.Session(config=session_conf) with self.sess.as_default(): # Load the saved meta graph and restore variables saver",
"Nagar\\\\n\\\\n Regards.\"\"\" else: template = \"\"\" Dear Sir,\\\\n\\\\n The transaction to the account",
"'.join(reqStrArr) print(\"reqStr\") print(reqStr) requestBody = json.loads(reqStr)... |
[
"Canvas(window, height=30, width=30) back.pack() diamonds = 0 def morediamonds(): global diamonds diamonds +=",
"-=15 Cursor = Button(window, text=\"Cursor: Clicks every second (Cost: 15). Lasts 20 seconds.\",",
"\" + str(diamonds) + \" diamonds!\") def cursorworking(): global diamonds for x in",
"from tkinte... |
[
"if not hasattr(cls, \"_instance\"): cls._instance = super().__call__(*args, **kwargs) return cls._instance #@Singleton #class TestClass(Singleton2):",
"a = TestClass() b = TestClass() print(\"id of a:\",id(a)) print(\"id of b:\",id(b)) #https://segmentfault.com/q/1010000007818814",
"_instance if _instance is N... |
[] |
[
"# filename='log.log', format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) parser = argparse.ArgumentParser() print(Configer.ip_address, Configer.port,",
"elif args.action == 'crawl_webpages': # TODO: parameters export_dir = '../data/webpages' concept_dir = '../data'",
"type=int, help='numbe... |
[
"element of the array to the key. \"\"\" def linear_search(array, key): len_array =",
"in the array.\".format(key)) array = list(map(int, input(\"Enter elements of array separated by space:",
"{} in the array.\".format(key, t)) else: print(\"{} not present in the array.\".format(key)) array",
"def linear_sear... |
[
"input length input_lengths, ids_sorted_decreasing = torch.sort( torch.LongTensor([len(x[0]) for x in batch]), dim=0, descending=True)",
":text.size(0)] = text # Right zero-pad mel-spec num_mels = batch[0][1].size(0) max_target_len = max([x[1].size(1)",
"self.get_mel(audiopath) if speaker_id is not None: speake... |
[
"= input(\"What year were you born?\") age = 2019 - int(birth_year) print(f\"Your age",
"<filename>type_conversion.py birth_year = input(\"What year were you born?\") age = 2019 - int(birth_year)",
"year were you born?\") age = 2019 - int(birth_year) print(f\"Your age is: {age}\")",
"input(\"What year were yo... |
[
"map.token_value} headers1 = {'content-type': 'application/json'} def insertintomnogo(Xmldata, build_id): try: # insert parsed xml",
"rel_no, build_no, junit_url, branch_name): try: # insert parsed xml data into mongodb for",
"MONGO_PERF_COLLECTION.insert_one(query) # call defect creation service resp = request... |
[
"= pd.DataFrame.from_dict(data_dict, orient='columns') df.reset_index(inplace=True) boxplot_environment(df) if __name__ == \"__main__\": parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('-r',",
"'--root', type=str, default=\"\", help='Root filepath of the log data') parser.add_argument('-... |
[
"series values_x will contain 1 list of of x-axis values per series. The",
"number of dimensions max_dimensions - limits to generics with max number of dimensions",
"the dimension indices to use as variables (1st one must be X axis;",
"subset of generic data as a 2D matrix Users passes in the dimension",
"V... |
[
"type: {attachment.content_type}') if header == 'VIDEO': await video.process_file(await save_attachment(attachment, msg), msg, ctx, attachment)",
"'AUDIO': await audio.process_file(await save_attachment(attachment, msg), msg, ctx) else: print(f'{Fore.RED}[DISPATCHER] failed to get file",
"def header_type(attach... |
[] |
[] |
[
"aberto', help_text='Determina se a compra do carrinho está em aberto.') class Meta: verbose_name",
"do carrinho está em aberto.') class Meta: verbose_name = 'carrinho de compras' verbose_name_plural",
"carrinho' verbose_name_plural = 'itens dos carrinhos' def __str__(self): return f'Cart #{self.cart.id} - {sel... |
[
"10:20 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('christelle', '0004_remove_about_fonction'), ]",
"Migration(migrations.Migration): dependencies = [ ('christelle', '0004_remove_about_fonction'), ] operations = [ migrations.RenameField( model_name='contact', old_name... |
[
"= LpVariable('Car B', lowBound=0, cat=LpInteger) #Objective Function problem += 20000*A + 45000*B, 'Objective",
"# VARIABLES # 0 <= Car_A Integer # 0 <= Car_B Integer print(problem)",
"= LpVariable('Car A', lowBound=0, cat=LpInteger) B = LpVariable('Car B', lowBound=0, cat=LpInteger) #Objective Function",
"2... |
[
"(2, _('Tuesday')), (3, _('Wednesday')), (4, _('Thursday')), (5, _('Friday')), (6, _('Saturday')), (7, _('Sunday')), )",
"DAY_CHOICES = ( (1, _('Monday')), (2, _('Tuesday')), (3, _('Wednesday')), (4, _('Thursday')), (5, _('Friday')),",
"= ( (1, _('Monday')), (2, _('Tuesday')), (3, _('Wednesday')), (4, _('Thursd... |
[
"# Generated by Django 3.1.12 on 2021-07-12 09:25 from django.db import migrations, models",
"import migrations, models class Migration(migrations.Migration): dependencies = [ (\"polio\", \"0016_config\"), ] operations =",
"class Migration(migrations.Migration): dependencies = [ (\"polio\", \"0016_config\"), ] ... |
[
") grey = threshold.Execute( black ) checker = sitk.CheckerBoardImageFilter(); pattern = [ 0,",
"10 ) threshold.SetOutsideValue ( 100 ) white = threshold.Execute( black ) threshold.SetOutsideValue (",
"i in [ 0, 1, 2 ] : pattern[ i ] = int(",
"threshold = sitk.ThresholdImageFilter() threshold.SetLower( 10 ) t... |
[] |
[
"started_field = (3, 'DATETIME(started) as \"started [timestamp]\"', 'From') finished_field = (4, 'DATETIME(finished) as",
"as pname, Tasks.description as description, \" \" Tracks.started as started, Tracks.finished as finished",
"Tasks.project_id == Projects.id AND \" \" finished == '' \" \" {where_date_claus... |
[
"YourId('1') # need stringify in such a way that they do not colide",
"but the characters in a word cannot be sorted prior to comparison if",
"maximal domain # for assuming similarity, though in some documents every instance of",
"operations are as simple as string= or numberical equality. These must employ a... |
[
"try: project_dir = f\"{dump_dir}/dump_{project.name.replace('/', '_')}\" if not os.path.exists(project_dir): os.makedirs(project_dir) print(f\"Dumping {project.name}\") labels =",
"SEQUENCE_LABELING from api.serializers import LabelSerializer from api.utils import JSONPainter def extract_document_classification(... |
[
"ideal2, productivity_factors[i], final_T_second) print(\"Iteration count 2 {}\".format(iteration_count2)) stop2 = time.time() write_to_optimization_table(task_id,optimizationed_schedule2,max_proj2,stop2-start2,relative_projection2,iteration_count2) def write_to_alorithms_table(task_id,",
"[] for j in range(table... |
[
"pagamento_despesa: return pagamento_despesa[0] return None class Meta: app_label = 'contrato' verbose_name = 'Despesa",
"def __unicode__(self): return u'%s: %s' % (self.contrato.titulo, self.despesa.valor_total) def pagamento(self): pagamento_despesa = PagamentoDespesa.objects.filter(despesa=self.despesa)",
"=... |
[
"TestTrendReq(TestCase): def test__get_data(self): \"\"\"Should use same values as in the documentation\"\"\" pytrend =",
"\"\"\"Should use same values as in the documentation\"\"\" pytrend = TrendReq() self.assertEqual(pytrend.hl, 'en-US')",
"unittest import TestCase from simplifiedpytrends.request import Tren... |
[
"flask import Blueprint posts = Blueprint('posts', __name__) from . import views from .",
"from flask import Blueprint posts = Blueprint('posts', __name__) from . import views from",
"print_function from flask import Blueprint posts = Blueprint('posts', __name__) from . import views",
"from __future__ import ... |
[
"= self._load_item_feats(self.config[\"item_feat_path\"], FS.ITEM) self.inter_feat = pd.read_csv(self.config[\"inter_feat_path\"]).sample( frac=1, random_state=28) mask = None if len(self.types)",
"in dataset'.format(field)) # if field not in self.field2token_id: # raise ValueError('field {} is",
"field in self... |
[
"decode(dct): if \"data\" in dct: return dct[\"data\"] elif \"config\" in dct: return dct[\"config\"]",
"= json.loads(datum, object_hook=decode) for idx, config in enumerate(configs): plt.figure(idx+1) xdata = arr[config[0]] ydata",
"# Add first coordinates l.set_xdata([xdata]) l.set_ydata([ydata]) # Update plo... |
[
"#import logging as log from argparse import ArgumentParser class SysBoard(object): ''' Main system",
"script if __name__ == '__main__': try: f=open('eeprom.json') # EEPROM format j_data = json.load(f)",
"json_data): ''' Constructor ''' self.eeprom = eeprom.EepromBin(\"syseeprom.bin\") # Init EEPROM programmer ... |
[
"the function getStoryString(). Use the functions getStoryString and loadWords to get the raw",
"created in this problem set, decrypt the story given by the function getStoryString().",
"Using the methods you created in this problem set, decrypt the story given",
"get the raw data you need. returns: string - ... |
[
"self._from_string is None assert self._from_filename is None new_piped = deepcopy(self) new_piped._from_handle = handle",
"is None: stdout = None else: if self._stdout_to_handle: stdout = self._stdout_to_handle if self._stdout_to_filename:",
"deepcopy(self) new_piped._from_handle = handle return new_piped def ... |
[
"2019-12-02 23:35 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('thebrushstash',",
"from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('thebrushstash', '0005_setting'), ]",
"= [ ('thebrushstash', '0005_setting'), ... |
[
"] operations = [ migrations.AddField( model_name='rate', name='content', field=models.PositiveIntegerField(default=0, validators=[django.core.validators.MaxValueValidator(10)]), ), migrations.AddField( model_name='rate', name='usability',",
"django.core.validators from django.db import migrations, models class M... |
[
"structFile = os.path.join(struct_dir, 'dg_seoul_test.mat') #x, y, coord, radius = 327934.67464998, 4153535.06119226, 'utm', 25",
"not(db_dir): raise FileNotFoundError(\"root_dir : {}, db_dir : {}\".format(root_dir, db_dir)) struct_dir = os.path.join(root_dir, 'datasets')",
"db_dir = os.path.join(root_dir, '.')... |
[
"Database # https://docs.djangoproject.com/en/4.0/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR /",
"import config, Csv # Build paths inside the project like this: BASE_DIR /",
"- unsuitable for production # See https://docs.djangoproject.com/en/4.0/... |
[
"STEPS = { \"810345672\": [\"X\", \"R'\", \"U\", \"R'\", \"D2\", \"R\", \"U'\", \"R'\", \"D2\",",
"\"D'\", \"R\", \"U\", \"R'\", \"D\", \"R\", \"U'\", \"R'\", \"D'\", \"X\"] } @staticmethod def",
"\"R\", \"U'\", \"R\", \"D2\", \"R'\", \"U\", \"R\", \"D2\", \"R2\", \"X\"], \"012743658\": [\"R2\", \"U\",",
"\"R... |
[
"import pandas as pd import torch import PIL.Image as Image import torchvision.transforms as",
"image_dir = os.path.join(data_dir, 'isic/Images') def main(csv_filename, include_sonic): if include_sonic: new_image_dir = image_dir.replace('Images','ImagesSmallerWithSonic') p",
"print('resizing images') for i,imag... |
[
"\"\"\" # revision identifiers, used by Alembic. revision = '4c4c7189593e' down_revision = '4b4e6d96c630'",
"### def downgrade(): ### commands auto generated by Alembic - please adjust! ###",
"by Alembic - please adjust! ### op.drop_constraint('organization_user_roles_name_german_key', 'organization_user_roles'... |
[
"with wall if snake.head.xcor() > 280 or snake.head.xcor() < -280 or snake.head.ycor() >",
"-280: scoreboard.reset() snake.reset() # Detect collision with tail for segment in snake.segments[1:]: if",
"food if snake.head.distance(food) < 15: food.refresh() snake.extent() scoreboard.increase_score() # Detect coll... |
[
"\"Count\" class ReasonCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): \"\"\"The reason for the restriction. \"\"\" NOT_SPECIFIED =",
"for the workspace. \"\"\" ENABLED = \"Enabled\" DISABLED = \"Disabled\" class NodeState(with_metaclass(_CaseInsensitiveEnumMeta, str,",
"removed from the compute. \"\... |
[
"We convert the images to floating point in range 0.0 - 1.0 face_part",
"-1)) return emojis[0:len(emojis) - 1] def overlay(image, emoji, x, y, w, h): emoji",
"w] = blend_transparent(image[y:y + h, x:x + w], emoji) except: pass return image",
"overlay_part, 255.0, 0.0)) def rescale_frame(frame, percent=75): wi... |
[
"<filename>config.py from pathlib import Path ROOT_DIR = Path(__file__).parent.resolve() IMAGE_DIR = ROOT_DIR / 'images'"
] |
[
"mDict['uid'] if uid not in visDatas: visDatas[uid] = {'mem_use':[], 'cpu_use':[]} visDatas[uid]['mem_use'].append(mDict['mem_use']) visDatas[uid]['cpu_use'].append(mDict['cpu_use']) print(mDict)",
"axCpu = plt.subplot(2,1,2) # colors of lines cols = ['C'+str(i%10) for i in",
"for i in range(options.numNodes)] ... |
[
"'this is a test' encoded_message = encoder(message) lyte.say(f' {message} -->encoded--> {encoded_message} -->decoded--> {decoder(encoded_message)}",
"if __name__ == '__main__': message = 'this is a test' encoded_message = encoder(message)",
"i in range( len(message) ): message[i] = shift( message[i], howMuch= ... |
[
"with ExecutorFactory() as ex: f_result = ex.executor(f_ng)() # compare Caffe2 and ngraph results",
"KIND, either express or implied. # See the License for the specific language",
"test_NHWC2NCHW(): workspace.ResetWorkspace() # NHWC shape = [2, 3, 4, 5] data1 = [float(i)",
"Unless required by applicable law o... |
[
"dinds.append(0) # if no mixed layer depth found, set it to 0 return",
"deps is the depth array depsU is the depth array at U poinnts",
"index less <=1 because the # buoyancy frequency is hard to define there",
"beta dk[S] ) / e3w temp and sal are the temperature and salinity",
"dates = [] for t in np.arang... |
[
"neg_conf_loss total_loss /= (num_pos + tf.to_float(num_neg_batch)) num_pos = tf.where(tf.not_equal(num_pos, 0), num_pos, tf.ones_like(num_pos)) total_loss",
"num_boxes, 4 + num_classes + 8). # Returns loss: Loss for prediction, tensor",
"softmax loss. # Arguments y_true: Ground truth targets, tensor of shape (... |
[
"return self._open_timeout @open_timeout.setter def open_timeout(self, open_timeout): if isinstance(open_timeout, (float, int)): self._open_timeout = open_timeout",
"= <PASSWORD> _timeout = None _open_timeout = None _read_timeout = None _default_header =",
"tuple): (open_timeout, read_timeout) = self._timeout e... |
[
"latvolMod.XSize = size latvolMod.YSize = size latvolMod.ZSize = size latvolMod.DataAtLocation = \"Nodes\" report1",
"data = {} addDataMod = addModule(\"CreateScalarFieldDataBasic\") #eval.Operator = 2 #eval.Scalar = i report2",
"size latvolMod.DataAtLocation = \"Nodes\" report1 = addModule(\"ReportFieldInfo\")... |
[
"@pytest.fixture() def zonedir_src(): return ZONEDIR_SRC @pytest.fixture() def zonedir(): return ZONEDIR @pytest.fixture(scope='module', params=get_connection_fixture_params()) def",
"Bind9ZoneCLI(['bulkpush', *con, '--dir', ZONEDIR_SRC, '--zones', 'public/example.com,private/example.com' ]).run() return connecti... |
[
"import os from setuptools import find_packages if __name__ == '__main__': for package in",
"if __name__ == '__main__': for package in find_packages(): if '.test' in package: continue",
"setuptools import find_packages if __name__ == '__main__': for package in find_packages(): if '.test'",
"find_packages if _... |
[
"= logging.getLogger() logger.setLevel(logging.INFO) smtp_handler = logging.handlers.SMTPHandler(mailhost=('outgoing.mit.edu', 465), fromaddr='<EMAIL>', toaddrs=['<EMAIL>'], subject='Sample Log Mail', credentials=('austinsp','<PASSWORD>'),",
"import logging.handlers logger = logging.getLogger() logger.setLevel(lo... |
[
"self.naucse_urls_to_freeze: while self.logged_calls: yield self.logged_calls.popleft() # Prefer URLs from logged_calls - ideally, cache",
"import contextlib from collections import deque from flask import current_app from flask_frozen import",
"logger # reverses the following operating from :class:`UrlForLogge... |
[
"neighbour) i += 1 except IndexError: self._relabel(n) i = 0 self.current_neighbhours[n] = i",
"return False self.height[n] = 1 + min_neighbour_height return True def _init_preflow(self): excess =",
"height = {k: 0 for k in self.flow_network.node_set} self.flow_network.reset() s = self.flow_network.source heigh... |
[
"taskManagerModule import taskManager import thread import threading import file_operate # import core def",
"import taskManager import thread import threading import file_operate # import core def error(code):",
"idChannel = int(threading.currentThread().getName()) # taskManager.shareInstance().notify(idChanne... |
[
"of all excel localisations all_localisations = all_localisations() # list of top level localisations",
"'FTP', 'TPO Junction', 'PO', 'FP'] if Bayesian: redistributed = ['FT', 'FTP', 'PO', 'Perisylvian',",
"list of localisations to drop minor_locs = [ loc for loc in all_localisations",
"drop minor_locs = [ lo... |
[
"# client = ApiClient(adapter=Co2ApiTimeoutAdapter(), timeout=10) # # # when/then # with self.assertRaises(ApiException): #",
"-*- coding: utf-8 -*- import unittest class ApiTests(unittest.TestCase): pass # @Mocker() # def",
"# @Mocker() # def test_timeout_exception(self, m): # # given # m._adapter = Co2ApiTime... |
[
"obslog_path = os.path.join(self.w.obslog_dir.get_text().strip(), self.w.obslog_name.get_text().strip()) self.write_obslog(obslog_path) def load_obslog_cb(self, w): obslog_path = os.path.join(self.w.obslog_dir.get_text().strip(), self.w.obslog_name.get_text().strip()) self.load_obslog(obslog_path)",
"MS Excel fil... |
[
"glosses_feats = fh_glosses[\"features\"][:] glosses_feats = torch.tensor(glosses_feats) if torch.cuda.is_available(): glosses_feats = glosses_feats.cuda() # load",
"help=\"Retrieve topk nodes for each input sentence.\") p.add_argument('--batch_size', type=int, default=1000) p.add_argument('--visualsem_path', typ... |
[
"255], [30, 285], ...] y_ind: List[List[int]] = calculate_indexes(10, 235, y, y) # [[0,",
":param cells: Iterable of cells :param nms_threshold: cell iou threshold :return: Iterable of",
"is not None: image_base: Tensor = correct_pixel_size(image_base, pixel_size) #model expects pixel size of",
"nms_threshold... |
[
"userver.object.gateway import Gateway, Location from utils.errors import KeyDuplicateError, PatchError from .forms.form_gateway import AddGatewayForm,",
"{} for key, value in add_gateway.errors.items(): errors[key] = value[0] return Response(status=406, response=json.dumps({\"errors\": errors}))",
"add_gateway... |
[
"'ReadControlPanel' ToFirstPuckAndGrabFirstPuck = 'ToFirstPuckAndGrabFirstPuck' ToFirstCornerAndReleaseFirstPuck = 'ToFirstCornerAndReleaseFirstPuck' ToSecondPuckAndGrabSecondPuck = 'ToSecondPuckAndGrabSecondPuck' ToSecondCornerAndReleaseSecondPuck = 'ToSecondCornerAndReleaseSecondPuck'",
"'ToControlPanel' ReadCo... |
[
"ALMAClassifier from .glm import LinearRegression, LogisticRegression, Perceptron from .pa import PAClassifier, PARegressor from",
"import LinearRegression, LogisticRegression, Perceptron from .pa import PAClassifier, PARegressor from .softmax import SoftmaxRegression",
".softmax import SoftmaxRegression __all_... |
[] |
[
"import * from tkinter import ttk import mysql.connector import sqlalchemy import json import",
"Entry(entry_screen, textvariable = Pressure).place(x=140, y=122) # Label for displaying entry status[success/failed] Label(entry_screen, text",
"StringVar() # Creating layout of Data Entry Form Label(entry_screen, w... |
[
"LatestNew class ProductAdmin(admin.ModelAdmin): list_display = ('name','price','created_at') list_links = ('id', 'name') list_filter = ('name','price','created_at')",
"Register your models here. from . models import Product, New, About, LatestNew class",
"portfolio # Register your models here. from . models im... |
[
"'I-time', 'O'] result = [self.id2tag[id] for id in paths[0]] # entities_result = #",
"= tf_ad.text.viterbi_decode( logit[:text_len], self.model.transition_params ) paths.append(viterbi_path) # path[0] = tag in sentence #",
"= tf.train.Checkpoint(optimizer=self.optimizer, model=self.model) ckpt.restore(tf.train... |