ngram
listlengths
0
67.8k
[ "i[2] == 2: card[f'{index}']['creature_name']= nameSplit[2] card[f'{index}']['creature_modifier']= nameSplit[1] card[f'{index}']['name_modifier']= nameSplit[0] card[f'{index}']['location']= nameSplit[2] = keyword", "card[f'{index}']['enchantment_name']=nameSplit[2] card[f'{index}']['spell_type']=nameSplit[1] card...
[ "= videos[video_file_path] predicted_label = predictor.predict(video_file_path) print('predicted: ' + predicted_label + ' actual: '", "label_index) in predictor.labels.items()]) video_file_path_list = np.array([file_path for file_path in videos.keys()]) np.random.shuffle(video_file_path_list) for video_file_path"...
[ "from django.conf import settings def less_settings(request): return { 'use_dynamic_less_in_debug': getattr(settings, 'LESS_USE_DYNAMIC_IN_DEBUG', True) }" ]
[ "non-None values will serve as pass-through arrays. Returns ------- y_transform : array-like or", "non-negative scalar value\") if lam1 is None: y, _ = self._check_y_X(y, X) _,", "array-like or None, shape=(n_samples, n_features), optional The exogenous array of additional covariates. Not", ": float, optional...
[ "be added to the response payload after the user authenticates. :param user: The", "dict containing the additional information that must be added to the response payload", "\"\"\" The user data type can be used to inject an additional payload", "must be implemented and should return a dict.\" ) class UserData...
[ "circuitComponents[IVS][i].node1 != 'GND': matrixM[nodeNumbers[circuitComponents[IVS][i].node1]][numNodes+i] = 1.0 if circuitComponents[IVS][i].node2 != 'GND': matrixM[nodeNumbers[circuitComponents[IVS][i].node2]][numNodes+i] = -1.0", "Supported engineer units are: M, k, m, u, n\\nYou can also enter values", "s...
[ "for dir in dirs: subdirectories.append(dirname + '/' + dir) return subdirectories \"\"\" Rocket", "dir in dirs: subdirectories.append(dirname + '/' + dir) return subdirectories \"\"\" Rocket science", "science \"\"\" def answer(string): a = input(string) if a == \"Y\" or a", "'/' + dir) return subdirectories...
[ "plt from skimage.exposure import rescale_intensity from unsharp import * # Load file and", "<gh_stars>1-10 import numpy as np import matplotlib.pyplot as plt from skimage.exposure import rescale_intensity", "unsharp import * # Load file and normalize to 0-1 fname = 'iguana.jpg'", "rescale_intensity from unsh...
[ "db_table = 'registro_establecimiento_domicilio' def __unicode__(self): if self.cp: cp = \" (CP: \" +", "localidad = models.ForeignKey(Localidad, related_name='domicilios_establecimientos') calle = models.CharField(max_length=100) altura = models.CharField(max_length=15) referencia = models.CharField(max_length=2...
[ "find() and string slicing (see section 6.10) to extract # the number at", "end of the line below. # Convert the extracted value to a floating", "(see section 6.10) to extract # the number at the end of the", "and string slicing (see section 6.10) to extract # the number at the", "extract # the number at th...
[ "self._model = None logger.info(f\"NAME={name}/{self.model_name} : {self._model}\") self._layer = None self._unit = None self.change(model_changed=True,", "= next(x for x in self._model.layers if x['name'] == name) self._unit = unit", "else self.layer_id + ':' + str(self._unit)) def _doRun(self, running: bool=T...
[ "them. txn.execute( \"INSERT INTO events_to_purge\" \" SELECT event_id, %s\" \" FROM events AS", "to the database Args: events_and_contexts: list of tuples of (event, context) backfilled (bool):", "FROM events_to_purge\") event_rows = txn.fetchall() logger.info( \"[purge] found %i events before cutoff, of", "...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "from buildtool import in_memory_metrics from buildtool import prometheus_metrics from buildtool import stackdriver_metrics from", "def singleton()...
[ "input_dirs)) result = process.wait() if result != 0: raise TaskError('Android aapt tool exited", "is the main aapt operation (see class docstring for more info). # :", "down while collecting resources. # : '-I' packages to add to base \"include\"", "and assets. This class gathers compiled classes (an Android...
[ "NQ evaluation.') class ApproximatePageRank(object): \"\"\"APR main lib which is used to wrap functions", "as a wrapper around the PPR algorithm. This class has the following functionality:", "KIND, either express or implied. # See the License for the specific language", "a neighbourhood around given entities...
[ "same bed thereafter.\"\"\" perennial_plan = plan.copy() #what was planted the year before plant_last_year", "not match. \"\"\" return plan*sun_constraint def enforce_perennial_constraint(plan,plant,bed,year,perennials): \"\"\"Forward fill plan for perennial plants.", "year and every year thereafter if plant in...
[ "forwards and {:.4g} backwards.'.format( metrics['time'], metrics['num_forwards'], metrics['num_backwards'])) success = metrics['success'].numpy() fail = bool(success.mean()", "is different from the original label. Parameters ---------- labels: Tensor Original labels. Generated", "classes): {} - Average: {:.2f}...
[ "== \"__main__\": usage = \"usage: %prog [options] old_shape_file new_shape_file \" parser = OptionParser(usage=usage,", "old_shp_path = args[0] new_shp_path = args[1] # check files do exist assert io_function.is_file_exist(new_shp_path)", "= 'expand_' + main_shp_name output_path_shrink = 'shrink_' + main_shp_n...
[ "= 0 def drive(self, gear): if self.type == \"trailer\": self.speed = gear *", "def drive(self, gear): if self.type == \"trailer\": self.speed = gear * 77 /", "drive(self, gear): if self.type == \"trailer\": self.speed = gear * 77 / 7", "num_of_wheels = 4 num_of_doors = 4 if car_type == \"trailer\": num_of_wh...
[ "as tf # Convert the model. converter = tf.lite.TFLiteConverter.from_saved_model('model.py') tflite_model = converter.convert() open(\"trash_ai.tflite\",", "<filename>CV Model/Model - JupyterNotebook/mrcnn/tfliteconverter.py import tensorflow as tf # Convert the model. converter", "tensorflow as tf # Convert th...
[ "= 1 # every 2 hours schedule = Schedule(run_every_mins=RUN_EVERY_MINS) code = 'basicapp.cron' #", "= Link.objects.all() for obj in links: print(\"Checking last hit date for: \", obj.shortenURL)", "django_cron import CronJobBase, Schedule from .models import Link from django.utils import timezone class", "\",...
[ "# The image is *not* in this context: assert serialize([context.box]) == [ ('html',", "weasyprint.tests.stacking ------------------------- :copyright: Copyright 2011-2012 <NAME> and contributors, see AUTHORS. :license: BSD, see", "def to_lists(page): html, = page.children return serialize_stacking(StackingCont...
[ "is your <a href=\"{}\">magic link</a> </p> <p>Thanks,</p> <p>Django Admin</p> \"\"\".format(login_link) send_mail( 'Django Magic", "html_message ) return render(request, \"login.html\", context={\"message\":\"Please check your email for magic link.\"}) return", "import utils from django.core.mail import send_m...
[ "test fails. It will raise an Exception with understandable text Args: errors(list[CustomCheckError]: Errors", "all checks are successful. Prints a success message\"\"\" self.print_success_message() def print_success_message(self): \"\"\"Formats the", "parameter value(Any): Value of the parameter checks(list[di...
[ "station.uic_code = '' if uic_code and len(uic_code) == 7 and uic_code[:2] == '85':", "Unless required by applicable law or agreed to in writing, software # distributed", "cStringIO except ImportError: import cStringIO import csv import datetime import optparse import sys", "= {} # This is ugly as hell, I kno...
[ "more than one file. This is a limitation, obvious in cases like Gotlands", "elif rule_key == \"HEADER_CONTAINS\": try: pos = make_unicode(header).find(rule_val.upper()) except UnicodeDecodeError: pos = -1", "def get_document_type(self): \"\"\" Return the first matching document type, based on this header", "...
[ "json_file) = sys.argv[1:4] tmpName = str(uuid.uuid4()) tmpdir = \"/tmp\" temp_input_file = f\"{tmpdir}/{tmpName}.dat\" temp_output_file", "sif = mgm_utils.get_sif_dir(root_dir) + \"/ina_segmentation.sif\" r = subprocess.run([\"singularity\", \"run\", sif, temp_input_file, temp_output_file]) shutil.copy(temp_outp...
[ "import etree from django import forms from django.db import models class XMLFileField(models.FileField): def", "kwargs.pop('schema') super(XMLFileField, self).__init__(*args, **kwargs) def clean(self, *args, **kwargs): data = super(XMLFileField, self).clean(*args, **kwargs)", "clean(self, *args, **kwargs): dat...
[ "= {\"aspect_ratios\": anchor_aspect_ratios, \"num_scales\": anchor_num_scales, \"anchor_scale\": anchor_scale, \"grid_zero_start\": anchor_grid_zero_start} pyramid_levels = [pyramid_levels_min, pyramid_levels_min", "ii in inputs] = }\") target_channel = inputs[-1].shape[-1] fpn_out = conv_dw_pw_block(inputs[0], ...
[ "10, \"price\": 1.20}, } my_response_obj = ItemResponse(**obj_to_validate) assert my_response_obj.dict() == { \"links\": None,", "response.dict() == { \"links\": None, \"data\": [ { \"id\": \"1\", \"name\": \"apple\", \"price\":", "\"name\": \"banana\", \"quantity\": 20, \"price\": 2.34, }, ], } def test_attrib...
[ "SCREEN_WIDTH = constants.SCREEN_WIDTH SCREEN_HEIGHT = constants.SCREEN_HEIGHT SCREEN_TITLE = constants.SCREEN_TITLE window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT,", "SCREEN_TITLE = constants.SCREEN_TITLE window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE) start_view = menu_view() window.show_v...
[ "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "writing, software # distributed under the License is distributed on an \"AS IS\"", "in session.query(qos_policy).filter(qos_policy.c.shared).all(): values.append({'id': uuidutils.generate_uuid(), 'object_id': row[0], 'tenant_id...
[ "message.ack() streaming_pull_future = subscriber.subscribe(subscription_path, callback=callback) print(f\"Listening for messages on {subscription_path}..\\n\") # Wrap subscriber", "pubsub_v1 project_id = \"pubsub-testing-331300\" subscription_id = \"test-sub\" # Number of seconds the subscriber", "5.0 subscrib...
[ "_('Set up refresh token'), 'type': 'ir.actions.act_window', 'res_model': 'res.config.settings', 'views': [(template.id, 'form')], 'target': 'new',", "= self.env['google.service']._get_google_token_uri('drive', scope=self.env['google.drive.config'].get_google_scope()) for config in self: config.google_drive_uri =...
[ "mode='valid'): super(MyTestDataset).__init__() dataset = MyDataset(data_path, dataset_name, cvfold=cvfold, n_way=n_way, k_shot=k_shot, n_queries=n_queries, mode='test', num_point=num_point, pc_attribs=pc_attribs,", "set(sampled_classes)) try: sampled_valid_classes = np.random.choice(np.array(remain_classes), sel...
[ "have either format of (opcode, var1) or (opcode, var1, var2) \"\"\" opcode: ConditionOpcode", "CLVM conditions Conditions in CLVM have either format of (opcode, var1) or (opcode,", "from greendoge.types.condition_opcodes import ConditionOpcode from greendoge.util.streamable import Streamable, streamable @datac...
[ "= shade_name self._shade = shade @property def device_info(self) -> DeviceInfo: \"\"\"Return the device_info", "DeviceInfo( identifiers={(DOMAIN, self._device_info[DEVICE_SERIAL_NUMBER])}, connections={ (dr.CONNECTION_NETWORK_MAC, self._device_info[DEVICE_MAC_ADDRESS]) }, name=self._device_info[DEVICE_NAME], sug...
[ "to identify a given set of clients with some identification method. The request", "select clients and identification methods to server. The server then tries to identify", "__init__(self, name, size, item_size): rq.LengthOf.__init__(self, name, size) self.item_size = item_size def parse_value(self, length,", ...
[ "\\ from start tasks (default is fromstart)') parser.add_argument( '--version', action='version', version='%(prog)s ' +", "from start tasks (default is fromstart)') parser.add_argument( '--version', action='version', version='%(prog)s ' + rubra_version)", "return parser.parse_args() parser = argparse.ArgumentPa...
[ "def main(): generator = Generator() latitude, longitude = generator.getCoordinates() webbrowser.open(config.api_request.format(latitude, longitude)) if __name__", "import webbrowser import config from Generator import Generator def main(): generator = Generator()", "Generator import Generator def main(): gener...
[ "60) execute_get(\"coap://\"+my_base+\"/fp/g\", 40) execute_del(\"coap://\"+my_base+\"/fp/g/3\", 60) execute_get(\"coap://\"+my_base+\"/fp/g/3\", 60) execute_get(\"coap://\"+my_base+\"/fp/g\", 40) def do_sequence_fp_g(my_base): # url,", "\"href\": \"xxxxyyy3\", \"cflag\": [1,4,5], \"ga\":[44,55,33]} ] execute_pos...
[ "= ['sip', 'PyQt4.QtGui', 'PyQt4._qt'] from PyInstaller.hooks.hookutils import qt4_plugins_binaries def hook(mod): mod.binaries.extend(qt4_plugins_binaries('phonon_backend')) return mod", "hiddenimports = ['sip', 'PyQt4.QtGui', 'PyQt4._qt'] from PyInstaller.hooks.hookutils import qt4_plugins_binaries def hook(mod...
[ "chain :type symbol: str :param expiration: Expiration for the chain :type expiration: Union[str,", "optional :param end: End date represented as YYYY-MM-DD, defaults to None :type end:", "the chain :type expiration: Union[str, datetime] :return: [description] :rtype: list \"\"\" return self._get(", "an optio...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "QtWidgets.QPushButton(self.controlWidget) self.accumulateButton.setCheckable(True) self.accumulateButton.setObjectName(\"accumulateButton\") self.co...
[ "Slave(object): __slots__ = [\"_conn\", \"namespace\"] def __init__(self): self._conn = None self.namespace = {}", "class FakeSlaveService(VoidService): \"\"\"VoidService that can be used for connecting to peers that operate", "their name by ``exposed_``, e.g. :: class FooService(Service): def exposed_add(self,...
[ "core, util from taskmator import context class ManagerTest(TaskmatorTestBase): def testManager(self): print (\"Pending\") def", "from testbase import TaskmatorTestBase from taskmator.task import core, util from taskmator import context", "<filename>tests/task/manager_test.py import unittest from testbase impor...
[ "a fan.\"\"\" node = ge_12730 assert node.device_class.specific.label == \"Multilevel Power Switch\" state =", "\"\"\"Test GE 12730 Fan Controller v2.0 multilevel switch is discovered as a fan.\"\"\"", "GE 12730 Fan Controller v2.0 multilevel switch is discovered as a fan.\"\"\" node", "entities for device-sp...
[ "None) -> Dict: pass def start_monitoring_members(self, AccountIds: List, DetectorId: str) -> Dict: pass", "None) -> Dict: pass def create_ip_set(self, Activate: bool, DetectorId: str, Format: str, Location:", "Enable: bool, ClientToken: str = None, FindingPublishingFrequency: str = None) -> Dict: pass", "fro...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, softwar...
[ "= Own fields = ('ownID', 'user', 'art', 'duplicates') class SaleSerializer(serializers.ModelSerializer): class Meta: model", "= serializers.ReadOnlyField() class Meta: model = Art fields = ('artID', 'title', 'filename', 'rarity',", "thumb_url = serializers.ReadOnlyField() class Meta: model = Art fields = ('art...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "EDIT.\"\"\" google_cloud_cpp_common_unit_tests = [ \"common_options_test.cc\", \"future_generic_test.cc\", \"future_generic_then_test.cc\", \"future...
[ "import create_app class TestBase(unittest.TestCase): \"\"\"Default super class for api ver 1 tests\"\"\" #", "api ver 1 tests\"\"\" # setup testing def setUp(self): self.app = create_app('testing') self.client", "1 tests\"\"\" # setup testing def setUp(self): self.app = create_app('testing') self.client = self...
[ "def get_nav(value): return value.split('/')[-2] @register.filter(name=\"encode_url\") def encode_url(value): return urllib.parse.quote(value) @register.filter def get_post_id(url): \"\"\"", "import markdown import urllib register = template.Library() @register.filter def strip_space(value): return value.replace(...
[ "o.od = d['od'] if 'time' in d: o.time = d['time'] if 'user_info' in", "'to_alipay_dict'): params['od'] = self.od.to_alipay_dict() else: params['od'] = self.od if self.time: if hasattr(self.time, 'to_alipay_dict'):", "d['time'] if 'user_info' in d: o.user_info = d['user_info'] if 'week_od' in d: o.week_od", "...
[ "the given redirect path', verbose_name='Catchall redirect'), ), migrations.AddField( model_name='redirect', name='subpath_match', field=models.BooleanField(default=False, help_text='If selected", "on 2019-08-10 08:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [...
[ "arguments can be accepted parser = argparse.ArgumentParser() parser.add_argument('query',metavar=\"\\\"SEARCH_KEYWORDS\\\"\", help=\"keywords to query in quotes", "Calculate how many multiples of 100s of hits there are num_hundreds = total_hits", "def find_total_hits(search_query): \"\"\" Function: find_total_...
[ "check_server(payload_type='coap'): template_str = \">>> Make sure south {} plugin service is running \\n", "import os import random import json from datetime import datetime, timezone import argparse", "Read those objects * Send those to CoAP or HTTP south plugin server,", "= \">>> Make sure south {} plugin ...
[ "error mitigation filter. Produced from a tensored measurement calibration fitter and can be", "matrix a list of the logical qubit indices (as int, states in the", "qubits_to_clbits[qubit] = i # Apply the correction for data_idx, _ in enumerate(raw_data2): if", "count_keys class MeasurementFilter(): \"\"\" Me...
[ "count = connected_species.count(sp) labels.append((count, sp)) labels = sorted(labels, reverse=True) if anonymous: mapping =", "to be unambiguous, \" \"trying to automatically detect.\") dist, to_jimage = self.structure[from_index].distance_and_image(self.structure[to_index]) if", "= np.subtract(to_jimage, jim...
[]
[ "request.user instance.save( ) return redirect ('articles:list') else: form = forms.CreateArticle() return render(request, 'articles/article_create.html',", "form.is_valid(): #save article to DB instance = form.save(commit=False) instance.author = request.user instance.save( )", "import login_required from . im...
[ "logging.getLogger(\"sifter\") log.error((\"No handler registered for test '%s' on line %d\" % (p[1], p.lineno(1))))", "p_argument_tag(p): \"\"\"argument : TAG\"\"\" p[0] = sifter.grammar.Tag(p[1]) def p_stringlist_error(p): \"\"\"argument : '[' error", "ELSE must follow IF or another ELSIF elif p[2].RULE_IDENT...
[ "sequence #fig, ax = plt.sublots() p1 = plt.bar(ind, base, width, color='r') p2 =", "sklearn.feature_extraction.text import CountVectorizer from sklearn.cross_validation import train_test_split from sklearn.cross_validation import cross_val_score from sklearn.cross_validation", "X.shape # sklearn's grid search ...
[ "import * from fast import * from spreadsheet import * from tab import", "import * from spreadsheet import * from tab import * from utils import", "from fast import * from spreadsheet import * from tab import * from", "utils import * from web import * __all__ = [] __all__.extend(io.__all__) __all__.extend(fas...
[ "rtn def build_url(self, targetid): \"\"\"Get the string representing the url for targetid. Gets", "= { 'IPAddress': \"Host name or ip address\", 'CompanyID': \"DB id of company\",", "not exist ' 'in local directory or config directory %s' % (fn, db_dict['directory']))", "return true, else return false. \"\"\...
[ "Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # #", "# or, if provided, by the license below or the license accompanying this", "or the license accompanying this file. Do not # remove or modify any", "\"AzEBusInline.tpl\", template_kwargs, '{}.generated.inline'.format(input_file_name))...
[ "60XXXX , #_stockMarke = 1 # 00XXXX , # _stockMarke = 2 #", "in string_lines: aline = aline.strip() if 'EM_CapitalFlowInterface' in aline: # print(aline) # print('------------------')", "# print(_stockCode) # print(_stockMarke) # print(_stockName) # print(_market) values = [] for aline", "目录存在 😁\") print(\"\...
[ "app as application def setup_flask_logging(): # Log to stdout handler = logging.StreamHandler(sys.stdout) #", "= logging.FileHandler('./application.log') handler.setLevel(logging.INFO) handler.setFormatter(logging.Formatter( '%(asctime)s [%(funcName)s] %(levelname)s: %(message)s ' )) application.logger.addHandle...
[ "Being class Enemy(Being): def __init__(self, app, scene, **kwargs): super().__init__(app, scene, **kwargs) self.friendly =", "game.base.being import Being class Enemy(Being): def __init__(self, app, scene, **kwargs): super().__init__(app, scene, **kwargs)", "class Enemy(Being): def __init__(self, app, scene, *...
[ "= [ ('rates', '0001_initial'), ] operations = [ migrations.RenameField( model_name='rate', old_name='euro_rate', new_name='eur_rate', ),", "migrations class Migration(migrations.Migration): dependencies = [ ('rates', '0001_initial'), ] operations = [ migrations.RenameField(", "= [ migrations.RenameField( model...
[ "using [openapi-generator](https://github.com/OpenAPITools/openapi-generator) from an OpenAPI specification of the Quetzal API. An improvement layer", "files and their associated metadata. OpenAPI spec version: 0.5.0 Contact: <EMAIL> Generated by:", "'Development Status :: 4 - Beta', 'Intended Audience :: Devel...
[ "chapter in stream_data.get('contentSegments', []): start_time = float_or_none(chapter.get('start')) chapter_duration = float_or_none(chapter.get('duration')) if start_time is", "subtitles.setdefault('en', []).append({ 'ext': ext, 'url': video_url, }) elif ext == 'png': thumbnails.append({ 'id':", "self._sort_f...
[ "time_window='daily_adj'): credentials = json.load(open('creds.json', 'r')) api_key = credentials['av_api_key'] print(symbol, time_window) ts = TimeSeries(key=api_key,", "= ts.get_daily_adjusted(symbol, outputsize='full') pprint(data.head(10)) data.to_csv(f'./{symbol}_{time_window}.csv') if __name__ == \"__main__...
[ "debug) self.path = path self._used = set() self.archive = None def playback(self): self.archive", "result[\"__module__\"] = obj.__module__ except AttributeError: pass # Convert objects to dictionary representation based", "class UTC(tzinfo): \"\"\"UTC\"\"\" def utcoffset(self, dt): return timedelta(0) def tzna...
[ "<<: *nss_from_start series: - Test Series 22: <<: *series_ep_pack max_reruns: 0 test_next_series_seasons_season_pack_and_ep_gap_from_start_backfill: <<:", "_config = \"\"\" templates: global: parsing: series: internal anchors: _nss_backfill: &nss_backfill next_series_seasons: backfill:", "Series 10 S02', 'Test...
[ "import mpl_toolkits.mplot3d as mpl3 color_list, color_proxy, color_proxy_on_wulff, miller_on_wulff, e_surf_on_wulff = self._get_colors( color_set, alpha,", "normal. Wulff shape is the convex hull. Based on: http://scipy.github.io/devdocs/generated/scipy.spatial.ConvexHull.html Process: 1. get", "= [0.0] * len(...
[ "self.PAD_s = state[6] self.voc_size = state[7] self._s2i = state[8] self._i2s = state[9] self.frequency", "self.get_s2i(s, -1) if i >= 0: return i else: raise Exception(f\"out of vocabulary", "default def __getitem__(self, s): return self.s2i(s) def s2i(self, s): i = self.get_s2i(s, -1)", "i = self._s2i.get(...
[ "g import sqlite3 import os import json from random import randint from flask_jwt_extended", "m.execute(sql, data) # stat min max data = [value, value, rom] sql =", "exist\" %rom) return False def update_sensor_tmp(rom,value): m = mysql.connection.cursor() rom1 = [rom] sql=\"SELECT", "sql = \"UPDATE sensors S...
[ "python_on_rails.either import as_either, Failure, Success @as_either(TypeError) def add_one(x): return x + 1 @as_either()", "add_one(x): return x + 1 @as_either() def times_five(x): return x * 5 def", "+ 1 @as_either() def times_five(x): return x * 5 def test_success_executes_bindings(): result =", "from pyt...
[ "= models.CharField(max_length=100) date = models.DateTimeField(auto_now_add=True) def __str_(self): return self.customerName # Items class Items(models.Model):", "= models.CharField(max_length=100) customerStartLoc = models.CharField(max_length=100) customerDestinationLoc = models.CharField(max_length=100) stati...
[ "input files that have spaces in their names, since bazel # cannot cope", "_default_size, size_override = {}, data = [], per_test_extra_data = {}, default_tags = _default_tags,", "\"//tensorflow/compiler/mlir/disc/tests:mlir_feature_test\", \"//tensorflow/core:test\", \"//tensorflow/core:test_main\", \"//tensor...
[ "<uuid/uuid.h> int main() { uuid_t uu; char uuid_str[37]; uuid_generate(uu); uuid_unparse(uu, uuid_str); return 0;", "= 0x00FF; uint32_t b32 = 0x0011EEFF; uint64_t b64 = 0x00112233CCDDEEFF; bswap_16(b16); bswap_32(b32); bswap_64(b64);", "['selinux']) byteswap_source = ''' #include <byteswap.h> #include <stdint....
[ "weight_value_tuples.append((symbolic_weight, array)) all_pytorch_weights.discard(name) K.batch_set_value(weight_value_tuples) if tf_inputs is not None: tf_model(tf_inputs, training=False) # Make", "separation (can be used to convert TF2.0 lists in PyTorch nn.ModulesList) return tuple", "allow_missing_keys=allo...
[ "res != v: raise ValueError(f' actual: {res}\\n expected: {v}') def assert_all_eval_to(*expr_and_expected): exprs, expecteds", "return {k: convert_struct_to_dict(v) for k, v in x._fields.items()} elif isinstance(x, list): return [convert_struct_to_dict(elt)", "return x _dataset = None def get_dataset(): global ...
[ "L] self.cross_entropy_losses = tf.nn.sigmoid_cross_entropy_with_logits( logits=self.label_scores, targets=true_label_ids, name=\"labeling_loss\") self.labeling_loss = tf.reduce_sum( self.cross_entropy_losses) / tf.to_float(self.batch_size)", "Discrete-State VAE\"\"\" def __init__(self, batch_size, num_labels, co...
[ "exit(1) mol = pmd.load_file(sys.argv[1]) crds = mol.coordinates dist = distance.cdist(crds, crds, 'euclidean') print", "pmd import numpy as np from scipy.spatial import distance if len(sys.argv) < 2:", "len(sys.argv) < 2: print \"Usage: molecular_diameter.py <mymolecule.mol2>\" exit(1) mol = pmd.load_file(sys....
[ "= pd.read_csv(prefix + \"train.csv\", header=None) train_df.head() eval_df = pd.read_csv(prefix + \"test.csv\", header=None) eval_df.head()", "= \"xlnet-base-cased\" train_args = { \"reprocess_input_data\": True, \"overwrite_output_dir\": True, \"use_cached_eval_features\": True, \"output_dir\": f\"outputs/{mode...
[ "not os.path.isfile(path): print(\"Error: file \" + path + \" not found!\") exit(-1) with", "file: for line in file.readlines(): line = line.split(delimiter) v1 = int(line[0]) v2 =", "float(line[3]) if (self_loop and v1 == v2) or (v1 != v2): graph.add_edge(v1, v2,", "\" + path + \" not found!\") exit(-1) with...
[ "as _ from model_utils.managers import InheritanceManager from mayan.apps.django_gpg.exceptions import VerificationError from mayan.apps.django_gpg.models import", "as exception: # Not signed logger.debug( 'detached signature verification error; %s', exception )", "**kwargs): if self.signature_file.name: self.s...
[ "argv[1] universe_config_file = \"config/galaxy.ini\" if len(argv) > 2: universe_config_file = argv[2] parser =", "= set([]) with open(reports_config_file, \"w\") as f: # Write all properties from reports", "replacement_property) and \\ not (replacement_property in replaced_properties): f.write(get_universe_lin...
[ "copy of Mulan PSL v2 at: # # http://license.coscl.org.cn/MulanPSL2 # # THIS SOFTWARE", "-l\")) print(exe.exec_command_sync(\"cat /proc/self/cmdline | xargs -0\")) print(exe.exec_command_sync(\"echo -e 'hello \\\\n world'\")[0].count('\\n')) print(exe.exec_command_sync(\"echo -e", "Technologies Co.,Ltd. # # ope...
[ "tf.div(tf.pow((x-mu), 2), tf.exp(logvar)), reduction_indices=1) def sample_gaussian(mu, logvar): epsilon = tf.random_normal(tf.shape(logvar), name=\"epsilon\") std =", "tf.div(tf.exp(recog_logvar), tf.exp(prior_logvar)), reduction_indices=1) return kld def norm_log_liklihood(x, mu, logvar): return -0.5*tf.reduce...
[ "distributed on an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY", "size arg') if random.uniform(0, 1) > self.probability: return x width, height, _ =", "values padded to the edges of each axis. ((before_1, after_1), ... (before_N, after_N))", "not isinstance(self.s_max, float): raise TypeError('...
[ ": {record.comments}') signals_df = pd.DataFrame(record.p_signal, columns=record.sig_name) annot_serie = pd.Series(annotation.symbol, index=annotation.sample, name=ANNOTATIONS_COL_NAME) full_df =", "= pd.DataFrame(record.p_signal, columns=record.sig_name) annot_serie = pd.Series(annotation.symbol, index=annotatio...
[ "pass def MoveNext(self): \"\"\" MoveNext(self: CharEnumerator) -> bool Increments the internal index of", "current System.CharEnumerator object to the next character of the enumerated string. Returns: true", "be inherited. \"\"\" def ZZZ(self): \"\"\"hardcoded/mock instance of the class\"\"\" return CharEnumer...
[ "<filename>src/home_automation_hub/config.py from .config_store import ConfigStore config = ConfigStore() config.set_mqtt_broker(\"mqtt\", 1883) config.set_redis_config(\"redis\", 6379, 0)" ]
[ "send(self): size = len(self.buffer) _size = pack('!Ih',size,self.status) data = _size + self.buffer sent", "#f float float 4 #d double float 8 #s char[] string #p char[]", "0 self.clear() self.add(\"i\",func_id) if types: self.add(types,*args) self.send() size = self.receive() if size: if", "from website.con...
[ "name name_face = AttrFace(\"name\") else: # If internal node, draws label with smaller", "style[\"hz_line_color\"] = 'black' n.set_style(style) #check if sample was misclassified and add misclassified label", "ax = fig.add_subplot(111) x = [0,1] lines = [ax.plot(x, pd.np.ones(len(x)), 'o', color =", "\"_lege...
[ "= CellDiameter(mesh) h_avg = avg(h) # Classical term a = dot(grad(p), grad(q)) *", "/ singular_values.min() else: raise NotImplementedError(\"The required method for condition number estimation is currently", "singular_values.max() / singular_values.min() elif backend == \"slepc\": S = SLEPc.SVD() S.create() S...
[ "Mobility varfdiff = np.var(diff_1st, axis=-1) # print(varfdiff.shape) mobility = np.sqrt(varfdiff / activity) #", "f return ], ind[2]] = - D f = np.expand_dims(fd, axis=-1) if combined:", "ss = np.sum(np.abs(np.diff(X[..., m::k], n=1)), axis=-1) Lm = (ss*norm) / k return Lm", "calc_L_average_series = np.from...