ngram
listlengths
0
82k
[ "\"value\": entrance_fee}) def withdraw(): fund_me = FundMe[-1] account = get_account()", "print(f\"entrance is {entrance_fee}\") print(\"funding..\") fund_me.fund({\"from\": account, \"value\": entrance_fee}) def withdraw():", "= FundMe[-1] account = get_account() fund_me.withdraw({\"from\": account}) def main...
[ "um programa que ajude ele, lendo o nome dos alunos", "= input('Digite mais um nome: ') nome4 = input('Digite o", "último nome: ') nome = [nome1, nome2, nome3, nome4] print(choice(nome))", "nome3 = input('Digite mais um nome: ') nome4 = input('Digite", "') nome3 = input('Digite mais um nome: ') nome4 =", ...
[ "search_fields = ('name', 'last_name', 'phone') list_editable = ('phone', 'show') admin.site.register(Categoria)", "'last_name', 'phone', 'email', 'creation_date', 'categoria', 'show') list_display_links = ('id', 'name',", "= 10 search_fields = ('name', 'last_name', 'phone') list_editable = ('phone',", "('id'...
[ "_n_jobs_for_upload = 20 _root_folders_set = ( '/path/to/folder', ) _spoiler_for_each_file =", "= {} tmp_dir = tempfile.mkdtemp() try: sub_results = Parallel(n_jobs=_n_jobs_for_upload, backend='threading')(", "continue file_path = os.path.join(root, file) pics_to_upload[file] = file_path print(pics_to_upload) p...
[ "Corporation Licensed under the Apache License, Version 2.0 (the \"License\");", "permissions and limitations under the License. \"\"\" import numpy as", "greater than min_value') def process_image(self, annotation, prediction): for target in", "Unless required by applicable law or agreed to in writing,", "...
[ "import nacl.secret import nacl.utils def test_random_bytes_produces(): assert len(nacl.utils.random(16)) == 16", "from 32 bytes\" seed = b\"\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\" with pytest.raises(TypeError) as e:", "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
[]
[ "1)] playing = True tries = 5 return [words, output,", "check_letter(letter, word, tries): correct = False for index, letter in", "{0} tries left.\".format(tries)) # print(\"DEBUG: word is {0}\".format(word)) if output", "[words, output, word, tries, playing] def check_finished(output, tries): if tries", "d...
[ "create ES client, create index es = Elasticsearch(hosts = [ES_HOST])", "txts_path = '%s/artdatis/tagging/OCRed/typed/' % DATA_PATH text_corpus = [] def corpus_iterator():", "out and collect text files for file_path in glob.glob(txts_path+'*_text.txt'): with", "\"text\": text, \"start_text\": start_text}, } p...
[ "a position, a game state, layer state, or some other", "Token is a button or other object on the table", "position, a game state, layer state, or some other piece", "state, layer state, or some other piece of info \"\"\"", "Token(object): def __init__(self, name, table): self.table = table self.name =", ...
[]
[ "1 else: index_of_last_element = mid_point - 1 store = [2,", "77] a = interpolation_search(store, 2) print(\"Index position of value 2", "- lower_bound_index) // (input_list[upper_bound_index] - input_list[lower_bound_index]) ) * (search_value -", "index_of_first_element, index_of_last_element, term ) if mid_...
[ "Projects(models.Model): project_name = models.CharField(max_length=60) project_owner = models.CharField(default=User, max_length=60) project_created =", "django.db.models import Q from django.contrib.auth.models import User from django.urls import", "projects_per_user(self, user): return self.filter( Q(project...
[ "checkov.runner_filter import RunnerFilter class TestAdminPolicyDocument(unittest.TestCase): def test_summary(self): runner = Runner()", "= os.path.dirname(os.path.realpath(__file__)) # Used in os.environ[\"sneaky_var\"] = \"*\" test_files_dir =", "checks: {[fc.file_path for fc in report.skipped_checks]}\") sel...
[ "opts: if opt in (\"-o\", \"--obfuscate\"): mpSession.obfuscateForm = True mpSession.obfuscateNames", "'nt' else 'clear') # Logging logging.basicConfig(level=getattr(logging, logLevel),format=\"%(message)s\", handlers=[utils.ColorLogFiler()]) logging.info(colored(BANNER, 'green'))", "mpSession.unicodeRtlo: # Re...
[ "<reponame>binhmuc/faced import os MODELS_PATH = os.path.join(os.path.dirname(__file__), \"models\") YOLO_SIZE = 288", "MODELS_PATH = os.path.join(os.path.dirname(__file__), \"models\") YOLO_SIZE = 288 YOLO_TARGET = 9", "= os.path.join(os.path.dirname(__file__), \"models\") YOLO_SIZE = 288 YOLO_TARGET = 9 CORRE...
[ "es_config['index-settings'] check_error(es_client.indices.put_template(name=template_name, body=template_body)) def bulk_index(es_client, index_name, file_path, logger): file_name =", "logger.info(\"Bulk indexing...\") for document_type, file_path in bulk_files: if document_type in", "delete_index(es_client, i...
[ "outputs. For the list of Cartopy CRS objects this module", "instance parameter, which together control the center of the plot,", "---------- `load` : Return a Cartopy CRS initialized with defaults", "with empty `df` and `centerings`. \"\"\" def __init__(self, **kwargs): \"\"\"Save", "object without having ...
[ "ne_corner = \"{0},{1}\".format(lat + 1, lon + 1) return self.config[kwargs['provider']]['url'].format(lat=lat,", "get_url(self, **kwargs): lat = float(kwargs.get('lat')) lon = float(kwargs.get('lon')) sw_corner =", "StoresHandler class ATTStoresHandler(StoresHandler): def handle_request(self, **kwargs): kwargs...
[ "o ano de nascimento de 7 pessoas e mostre quantas", "e quantas ainda não for c in range(1,8): p=int(input('Qual o", "e mostre quantas ja atingiram a maioridade e quantas ainda", "else: print('A pessoa numero {} não é maior de idade!'.format(c))", "ano de nascimento de 7 pessoas e mostre quantas ja", "nas...
[ "= [] for j in front: if i == j:", "\"\"\" Provide function to calculate SDE distance @auth: <NAME> @date:", "[(values1[i], values2[i])] shifted_list = [] for j in front: if", "j in front: if i == j: continue else: shifted_list.append((min(values1[i],", "i in front: shifted_dict[i] = [(values1[i], values2[i...
[ "print(\"-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=\") print(\"-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=\") print(\"-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=\") wake() # 启动手机 start_app(\"com.ss....
[ "is not None assert in_log in result delete_all(client, [c]) def", "ws.create_connection(logs.url) assert 'Handshake status 401' in str(excinfo.value) delete_all(client, [c]) def", "import websocket as ws import pytest def get_logs(client): hosts =", "{}; sleep 2\"'.format(in_log) c = client.create_container(...
[ "Image Recognition. arXiv:1512.03385 ''' from numpy.lib.arraysetops import isin import torch", "planes, kernel_size=1, bias=False) self.conv1 = conv1x1(in_planes, planes, stride=1, input_signed=False, predictive_forward=False,", "stride=1, input_signed=False, predictive_forward=False, writer_prefix=None) self.b...
[ "def person_in_db(x, celebrity_knowledge_base): for ent in x.doc.ents: if ent.label_ ==", "from pyspark.sql import Row from snorkel.labeling.lf import labeling_function from snorkel.labeling.lf.nlp_spark", "if ent.label_ == \"PERSON\": return ABSTAIN return NEGATIVE @spark_nlp_labeling_function( text_field=\"ar...
[ ":(N+1)//2, 0] z[..., 1:N:2] = y[..., (N+1)//2:, 0].flip([x.ndimension()-1]) return z", "j} exp(-j*2*pi*(u*i/M + v*j/N)) = \\sum_i \\sum_j x_{i, j} (cos(-2*pi*(u*i/M", "..., 2*(N//2)-2, 2*(N//2)-1, 2*(N//2)-3, ..., 3, 1 \"\"\" perm =", "x.ndimension() <= 1: x_reorder = x.view([1, N]) else: x_reorder =", "I ...
[ "\"colResultList\", colResultList print \"*************\" self.assertEqual(rowCount, num_rows, msg=\"generated %s rows, parsed", "the output (col 0) # random integer for class val", "num_cols)) # Exec (column sums)************************************************* if DO_COMPARE_SUM: h2e.exec_zero_list(zeroList) ...
[ "- name of table fields - dict of field name", "from utils.influx_utils import InfluxUtils from utils.spp_utils import SppUtils @unique class", "continuous_queries(self) -> Set[Queries.ContinuousQuery]: \"\"\"Set of all provided Continuous Queries\"\"\" return", "json from typing import Any, Dict, List, Set, ...
[ "file LICENSE for copying permission. \"\"\" from sleekxmpp.plugins.xep_0009.remote import Endpoint,", "(C) 2011 <NAME> This file is part of SleekXMPP. See", "permission. \"\"\" from sleekxmpp.plugins.xep_0009.remote import Endpoint, remote, Remote, \\ ANY_ALL", "%s\" % temperature) self._temperature = temper...
[ "If no response is received within self.timeout seconds. \"\"\" self.response_client.pop()", "rotate_velocity: int, [-100, 100] param with_return: bool return: 'ok' or", "threading class Response(object): def __init__(self): pass def recv(self, data): pass", "self.lock: return self.response is None class Stat...
[ "UTC) # # For imports without namespace, e.g. # #", "<filename>terrascript/resource/sematext.py # terrascript/resource/sematext.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:26:36", "namespace, e.g. # # >>> import terrascript.resource.sematext # # instead", "# This is only available for 'o...
[ "numpy as np import os, time, csv import tqdm import", "eval(self): self.data = net.FontData() print(\"Plot: \", self.init_epoch + 1) acc", "plt.close('all') return acc def eval(): encoder = SimpleEncodeDecoder() encoder.eval() if", "txt.write('accuracy = %f\\n'%acc) result = np.concatenate(result) labels = n...
[ "This is a convenience method to avoid the need to", "pp.pformat(model_dict))) def stop_all_model_containers(self): \"\"\"Stops all model containers started via Clipper", "Test; Not Windows Compatible logging.basicConfig( format='%(asctime)s %(levelname)-8s %(message)s', datefmt='%y-%m-%d:%H:%M:%S', level=loggi...
[ "self.matr[self.topo[i]][self.topo[i+1]]=1 count = count+1 self.RandomGenerTopoEdges(n-1-count) self.edges = list() for i", "edge_num): for i in range(edge_num): mid = random.randint(1, self.n-2) st", "else: count = 0 for i in range(n-1): if self.matr[self.topo[i]][self.topo[i+1]]!=1:", "i!=j: return False re...
[ "to Google Sheets.\"\"\" from csv2googlesheets.gapi_authorization import auth_with_google from csv2googlesheets.gapi_create_sheet import", "to write data from csv to G Sheets.\"\"\" cli_args =", "write_to_sheet from csv2googlesheets.parse_file import build_spreadsheet_title from csv2googlesheets.parse_file impo...
[ "netforce.model import get_model from netforce import migration from netforce import", "Migration(migration.Migration): _name=\"account.credit_remain_cur\" _version=\"2.5.0\" def migrate(self): db=database.get_connection() db.execute(\"UPDATE account_invoice SET amount_credit_remain_cur=amount_credit_remain", "...
[ "succeeds, then the result of C{deferred} is left unchanged. Otherwise,", "expectedExceptionTypes: Exception types to expect - if provided, and the", "drop_user): \"\"\" Initialize the testing environment. \"\"\" cls._drop_user = drop_user", "Iterate the reactor without stopping it. \"\"\" iterations = [False...
[ "def generate(self): unique_id = ( ((int(time.time() * 1000) - self.epoch)", "1000) - self.epoch) & 0x1FFFFFFFFFF) << 22 | (self.machine_id &", "= 0 self.serial_no = init_serial_no def generate(self): unique_id = (", "self.serial_no = init_serial_no def generate(self): unique_id = ( ((int(time.time() *", "i...
[]
[ "Text-generation loop import sys import random # Trains the model", "temperature exp_preds = np.exp(preds) preds = exp_preds / np.sum(exp_preds) probas", "1) generated_text = text[start_index: start_index + maxlen] print(f'--- Generating with", "character preds = model.predict(sampled, verbose=0)[0] next_inde...
[ "return GraphicalLasso def _makeOne(self, *args, **kwargs): return self._getTarget()(*args, **kwargs) @classmethod", "[-0.904446243, -0.287837582, 0.197153592], [-1.106120624, 0.243612535, 1.051237763], [0.371920628, 1.690566027, -0.468645532], [-0.861682655,", "-0.599247488], [-0.503171745, -1.308368748, -1.45...
[ "t += dt if \"-nogui\" not in sys.argv: import matplotlib.pyplot", "sys.argv: verbose = True # verbose = False from modeci_mdf.utils", "matplotlib.pyplot as plt plt.plot(times, s) plt.show() if \"-graph\" in sys.argv:", "= 2 t = 0 recorded = {} times =", "\"-run\" in sys.argv: verbose = True # verbose = Fal...
[ "test_client_simple_eval_bindings(client): assert client.submit('x + x', {'x': 2}).all().result()[0] == 4 def", "in ex.status_attributes assert 'stackTrace' in ex.status_attributes def test_client_connection_pool_after_error(client): # Overwrite", "gremlin_python.process.graph_traversal import __ from gremlin_p...
[ "2016-09-21 - Account for Gaia epoch 2015 - Bovy (UofT)", "cat2['ref_epoch'] else: epoch2= 2000. _check_epoch(cat1,epoch1) _check_epoch(cat2,epoch2) depoch= epoch2-epoch1 if numpy.any(depoch", "catalog INPUT cat - original catalog xcat - matched catalog", "= idx_1[temp_idx] d2d[cat2[col_field] == unique] = te...
[ "ray.rllib.utils.error import UnsupportedSpaceException from ray.rllib.utils.exploration.parameter_noise import ParameterNoise from ray.rllib.utils.framework import", "add LayerNorm after each Dense # generically into ModelCatalog. add_layer_norm=add_layer_norm)", "support_logits_per_action, logits, probs_or_lo...
[]
[ "2, 3)) print(numcount(1, 2, 3, \"4\")) print(numcount(1, None, 3, 4,", "argumente + 1 return sum / argumente print(keskmine(1, 2)) #", "tuleb '*' kasutada arvud=[1, 2, 3] print(summa(*arvud)) arvud=[1, 2, 3,", "4, 5] print(summa(*arvud)) arvud=[1] print(summa(*arvud)) # Erinevat sort argumendid def", "väär...
[ "comment here to make sure the comment reads that the", "of run_watch ''' def setUp(self): self.state_name = 'run_watch' state_filename =", "\"hello\"_|-run']['comment'], 'Command \"echo \"hello\"\" run') def test_run_creates_exists(self): ''' test cmd.run", "'cmd_|-echo test > {0}_|-echo test > {0}_|-run'.fo...
[ "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "* chunk.ndim, dtype=chunk.dtype) else: # sparse to_store = ctx[chunk.op.input.key].spmatrix.tocoo() if", "datastore from .utils import get_tiledb_ctx def _store_tiledb(ctx, chunk): tiledb_ctx =", "tiledb = None from ...li...
[ "x.view(-1, self.input_size) out = x for layer in self.linears: out", "zip(layer_sizes[:-1], layer_sizes[1:])]) self.output_layer = Linear(hidden_sizes[-1], output_size, bias=True) self.act = activation[act_func]", "self.act = activation[act_func] self.train_alg=train_alg # list of layers in the", "<gh_stars>...
[ "-- a function that takes one argument to produce the", "the sum of f(1) + ... + f(n). The implementation", "***\" return lambda x: f(f(x)) three = successor(two) def church_to_int(n):", "3^2 * 4^2 * 5^2 14400 >>> product(3, increment) #", "identity = lambda x: x triple = lambda x: 3", "Church numerals m ...
[ "generates materials for an unsigned algorithm suite that includes the", "self.plaintexts.items()} ciphertext_writer = file_writer(os.path.join(root_dir, \"ciphertexts\")) test_scenarios = { decrypt_scenario_name: decrypt_scenario", "bit_index = divmod(bit, BITS_PER_BYTE) result = bytearray(ciphertext) result[b...
[ "import WatchdogAcceptanceTest class TestStartStopFeature(WatchdogAcceptanceTest): def test_willStartObserverWhenWatchdogStarted(self): self.create_and_start_watchdog() self.assertTrue(self.fs_observer.running) def test_willStopObserverWhenWatchdogStopped(self):", "class TestStartStopFeature(WatchdogAcceptanceTes...
[ "inverse = base.InverseTransform(transform) identity = base.CompositeTransform([inverse, transform]) outputs, logabsdet =", "outputs, logabsdet = identity(inputs) self.assert_tensor_is_good(outputs, shape=inputs.shape) self.assert_tensor_is_good(logabsdet, shape=inputs.shape[:1]) self.assertEqual(outputs, inputs)...
[ "sys import requests site = sys.argv[1] if 'https://' in site:", "\"\"\" https://portswigger.net/web-security/file-path-traversal/lab-validate-file-extension-null-byte-bypass \"\"\" import sys import requests site = sys.argv[1]", "if 'https://' in site: site = site.rstrip('/').lstrip('https://') url = f'''https...
[ "logs_dir = Path('/home/joselyn/workspace/ATM_SERIES/{}'.format(args.log_name)) # 本地跑用这个 cudnn.benchmark = True cudnn.enabled =", "# @Software: PyCharm # @Desc : from my_reid.eug import *", "u_data iter_mode = 2 #迭代模式,确定是否训练tagper for step in range(total_step): #", "t_label_pre,t_select_pre = 0,0 raw_select_p...
[ "OF ANY # KIND, either express or implied. See the", "is not None) assert(first(f'$._doc.properties.{geo_name}.type', index) == 'geo_point') assert(first(f'$._doc._meta.aet_auto_ts', index) ==", ") @pytest.mark.unit def test__get_alias_from_namespace(): namespace = 'A_Gather_Form_V1' res = index_handler.get_ali...
[]
[ "print(odd) # In[13]: # Deleting list items my_list = ['p',", "# Changing tuple values my_tuple = (4, 2, 3, [6,", "# In[13]: # Deleting list items my_list = ['p', 'r',", "extend to multiple lines String_var = \"\"\" This document will", "'a', 'm', 'i', 'z') print(my_tuple) # In[37]: #String and its", "my_...
[ "pickingNumbers(a): # Write your code here max = 0 for", "code here max = 0 for i in a: c", "here max = 0 for i in a: c =", "def pickingNumbers(a): # Write your code here max = 0", "for i in a: c = a.count(i) d = a.count(i-1)", "a: c = a.count(i) d = a.count(i-1) e = c+d", "e = c+d if e>max: max = e ret...
[ "= TransactionAPI('123', '456', debug=False) self.assertEqual(api.url, PROD_URL) @mock.patch('authorizesauce.apis.transaction.urlopen') def test_make_call(self, urlopen):", "self.assertEqual(params, { 'x_card_num': '4111111111111111', 'x_exp_date': '01-{0}'.format(self.year), 'x_card_code': '911', 'x_address': '4...
[ "# 日付のリストを生成 strdt = datetime.strptime(\"2020-01-26\", '%Y-%m-%d') # 開始日 enddt =", "'%Y-%m-%d') # 開始日 enddt = datetime.strptime(args[1], '%Y-%m-%d') # 終了日 #", "inspections_summary_list }, \"main_summary_history\": { \"date\": JST_current_time, \"data\": json.loads(main_summary_history_df.to_json(orient='records...
[ "object_ind, dbox_ind in enumerate(best_dbox_ind_per_object): best_object_ind_per_dbox[dbox_ind] = object_ind best_overlap_per_dbox.index_fill_(0, best_dbox_ind_per_object, 999)", "target[:, :4], target[:, 4:12], target[:, 12:] # overlaps' shape =", "enumerate(dbox_indices): object_indices[dbox_ind] = obj_ind o...
[ "-= sky.rect.width * 2 for hill in self.bg_hills: hill.rect.left +=", "Exception as e: #print '-' * 60 pass def rd_sprts_render(self,", "220 }, 'COLUMN': { 'x': 995, 'y': 5, 'w': 200,", "{ 'x': 5, 'y': 5, 'w': 215, 'h': 540 },", "self.d, zc1) xsr2 = self.xp_to_xs(xpr2, self.w) xpr3 = self.xc_to_xp(xcr3, sel...
[ "881 Fas 1 R4 Fas 0/14 173 R S I", "Device ID Local Intrfce Holdtme Capability Platform Port ID SW1", "- Repeater Device ID Local Intrfce Holdtme Capability Platform Port", "Entry address(es): IP address: 10.1.1.4 Platform: Cisco 881, Capabilities: Router", "- IGMP, r - Repeater, P - Phone Device ID", "ad...
[ "return np.max(np.abs(abs_err_data) / np.maximum(1, np.abs(J_diff_data))) else: J_diff = approx_derivative(fun, x0,", "np.atleast_1d(fun(x, *args, **kwargs)) if f.ndim > 1: raise RuntimeError(\"`fun` return", "row_indices = [] col_indices = [] fractions = [] n_groups", "'2-point': x = x0 + h_vec dx = x -", ...
[ "2.0 (the \"License\"); # you may not use this file", "# ------------------------- def test_class_nesting(): class MyModule(LightningModule): def forward(self): ... #", "can overwrite whatever we want raw_checkpoint_path = _raw_checkpoint_path(trainer) model =", "Trainer, LightningModule from pytorch_lightnin...
[ "disp_fn = space.map_product(disp_fn) general_disp_fn = space.map_product(general_disp_fn) self.assertAllClose(disp_fn(R_scaled, R_scaled), general_disp_fn(R, R))", "for dtype in POSITION_DTYPE)) def test_periodic_against_periodic_general(self, spatial_dimension, dtype): key =", "box_format) deformed_box = box ...
[ "<filename>functions/batch-custom-action/status-api/lambda.py import boto3 batch_client = boto3.client('batch') def lambda_handler(event, context): describe_response", "lambda_handler(event, context): describe_response = batch_client.describe_jobs( jobs=[ event.get('jobId', '')] ) return", "batch_client = boto3...
[ "Hydrosmart', form=form, error=error) @mod_auth.route('/signup', methods=['GET', 'POST']) def signup(): form =", "methods=['GET', 'POST']) def signup(): form = SignupForm(request.form) error = None", "app, _callback from .models import User from .forms import LoginForm,", "from app import db, login_manager, p...
[ "migrations.AlterField( model_name='article', name='alternativename', field=models.TextField(blank=True, null=True), ), migrations.AlterField( model_name='article', name='category', field=models.TextField(blank=True,", "Generated by Django 1.10.6 on 2017-04-06 06:02 from __future__ import", "-*- # Generated by ...
[ "(\"0258cdabe1dad468dda6a7d62bee9e0cddadfe87d664e62df9143e769c017dd651\", \"0xaA5EacE5be0D09B09BAf66df62b0D85EA20b4ee4\"), (\"<KEY>\", \"<KEY>\")] def test_address_testvector(self): for publickey_hex, address_expected in", "conversion from private key to wif\"\"\" def setUp(self): self.test_add_vector =", "(\"<...
[ "# print(odd_list) # 2. 逻辑复杂的情况 如果是奇数将结果平方 # 列表生成式性能高于列表操作 def handle_item(item):", "set(my_dict.keys()) my_set = {key for key, value in my_dict.items()} print(type(my_set))", "\"bobby2\": 23, \"imooc.com\": 5} reversed_dict = {value:key for key, value", "my_set = set(my_dict.keys()) my_set = {key for key, va...
[ "Plugin(object): \"\"\"A plugin can retrieve stream information from the URL", "url): self.url = url @classmethod def can_handle_url(cls, url): raise NotImplementedError", "op, value = match.group(\"op\", \"value\") op = FILTER_OPERATORS.get(op, operator.eq) filter_weight,", "version 1.9.0. Has been renamed t...
[ "details. \"\"\"Fixtures for testing the command-line interface.\"\"\" import os import", "LICENSE file for more details. \"\"\"Fixtures for testing the command-line", "= basedir os.environ[config.ENV_URL] = connect_url # Make sure to reset", "database. yield CliRunner() # Clear environment variables that wer...
[ "Using num_patches: {num_patches}\") logging.info(f\"ImgPatchesFromTensor | Using patch_jitter: {patch_jitter}\") return cls(num_patches=num_patches,", "ClassyTransform @register_transform(\"ImgPatchesFromTensor\") class ImgPatchesFromTensor(ClassyTransform): \"\"\" Create image patches from a", "ImgPatchesFrom...
[ "# upload to pip: # rm -rf dist && python3.7", "chmod 666 /tmp/{bname}.tgz\") upload_file(f\"/tmp/{bname}.tgz\") docker_task( \"jittor/jittor-cuda-11-1\", \"sudo docker build --tag", "# *************************************************************** # Publish steps: # 1. build,push,upload docker image[jittor/ji...
[ "my_parser.parse_args() CliArgs.BankName = args.bank_name CliArgs.InputFilepath = args.input_filepath CliArgs.LogLevel = args.log_level", "import Singleton class CliArgs(metaclass=Singleton): LogLevel = None BankName = None", "my_parser.add_argument('--log-level') args = my_parser.parse_args() CliArgs.BankName ...
[ "papermill plugin\", namespace_packages=[\"flytekitplugins\"], packages=[f\"flytekitplugins.{PLUGIN_NAME}\"], install_requires=plugin_requires, license=\"apache2\", python_requires=\">=3.7\", classifiers=[ \"Intended Audience", "setuptools import setup PLUGIN_NAME = \"papermill\" microlib_name = f\"flytekitplugin...
[ "size + 2 top_right = s_size - 3 * size", "= size * size # squared size while (s_size <", "(input > top_left): input_y = input - top_left input_x =", "# bottom horizontal line if (input > bottom_left): input_x =", "- 1 input_y = input - bottom_left elif (input >", "0 input_y = size - input + top_right - 1...
[ "parameterized_trees): self.parameterized_trees = parameterized_trees @staticmethod def from_individual(ind): return ParameterizedIndividual( parameterized_trees=[ParameterizedTree(tree)", "get_flat_parameters(self): params = [] for tree in self.parameterized_trees: for node", "in_order(self): yield self if has...
[ "redirect(url_for('frontends.home')) next = '' if request.method == 'GET': if 'next'", "to his or her original place before logging in \"\"\"", "Subreddit.query.all() return subreddits def process_thread_paginator(trending=False, rs=None, subreddit=None, sort_type='hot'): \"\"\" abstracted", "as search_module...
[ "= pyttsx3.init('sapi5') voices = engine.getProperty('voices') engine.setProperty('voice', voices[0].id) # To change", "\"play music\" in query: music_dir = \"D:\\\\vijayesh\\\\music\" songs = os.listdir(music_dir)", "more increase sentence to decrease sentence decreease sentence speak(\"According to", "#prin...
[ "\"\"\" pass def test_admin_update_identity(self): \"\"\"Test case for admin_update_identity Update an", "Update an Identity # noqa: E501 \"\"\" pass def test_create_self_service_logout_flow_url_for_browsers(self):", "port you should use something like Nginx, Ory Oathkeeper, or", "# noqa: E501 \"\"\" pass def...
[ "from .item import Item from .priceinfo import PriceInfo from .pricetrend", "import Item from .priceinfo import PriceInfo from .pricetrend import PriceTrend", ".grandexchange import GrandExchange, GameItemNotFound, GameItemParseError from .item import Item from", "GameItemParseError from .item import Item fro...
[ "extracting labels y_train.append(label_row[row]) if (data_type_row[row] == \"TEST\"): # setting the", "# label # data_type data_type_row = df[\"data_type\"].tolist() image_row = df[\"image_name\"].tolist()", "cv2.IMREAD_GRAYSCALE) # downscaling image to 28x28 image = cv2.resize(image, (128,", "img_path) # ex...
[ "f: while True: c = f.read(1) if not c: break", "lexer import * import sys if len(sys.argv) != 2: print(\"usage:", "2: print(\"usage: main.py file\") else: lex = Lexer(sys.argv[1]) with open(sys.argv[1])", "open(sys.argv[1]) as f: while True: c = f.read(1) if not", "from lexer import * import sys if len(sys...
[ "= self.client.login(username=\"test_username\", password=\"<PASSWORD>\") # Exercise test request = self.client.get(url) #", "get_topic(request, self.dep.id, outsider_topic.id) flag = False except Http404: flag =", "test request = self.client.post(url, data=data) # Assert test self.assertEqual(302, request.stat...
[ "numpy as np import tensorflow as tf import time import", "import device_lib #print(device_lib.list_local_devices()) #os.environ[\"CUDA_DEVICE_ORDER\"]=\"PCI_BUS_ID\" # see issue #152 #os.environ[\"CUDA_VISIBLE_DEVICES\"]=\"0\" ##", "IPsizex - Num 6 HyperPar.append(int(7)) # IPsizey - Num 7", "StepLR = 10 Poi...
[ "request: HttpRequest) -> bool: from django.conf import settings is_enabled =", "from django.conf import settings is_enabled = False attributes = _attributes_from_request(request)", "= False attributes = _attributes_from_request(request) try: is_enabled = settings.FEATURE_FLAG_PROVIDER.is_feature_enabled( featu...
[]
[ "for each time series. sharex [optional, default to True] In", "| green | +------+---------+ | r | red | +------+---------+", "1], # ytitle=[str, [\"pass\", []], 1], # title=[str, [\"pass\", []],", "\"log\": logy = True xlim = plotutils.know_your_limits(xlim, axis=xaxis) ylim =", "take for the standard line...
[ "-> dict: raise NotImplementedError def forward(self, batch: Batch, output_all_steps=True): edge_index", "self.mp_steps: continue for element, readout_fn in self.readout_fns.items(): outputs[element].append(readout_fn(**hiddens)) return outputs", "\"batch\") else None ) hiddens = self.initialize(batch) del batc...
[ "__repr__(self): return self.__class__.__name__ + ' (' + self.name + ')'", "adj): output_1 = self.gcn_1(input, adj) output_1_relu = self.relu1(output_1) output_2 =", "as nn from torch.nn.modules.module import Module from GNN.GCN_layer import GraphConvolution", "self.gcn_1(input, adj) output_1_relu = self.relu...
[ "moved_from = \"Unknown\" note = match.group('note') if note == \"success\":", "streams or stdin.\"\"\" def __init__(self, filehandle): \"\"\"Provide logfile as open", "if not self._num_lines: self._iterate_lines() return self._num_lines @property def restarts(self): \"\"\"Lazy", "seek position is wrong line ...
[ "= pg.GraphicsWindow() #w.show() #p1 = w.addPlot() #p2 = w.addPlot() #p1.plot([1,3,2,3,1,6,9,8,4,2,3,5,3],", "#w.show() #p1 = w.addPlot() #p2 = w.addPlot() #p1.plot([1,3,2,3,1,6,9,8,4,2,3,5,3], pen={'color':'k'}) #p1.setXRange(0,5)", "app = pg.mkQApp() class SVGTest(test.TestCase): #def test_plotscene(self): #p...
[ "2 ** 2 EVENT_SCHEDULER_RESUMED = 2 ** 3 EVENT_EXECUTOR_ADDED =", "EVENT_JOB_ADDED = 2 ** 9 EVENT_JOB_REMOVED = 2 ** 10", "EVENT_JOB_ERROR = 2 ** 13 EVENT_JOB_MISSED = 2 ** 14", "EVENT_SCHEDULER_RESUMED = 2 ** 3 EVENT_EXECUTOR_ADDED = 2 ** 4", "** 5 EVENT_JOBSTORE_ADDED = 2 ** 6 EVENT_JOBSTORE_REMOVED = 2",...
[ "profile=MbedProfile.DEBUG).GlobBlacklist( 'Compile only for debugging purpose - ' 'https://os.mbed.com/docs/mbed-os/latest/program-setup/build-profiles-and-rules.html') def", "2.0 (the \"License\"); # you may not use this file", "(a.name in b.conflicts) or (b.name in a.conflicts): return True return", "from ...
[ "the pianoroll.\"\"\" pianoroll.set_shape(data_shape) return pianoroll def set_label_shape(label): \"\"\"Set the label", "= dataset.map( lambda pianoroll: tf.py_func( random_transpose, [pianoroll], tf.float32), num_parallel_calls=num_threads) dataset", "and `lables` do not match.\") dataset = tf.data.Dataset.fr...
[]