ngram listlengths 0 67.8k |
|---|
[
"instance): # If we got here, instance.changed() is True, but all changes could",
"def delete(self, name, id_): self._q().delete(name, id_) @capture_psycopg_error def selected_ids(self, this_name, wr, sort, limit):",
"NAME == 'parent' we need to add 'children' key in data, based on",
"instance.field_values():... |
[
"foo at timestamp 3 and timestamp 2, then the only value is at",
"\"\" # Your TimeMap object will be instantiated and called as such: #",
"lowercase. All key/value strings have length in the range [1, 100] The timestamps",
"set(key, value, timestamp_prev) was called previously, with timestamp_prev <= timestam... |
[
"open(html_file) as fp: html_template = Template(fp.read()) if not config.dry_run: boxplot_spec = json.dumps(_get_boxplot_spec(), indent=2)",
"\"boxplot\", \"extent\": \"min-max\", \"size\": 5}, \"width\": 1400, \"height\": 500, \"encoding\": { \"y\": {\"field\":",
"def write_html(): html_file = os.path.join(os... |
[
"AX_AAF_COMAPI = os.path.join(dirname,'libcom-api' + ext) os.environ['AX_AAF_COMAPI'] = os.environ.get('AX_AAF_COMAPI', AX_AAF_COMAPI) return core.AxInit() _AxInit =",
"from core import * import core def Initialize(): \"\"\" find libcom-api and initialize",
"\"\"\" import os import sys dirname = os.path.dirname... |
[
"in keys: config = config[key] return config if __name__ == '__main__': # wait_time",
"yaml import os fileNamePath = os.path.split(os.path.realpath(__file__))[0] dir = os.path.join(fileNamePath,'../conf') def get(file_name,*keys,file_path=dir): yamlPath =",
"= config[key] return config if __name__ == '__main__'... |
[
"characters\" id = \"CKV_OCI_18\" supported_resources = ['oci_identity_authentication_policy'] categories = [CheckCategories.IAM] super().__init__(name=name, id=id, categories=categories,",
"categories = [CheckCategories.IAM] super().__init__(name=name, id=id, categories=categories, supported_resources=supported_... |
[
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,",
"os import sys import argparse import textwrap import traceback from common.common import report,",
"@capture_exception_and_abort def run(self): TestRun.run(self) g = GeppettoExecutableTest() g.run() if __name__ == '__main__': ... |
[
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,",
"proc_shape, dtype, Stepper, timing=False): if proc_shape != (1, 1, 1): pytest.skip(\"test expansion only",
"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
"slc = () if is_low_s... |
[
"\"tokens\": {}, \"features\": [\"unknown feature\"], }, ) == subscription.Subscription( 123, True, \"friend\", {},",
"assert sub.from_dict(owner_id, sub.to_dict()) == sub @pytest.mark.parametrize( \"features\", ( {}, {subscription.Features.PRIVATE_REPOSITORY}, { subscription.Features.PRIVATE_REPOSITORY, subscrip... |
[
"= [hubmap_api_admin_v1, hubmap_api_admin_v2, hubmap_api_admin_v3, hubmap_api_admin_v4, hubmap_api_admin_v5, hubmap_api_admin_v6] flask_blueprints = [hubmap_api_blueprint] menu_links = []",
"import AirflowPlugin from hubmap_api.manager import aav1 as hubmap_api_admin_v1 from hubmap_api.manager import aav2 as",
... |
[
"numpy.distutils.misc_util import Configuration config=Configuration('hgen',parent_package,top_path) return config if __name__ == '__main__': from numpy.distutils.core import",
"def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config=Configuration('hgen',pare... |
[
"), migrations.RemoveField( model_name='post', name='image', ), migrations.AddField( model_name='business', name='image', field=cloudinary.models.CloudinaryField(blank=True, max_length=255, null=True, verbose_name='image'), ),",
"cloudinary.models from django.db import migrations class Migration(migrations.Migrat... |
[
"(output_dir or output_file): raise ValueError( 'GetPackageWriter requires either output_dir or output_file') if output_dir",
"or output_file') if output_dir and output_file: raise ValueError( 'GetPackageWriter requires only one of",
"requires either output_dir or output_file') if output_dir and output_file: ra... |
[
"\"\\nStream : \" + stream +\"\\nCollege Name : \" + collegename # Generate",
"pyqrcode import png from pyqrcode import QRCode print(\"WELCOME TO THE QR CODE GENERATION\")",
"GENERATION\") # Take input name = input(\"Enter Name : \") stream = input(\"Enter",
": \"+ name + \"\\nStream : \" + stream +\"\\nColle... |
[
"else: return self._successor.handle(FILE) def __repr__(self): return f\"{self.__class__.__name__}\" def getter(self): return self._temp class CSV(AbstractHandler):",
"CSV(AbstractHandler): def __init__(self): self._successor = None self._temp: list = list() def set_successor(self, successor):",
"file_ext == se... |
[
"VakhitovHelper: \"\"\"Utility functions to prepare inputs for what is requested by functions in",
"= _matlab.double(bear[:, 0, :].T.tolist()) xe = _matlab.double(bear[:, 1, :].T.tolist()) Xs = _matlab.double(line_3d[:, 0,",
"_matlab.engine.start_matlab() print(\"DONE\", flush=True) return _matlab_engine class ... |
[
"\"goiaba\", \"romã\"] if \"laranja\" in lista: print(\"Laranja está na lista.\") else: print(\"Laranja não",
"\"banana\", \"maçã\", \"goiaba\", \"romã\"] if \"laranja\" in lista: print(\"Laranja está na lista.\") else:",
"[\"laranja\", \"banana\", \"maçã\", \"goiaba\", \"romã\"] if \"laranja\" in lista: print(... |
[
"# -*- coding: utf-8 -*- # @Time : 2019-01-17 13:48 # @Author :",
"-*- # @Time : 2019-01-17 13:48 # @Author : pang # @File :",
"-*- coding: utf-8 -*- # @Time : 2019-01-17 13:48 # @Author : pang",
": 2019-01-17 13:48 # @Author : pang # @File : __init__.py.py # @Software:",
"@Time : 2019-01-17 13:48 # @Author... |
[
"0, 1) if not self.screen: self.screen = pygame.display.set_mode((image.shape[0], image.shape[1])) pygame.surfarray.blit_array(self.screen, image) pygame.display.flip() def",
"as np import pygame CAPTION = \"dm_control viewer\" class DmControlViewer: def __init__(self): pygame.init()",
"__init__(self): pygame.i... |
[
"cpp_type=9, label=1, has_default_value=False, default_value=_b(\"\").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='data',",
"file=DESCRIPTOR), ], extensions=[ ], nes... |
[
"from setuptools import setup import numpy setup( name='CIGAN', version='0.2dev', packages=['vpa'], license='MIT License', include_dirs=[numpy.get_include(),],",
"setuptools import setup import numpy setup( name='CIGAN', version='0.2dev', packages=['vpa'], license='MIT License', include_dirs=[numpy.get_include(),... |
[
"plt.subplot(1, nRes, j+1) ] for j in range(nRes): RE = REs[j] # read",
"axes[j].set_xlabel(r'$\\frac{\\log E(k) - \\mu_{\\log E(k)}}{\\sigma_{\\log E(k)}}$') for j in range(1,nRes): axes[j].set_yticklabels([]) #axes[0].legend(lines, labels,",
"'#a6cee3', '#b2df8a', '#fb9a99', '#fdbf6f', '#cab2d6', '#ffff99'] c... |
[
"digit is 0, # this is likely cheaper and faster result_dict = {1:",
"0, # this is likely cheaper and faster result_dict = {1: 1, 2:",
"at 10, and anything after 5 the last digit is 0, # this",
"is 0, # this is likely cheaper and faster result_dict = {1: 1,",
"5 the last digit is 0, # this is likely cheaper... |
[
"bson - 'utc' from datetime import datetime from datetime import tzinfo class UTC(tzinfo):",
"This empty module with the name pytz.py fools # bson.py into loading; we",
"\"\"\"UTC\"\"\" def utcoffset(self, dt): return ZERO def tzname(self, dt): return \"UTC\" def dst(self,",
"# vim: tabstop=4 expandtab shiftw... |
[
"'icons/256x256.png'), QtCore.QSize(256,256)) app.setWindowIcon(app_icon) if platform == \"win32\": # Windows... #This will make sure",
"will make sure that the app icon is set in the taskbar on",
"import os, sys from PyQt5 import QtCore, QtGui from qtpy.QtWidgets import QApplication import",
"= QApplication(... |
[
"= { 'salvoventura': os.sep.join([root_path, 'pyunsplash', 'tests', 'resources', 'resource__users_salvoventura.json']), 'salvoventura_statistics': os.sep.join([root_path, 'pyunsplash', 'tests', 'resources',",
"the user api response type = 'salvoventura' resource_filepath = self.store_mapping[type] stored_response... |
[
"trunc def escreva(msg): c = trunc(len(msg)/2) print(f'{\"-=\":^}' * (c + 2)) print(f' {msg}')",
"print(f'{\"-=\":^}' * (c + 2)) # Programa Principal n = input('Escreva uma mensagem:",
"math import trunc def escreva(msg): c = trunc(len(msg)/2) print(f'{\"-=\":^}' * (c + 2))",
"trunc(len(msg)/2) print(f'{\"-=\... |
[
"has no stop' current = self.footer continue if '/*#' in line: assert current",
"label = parse_label(line) current = self.sections[label] = [] continue current.append(line) return self def",
"render(): query = request.args.getlist('sections') dot = graph.emit(query).encode() result = subprocess.run('dot -Tsvg',... |
[
"Env env = Env() env.read_env() db_host = env.str('DB_HOST', 'localhost') db_port = env.int('DB_PORT', 27017)",
"environs import Env env = Env() env.read_env() db_host = env.str('DB_HOST', 'localhost') db_port =",
"from environs import Env env = Env() env.read_env() db_host = env.str('DB_HOST', 'localhost') db_... |
[
".sina import SinaQuotation from .tencent import TencentQuotation from .helpers import update_stock_codes, stock_a_hour __version__",
"from .sina import SinaQuotation from .tencent import TencentQuotation from .helpers import update_stock_codes, stock_a_hour",
"from .tencent import TencentQuotation from .helper... |
[
"= max(imgA.shape, imgB.shape) new_imgA = cv2.resize(imgA, new_size) new_imgB = cv2.resize(imgB, new_size) return new_imgA,",
"imgB): new_size = max(imgA.shape, imgB.shape) new_imgA = cv2.resize(imgA, new_size) new_imgB = cv2.resize(imgB, new_size)",
"import cv2 def image_equalize(imgA, imgB): new_size = max(im... |
[] |
[
"instance=keg) if form.is_valid(): form.save() return redirect('kegs:keg_list') return render(request, template_name, {'form':form}) def beer_delete(request, pk,",
"render(request, template_name, {'form':form}) def beer_update(request, pk, template_name='beer_form.html'): beer = get_object_or_404(Beer, pk=pk) for... |
[
"in range(0, len(self.X) + 1 -(self.train_sample_size + self.test_sample_size), self.step): train_index = list(range(0+i,self.train_sample_size+i)) test_index",
"+ 1 -(self.train_sample_size + self.test_sample_size), self.step): train_index = list(range(0+i,self.train_sample_size+i)) test_index = list(range(self.... |
[
"default=\"data/3_processed/\", help=\"Path to csv file to store the result.\") def main(input_path, output_path): \"\"\"",
"= \"data/0_raw/\", required=True, help=\"Path to csv file to be processed.\", ) @click.option(\"--output-path\", \"-o\",",
"result.\") def main(input_path, output_path): \"\"\" Runs data ... |
[
"reversed(array)) #Big-endian, unsigned 32-byte integer. buf = b''.join([struct.pack('>I', ((0xffFFff & i32)<<8)|(i32>>24) ) for",
"np.uint32) r[0,0] = 0xFF r[0,1] = 0xFF g = np.empty((2,2), np.uint32) g[0,1] =",
"24) | (r << 16) | (g << 8) | b print tot",
"0xFF tot = (a << 24) | (r << 16) | (g <<",
"n=9 im... |
[
"required=NotDEBUG) parser.add_argument('-o', '--output1', action='store', nargs='?', help=\"Output first read file\", required=NotDEBUG) parser.add_argument('-p', '--output2', action='store',",
"0 with gzip.open(tmpFile1, \"wt\") as fout1: with gzip.open(tmpFile2, \"wt\") as fout2: while True:",
"read file.\",... |
[
"entity_test_added_to_hass, patch_async_track_time_interval, ) from .api_samples import ( MOCK_RWL, MOCK_ZGP, MOCK_Z3_ROTARY, PARSED_RWL, PARSED_ZGP, PARSED_Z3_ROTARY,",
"MOCK_Z3_ROTARY, PARSED_RWL, PARSED_ZGP, PARSED_Z3_ROTARY, ) @pytest.mark.parametrize( \"raw_response, sensor_key, parsed_response, parser_func\... |
[
"import render from .text_generator import create # Create your views here. def text_generation(request):",
"def text_generation(request): context = {} if request.method == \"POST\": file = request.FILES.get(\"file\") if",
"views here. def text_generation(request): context = {} if request.method == \"POST\": fi... |
[
"_pickle as cPickle f=open(\"neural_network.pickle\",\"rb\") net=cPickle.load(f) f.close() training_data, test_data=data_loader.load_data() num_correct = net.evaluate(training_data) print(\"{}/{} correct\".format(num_correct,",
"as cPickle f=open(\"neural_network.pickle\",\"rb\") net=cPickle.load(f) f.close() tra... |
[
"import migrations, models class Migration(migrations.Migration): dependencies = [ ('products', '0004_productimage_is_main'), ] operations =",
"2022-02-23 17:14 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('products',",
"# Generated by Django 4.0.2 on 2022-02... |
[
"environment...') env = muniverse.Env(spec) try: print('Resetting environment...') env.reset() print('Getting observation...') obs = env.observe()",
"y in range(0, height): if res != '': res += '\\n' for x",
"takes mouse events. \"\"\" import sys import numpy as np sys.path.insert(0, '..') import",
"x in rang... |
[
"pyani_config.BLASTALL_DEFAULT) -> str: r\"\"\"Return BLAST blastall version as a string. :param blast_exe: path",
"0 ) except OSError: logger.warning(\"blastall executable will not run\", exc_info=True) return f\"blastall exists",
"TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NO... |
[
"on which to plot X[:,p] should be the base point for the p^{th}",
"the p^{th} point X[2,:] is shown as a surface over X[1,:] and X[2,:]",
"if X.shape[0]==2: ax.scatter(X[0,:],X[1,:], *args, **kwargs) elif X.shape[0]==3: #ax = plt.gca(projection=\"3d\") ax.scatter(X[0,:],X[1,:],X[2,:],*args, **kwargs) def",
"... |
[
"Assembly) def append(self, arg): super().append(arg) arg.state = self.state def last(self): return self.children[-1] def",
"root_transforms(self): '''get transforms stacked all the way to the root''' result = transform.TransformList()",
"point(self): return pt.PointList(self.root_transforms(self.dest.arr))[0] ... |
[
"# from django.shortcuts import get_object_or_404 # from django.http import HttpResponseRedirect # from django.urls",
"django.views import generic from django.contrib.auth.mixins import PermissionRequiredMixin def index(request): \"\"\"View function for home",
"Book class AuthorListView(generic.ListView): \"\"\... |
[
"\"MessageBody\": str(json.dumps(message_dict)), } messages.append(message) count += 1 # Send 10 messages per time",
"the report, therefore limit the number of messages to be sent #### example",
"scene_path in gzip.decompress(missing_scene_file_gzip).decode(\"utf-8\").split(\"\\n\") if scene_path ] logging.info... |
[
"bcrypt from ...models.user import User class ResetPassword(APIView): def post(self, request): data = request.data",
"password using bcrypt algorithm hashed = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt()) user.password = <PASSWORD> user.save() message",
"bcrypt algorithm hashed = bcrypt.hashpw(passw... |
[
"11:34:05.456439 \"\"\" from alembic import op import sqlalchemy as sa # revision identifiers,",
"128 Revision ID: 799310dca712 Revises: ca514840f404 Create Date: 2020-04-09 11:34:05.456439 \"\"\" from alembic",
"'ca514840f404' branch_labels = None depends_on = None def upgrade(): op.alter_column('flask_usage',... |
[
"django.core.management.base import BaseCommand, CommandError from asylum.tests.fixtures.full import generate_all class Command(BaseCommand): help = 'Generates",
"from django.core.management.base import BaseCommand, CommandError from asylum.tests.fixtures.full import generate_all class Command(BaseCommand): help ... |
[
"pose of the camera in the local coordinate system. \"\"\" self._add_axis(pose_local_camera) def add_camera_frustum(self,",
"and image to the 3D world\"\"\" self._add_frustum(camera_model, image) def _add_axis(self, pose: SE3, scale=10.0):",
"z_arrow = pv.Arrow(direction=(0.0, 0.0, 1.0), scale=scale) z_arrow.tr... |
[
"\"\"\" \"\"\" import pinot ds = pinot.data.moonshot_with_date return ds def test_moonshot(moonshot): \"\"\" Parameters",
"pinot.data.datasets @pytest.fixture def moonshot(): \"\"\" \"\"\" import pinot ds = pinot.data.moonshot_with_date return ds",
"\"\"\" import pinot ds = pinot.data.moonshot_with_date return ... |
[
"<reponame>YuriyLisovskiy/NeuralNetwork<filename>tests/unittest/test_exceptions.py import unittest from neural_network.network import net from neural_network.config.config import INPUT_LAYER, HIDDEN_LAYERS, OUTPUT_LAYER",
"} net.NeuralNetwork(**params) def test_output_layer_exception(self): with self.assertRaises... |
[
"ctypes.sizeof(ctypes.c_ubyte) - ctypes.sizeof(sa_family_t) _SS_PAD2SIZE = ( _SS_MAXSIZE - ctypes.sizeof(ctypes.c_ubyte) - ctypes.sizeof(sa_family_t) - _SS_PAD1SIZE",
"ctypes.c_uint32), (\"kf_file_rdev_freebsd11\", ctypes.c_uint32), (\"kf_file_mode\", ctypes.c_uint16), (\"kf_file_pad0\", ctypes.c_uint16), (\"kf_f... |
[
"home_dir = os.path.expanduser(\"~\") default_config = os.path.join(module_dir, \"opensda_flasher.ini\") home_config = os.path.join(home_dir, \".opensda_flasher.ini\") config =",
"os.path.dirname(__file__) home_dir = os.path.expanduser(\"~\") default_config = os.path.join(module_dir, \"opensda_flasher.ini\") home... |
[
"**kwargs) class CancellableAsyncMock(AsyncMock): # pylint: disable = too-many-ancestors async def __call__(self, *args, **kwargs):",
"# AsyncMock is new in Python 3.8 class AsyncMock(MagicMock): async def __call__(self, *args,",
"return super().__call__(*args, **kwargs) class CancellableAsyncMock(AsyncMock): #... |
[
"= 9 # tuples are immutable, can't change items once assigned except Exception",
"by creating a new tuple new_number_tuple = number_tuple + (5) # TypeError: can",
"mixed_tuple = (1, 'a', 2, 'b', [88, 99]) # can mix different types",
"Exception:', e) # TypeError: 'tuple' object does not support item assignment... |
[
"< len(cities_order) else cities_order[0] total_distance += self.distances[city][next_city] return Fitness(-total_distance, is_natural=False) def print_results(result): print('Visit",
"i, city in enumerate(cities_order): next_city = cities_order[i + 1] if i + 1",
"360, 0] # d ] class SalesmanFitnessEvaluator(Fi... |
[
"with a T\") # checking the weekday number is equal to 3 using",
"datetime of the system using import syntax import datetime # checking the weekday",
"is equal to 1 using if condition if datetime.datetime.today().weekday() == 1: # print",
"elif conditon elif datetime.datetime.today().weekday() == 3: # print r... |
[
"zrxns, _ = _id_reaction(rxn_info) if rxn_class is None: print( 'Error: user did not",
"'basis': '6-31g*' }, 'lvl_b3mg': { 'orb_res': 'RU', 'program': 'gaussian09', 'method': 'b3lyp', 'basis': '6-311g**'",
"cnf_fs[-1].existing(): current_rid, _ = locs if current_rid in checked_rids: continue if cnf_fs[-1].file.... |
[
"for i in data.get(\"data\")[\"options\"]] context = SlashContext( client, event[\"type\"], id=data[\"id\"], application_id=data[\"application_id\"], command_id=data.get(\"data\")[\"id\"], name=data.get(\"data\")[\"name\"],",
"GatewayDispatch from ..models import SlashContext, Option async def interaction_create(... |
[
"== dict: message = ','.join([str(x) for x in [i,stats['avg'], stats['std'], stats['min'], stats['max'], stats['dateRange']]])",
"','.join([str(x) for x in [i,stats['avg'], stats['std'], stats['min'], stats['max'], stats['dateRange']]]) elif type(stats) == list:",
"np.max) return stats def write_evolution_logs(... |
[
"= Headline.objects.all()[::-1] context = {'object_list': headlines,} return render(request, \"mysite/scrape.html\", context) def post(self, request):",
"{'object_list': headlines,} return render(request, \"mysite/scrape_detail.html\", context) class HomeClass(View): def get(self, request): list_title =",
"= {'... |
[
"'GAS', 'STZ', 'HRB', 'XYL', 'TSN', 'FOSL', 'DO', 'BBY', 'LUK', 'CTAS', 'HAS', 'POM', 'PBCT',",
"'TDY', 'TE', 'TECD', 'TECH', 'TEG', 'TEL', 'TER', 'TEX', 'TFX', 'TG', 'TGI', 'TGT', 'THC',",
"'DHI', 'ARG', 'LEN', 'QEP', 'EFX', 'CVH', 'CLF', 'CBG', 'CINF', 'NWL', 'HSP', 'EXPE', 'XRAY',",
"'COHU', 'COL', 'COLB',... |
[
"another way to redirect streams of spawned programs and are close cousins to",
"data, int(data) * 2) \"\"\" ''' the following connects two programs, by piping",
"\"\"\" But Python scripts can also provide input to spawned programs’ standard input",
"shell world') C:\\...\\PP4E\\System\\Streams> type hello-in... |
[
"else: break images = np.vstack(images) y_true = np.concatenate(y_true) y_pred = np.concatenate(y_pred) y_true =",
"np.argmax(y_pred, axis=1) true_taxonID = [self.label_names[x] for x in y_true] pred_taxonID = [self.label_names[x] for",
"Args: experiment: a comet experiment object train_data: a tf data object t... |
[
"# program template for mini-project 0 # Modify the print statement according to",
"the print statement according to # the mini-project instructions #CodeSkulptor link: #http://www.codeskulptor.org/#user40_lXiJqEZDdrSdSu5.py print",
"template for mini-project 0 # Modify the print statement according to # the",
... |
[
"import get_type_data class TestFormat(object): def test_get_type_data_with_format(self): results = get_type_data('troff') assert results['identifier'] == 'TROFF'",
"assert results['description'] == 'The display text format type for the troff format.' def",
"results['identifier'] == 'TROFF' assert results['doma... |
[
"else: fields[\"payment_account\"] = fields[\"payment_account\"].replace(\" \", \"\") # check amount try: orig = fields[\"amount\"]",
"\"message\": errmsg}]})\\ , 400 if transfer_amount > 0 and \"top up\" in fields[\"direction\"]:",
"str(result[\"Response\"][0][\"Id\"][\"id\"])}]}) def target_balance_external()... |
[
"setup( name='malloc_tracer', version=get_version(), description='This is a debugging tool for tracing malloc that occurs",
"without importing, which avoids dependency issues def get_version(): with open('malloc_tracer/version.py') as version_file: return",
"malloc that occurs inside a function or class.', long... |
[
"== '__main__': # se abbiamo un token di mapbox nell'environment facciamo il geocoding",
"continue match = ORARI_A_RE.match(line) if match: continue match = BLOCCO_NOTE_RE.match(line) if match: blocco_note",
"num_orari = len(indirizzo['ore']) / 2 indirizzo['orario_affidabile'] = num_orari == len(indirizzo['gior... |
[
"failed!' # fig = plt.figure('Spy Der',figsize=(10,4)) # ax1 = fig.add_subplot(111) # ax1.spy(ErMat,precision=50*step) #",
"restore zeta: (include only induced velocity contrib.) Surf_in.zeta=Zeta0[ss_in].copy() Surf_star_in.zeta=Zeta0_star[ss_in].copy() # estimate derivatives for",
"# ax2.spy(ErRel,precision=1... |
[
"self.extra=nn.Sequential( nn.Conv2d(ch_in,ch_out,kernel_size=1,stride=stride), nn.BatchNorm2d(ch_out) ) def forward(self, x): out=F.relu(self.bn1(self.conv1(x))) out=self.bn2(self.conv2(out)) out=self.extra(x)+out return out class",
"super(Resnet,self).__init__() self.con1=nn.Sequential( nn.Conv2d(3,64,kernel_si... |
[
"cv2 import configs FONT_SYTLE = ImageFont.truetype(configs.IMAGE_FONT, 25) def draw_image(img, text, color): img =",
"def id2data(_id): _labels = [ '_', '有害垃圾', '可回收垃圾', '厨余垃圾', '其他垃圾' ] class_name, object_name",
"] class_name, object_name = configs.PREDICT_LABELS[_id].split('/') class_id = _labels.index(class... |
[
"sorted(scans.keys()) else: logger.warn('Could not find file {0}. Estimating scans from available files.'.format(filename)) filelist",
"type=str) @click.argument('candnum', type=int) @click.option('--threshold', type=float, default=0., help='Filter candidates to abs(snr) > threshold') def",
"in list_cands with ... |
[
"SECRET KEY, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=secret key\", 'User-Agent': \"PostmanRuntime/7.15.0\", 'Accept': \"*/*\", 'Cache-Control': \"no-cache\", 'Postman-Token': \"<PASSWORD>\",",
"http import requests r=requests.get(\"https://raw.githubusercontent.com/becloudready/snowflake-tut... |
[] |
[
"2018-12-16 13:01 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('vespene', '0008_auto_20181106_2233'),",
"by Django 2.1.2 on 2018-12-16 13:01 from django.db import migrations class Migration(migrations.Migration): dependencies",
"# Generated by Django 2.1.2 on 2018-12... |
[
"finally: hdf5file.close() self.assertGreaterEqual(len(ncomments), 1) self.assertTrue(any(x > 1 for x in ncomments.values())) def my_run_func(idx):",
"= self.explored['csr_mat'][0].tocsr() self.explored['csr_mat'][1] = self.explored['csr_mat'][0].tocsr() traj.f_explore(cartesian_product(self.explored)) def explor... |
[
"license terms in the LICENSE file found in the top-level # directory of",
"_bytes = bytes else: _bytes = lambda x: bytes(bytearray(x)) # Core definitions COIN",
"part of python-ravencoinlib, including this file, may be copied, modified, # propagated, or",
"COIN nIssueUniqueAssetBurnAmount = 5 * COIN # Burn A... |
[
"float(input()) puzzle_count = int(input()) dolls_count = int(input()) teddy_bears_count = int(input()) minions_count = int(input())",
"= int(input()) dolls_count = int(input()) teddy_bears_count = int(input()) minions_count = int(input()) trucks_count =",
"puzzle_count * 2.6 total_price_teddy_bears = teddy_bea... |
[
"@patch(\"profile_generator.util.file.read_file\") @patch( \"profile_generator.util.file.get_full_path\", lambda *xs: \"/root/\" + \"/\".join(xs) ) def test_get_profile_template_returns_template_file_content( self, read_file:",
"marshall = lambda x: x content = generator.create_profile_content(template, cfg, mars... |
[
"<reponame>rdmolony/scaffold<filename>lib/conda.py def run_in_env(c, command, env): commands = ['eval \"$(conda shell.bash hook)\"', f'conda activate",
"env): commands = ['eval \"$(conda shell.bash hook)\"', f'conda activate {env}'] commands.append(command) c.run(' &&",
"run_in_env(c, command, env): commands = ... |
[
"formatter = logging.formatter(format_string) file_handler.setFormatter(formatter) logger = logging.getLogger() logger.addHandler(file_handler) logging.StreamHandler() try: run() except: logging.exception('Got",
"anything above log level logging DEBUG which is everything. logging.basicConfig(filename=\"filename.l... |
[
"min_length=5, write_only=True) username = serializers.CharField(max_length=150, min_length=5, write_only=True) def validate(self, attrs): \"\"\"Validate credentials and",
"password = serializers.CharField(max_length=150, min_length=6, write_only=True) def create(self, validated_data): \"\"\"Create a new user.\"\... |
[
"m = sum([abs(e) for e in particles[0][0]]) min_n = 0 for i, d",
"d[1][0] d[0][1] += d[1][1] d[0][2] += d[1][2] def part1(data): particles = [parse(d) for",
"open(\"input\",\"r\").read() def parse(particle): return [list(map(int, p[3:-1].split(\",\"))) for p in particle.split(\", \")] def step(d):",
"d[1][2] ... |
[
"database_host_and_port if __name__ == \"__main__\": client = pymongo.MongoClient(database_host_and_port) db = client[\"jidata\"] db[\"issues\"].create_index('projectname') db[\"users\"].create_index('projectname')",
"from properties import database_host_and_port if __name__ == \"__main__\": client = pymongo.Mong... |
[
"to directory of fast5 files\") parser.add_argument('--analysis', required=False, action='store_true', dest='analysis', default=False, help=\"Remove all analysis",
"fh.delete(os.path.join(\"Analyses\", analyses)) counter += 1 fh = fh.repack() fh.close() return counter def remove_basecall_analyses(fast5):",
"sig... |
[
"# return 7 # 2 list1 = [10,12,3,14,20,7,6,5] list1.sort() print(\"#2 :\",list1[-1]) # 3",
"for elem in a: if elem > max0: max0 = elem return max0",
"= [2,3,4,5,6,7,1,2,3] result = max_elem(list0) print(\"#1 :\",result) # return 7 # 2 list1",
"= [10,12,3,14,20,7,6,5] list1.sort() print(\"#2 :\",list1[-1]) # 3... |
[
"import wsgi # custom JSON handler JSONHandler = media.JSONHandler(dumps=orjson.dumps, loads=orjson.loads) extra_handlers = {",
"custom JSON handler JSONHandler = media.JSONHandler(dumps=orjson.dumps, loads=orjson.loads) extra_handlers = { \"application/json\": JSONHandler, \"application/json;",
"falcon import ... |
[
"'vfj'], package_dir={\"\": folderLib}, packages=[packageName], include_package_data=True, setup_requires=pytest_runner + wheel, tests_require=[ 'pytest>=2.8', ], python_requires='>=2.7', install_requires=get_requirements('requirements.txt'),",
"create the appropriate form of executable for the target platform. #... |
[
"Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticbeanstalk-configurationtemplate-configurationoptionsetting.html Property Document: - ``rp_Namespace``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticbeanstalk-configurationte... |
[
"only needed when the array to deserialize isn't a native cupy array. \"\"\"",
"if not x.flags.c_contiguous: x = cupy.array(x, copy=True) header = x.__cuda_array_interface__.copy() return header, [x]",
"cupy array. \"\"\" def __init__(self, ary): cai = ary.__cuda_array_interface__ cai_cupy_vsn = cupy.ndarray(0)... |
[] |
[
"in mapping scheme for {obj.__class__}\" ) continue mapped_key = mapping[key] if isinstance(mapped_key, str):",
") mapping = cls.__mappings__[object_type] result: Dict[str, Any] = {} for key, attribute in",
"value in kwargs.items(): self.__setattr__(key, value) def __getattr__(self, attribute_name): if attribut... |
[
"2): degree.append(i ** 3 + value) for item in degree: str_degree = str(item)",
"item in degree: str_degree = str(item) pred_sum = 0 for x in str_degree:",
"+= int_degree del_7 = pred_sum % 7 if del_7 == 0: sum_numers +=",
"for i in range(1, 1000, 2): degree.append(i ** 3 + value) for item",
"str(item) pred... |
[
"find what the day is on that date. Input Format A single line",
"date. Your task is to find what the day is on that date.",
"5th 2015 was WEDNESDAY. ''' # Enter your code here. Read input from",
"import calendar as cal day={0:'MONDAY',1:'TUESDAY',2:'WEDNESDAY',3:'THURSDAY',4:'FRIDAY',5:'SATURDAY',6:'SUNDAY'}... |
[
"['phone', 'password'] def __init__(self, status=0, data={}): if isinstance(data, list): for val in data:",
"UserWrapper(Wrapper): filter = ['phone', 'password'] def __init__(self, status=0, data={}): if isinstance(data, list): for",
"__init__(self, status=0, data={}): if isinstance(data, list): for val in data... |
[
"return render_template(\"index.html\") @app.route(\"/login\") def login(): redirect_uri = url_for('auth', _external=True) return oauth.fitbit.authorize_redirect(\"\") @app.route('/auth') def",
"session, redirect from authlib.integrations.flask_client import OAuth from azure.keyvault.secrets import SecretClient f... |
[
"from __future__ import absolute_import import yaml from os.path import join class BaseComm: def",
"raise NotImplementedError def _load_config(self): config_file = open(join(self.CONFIG_FOLDER, 'comms.yml'), 'rb') yaml_config = yaml.load(config_file.read()) config_file.close()",
"def _load_config(self): config_... |