ngram
listlengths
0
82k
[ "# Create representation data = self._write_repr(instance) # Save new value", "child table has something like 'parent_id', but parent table has", "schema, query_cls) @capture_psycopg_error def _true_init(self, conn, schema, query_cls): # Modify", "for each joined table with REL field stored on the", "one se...
[ "Returns a value such that set(key, value, timestamp_prev) was called", "your data structure here. \"\"\" self.dic = {} def set(self,", "Time Based Key-Value Store https://leetcode.com/problems/time-based-key-value-store/ Create a timebased key-value store", "int timestamp) Returns a value such that set(key, ...
[ "as fp: html_template = Template(fp.read()) if not config.dry_run: boxplot_spec =", "}, \"tooltip\": {\"field\": \"message\", \"type\": \"ordinal\", \"aggregate\": \"min\"}, }, }", "fp: fp.write(html_template.render(boxplot_spec=boxplot_spec)) def _get_boxplot_spec(): with open(config.combined_benchmark_file) a...
[ "os import sys dirname = os.path.dirname(__file__) ext = '.so' if", "'darwin': ext = '.dylib' elif sys.platform.startswith(\"win\"): ext = '.dll' AX_AAF_COMAPI", "ext) os.environ['AX_AAF_COMAPI'] = os.environ.get('AX_AAF_COMAPI', AX_AAF_COMAPI) return core.AxInit() _AxInit = Initialize()", "core import * impo...
[ "# wait_time = yaml_utils.get(\"constant.yaml\", \"wait_elements_time\") # driver = get(\"host\",\"url_regerister\") #", "# driver = get(\"host\",\"url_regerister\") # driver2 = get_url(\"constant.yaml\",\"host\") driver2 =", "keys: config = config[key] return config if __name__ == '__main__':", "import os fi...
[ "\"OCI IAM password policy for local (non-federated) users has a", "conf.get(\"password_policy\")[0] if 'minimum_password_length' in rules: passwordlength = rules.get(\"minimum_password_length\") if isinstance(passwordlength[0],", "minimum length of 14 characters\" id = \"CKV_OCI_18\" supported_resources =", ...
[ "70), '*' * 70,) usage = \"\"\" \"\"\" print(title) print(license)", "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO", "@capture_exception_and_abort def run(self): TestRun.run(self) g = GeppettoExecutableTest() g.run() if __name__", "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE S...
[ "<= 10. - dt: for s in range(expand.stepper.num_stages): slc =", "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO", "while t <= 10. - dt: for s in range(expand.stepper.num_stages):", "expand.stepper.expected_order rtol = dt**order print(order, w, expand.a[slc]/sol(w, t) - 1,", "...
[ "== subscription.Subscription( 123, True, \"friend\", {}, frozenset(), ) def test_active_feature():", "owner_id, True, \"friend\", {}, frozenset({subscription.Features.PRIVATE_REPOSITORY}), ) assert sub.from_dict(owner_id, sub.to_dict()) ==", "async def test_unknown_sub(): sub = await subscription.Subscription....
[ "hubmap_api.manager import blueprint as hubmap_api_blueprint class AirflowHuBMAPPlugin(AirflowPlugin): name = \"hubmap_api\"", "hubmap_api_admin_v6] flask_blueprints = [hubmap_api_blueprint] menu_links = [] appbuilder_views = []", "hooks = [] executors = [] macros = [] admin_views", "hubmap_api_admin_v6 from ...
[ "Configuration config=Configuration('hgen',parent_package,top_path) return config if __name__ == '__main__': from numpy.distutils.core", "configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config=Configuration('hgen',parent_package,top_path) return config if __name...
[ "django.db import migrations class Migration(migrations.Migration): dependencies = [ ('hoodapp', '0013_auto_20220110_1102'),", "migrations class Migration(migrations.Migration): dependencies = [ ('hoodapp', '0013_auto_20220110_1102'), ] operations", "= [ ('hoodapp', '0013_auto_20220110_1102'), ] operations = [ ...
[ "output_file): raise ValueError( 'GetPackageWriter requires either output_dir or output_file') if", "filesystem_library_package.FilesystemLibraryPackage( output_dir) else: out = open(output_file, 'w') if output_format ==", "a package writer.\"\"\" from googleapis.codegen.filesys import filesystem_library_packag...
[ "# String which represents the QR code s = \"Name", "\" + collegename # Generate QR code url = pyqrcode.create(s)", "QR CODE GENERATION\") # Take input name = input(\"Enter Name", "code s = \"Name : \"+ name + \"\\nStream :", "input name = input(\"Enter Name : \") stream = input(\"Enter", "from pyqrcode i...
[ "the *.txt file event\"\"\" file_name, file_ext = str(FILE).split(\".\") if file_ext", "file_ext = str(FILE).split(\".\") if file_ext == self.__class__.__name__.lower(): with open(FILE, \"r\")", "Client may compose chains once or # the hadler can", "self.__class__.__name__.lower(): with open(FILE, \"r\") as f...
[ "_matlab.engine.start_matlab() print(\"DONE\", flush=True) return _matlab_engine class VakhitovHelper: \"\"\"Utility functions to", "importlib import import_module import numpy as np # Dynamically import", "return xs, xe, Xs, Xe def points(pts_2d, pts_3d, K): #", "bearing vectors bear = np.linalg.solve( K, np...
[ "if \"laranja\" in lista: print(\"Laranja está na lista.\") else: print(\"Laranja", "in lista: print(\"Laranja está na lista.\") else: print(\"Laranja não está", "[\"laranja\", \"banana\", \"maçã\", \"goiaba\", \"romã\"] if \"laranja\" in lista: print(\"Laranja", "\"maçã\", \"goiaba\", \"romã\"] if \"laranja\...
[ "-*- # @Time : 2019-01-17 13:48 # @Author : pang", "python # -*- coding: utf-8 -*- # @Time : 2019-01-17", "-*- coding: utf-8 -*- # @Time : 2019-01-17 13:48 #", ": 2019-01-17 13:48 # @Author : pang # @File :", "@Time : 2019-01-17 13:48 # @Author : pang # @File", "#!/usr/bin/env python # -*- coding: utf-8 -...
[ "self.screen = None def loop_once(self, image): image = np.swapaxes(image, 0,", "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()", "pygame.init() pygame.display.set_caption(CAPTION) self.screen = No...
[ "number=2, type=9, 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,", "(_message.Message,), { 'DESCRIPTOR' : _UPDATECOMMENTRESPONSEWRAPPER, '__module__' : 'update_comment_pb2' # @@protoc_insertion_poi...
[ "setuptools import setup import numpy setup( name='CIGAN', version='0.2dev', packages=['vpa'], license='MIT", "setup import numpy setup( name='CIGAN', version='0.2dev', packages=['vpa'], license='MIT License', include_dirs=[numpy.get_include(),],", "import setup import numpy setup( name='CIGAN', version='0.2dev...
[ "'#313695', '#006837', '#1a9850', '#66bd63', '#a6d96a', '#d9ef8b', '#fee08b', '#fdae61', '#f46d43', '#d73027',", "assumes box is 2 pi plt.figure() #REs = findAllParams(path) nRes", "import matplotlib.pyplot as plt from extractTargetFilesNonDim import epsNuFromRe from extractTargetFilesNonDim", "numbers\") par...
[ "# this is likely cheaper and faster result_dict = {1:", "number = int(line.rstrip()) if number >= 5: print(0) else: print(result_dict[number])", "\"\"\" An attempt to solve the Last Factorial Digit \"\"\"", "\"\"\" import sys # This is totally wrong, but given", "is 0, # this is likely cheaper and faster r...
[ "bson.py into loading; we then provide the only # pytz-reference", "module\"\"\" # This empty module with the name pytz.py fools", "# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # Copyright (c)", "2014 <NAME> <<EMAIL>> # \"\"\"Pytz dummy module\"\"\" # This empty", "import datetime from datetime i...
[ "if platform == \"win32\": # Windows... #This will make sure", "font_id = QtGui.QFontDatabase.addApplicationFont(f) if QtGui.QFontDatabase.applicationFontFamilies(font_id) == -1: print(\"Could not load", "= os.path.dirname(os.path.realpath(sys.argv[0])) assets_dir = os.path.join(exe_path, 'assets') for (dirpath...
[ "import os from pyunsplash import PyUnsplash from pyunsplash.src.settings import API_ROOT", "# File: test_users.py # # Author: <NAME> <<EMAIL>> # Date:", "the url, because the class always inits without query params", "{ 'salvoventura': os.sep.join([root_path, 'pyunsplash', 'tests', 'resources', 'resource__us...
[ "c = trunc(len(msg)/2) print(f'{\"-=\":^}' * (c + 2)) print(f' {msg}')", "{msg}') print(f'{\"-=\":^}' * (c + 2)) # Programa Principal n", "escreva(msg): c = trunc(len(msg)/2) print(f'{\"-=\":^}' * (c + 2)) print(f'", "# Programa Principal n = input('Escreva uma mensagem: ') escreva(n)", "2)) # Programa Prin...
[ "= [] result.extend(self.header) for label, section in self.sections.items(): if label", "in query: result.extend(section) result.extend(self.footer) return \"\".join(result) def list(self): return self.sections", "assert current is self.header or current is self.footer, 'nested section'", "[] self.sections =...
[ "env = Env() env.read_env() db_host = env.str('DB_HOST', 'localhost') db_port =", "= Env() env.read_env() db_host = env.str('DB_HOST', 'localhost') db_port = env.int('DB_PORT',", "environs import Env env = Env() env.read_env() db_host = env.str('DB_HOST',", "import Env env = Env() env.read_env() db_host = env...
[ ".sina import SinaQuotation from .tencent import TencentQuotation from .helpers import", "import SinaQuotation from .tencent import TencentQuotation from .helpers import update_stock_codes,", "SinaQuotation from .tencent import TencentQuotation from .helpers import update_stock_codes, stock_a_hour", "TencentQ...
[ "def image_equalize(imgA, imgB): new_size = max(imgA.shape, imgB.shape) new_imgA = cv2.resize(imgA,", "max(imgA.shape, imgB.shape) new_imgA = cv2.resize(imgA, new_size) new_imgB = cv2.resize(imgB, new_size)", "= max(imgA.shape, imgB.shape) new_imgA = cv2.resize(imgA, new_size) new_imgB = cv2.resize(imgB,", "n...
[]
[ "render(request, template_name, {'form':form}) def keg_update(request, pk, template_name='keg_form.html'): keg = get_object_or_404(Keg,", "render(request, template_name, {'form':form}) def beer_delete(request, pk, template_name='beer_confirm_delete.html'): beer = get_object_or_404(Beer,", "data) def keg_list(re...
[ "self.step): train_index = list(range(0+i,self.train_sample_size+i)) test_index = list(range(self.train_sample_size+i,self.train_sample_size+i+self.test_sample_size)) list_of_indexes.append((train_index, test_index)) return", "than length of input variable (X).\") if test_sample_size > len(X):", "= list(range(s...
[ "file (../3_processed) to be used for further analysis. \"\"\" print(\"Preprocessing", "df[\"image_name\"] + \".jpg\" df.to_csv(output_path+\"processed.csv\", index=False) print(\"Preprocessed and saved as processed.csv\")", "read raw data (../0_raw) and convert it into processed csv", "processed.\", ) @click...
[ "ideasman42, 2013-10-04, stackoverflow.com \"\"\" buf: must be bytes or a", "for i in range(2*n): buf = buf + buf print", "b''.join(b'\\x00' + buf[span:span + width_byte_4] for span in range((height -", "tot = (a << 24) | (r << 16) |", "fd: fd.write(data) def saveAsPNG(array, filename): # by <NAME>, 2014-01...
[ "NotDEBUG=not DEBUG parser = argparse.ArgumentParser(description=\"Extract barcode and UMI from 10x", "gzip.open(args.input2, 'rt') as fin2: count = 0 with gzip.open(tmpFile1, \"wt\")", "= 0 logger.info(\"Processing reads ...\") with gzip.open(args.input1, 'rt') as fin1:", "fin1.readline() fin1count += 1 if f...
[ "%s\", x[0]), ) assert DOMAIN in mock_hass.data data_manager = mock_hass.data[DOMAIN]", "{\"platform\": \"hueremote\", \"scan_interval\": timedelta(seconds=3)}, lambda *x: logging.warning(\"Added remote entity: %s\",", "( MOCK_RWL, MOCK_ZGP, MOCK_Z3_ROTARY, PARSED_RWL, PARSED_ZGP, PARSED_Z3_ROTARY, ) @pytest.ma...
[ "import create # Create your views here. def text_generation(request): context", "views here. def text_generation(request): context = {} if request.method ==", "= {} if request.method == \"POST\": file = request.FILES.get(\"file\") if", "context = {} if request.method == \"POST\": file = request.FILES.get(\"f...
[ "import network import _pickle as cPickle f=open(\"neural_network.pickle\",\"rb\") net=cPickle.load(f) f.close() training_data,", "_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 =", "cPickle f=open(\"neural_n...
[ "import migrations, models class Migration(migrations.Migration): dependencies = [ ('products', '0004_productimage_is_main'),", "Migration(migrations.Migration): dependencies = [ ('products', '0004_productimage_is_main'), ] operations = [", "('products', '0004_productimage_is_main'), ] operations = [ migrations...
[ "'\\n' for x in range(0, width): if binary[y, x]: res", "print('Looking up environment...') spec = muniverse.spec_for_name('TowerMania-v1') print('Creating environment...') env =", "binary.shape res = '' for y in range(0, height): if", "binary[y, x]: res += 'X' else: res += ' '", "that takes mouse events. \...
[ "2.2.26] ERROR: Number of database sequences to show \\ one-line", "0 ) except OSError: logger.warning(\"blastall executable will not run\", exc_info=True)", "LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A", "MIT License # # Copyright (c) 2021 University of Strathclyde", "TO THE WARRANTIES OF...
[ "G[:,n] is the n^{th} grid point sampled \"\"\" G =", "for j in range(X.shape[1]): if X.shape[0]==2: ax.text(X[0,j],X[1,j], strs[j], *args, **kwargs)", "*args, **kwargs): \"\"\" Plot text at 2d or 3d points", "kwargs should be as in matplotlib.Axes.plot \"\"\" if X.shape[0]==2: ax.quiver(X[0,:],X[1,:],U[0,:],...
[ "import transform from .state import CncState from . import point", "return self.state['position'] @pos.setter def pos(self, arg): self.state['position'] = arg def", "self.pos.offset(x, y, z) @property def root_transforms(self): '''get transforms stacked all", "stacked all the way to the root''' result = tran...
[ "of some of the main objects num_books = Book.objects.all().count() num_instances", "context variable. return render(request,'index.html',context={ 'num_books': num_books, 'num_instances': num_instances, 'num_instances_available': num_instances_available,", "initial = {'date_of_death': '05/01/2018'} permission_...
[ "PROCESSES.append( PythonOperator( task_id=f\"{sat}_fill_the_gap\", python_callable=fill_the_gap, op_kwargs=dict(landsat=sat, scenes_limit=\"{{ dag_run.conf.scenes_limit }}\"), on_success_callback=task_success_slack_alert, )", "{ \"landsat_product_id\": landsat_product_id, \"s3_location\": str(path), \"update_sta...
[ "= data['token'] if len(password) < 6: return Response({\"message\":\"Invalid Password! Password", "user = result[0] # hash user password using bcrypt algorithm", "has been sucessfully reset\" return Response({\"message\":message},status=status.HTTP_200_OK) return Response(dict(error=\"This user does", "= <PA...
[ "upgrade(): op.alter_column('flask_usage', 'path', type_=sa.String(128), existing_type=sa.String(length=32)) def downgrade(): op.alter_column('flask_usage', 'path', type_=sa.String(32),", "128 Revision ID: 799310dca712 Revises: ca514840f404 Create Date: 2020-04-09 11:34:05.456439", "identifiers, used by Alembic...
[ "CommandError from asylum.tests.fixtures.full import generate_all class Command(BaseCommand): help = 'Generates", "BaseCommand, CommandError from asylum.tests.fixtures.full import generate_all class Command(BaseCommand): help =", "-*- coding: utf-8 -*- from django.core.management.base import BaseCommand, Comman...
[ "plane scene_plane = pv.Plane(i_size=1000, j_size=1000) self._plotter.add_mesh(scene_plane, show_edges=True, style='wireframe') self._add_axis(SE3(), 100)", "-200) self._plotter.show(title=\"3D visualization\", interactive_update=True) def add_body_axes(self, pose_local_body: SE3): \"\"\"Add axes", "@ np.diag([...
[ "test_moonshot(moonshot): \"\"\" Parameters ---------- moonshot : Returns ------- \"\"\" print(moonshot)", "= pinot.data.moonshot_with_date return ds def test_moonshot(moonshot): \"\"\" Parameters ---------- moonshot", "def test_moonshot(moonshot): \"\"\" Parameters ---------- moonshot : Returns ------- \"\"\""...
[ "import unittest from neural_network.network import net from neural_network.config.config import INPUT_LAYER,", "neural_network.config.config import INPUT_LAYER, HIDDEN_LAYERS, OUTPUT_LAYER class TestExceptions(unittest.TestCase): def test_last_layer_exception(self): with", "'output_layer': [2] } net.NeuralNetw...
[ "CTL_KERN = 1 KERN_PROC = 14 KERN_PROC_FILEDESC = 33 KF_TYPE_VNODE", "(\"kf_file_fsid\", ctypes.c_uint64), (\"kf_file_rdev\", ctypes.c_uint64), (\"kf_file_fileid\", ctypes.c_uint64), (\"kf_file_size\", ctypes.c_uint64), (\"kf_file_fsid_freebsd11\", ctypes.c_uint32),", "(\"kf_sem_value\", ctypes.c_uint32), (\"kf...
[ "read_config(sys.argv[1]) else: cfg = read_config() for k, v in cfg.items():", "sys from configparser import ConfigParser from configparser import ExtendedInterpolation def", "def read_config(local_config=None): \"\"\"Read Configuration File.\"\"\" if local_config is None: local_config", "import os import sys...
[ "from unittest.mock import MagicMock class MockException(Exception): pass # AsyncMock is", "Python 3.8 class AsyncMock(MagicMock): async def __call__(self, *args, **kwargs): #", "MockException(Exception): pass # AsyncMock is new in Python 3.8 class", "**kwargs): # pylint: disable = invalid-overridden-method, ...
[ "the variable name is now pointing to a new object", "number_tuple + (5,) # have to add a comma to", "3, 4) # tuples use parentheses for creation letter_tuple =", "number_tuple = (1, 2, 3, 4) # tuples use parentheses", "different objects number_tuple = number_tuple + (6,) print(id(number_tuple)) # the", "...
[ "abs(result.fitness)) logging.basicConfig(level=logging.DEBUG) random = Random() probability = Probability(crossover_mutate_probability, random) candidate_factory", "else cities_order[0] total_distance += self.distances[city][next_city] return Fitness(-total_distance, is_natural=False) def print_results(result):"...
[ "& 3 print(\"No - today is doesn't begins with T\")", "is 3 print(\"Yes - today begins with a T\") #", "pm # Solution for problem number 2 # Version 1.0", "if the weekday number is not 1 or 3 else:", "if condition if datetime.datetime.today().weekday() == 1: # print result if", "a T\") # checking the week...
[ "inf_obj, inp_str, zrxn=zrxn, zma_locs=(0,)) print( 'geometry is now saved at", "+ 'is not an allowed multiplicty for inchi {}'.format(ich)) sys.exit()", "basis = insert_dct['basis'] orb_res = insert_dct['orb_res'] # Get input method", "'user specified mult of {}'.format(mults[idx]) + 'is not an allowed", "...
[ "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\"],", "the event. event : `GatewayDispatch` The event that was dispatched.", "i in data.get(\"data\")...
[ "','.join([str(x) for x in [i] + stats]) else: raise #print(message)", "dict: message = ','.join([str(x) for x in [i,stats['avg'], stats['std'], stats['min'],", "stats.register(\"max\", np.max) return stats def write_evolution_logs(i, stats, filename=\"output/evolution_gen.csv\"): #print(i, stats)", "#!/bin/p...
[ "if not Artical.objects.filter(title=title): new_post = Artical() new_post.id = id_get new_post.image", "get(self, request): list_title = Title.objects.all() context = {\"baiviet\" : list_title}", "AddPost(LoginRequiredMixin,View): login_url='/login/' def get(self, request): f = PostForm() context =", "'mysit...
[ "'LSI', 'LSTR', 'LTC', 'LTD', 'LTM', 'LUFK', 'LUK', 'LUV', 'LXK', 'LXP',", "'VCLK', 'VDSI', 'VECO', 'VFC', 'VIAB', 'VICR', 'VIVO', 'VLO', 'VLTR', 'VLY',", "'BRK.B', 'JPM', 'PM', 'KO', 'MRK', 'VZ', 'WMT', 'ORCL', 'INTC', 'PEP',", "'WM', 'WMB', 'WMS', 'WMT', 'WOOF', 'WOR', 'WPO', 'WPP', 'WPX', 'WR',", "'EPIQ'...
[ "hello-in.py', stdin=PIPE) >>> pipe.stdin.write(b'Pokey\\n') >>> pipe.stdin.close() >>> pipe.wait() >>> open('hello-in.txt').read()", "meaning of life is 42 84 C:\\...\\PP4E\\System\\Streams> python >>> from", ">>> output = p2.communicate()[0] >>> output b'Got this: \"Help! Help!", "C:\\...\\PP4E\\System\\Str...
[ "site_confusion) plot_lists = self.train_shp.groupby(\"taxonID\").plotID.unique() plot_confusion = metrics.site_confusion(y_true = results.true_taxonID, y_pred", "\"Within_domain confusion[training]\", value = domain_confusion) #Genus of all the different", "limit = 20 num_images = 0 for data, label in", "= 2...
[ "0 # Modify the print statement according to # the", "template for mini-project 0 # Modify the print statement according", "program template for mini-project 0 # Modify the print statement", "# Modify the print statement according to # the mini-project", "for mini-project 0 # Modify the print statement acco...
[ "'DisplayText Formats' assert results['display_name'] == 'troff Format Type' assert results['display_label']", "errors from dlkit.primordium.locale.types.format import get_type_data class TestFormat(object): def test_get_type_data_with_format(self): results", "get_type_data class TestFormat(object): def test_ge...
[ "up\" in fields[\"direction\"]: paymentmsg = { \"amount\": { \"value\": \"{:.2f}\".format(transfer_amount),", "# execute the payment if fields[\"payment_type\"] == \"DIRECT\": result =", "balance print(\"[target_balance_external] ERROR: \"+errmsg) return json.dumps({\"errors\": [{\"status\": \"SKIP\", \"message...
[ "5 - Production/Stable', 'Environment :: Other Environment', 'Intended Audience ::", "Audience :: Developers', 'Topic :: Software Development', 'Topic :: Utilities'", "if __name__ == '__main__': setup( name='malloc_tracer', version=get_version(), description='This is a", "Python :: 3.6', 'Programming Language...
[ "mapbox_token = os.getenv(\"MAPBOX_ACCESS_TOKEN\") documento = { 'aggiornamento': None, 'circoscrizione_numero': None,", "dottore: dottore['indirizzi'].append(indirizzo) dottori.append(dottore) indirizzo = None dottore = { 'nome':", "8, 'settembre': 9, 'ottobre': 10, 'novembre': 11, 'dicembre': 12, }", "print...
[ "abs error point iimax=np.unravel_index(np.argmax(ErAbs),ErAbs.shape) ermax_rel=ErRel[iimax] assert ermax_rel<1e-16,\\ 'option Merge=True not", "Eabs, Erel class Test_assembly(unittest.TestCase): ''' Test methods into assembly module", "range(n_surf): for ss_in in range(n_surf): Der_an=Der_list[ss_out][ss_in] D...
[ "return out class Resnet(nn.Module): def __init__(self): super(Resnet,self).__init__() self.con1=nn.Sequential( nn.Conv2d(3,64,kernel_size=3,stride=3,padding=0), nn.BatchNorm2d(64)", "import torch from torch import nn from torch.nn import functional", "#print(x.shape) x=x.view(x.size(0),-1) x=self.outlayer(x) r...
[ "color): img = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB)) draw = ImageDraw.Draw(img) draw.text((0, 0),", "img = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB)) draw = ImageDraw.Draw(img) draw.text((0, 0), '{}'.format(text),", "def draw_image(img, text, color): img = Image.fromarray(cv2.cvtColor...
[ "abs(snr) in candsfile \"\"\" reproduce.list_cands(candsfile, threshold) @cli.command() @click.argument('candsfile', type=str) @click.argument('candnum',", "range(d['nsegments'])) # clean up and merge files pc.merge_segments(filename, scan) pc.merge_scans(os.path.dirname(filename),", "scans])) logger.info('Exam...
[ "\"e3numbergeneratedbypostman55\", 'X-Amz-Date': \"20190703T185532Z\", 'Authorization': \"AWS SECRET KEY, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=secret key\",", "###Get the second from the last row r.text.split('\\n')[-2] ##write into", "denied ##500 server ##read as a text file r.text ##...
[ "<reponame>u-transnet/utransnet-gateway from django.apps import AppConfig class AuthCustomConfig(AppConfig): name = 'auth_custom'" ]
[ "django.db import migrations class Migration(migrations.Migration): dependencies = [ ('vespene', '0008_auto_20181106_2233'),", "# Generated by Django 2.1.2 on 2018-12-16 13:01 from django.db", "migrations class Migration(migrations.Migration): dependencies = [ ('vespene', '0008_auto_20181106_2233'), ] operation...
[ "1 self.use_pool=True self.pandas_format='table' self.pandas_append=True self.complib = 'blosc' self.complevel=2 self.shuffle=False self.fletcher32", "newtraj.v_idx = idx nameset = set((x.v_name for x in traj.f_iter_nodes(predicate=(idx,))))", "%s * %s' % (str(newtraj.crun.z),str(newtraj.x),str(newtraj.y))) tra...
[ "WITNESS_COINBASE_SCRIPTPUBKEY_MAGIC bitcoin.core.CoreMainParams = CoreMainParams bitcoin.core.CoreTestNetParams = CoreTestNetParams bitcoin.core.CoreRegTestParams = CoreRegTestParams", "= MAX_BLOCK_SIZE bitcoin.core.MAX_BLOCK_WEIGHT = MAX_BLOCK_WEIGHT bitcoin.core.MAX_BLOCK_SIGOPS = MAX_BLOCK_SIGOPS bitcoin.core...
[ "discount rent = total_price * 0.1 earning_after_rent = total_price -", "8.20 total_price_trucks = trucks_count * 2 total_price = total_price_puzzles +", "* 2.6 total_price_teddy_bears = teddy_bears_count * 4.10 total_price_minions = minions_count", "left.\") else: rent = total_price * 0.1 earning_after_rent ...
[ "\"two.json\"], generator.get_config_files()) @patch(\"sys.argv\", [\"app.py\"]) def test_get_config_files_raises_error_when_arguments_are_missing(self) -> None: self.assertRaises(NoConfigFileError, generator.get_config_files)", "test_get_profile_template_raises_error_when_cannot_read_template_file( self, read_fi...
[ "commands = ['eval \"$(conda shell.bash hook)\"', f'conda activate {env}'] commands.append(command)", "def run_in_env(c, command, env): commands = ['eval \"$(conda shell.bash hook)\"',", "= ['eval \"$(conda shell.bash hook)\"', f'conda activate {env}'] commands.append(command) c.run('", "\"$(conda shell.bash ...
[ "= logging.FileHandler(filename = \"filename.log\") file_handler.setLevel(logging.DEBUG) file_handler.set_name() format_string = \"%(asctime)s -", "logging.StreamHandler() try: run() except: logging.exception('Got exception on main handler') raise", "encoding utf-8 and anything above log level logging DEBUG whi...
[ "return {'access': str(refresh.access_token), 'refresh': str(refresh)} class Meta: \"\"\"Meta information for", "model = User fields = ['username', 'name', 'role', 'password'] extra_kwargs", "attrs): \"\"\"Validate credentials and get user tokens.\"\"\" username = attrs.get('username',", "import serializers f...
[ "else: positions[tuple(d[0])] = i particles = [d for i, d", "data.split('\\n')] while True: positions = {} delete = [] for", "for i, d in enumerate(particles): if sum([abs(e) for e in", "d[1][0] d[0][1] += d[1][1] d[0][2] += d[1][2] def part1(data): particles", "part1(data): particles = [parse(d) for d in d...
[ "pymongo.MongoClient(database_host_and_port) db = client[\"jidata\"] db[\"issues\"].create_index('projectname') db[\"users\"].create_index('projectname') db[\"comments\"].create_index('issue') db[\"comments\"].create_index('projectname') db[\"events\"].create_index('issue') db[\"events\"].create_index('projectname'...
[ "analyses from files\"\"\" ######################################################################## # File: remove_sa_analyses.py # executable: remove_sa_analyses.py", "'-d', required=True, action='store', dest='dir', type=str, default=None, help=\"Path to directory of", "files\") parser.add_argument('--threads...
[ "elem > max0: max0 = elem return max0 list0 =", "max_elem(list0) print(\"#1 :\",result) # return 7 # 2 list1 =", "elem return max0 list0 = [2,3,4,5,6,7,1,2,3] result = max_elem(list0) print(\"#1", "return 7 # 2 list1 = [10,12,3,14,20,7,6,5] list1.sort() print(\"#2 :\",list1[-1])", "max0 = a[0] for elem in a...
[ "loads=orjson.loads) extra_handlers = { \"application/json\": JSONHandler, \"application/json; charset=UTF-8\": JSONHandler }", "= { \"application/json\": JSONHandler, \"application/json; charset=UTF-8\": JSONHandler } wsgi.req_options.media_handlers.update(extra_handlers) wsgi.resp_options.media_handlers.update(...
[ "[] setup( name=packageName, version=get_version(), description='Low-level reader and writer for FontLab", "scripts, use entry points in preference to the # \"scripts\"", "get_description(*args): readmepath = get_absolute_path('README.md') if path.exists(readmepath): long_description = open(readmepath, encoding...
[ "attr.ib( default=None, validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)), metadata={AttrMeta.PROPERTY_NAME: \"EnvironmentName\"}, ) \"\"\"Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-beanstalk-environmen...
[ "\"\"\" def __init__(self, ary): cai = ary.__cuda_array_interface__ cai_cupy_vsn = cupy.ndarray(0).__cuda_array_interface__[\"version\"]", "active when deallocating the base cuda array. Notice, this is", "two things: 1) Makes sure that __cuda_array_interface__['strides'] behaves as specified", "def deserializ...
[ "import autosar ws = autosar.workspace(\"4.2.2\") components = ws.createPackage(\"ComponentTypes\") swc =", "autosar ws = autosar.workspace(\"4.2.2\") components = ws.createPackage(\"ComponentTypes\") swc = components.createCompositionComponent(\"MyComposition\")", "ws = autosar.workspace(\"4.2.2\") components ...
[ "type(obj) if object_type not in cls.__mappings__: raise ValueError( f\"Object of", "= {} for key, attribute in cls.__schema__.properties.items(): if key not", "elif mapped_key is True or mapped_key == 1: result[key] =", "for {obj.__class__}\" ) continue mapped_key = mapping[key] if isinstance(mapped_key, str...
[ "value) for item in degree: str_degree = str(item) pred_sum =", "def function(value): degree = [] sum_numers = 0 for i", "** 3 + value) for item in degree: str_degree =", "in degree: str_degree = str(item) pred_sum = 0 for x", "7 if del_7 == 0: sum_numers += int(str_degree) print(sum_numers) function(0)", ...
[ "correct day in capital letters. Sample Input 08 05 2015", "n1=cal.weekday(n[2],n[0],n[1]) for i in day: if i==n1: print(day[i]) ''' output:", "from STDIN. Print output to STDOUT import calendar as cal", "Format Output the correct day in capital letters. Sample Input", "in range(2001,3000): n1=cal.weekday(n...
[ "<gh_stars>0 from core.bean.wrapper import * class UserWrapper(Wrapper): filter = ['phone',", "class UserWrapper(Wrapper): filter = ['phone', 'password'] def __init__(self, status=0, data={}):", "= ['phone', 'password'] def __init__(self, status=0, data={}): if isinstance(data, list):", "__init__(self, status...
[ "with producer: # Create a batch. event_data_batch = await producer.create_batch()", "messages to the event hub. # Specify a connection string", "oauth = OAuth(app) client = oauth.register(name=\"fitbit\") # Step 1: Bring", "the key client.begin_delete_secret(secretName) # sync data with FHIR API using", "=...
[ "import join class BaseComm: def __init__(self, config): self.config = config", "communicate(self): raise NotImplementedError def _load_config(self): config_file = open(join(self.CONFIG_FOLDER, 'comms.yml'), 'rb')", "def __init__(self, config): self.config = config def setup(self): raise NotImplementedError", ...