ngram listlengths 0 82k |
|---|
[
"<reponame>gray0018/CMU-16-385-Spring2020<gh_stars>0 import numpy as np # write your implementation here"
] |
[
"try: cve_file = open(path, \"rb\") cve_files.append(cve_file) except (OSError, IOError) as",
"requests def upload_cve(file: FileIO) -> dict: \"\"\" Uploads vulnerability list",
"Make the request to upload the batch file print(f\"Sending {os.path.basename(file.name)}",
"inputs api_secret = os.getenv('AUTOMOX_... |
[
"\"lolcats\"] with pytest.raises(TypeError): out = mean(values) def test_zero(): num_list =",
"= [1, 2, 3, 4, 5] obs = mean(num_list) assert",
"out = mean(values) def test_zero(): num_list = [0, 2, 4,",
"pytest def test_ints(): num_list = [1, 2, 3, 4, 5]",
"mean import mean import pytest def test_ints(): nu... |
[
"gitlab_url, token): ''' get the SSH url for all projects",
"must contain two columns: source url in the first, and",
"migrate group variables from 1+ groups on one host to",
"= glm._get_namespace_id(src_gitlab_url, src_group, src_token) else: src_group_id = None target_group_id =",
"@click.argument('target... |
[
"async def destroy(self): raise NotImplementedError() # TODO: destroy a relation",
"<filename>juju/relation.py import logging from . import model log = logging.getLogger(__name__)",
"logging.getLogger(__name__) class Relation(model.ModelEntity): async def destroy(self): raise NotImplementedError() # TODO:",
"... |
[
"Weights) + biases if activation_function is None: outputs = Wx_plus_b",
"# the error between prediction and real data sess =",
"for inputs to network # add output layer # the",
"+ 0.1, ) Wx_plus_b = tf.matmul(inputs, Weights) + biases if",
"biases = tf.Variable(tf.zeros([1, out_size]) + 0.1, ) Wx_plus_b = ... |
[
"= agnid.rpc_command('getinfo') info_keys = [ 'blocks', 'connections', 'difficulty', 'errors', 'protocolversion',",
"def test_agnid(): config_text = AgniConfig.slurp_config_file(config.agni_conf) network = 'mainnet' is_testnet =",
"= AgniConfig.get_rpc_creds(config_text, network) agnid = AgniDaemon(**creds) ass... |
[
"= ClassCollection() self.assertRaises(KeyError, collection.addRelationship, \"bar\", \"foo\", \"aggregation\") # Adding a",
"\"aggregation\") # Adding a relationship that already exists def testAddRelationshipAlreadyExists(self):",
"def testDeleteRelationshipNoSecondClass(self): collection = ClassCollection() ... |
[
"# -*- coding: utf-8 -*- \"\"\" greenbyteapi This file was",
"CustomHeaderAuth: @staticmethod def apply(http_request): \"\"\" Add custom authentication to the",
"https://apimatic.io ). \"\"\" from greenbyteapi.configuration import Configuration class CustomHeaderAuth: @staticmethod",
"). \"\"\" from greenbyte... |
[
"spice.gdpool('INS{}_PIXEL_PITCH'.format(self.ikid), 0, 1)[0] @property def detector_center_sample(self): return 499.5 @property def",
"Hayabusa2IsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver): @property def sensor_model_version(self): return 1 @property",
"return 1 @property def ikid(self): retu... |
[
"range((10**4)+1): lookup.append(lookup[i]*2) answer = [] for i in lookup: anslist",
"for char in str(i)] answer.append(sum(anslist)) t = int(input()) while t:",
"lookup.append(lookup[i]*2) answer = [] for i in lookup: anslist =",
"answer.append(sum(anslist)) t = int(input()) while t: t -= 1 n",
"= [] looku... |
[
"ObsState.EMPTY assert len(proxies.subarray[1].receptors) == 0 assert proxies.fspSubarray[1].obsState == ObsState.IDLE assert",
"fsp_2_proxies.subarray[1].channelAveragingMap[3][0] == 2233 # # assert fsp_2_proxies.subarray[1].channelAveragingMap[3][1] == 0 #",
"== ObsState.IDLE assert proxies.vcc[proxies.recept... |
[
"g = MM0Group() ref_g = MGroupN() class TestSpace: def __init__(self,",
"is deprecated!!\") spaces_dict = {} g = MM0Group() ref_g =",
"def __call__(self, *args): return self.space(*args) def MMTestSpace(p): global spaces_dict try:",
"def __init__(self, p): self.p = p self.space = MMV(p) self.ref_space",
"__... |
[
"{}</p>\\n\".format(entry.author) out = out + u\"<a href='{}'>Link</a>\\n\".format(entry.link.replace(\"abs\",link_to,1)) out = out",
"# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN",
"archive to fetch\", nargs=\"+\") parser.add_argument(\"-r\", \"--replacements\", help=\"also fetch the replacements\",",
"in... |
[
"\"\"\"Advanced Collection of Data: Collects all the walls of height",
"= DB.FilterDoubleRule(height_param_prov, param_equality, 10.0, 1E-6) param_filter = DB.ElementParameterFilter(heigh_value_rule) walls =",
"param_equality = DB.FilterNumericEquals() heigh_value_rule = DB.FilterDoubleRule(height_param_prov, p... |
[
"= 0 for i in range(3,count,2): if (count%i==0): flag =",
"def prime(limit): count = 1 while(count<limit): flag = 0 for",
"range(3,count,2): if (count%i==0): flag = 1 if (flag==0): print(count) count+=2",
"prime(limit): count = 1 while(count<limit): flag = 0 for i",
"if (count%i==0): flag = 1 if (flag==0): ... |
[
"= raw_storage(self.configuration['storage']) self.process_synchronizer = ProcessSynchronizer( self.configuration['synchronization']) def execute_with(self, message): video_chunk",
"= ProcessSynchronizer( self.configuration['synchronization']) def execute_with(self, message): video_chunk = VideoChunk(camera_id=me... |
[
") -> Any: context = _check_invocation_requirements(solid_def, context) input_dict = _resolve_inputs(solid_def,",
"config schema, but no context was provided. ' \"Use the",
"context with the required \" \"resources.\" ) if context is",
"f\"Too many input arguments were provided for solid '{solid_def.name}'. T... |
[
"Maze from .mountain_car import MountainCar from .random_walk import RandomWalk from",
".k_armed_bandit import KArmedBandit from .grid_world import GridWorld from .race_track import",
".race_track import RaceTrack from .windy_grid_world import WindyGridWorld from .maze import",
"WindyGridWorld from .maze impo... |
[
"end=' ') print(f'\\nO maior número foi {M}\\nE o Menor foi",
"random import randint for i in range(5): n = (randint(0,10))",
"m): m = n print(n, end=' ') print(f'\\nO maior número",
"n M = n if (n > M): M =",
"if (n > M): M = n elif (n <",
"= n elif (n < m): m = n print(n,",
"(n < m): m = n print(n, en... |
[
"common import Codes from ..controllers import FileController # EditorController (?)",
"= FileController.add_file_editor(self.current_file, editor_username, Data().get_token()) if response.code == Codes.SUCCESS: self.parent.display_info('Editor added",
"def __init__(self, parent): Frame.__init__(self, parent) s... |
[
"schema, definition, **kwargs): \"\"\"Definition helper that modifies the schema definition",
"terms of the GNU Lesser General Public License as published",
"child_def['required']: del child_def['required'] definition.clear() return { 'allOf': [{'$ref': ref} for",
"is free software: you can redistribute it an... |
[
"migrate_engine t = Table(\"demographics_request_column_definition\", meta, autoload=True) uhl_system_number_column_id = Column(\"uhl_system_number_column_id\", Integer)",
"sqlalchemy import ( MetaData, Table, Column, Integer, ) meta =",
"uhl_system_number_column_id.create(t) def downgrade(migrate_engine): meta... |
[
"= spider.soccer.countries(full=True) assert set(self.competitions.keys()) <= set(countries.keys()) assert isinstance(countries, dict) @pytest.mark.parametrize('country',",
"'serie_a', 'spain': 'la_liga', } def test_countries(self, spider): countries = spider.soccer.countries()",
"[next(iter(competitions.items(... |
[
"date(1995, 4, 23), date(1996, 4, 14), date(1997, 4, 27), date(1998,",
"date(2016, 3, 27), date(2017, 4, 16), date(2018, 4, 1), date(2019,",
"== easter(easter_date.year, EASTER_ORTHODOX) @pytest.mark.parametrize(\"easter_date\", julian_easter_dates) def test_easter_julian(easter_date): assert easter_date ==",
... |
[
"parameters') print(e) def load_str(self, config_str: str): self.config = yaml.load(config_str) def",
"class validateYAML: def validate_yaml(self, schemaFile: str, yamlFile: str): schema =",
"r, v.errors class Config: \"\"\" Configuration parsed directly from a",
"errs = validator.validate_yaml('configs/schem... |
[
"code, out, _ = run_vhdeps('ghdl', '-i', DIR+'/complex/multi-tc-per-file') self.assertEqual(code, 0) self.assertTrue(bool(re.search(r'ghdl",
"local.env(PATH=DIR+'/ghdl/fake-ghdl:' + local.env['PATH']): code, out, _ = run_vhdeps( 'ghdl', '-i',",
"local.env(PATH=DIR+'/ghdl/fake-ghdl:' + local.env['PATH']): code, ... |
[
"1.0), #0.5, #'vect__max_features': (None, 5000, 10000, 50000), #'union__word__vect__ngram_range': ((1, 4),",
"ep = elems[5:] features['meta'][i].update({'event_condscore': float(ecs), 'event_score': float(es), 'event_normscore': float(ens), 'event_pred':",
"0 for line in einf: elems = line.strip().split() even... |
[
"i in range(r): u*=N u%=mod N-=1 d*=R d%=mod R-=1 return",
"def comb_mod(n,r,mod): if n-r<r: r=n-r N=n R=r u=1 d=1 for",
"r=n-r N=n R=r u=1 d=1 for i in range(r): u*=N",
"for i in range(r): u*=N u%=mod N-=1 d*=R d%=mod R-=1",
"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 in range(r)... |
[
"informations that will be used based on existent set from",
"import forms from django.utils.translation import ugettext, ugettext_lazy as _ from",
"the existents forms on create message page. \"\"\" class Meta:",
"message page. \"\"\" class Meta: \"\"\"Meta Class. This class defines",
"Message fields = '__... |
[
"if a < 0: print(\"Negative\") elif a > 0: print(\"Positive\")",
"\")) if a < 0: print(\"Negative\") elif a > 0:",
"a < 0: print(\"Negative\") elif a > 0: print(\"Positive\") else:",
"number : \")) if a < 0: print(\"Negative\") elif a",
"a = int(input(\"enter a number : \")) if a <",
"0: print(\"Negative\... |
[
"# Get the placeholders from the graph by name self.input_x",
"something print(\"In ready\") @csrf_exempt def getResponse(self, request): if request.method ==",
"print(\"request\") print(request.body) print(request.POST) reqStr = str(request.body,'utf-8') reqStrArr = reqStr.split() reqStr",
"= \"\"\" Dear Sir... |
[
"= Canvas(window, height=30, width=30) back.pack() diamonds = 0 def morediamonds():",
"def minerworking(): global diamonds diamonds -=15 Cursor = Button(window, text=\"Cursor:",
"Button(window, text=\"Cursor: Clicks every second (Cost: 15). Lasts 20 seconds.\",",
"minerworking(): global diamonds diamonds -=15... |
[
"**kwargs) return cls._instance #@Singleton #class TestClass(Singleton2): class TestClass(metaclass = Singleton3):",
"__call__(cls, *args, **kwargs): if not hasattr(cls, \"_instance\"): cls._instance = super().__call__(*args,",
"if not hasattr(cls, \"_instance\"): cls._instance = super().__new__(cls, *args, **k... |
[] |
[
"= argparse.ArgumentParser() print(Configer.ip_address, Configer.port, Configer.ssh_username, Configer.ssh_password) print(Configer.db_name, Configer.db_username, Configer.db_password) if",
"import * from src.configer import * from src import tfidf",
"Configer = Configer('setting.ini') logging.basicConfig( # fi... |
[
"of array separated by space: \").split())) key = input(\"Enter element",
"search algorithms having a time complexity of O[n]. It compares",
"def linear_search(array, key): len_array = len(array) t = None for",
"array separated by space: \").split())) key = input(\"Enter element to",
"algorithms having a ti... |
[
"torch.LongTensor(len(batch), max_input_len) text_padded.zero_() for i in range(len(ids_sorted_decreasing)): text = batch[ids_sorted_decreasing[i]][0]",
"import load_filepaths_and_text from tacotron2_gst.audio_processing import load_wav_to_torch class TextMelLoader(torch.utils.data.Dataset): \"\"\" 1)",
"% self... |
[
"= input(\"What year were you born?\") age = 2019 -",
"<filename>type_conversion.py birth_year = input(\"What year were you born?\") age =",
"born?\") age = 2019 - int(birth_year) print(f\"Your age is: {age}\")",
"were you born?\") age = 2019 - int(birth_year) print(f\"Your age",
"year were you born?\") age... |
[
"defect creation service resp = requests.post(map.defect_service_url, data=json.dumps(gitdata), headers=headers1) return resp.text",
"\"Build Failed To get data for nightly build\" }, \"error\":",
"return jenkinsdata def getgitcommitdata(commit_id): response = requests.get(giturl+commit_id, headers = headers,",... |
[
"# fig.figimage(im, 300, 0, zorder=3, alpha=0.2) ax.xaxis.set_minor_locator(hours3) ax.tick_params(which='major', length=7, width=2,",
"parser.add_argument('-e', '--environment', type=str, default=\"environment_sensor.txt\", help='Name of the envrionment sensor log",
"== \"__main__\": parser = argparse.Argument... |
[
"of String, parameter \"scalar_types\" of list of String, parameter \"dimension_types\"",
"series. The number of series depends on the number of",
"instance of type \"GetGenericMetadataParams\" (Get metadata describing the dimensions of",
"-> structure: parameter \"input_ref\" of String :returns: instance of ... |
[
"os.path.basename(embed.url) with open(f'temp/{msg.id}', \"wb\") as file: file.write(await resp.read()) else: print('[EMBED",
"msg.attachments: for attachment in msg.attachments: for attachment in msg.attachments: header",
"type: {attachment.content_type}') if header == 'VIDEO': await video.process_file(await s... |
[
"from sklearn.preprocessing import PolynomialFeatures poly = PolynomialFeatures(6) def map(x): return",
"sklearn.preprocessing import PolynomialFeatures poly = PolynomialFeatures(6) def map(x): return poly.fit_transform(x)"
] |
[
"from .intpy import deterministic from .data_access import get_cache_data, create_entry name=\"int_py\""
] |
[
"on_delete=models.CASCADE, verbose_name='carrinho de compras') freight = models.FloatField('frete') class Meta: verbose_name",
"= 'vendas' def __str__(self): return f'Sale #{self.id} - {self.buyer}' def",
"= 0 for i in self.get_items(): subtotal += i.product.price return",
"class CartItem(models.Model): cart ... |
[
"migrations class Migration(migrations.Migration): dependencies = [ ('christelle', '0004_remove_about_fonction'), ] operations",
"django.db import migrations class Migration(migrations.Migration): dependencies = [ ('christelle', '0004_remove_about_fonction'),",
"class Migration(migrations.Migration): dependenci... |
[
"problem += 3*A + 6*B <= 30, 'Engineer Constraint' problem",
"+ 45000*B, 'Objective Function' #Constraints problem += 4*A + 5*B",
"#Constraints problem += 4*A + 5*B <= 30, 'Designer Constraint'",
"Car_B <= 30 # Machine_Constraint: 2 Car_A + 7 Car_B",
"<= 30 # Machine_Constraint: 2 Car_A + 7 Car_B <=",
"Cr... |
[
"= ( (1, _('Monday')), (2, _('Tuesday')), (3, _('Wednesday')), (4, _('Thursday')),",
"from django.utils.translation import gettext as _ DAY_CHOICES = ( (1,",
"( (1, _('Monday')), (2, _('Tuesday')), (3, _('Wednesday')), (4, _('Thursday')), (5,",
"(3, _('Wednesday')), (4, _('Thursday')), (5, _('Friday')), (6, _... |
[
"on 2021-07-12 09:25 from django.db import migrations, models class Migration(migrations.Migration):",
"2021-07-12 09:25 from django.db import migrations, models class Migration(migrations.Migration): dependencies",
"import migrations, models class Migration(migrations.Migration): dependencies = [ (\"polio\", \... |
[
"/ gridSpacing ) pattern[ 0 ] = 1 print pattern",
"= image.GetSpacing(); black.SetSpacing( spacing ) black.SetDirection( image.GetDirection() ) threshold =",
"checker = sitk.CheckerBoardImageFilter(); pattern = [ 0, 0, 0 ]",
") pattern[ 0 ] = 1 print pattern checker.SetCheckerPattern( pattern",
"SimpleITK a... |
[
"marketlearn.portfolio.asset import Asset # noqa from marketlearn.portfolio.harry import Harry #",
"import Asset # noqa from marketlearn.portfolio.harry import Harry # noqa",
"from marketlearn.portfolio.asset import Asset # noqa from marketlearn.portfolio.harry import Harry"
] |
[
"finished == ''\") return self.cursor.fetchall() def get_active_task(self, started='', finished='', tname='',",
"Projects.id AND \" \" Tracks.task_id == Tasks.id \" \"GROUP BY",
"ON DELETE CASCADE, ' ' started TIMESTAMP, ' ' finished",
"Tracks started = datetime.datetime.now() - timedelta(days=4) self.create_... |
[
"super().__new__(cls, *args, **kwargs) def __init__(self, *args, **kwargs): return super().__init__(*args, **kwargs)",
"the family of functions that implement 'sameness' requires direct comparison",
"are interested in the equality of two ordered strings of",
"str should be base ... \"\"\" Base class for all",... |
[
"os.makedirs(project_dir) print(f\"Dumping {project.name}\") labels = project.labels.all() label_serializer = LabelSerializer(labels, many=True)",
"= project.documents.all() data = JSONPainter().paint(documents) data = map( lambda x:",
"{ **x, \"labels\": list( map( lambda y: get_extract_label(project)(y, label... |
[
"{2}'.format(len(schedule2), type(schedule2[0]), schedule2[i][0])) sched_JSON1 = json.dumps(schedule1[i]) sched_JSON2 = json.dumps(schedule2[i]) alg",
"[] for i in range(len(sets)): task_table_with_coefficient = calculate_task_table_from_productivity_factors(sets[i], productivity_factors[i]) schedules_first_alg.a... |
[
"verbose_name=\"Contrato\") despesa = models.ForeignKey(Despesa, verbose_name=\"Despesa\") def __unicode__(self): return u'%s: %s'",
"gestao.financeiro.models.pagamento.PagamentoDespesa import PagamentoDespesa class ContratoDespesas(models.Model): contrato = models.ForeignKey(Contrato, verbose_name=\"Contrato\") ... |
[
"self.assertEqual(pytrend.tz, 360) self.assertEqual(pytrend.geo, '') self.assertTrue(pytrend.cookies['NID']) def test_interest_over_time(self): pytrend = TrendReq()",
"360) self.assertEqual(pytrend.geo, '') self.assertTrue(pytrend.cookies['NID']) def test_interest_over_time(self): pytrend = TrendReq() pytrend.bui... |
[
"print_function from flask import Blueprint posts = Blueprint('posts', __name__) from",
"import Blueprint posts = Blueprint('posts', __name__) from . import views",
"posts = Blueprint('posts', __name__) from . import views from .",
"= Blueprint('posts', __name__) from . import views from . import",
"__futur... |
[
"ValueError('field {} is not token type'.format(field)) if len(self.field2token_id[field]) == 0:",
"= item_feat[field].map(id_map) def join(self, df): \"\"\" Join user/item features to",
"= self.inter_feat[self.inter_feat['type'] == kind_id].sample(frac=ratio * 0.7 + 0.3, random_state=16) print(kind,",
"sum([... |
[
"if \"data\" in dct: return dct[\"data\"] elif \"config\" in dct:",
"connection conn, addr = s.accept() print \"Connected by\", addr configs",
"closing connection print \"Invalid data received\" else: # If data",
"numpy as np import json idx = 0 lines =",
"data l.set_xdata(np.append(x, xdata)) l.set_ydata(n... |
[
"== 'show': # eepprog show eepprog.eep_dev.reload() for key in sorted(eepprog.fields.keys(),",
"json eepprog.eep_dev.reload() print eepprog.toJSON() elif args.subcommand == 'field': # eepprog",
"def main(board, argv=None): '''Command line options.''' if argv is None:",
"eepprog.eep_dev.dump() elif args.subcom... |
[
"you created in this problem set, decrypt the story given",
"get the raw data you need. returns: string - story",
"def decrypt_story(): \"\"\" Using the methods you created in this",
"in this problem set, decrypt the story given by the",
"you need. returns: string - story in plain text \"\"\"",
"the metho... |
[
") return stdoutput.decode(\"utf8\") def __str__(self): return \" \".join(self._command.arguments) def __unicode__(self):",
"= deepcopy(self) new_piped._stderr_to_handle = handle return new_piped def run(self): _check_directory(self._command.directory)",
"previous_directory = getcwd() if ( self._from_handle is ... |
[
"migrations, models class Migration(migrations.Migration): dependencies = [ ('thebrushstash', '0005_setting'), ]",
"('thebrushstash', '0005_setting'), ] operations = [ migrations.CreateModel( name='StaticPageContent', fields=[ ('id',",
"Generated by Django 2.2.7 on 2019-12-02 23:35 from django.db import",
"[ ... |
[
"('awwaards_app', '0003_rate'), ] operations = [ migrations.AddField( model_name='rate', name='content', field=models.PositiveIntegerField(default=0,",
"django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('awwaards_app',",
"class Migration(migrations.Migration): dependen... |
[
"of image files are #structFile = join(struct_dir, 'pitts30k_test.mat') #structFile =",
"os.path.join(struct_dir, 'dg_daejeon_test.mat') structFile = os.path.join(struct_dir, 'dg_seoul_test.mat') #x, y, coord, radius",
"'dg_daejeon_test.mat') structFile = os.path.join(struct_dir, 'dg_seoul_test.mat') #x, y, coo... |
[
"type # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' # Email configuration #",
"= 'farmblr.wsgi.application' # Database # https://docs.djangoproject.com/en/4.0/ref/settings/#databases DATABASES = { 'default':",
"}, { 'NAME': 'django.... |
[
"\"U'\", \"L\", \"U\", \"L\", \"F\", \"L2\", \"U\"], \"210347658\": [\"R'\", \"U2\",",
"cubies = ['BLU', 'BU', 'BRU', 'LU', 'U', 'RU', 'FLU', 'FU',",
"\"L2\", \"U\"], \"210347658\": [\"R'\", \"U2\", \"R\", \"U2\", \"R'\", \"F\", \"R\",",
"\"L\", \"U'\", \"R\", \"U2\", \"L'\", \"U\", \"R'\", \"U\"], \"07634521... |
[
"= transforms.Compose([transforms.Resize((224,224))]) data_dir = '../../data' image_dir = os.path.join(data_dir, 'isic/Images') def",
"images') for i,image_name in enumerate(image_names): if i % 1000 ==",
"= p['image_name'].values if not os.path.exists(new_image_dir): print('making ',new_image_dir) os.mkdir(new... |
[
"revision = '4c4c7189593e' down_revision = '4b4e6d96c630' from alembic import op",
"auto generated by Alembic - please adjust! ### op.drop_constraint('organization_user_roles_name_german_key', 'organization_user_roles',",
"'organization_user_roles', type_='unique') op.drop_constraint('organization_user_roles_na... |
[
"Collision with food if snake.head.distance(food) < 15: food.refresh() snake.extent() scoreboard.increase_score()",
"Detect collision with wall if snake.head.xcor() > 280 or snake.head.xcor()",
"if snake.head.xcor() > 280 or snake.head.xcor() < -280 or snake.head.ycor()",
"if snake.head.distance(food) < 15: f... |
[
"ssh port is open and accessible according to the VNet/subnet",
"\"Updating\" CREATING = \"Creating\" DELETING = \"Deleting\" SUCCEEDED = \"Succeeded\"",
"FAILURE = \"Failure\" INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = \"InvalidQuotaBelowClusterMinimum\" INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = \"InvalidQuotaExce... |
[
"* (background_mask * (1 / 255.0)) overlay_part = (overlay_img *",
"0.0 - 1.0 face_part = (face_img * (1 / 255.0))",
"(face_img * (1 / 255.0)) * (background_mask * (1 /",
"* (1 / 255.0)) overlay_part = (overlay_img * (1 /",
"to floating point in range 0.0 - 1.0 face_part =",
"calculate the inverse mask ba... |
[
"from pathlib import Path ROOT_DIR = Path(__file__).parent.resolve() IMAGE_DIR = ROOT_DIR",
"<filename>config.py from pathlib import Path ROOT_DIR = Path(__file__).parent.resolve() IMAGE_DIR =",
"import Path ROOT_DIR = Path(__file__).parent.resolve() IMAGE_DIR = ROOT_DIR / 'images'",
"pathlib import Path ROOT... |
[
"lines lins = ['-']*10 + ['--']*10 + ['-.']*10 # manually",
"uid in enumerate(list(visDatas.keys())): l = len(visDatas[uid]['mem_use']) axRam.plot(visDatas[uid]['mem_use'][max(0, l-maxX):l], color=cols[i], linestyle=lins[i],",
"= s.accept() start_new_thread(dataStream, (con,)) visDatas = {} # store all",
"bre... |
[
"+ howMuch) def encoder(message): message=list(message) for i in range( len(message)",
"for i in range( len(message) ): message[i] = shift( message[i],",
"shift( message[i], howMuch= secret_number ) return ''.join(message) def decoder(message): message=list(message)",
"lyte secret_number = 4 def shift(c, howM... |
[
"] expected = [ [2.71828, 7.3890, 20.08553, 54.59815, 2.71828, 7.3890,",
"expected results and ngraph results if expected: assert(np.allclose(f_result, expected, atol=1e-3,",
"2.0 (the \"License\"); # you may not use this file",
"0.175], ] run_all_close_compare_initiated_with_random_gauss('Softmax', shape=sha... |
[
"gravity (m/s^2) g = 9.81 # calculate average density in",
"calculate the Froude # number in a simple 2D system",
"over time n2 is the buoyancy frequency array with dimensions",
"returns: Fr, c, u_avg - the Froude number, wave speed,",
"defini tion based on an question of state: g* (alpha",
"axis drho_r =... |
[
"# Returns softmax_loss: Softmax loss, tensor of shape (?, num_boxes).",
"num_neg_batch = tf.reduce_min(tf.boolean_mask(num_neg, tf.greater(num_neg, 0))) num_neg_batch = tf.to_int32(num_neg_batch) confs_start =",
"is free software: you can redistribute it and/or modify #",
"num_boxes, 4). y_pred: Predicted bo... |
[
"= site self.format = format @property def site(self): return self._site",
"if self._site.username: self.username = self._site.username if self._site.password: self.password = <PASSWORD>",
"if isinstance(self._site, furl): self._site = site else: self._site = furl(site)",
"not None: if isinstance(self._timeou... |
[
"= {} addDataMod = addModule(\"CreateScalarFieldDataBasic\") #eval.Operator = 2 #eval.Scalar =",
"executeAll() removeModule(view.id) view = addModule(\"ViewScene\") show.output[0] >> view.input[0] view.showUI() executeAll()",
"latvolMod.output[0] >> report1.input[0] data = {} addDataMod = addModule(\"CreateScal... |
[
"request.param con = ['--connection', connection] Bind9ZoneCLI(['init', *con, '--drop']).run() Bind9ZoneCLI(['bulkpush', *con,",
"bind9zone.cli import Bind9ZoneCLI ZONEDIR_SRC = 'tests/input' ZONEDIR = 'tests/output' def",
"1つのモジュール内(pyファイル)から複数回使用された場合でも、データベースの初期化処理が行われるのは 各モジュールあたり最初の一回だけです。 \"\"\" engine = ... |
[
"'.test' in package: continue os.system(f'cmd /c \"python -m pytest -s",
"in package: continue os.system(f'cmd /c \"python -m pytest -s {package}/test\"')",
"if __name__ == '__main__': for package in find_packages(): if '.test'",
"import os from setuptools import find_packages if __name__ == '__main__':",
"... |
[
"import logging.handlers logger = logging.getLogger() logger.setLevel(logging.INFO) smtp_handler = logging.handlers.SMTPHandler(mailhost=('outgoing.mit.edu', 465),",
"logging.handlers logger = logging.getLogger() logger.setLevel(logging.INFO) smtp_handler = logging.handlers.SMTPHandler(mailhost=('outgoing.mit.edu... |
[
"urls_to_freeze = current_app.config.get('NAUCSE_ABSOLUTE_URLS_TO_FREEZE') if urls_to_freeze is not None: urls_to_freeze.append(url) class",
"app, urls_to_freeze): super().__init__(app) self.naucse_urls_to_freeze = urls_to_freeze def iter_calls(self): \"\"\"Yield all",
"the following operating from :class:`UrlF... |
[
"self.flow_network.source height[s] = self.flow_network.total_nodes for n in self.flow_network.get_node_neighbours(s): c =",
"neighbour_list[i] success = self._push(n, neighbour) i += 1 except IndexError:",
"in self.flow_network.get_node_neighbours(s): c = self.flow_network.get_arc_capacity(s, n) self.flow_netw... |
[
"core def error(code): return # idChannel = int(threading.currentThread().getName()) # taskManager.shareInstance().notify(idChannel,",
"import taskManager import thread import threading import file_operate # import",
"taskManager.shareInstance().notify(idChannel, 100 + code) # file_operate.printf('%s Failed at ... |
[
"we want to keep def top_level_lobes(Bayesian=False): Lobes = ['TL', 'FL',",
"if i not in redistributed] return Lobes major_localisations = top_level_lobes()",
"'FP', 'Sub-Callosal Cortex', 'TO', 'TPO Junction', 'TP'] redistributed.append('Cerebellum') Lobes =",
"redistributed = ['FT', 'FTP', 'PO', 'Perisylvi... |
[
"# given # m._adapter = Co2ApiTimeoutAdapter(m._adapter) # m.register_uri(ANY, ANY, text=self.hanging_callback)",
"import unittest class ApiTests(unittest.TestCase): pass # @Mocker() # def test_timeout_exception(self,",
"text=self.hanging_callback) # client = ApiClient(adapter=Co2ApiTimeoutAdapter(), timeout=10... |
[
"in self.rpt_columns]) self.rpt_dict[frameid] = d self.w.rpt_tbl.set_tree(self.rpt_dict) except Exception as e:",
"None) if imname is None: return # only accepted list",
"image): \"\"\"Override this method to do something special with the",
"Select one or more frames to add the memo to",
"this method to do ... |
[
"the test set. (See paper for reference)\"\"\") args = p.parse_args()",
"to_idx = from_idx+batch_size if from_idx+batch_size <= n_lines else n_lines batch_sentences",
"bnids_predicted: bnids_predicted.append((bnid_pred,bnid_pred_score)) if len(bnids_predicted)>=topk: break # write top-k predicted BNids",
"loa... |
[
"= out['labels'].cpu() # The model output coords with respect to",
"= os.path.split(f)[-1] # remove weird cell ID's for i, c",
"Tensor = out['labels'].cpu() # The model output coords with respect",
"shape of: {image_base.shape}') elif cell_diameter is not None: image_base: Tensor",
"Cochlea from hcat.backen... |
[
"request.method == 'GET': gateways_list = [] gateways = Gateway.query.filter_by(user_id=user.id) for",
"@api.route(root + 'gateways/<gateway_id>', methods=['GET', 'DELETE', 'PATCH', 'POST']) @require_basic_or_oauth @gateway_belong_to_user def",
"Response(status=406, response=json.dumps({\"errors\": {\"other\": ... |
[
"random from enum import Enum import rospy from std_msgs.msg import",
"CycleStarted = 'CycleStarted' ToResistanceStation = 'ToResistanceStation' ReadResistance = 'ReadResistance' ToControlPanel",
"ToSecondCornerAndReleaseSecondPuck = 'ToSecondCornerAndReleaseSecondPuck' ToThirdPuckAndGrabThirdPuck = 'ToThirdPuc... |
[
".glm import LinearRegression, LogisticRegression, Perceptron from .pa import PAClassifier, PARegressor",
"PARegressor from .softmax import SoftmaxRegression __all__ = [ \"ALMAClassifier\", \"LinearRegression\",",
".softmax import SoftmaxRegression __all__ = [ \"ALMAClassifier\", \"LinearRegression\", \"Logisti... |
[
"{'name': '<NAME>', 'data': [ 'security/ir.model.access.csv', 'security/todo_access_rules.xml', 'views/todo_menu.xml', 'views/todo_view.xml'], 'application': True}",
"<reponame>hitosony/odoo {'name': '<NAME>', 'data': [ 'security/ir.model.access.csv', 'security/todo_access_rules.xml', 'views/todo_menu.xml', 'view... |
[
"try: # executing the sql command Epi_con.execute(sql, data) # commit",
"== '': message.set(\"fill the empty field!!!\") else: # Create connection",
"Label(entry_screen, width=\"300\", text=\"Please enter details below\", bg=\"blue\", fg=\"white\").pack() # Temperature",
"query to INSERT a record into the dat... |
[
"ProductAdmin(admin.ModelAdmin): list_display = ('name','price','created_at') list_links = ('id', 'name') list_filter =",
"('id', 'name') list_filter = ('name','price','created_at') search_fields = ('name','price') ordering =('name','price','created_at')",
"import Product, New, About, LatestNew class ProductAdm... |
[
"= # [{'begin': 0, 'end': 3, 'words': '賈伯斯', 'type': 'name'},",
"'I-name', 'O', 'B-time', 'I-time', 'O'] result = [self.id2tag[id] for id",
"result = [self.id2tag[id] for id in paths[0]] # entities_result =",
"+= len(testset) if counter == self.test_mapping[article_id]: results.append(result) article_id += 1"... |