ngram
listlengths
0
82k
[ "set, and returns the loss. Args: model: The model to", "test set, and returns the loss. Args: model: The model", "of the test set. Returns: The loss on the test", "<gh_stars>0 def default_evaluator(model, X_test, y_test): \"\"\"A simple evaluator that takes", "y_test): \"\"\"A simple evaluator that takes i...
[ "class Yolov3(object): def __init__(self): self.num=0 self.input_size=[8,16,32] def __iter__(self): return self", "= random.choice(self.input_size) self.num=self.num+1 if self.num<3: return a else: raise StopIteration", "self.num=self.num+1 if self.num<3: return a else: raise StopIteration yolo=Yolov3() for", ...
[ "np.sign(x) * np.log(1 + mu * np.abs(x)) / np.log(1 +", "hp from scipy.signal import lfilter import soundfile as sf def", "amp_to_db(x): return 20 * np.log10(np.maximum(1e-5, x)) def db_to_amp(x): return np.power(10.0,", "amp_mel = db_to_amp(denormalized) S = librosa.feature.inverse.mel_to_stft( amp_mel, powe...
[ "NA_Talon_Jng_Camille(Ratings): pass class NA_Talon_Jng_Cassiopeia(Ratings): pass class NA_Talon_Jng_Chogath(Ratings): pass class NA_Talon_Jng_Corki(Ratings):", "pass class NA_Talon_Jng_Viktor(Ratings): pass class NA_Talon_Jng_Vladimir(Ratings): pass class NA_Talon_Jng_Volibear(Ratings): pass", "pass class NA_T...
[ "TurkishText(): \"\"\"Class for handling lowercase/uppercase conversions of Turkish characters.. Attributes:", "for i in self.text: if i in self.u: res +=", "i in self.text: if i in self.l: res += self.u[self.l.index(i)]", "in self.l: res += self.u[self.l.index(i)] else : res += i.upper()", "if i in self.l:...
[ "import googlemaps gmaps = googlemaps.Client(key='google_key') def get_markers(address): geocode_result = gmaps.geocode(address)", "googlemaps gmaps = googlemaps.Client(key='google_key') def get_markers(address): geocode_result = gmaps.geocode(address) return", "gmaps = googlemaps.Client(key='google_key') def g...
[ "import print_function # Imports import os import numpy as np", "print(\"Model path chosen : \", dir_path) if (not os.path.exists(dir_path)): os.mkdir(dir_path)", "None: optimizer = tf.keras.estimators.SGD( lr=0.0009, decay=1e-5, momentum=0.9, nesterov=True) # 1.", "Create optimizer and compile model if optim...
[ "\"\"\" @classmethod def find_bundle_dir(cls, path): \"\"\" Included for similarity with", "just keeps track of some state with an unzipped app", "= abc.ABCMeta # we use abc.abstractmethod throughout because there are", "Check if this is, in fact, an archive of this", "process_watchkit(app_dir, REMOVE_WATCH...
[ "environment(self): \"\"\" collects the runtime information from dependencies. For normal", "information from dependencies. For normal libraries should be very occasional", "runtime information from dependencies. For normal libraries should be very", "dep.runenv_info: runenv.compose_env(dep.runenv_info) runen...
[ "import Enum from dataclasses import dataclass from uuid import UUID", "id : UUID = None user_id : UUID = None", "from datetime import datetime class ListType(str, Enum): LIST : str", "'list' TEMPLATE: str = 'template' @classmethod def _missing_(cls, value): return", "uuid import UUID from datetime import d...
[ "1, \"sound\": _IOS_SOUND_POWER_PEAK, } else: push_data = { \"category\": \"confirm\",", "for {self._min_time_high} secs, \" f\"(low={self._lower_limit} W for {self._min_time_low} secs). \"", "notify when back to normal (< lower limit). \"\"\" #", ") self.log( f\"TRIGGER ALARM with msg={data}\", level=LOG_LEV...
[ "iteration and mainloop functions didn't release # global interpreter lock,", "and signal support. if getattr(gobject, \"pygtk_version\", ()) >= (2, 3,", "that method # as the input source. The pygtk2 input_add", "given L{FileDescriptor} for writing. \"\"\" self._remove(writer, self._writes, self._reads, INFL...
[ "models \"\"\" assets = list(asset_details[\"Asset_ID\"].astype(str)) # Get indexes i =", "list(asset_details[\"Asset_ID\"].astype(str)) # Get indexes i = np.select( [ (wide_close.index >=", "cores - Import Data \"\"\" import pandas as pd import", "f\"model_files/linear_regression/lr_{a}_16\") dump(time_d, \"...
[ "if us == 'member': msg = bot.send_message(message.chat.id, \"\"\"\\ Juda soz!!!,", "process button presses import telebot import time from telebot.types import", "<reponame>menlen/one # This example show how to use inline keyboards", "message.text myfile = TextToImg(name) photoSend = open(f'{myfile}.png', 'r...
[ "from rectangle2 import rectangle_area def test_unit_square(): assert rectangle_area([0, 0, 1,", "assert rectangle_area([1, 1, 4, 4]) == 9.0 def test_actual_rectangle(): assert", "rectangle_area def test_unit_square(): assert rectangle_area([0, 0, 1, 1]) == 1.0", "== 9.0 def test_actual_rectangle(): assert re...
[ "self.radio.request('bar') @init_radio def test_kwargs(self): ''' Keyword arguments works correctly. '''", "wrap class TestRadioRequestReplyMethods(TestCase): @init_radio def test_request_reply_stop_replying(self): ''' \"request\", \"reply\" and", "def init_radio(f): def wrap(self, *args): self.radio = Radio() ...
[ "pass class APIResourcePatternError(APIError): \"\"\" Raised when an app tries to", "class APIResourcePatternError(APIError): \"\"\" Raised when an app tries to override", "app \"\"\" pass class APIResourcePatternError(APIError): \"\"\" Raised when an app", "Raised when an app tries to override an existing UR...
[ "def test_lazy_access(field): reqs = (Request(r.SerializeToString(), EnvelopeProto()) for r in request_generator(random_docs(10)))", "import Sequence import pytest from jina import Request, QueryLang, Document", "in request_generator(random_docs(10))] for r in reqs: assert r.size == 0", "jina_pb2.RequestProto...
[ "__file__ ) ) def Settings( **kwargs ): return { 'interpreter_path':", "Settings( **kwargs ): return { 'interpreter_path': sys.executable, 'sys_path': [ os.path.join(", "import os import sys DIR_OF_THIS_SCRIPT = os.path.abspath( os.path.dirname( __file__ )", "DIR_OF_THIS_SCRIPT = os.path.abspath( os.path.dirn...
[ "author_email='<EMAIL>', packages=[ 'utils', ], scripts=[], url='https://github.com/Cloud-PG/smart-cache', license='Apache 2.0 License', description='Utils", "description='Utils for the SmartCache project', long_description=\"To do...\", install_requires=open(\"requirements.txt\").read(), classifier=[ \"Operating...
[ "a Eight Sleep heat-based sensor.\"\"\" _attr_device_class = BinarySensorDeviceClass.OCCUPANCY def __init__(", "<gh_stars>1-10 \"\"\"Support for Eight Sleep binary sensors.\"\"\" from __future__ import", "EightSleep, user_id: str | None, sensor: str, ) -> None:", "None: return eight: EightSleep = hass.data[DO...
[ "('https://ravem.test', './final_endpoint', 'https://ravem.test/final_endpoint'), ('https://ravem.test/api/', './final_endpoint', 'https://ravem.test/api/final_endpoint'), ('https://ravem.test/api/v2/', './final_endpoint', 'https://ravem.test/api/v2/final_endpoint'), ('https://ravem.test',", "session.user = '<NAM...
[ "# -------------------------django---------------------- from django.conf.urls import url from .views import OrgView,", "utf-8 _*_ # --------------------------- __author__ = 'StormSha' __date__ = '2018/3/28", "import url from .views import OrgView, AddUserAskView, OrgHomeView, OrgCourseView, OrgDescView,", "n...
[ "Migration(migrations.Migration): dependencies = [ ('filer', '0009_auto_20171220_1635'), ] operations = [", "operations = [ migrations.AlterField( model_name='image', name='file_ptr', field=models.OneToOneField(primary_key=True, serialize=False, related_name='filer_image_file', parent_link=True,", "[ migrations...
[ "if hcaldigi is not None: hcaldigi.HBDarkening = cms.bool(turnon) if hasattr(process,'es_hardcode'):", "process = ageHF(process,False) return process def turn_off_SiPM_aging(process): process = ageSiPM(process,False,0.0)", "= 2.5 # try to get conditions if int(lumi) in", "import _years_LHC, _years_HLLHC_ultim...
[ "radius] self.axis = (self.p2 - self.p1) / length def update_point(self,", "in zip(self.joints, self.joint_positions): joint.set('pos', ' '.join([str(x) for x in pos]))", "p1 self.p2 = p2 super().set_params(new_params) def get_smallest_z(self): return min(self.p1[2], self.p2[2])", "def update_params(self, new...
[ "Route Executes ''' pass def load_user(self, request): ''' Load user", "import Auth class LoadUserMiddleware: ''' Middleware class which loads the", "Auth class LoadUserMiddleware: ''' Middleware class which loads the current", "''' Load User Middleware''' from masonite.facades.Auth import Auth class LoadUser...
[ "Player2\", team=\"blue\") player3 = fake_player(789, \"Speccing Player\", team=\"spectator\") connected_players(player1, player2,", "when(self.db).get(\"minqlx:players:{}:minelo:freegames\".format(player3.steam_id)).thenReturn(None) self.plugin.cmd_mercis(player, [\"!mercis\"], minqlx.BLUE_TEAM_CHAT_CHANNEL) ass...
[ "SmsSDK(accId, accToken, appId) tid = '1' # 我们发送短信的模板,值 只能是 1", "SmsSDK from celery_tasks.main import app # 写我们的任务(函数) # 任务必须要celery的实例对象装饰器task装饰 #", "= SmsSDK(accId, accToken, appId) tid = '1' # 我们发送短信的模板,值 只能是", "任务包的任务需要celery调用自检检查函数。(在main里面写。) @app.task def celery_send_sms_code(mobile, sms_code): accId...
[ "visibility(self): return self._visibility @visibility.setter def visibility(self, value): self._visibility = value", "has_implementation(self): return self._has_implementation @has_implementation.setter def has_implementation(self, value): self._has_implementation = value", "value @property def params(self): r...
[ "= weight['dtype'] self.assertEqual( sorted(list(weight_shapes.keys())), sorted([ 'MergedDense1/kernel', 'MergedDense1/bias', 'MergedDense2/kernel' ])) self.assertEqual(weight_shapes['MergedDense1/kernel'],", "self).tearDown() def testVersionString(self): self.assertEqual(2, tfjs.__version__.count('.')) def testS...
[ "re.compile('<addon.+?id=\"(.+?)\".+?>').findall(g) match2 = re.compile('<addon.+?name=\"(.+?)\".+?>').findall(g) control.loga(\"%s: %s\" % (folder, str(match[0]))) if", "new = old setNew(new, value) def lookandFeelData(do='save'): scan = ['lookandfeel.enablerssfeeds',", "COLOR1, SKIN[5:].title()), \"Would you ...
[ "dict of properties, such as Format, ValidValues, etc. :type properties:", "len(value) > 64: hap_rep[HAP_REPR_MAX_LEN] = min(len(value), 256) if HAP_PERMISSION_READ in", "and a set of properties, like format, min and max", "\"\"\"Generic exception class for characteristic errors.\"\"\" class Characteristic: \...
[ "pin_memory=True, batch_sampler=dict( type='TokenBucketSampler', bucket_size=BUCKET_SIZE, batch_size=vqa_cfg['train_batch_size'], drop_last=True, size_multiple=8, ), data=dict( type=dataset_type,", "name not in use, but have defined one to run", "# name not in use, but have defined one to", "vqa_cfg = dict( t...
[ "= [ path('api-auth/', include('rest_framework.urls')), path('rest-auth/', include('rest_auth.urls')), path('rest-auth/registration/', include('rest_auth.registration.urls')), path('admin/', admin.site.urls),", "import static from django.contrib import admin from django.urls import path,", "from django.views.ge...
[ "self.in_smtp_host = QLineEdit() self.in_smtp_port = QLineEdit() self.in_smtp_user = QLineEdit() self.in_smtp_password", "self.in_smtp_password = QLineEdit() self.cb_smtp_ssl = QCheckBox('使用') self.in_smtp_test = QLineEdit() self.btn_smtp_save", "labels = [\"寄件人 :\", \"寄件人名稱 :\", \" 是否加入附件 :\", \"附件名稱", "serv...
[ "To avoid ambiguity, please specify only one of them.\") elif", "Conv2DMMLayer: %s\" % border_mode) else: self.pad = pad self.W =", "[self.b] if self.b is not None else [] def get_output_shape_for(self,", "self.corr_mm_op(contiguous_input, contiguous_filters) if self.b is None: activation = conved elif", "s...
[ "handle as before c.begin_tx() c.create_node('ayush') try: c.end_tx() assert False, 'create", "c.end_tx() # 10. list all the people who like egs's", "9. add auxiliary handles to nodes c.begin_tx() c.add_alias('ad688', 'ayush') c.add_alias('el33th4x0r',", "assert False, 'create node passed' except client.Weave...
[ "graphs are isomorphic iso1 = compare.to_isomorphic(graph1) iso2 = compare.to_isomorphic(graph2) if", "u\"The 2 '%s' Graphs\" % graph1.identifier else: str_bit = (u\"Graphs", "COL: record.levelname = COLOR_SEQ % ( 30 + COL[record.levelname]) +", "== type(graph2) == rdflib.Graph: if type(graph1) == rdflib.Conj...
[ "Packet handlign callbacks DPROCFS = (1 << 4) # procfs", "handling DGENPKTV = (1 << 2) # Generic packet handling", "DIPNAT: 'IPNAT', DMANGLE: 'MANGLE', DPCAP: 'PCAP', DIGN: 'IGN', DFTP: 'FTP',", "DPROCFS = (1 << 4) # procfs DIPTBLS = (1", "DNONLOC: 'NONLOC', DDPF: 'DPF', DDPFV: 'DPFV', DIPNAT: 'IPNAT', DMAN...
[ "training_state, _ = sess.run( [loss, final_state, train_op], feed_dict) if steps", "learning_rate = 0.0001 # build the model rnn_model = MultiRnn(", "= 'sum' # dir to write summary train_dir = 'ckpt'", "from matplotlib import pyplot as plt sum_dir = 'sum' #", "matplotlib import pyplot as plt sum_dir = 'sum...
[ "DagsterInstance.get() as instance: if all_daemons_live(instance, heartbeat_tolerance_seconds=_get_heartbeat_tolerance()): click.echo(\"Daemon live\") else: click.echo(\"Daemon(s)", "statuses\", ) def debug_heartbeat_dump_command(): with DagsterInstance.get() as instance: for daemon_type", "to allow a daemon to...
[ "import Teams for team in Teams(): print(team.name) for player in", "Teams(): print(team.name) for player in team.roster.players: print(player.name) for game in", "sys, os sys.path.append(os.path.dirname(os.path.dirname(sys.path[0]))) from sportsreference.nfl.teams import Teams for team in", "<filename>tests/...
[ "* nx * ny,)) ftype = 1 # plane wave", "for y in ys ] ) # for map_fields function", "133 x0 = 0 x1 = 30 # lambdas y0", "by = by.transpose() bz = bz.transpose() plt.imshow(ey, cmap = 'RdYlBu',", "ey = ey.reshape((nx, ny)) ez = ez.reshape((nx, ny)) bx =", "lambdas y0 = 0 y1 = 20 # lambdas xs", "ey.reshape...
[ "_f_pixels = penultimate_feat_extractor.predict(_x_pixels, batch_size=224*224*dim).reshape(-1, FLAGS.penultimate_nodes) _var_f = np.sum(np.var(_f_pixels, axis=0)) _var_fs.append(_var_f)", "\"uncertainties.npy\"), uncertainties) with open(os.path.join(dn, \"results.txt\"), \"w\") as f: for i,", "os from absl imp...
[ "header_time_format = 'H:i e' menu = ( ParentItem('JAX Id Record", "'Mbiome Core JAXid Tracking' site_header = site_title index_title = verbose_name", "row on the right form_submit_on_right = False # Hide name/\"original\"", "by suit_form_inlines_hide_original = False #form_inlines_hide_original = False form_...
[ "pretrained[\"model_weights\"][\"batch_normalization_2\"][\"batch_normalization_2\"][\"gamma:0\"] p_moving_mean = pretrained[\"model_weights\"][\"batch_normalization_2\"][\"batch_normalization_2\"][\"moving_mean:0\"] p_moving_variance = pretrained[\"model_weights\"][\"batch_normalization_2\"][\"batch_normalization_...
[ "return list(self._labels) def write(self, outfile, tokens): \"\"\"Writes ARFF data to", "%s\\n\\n' % time.ctime()) # Relation name s += '@RELATION rel\\n\\n'", "or STRING. \"\"\" self._labels = labels self._features = features def", "def header_section(self): \"\"\"Returns an ARFF header as a string.\"\"\" #...
[ "# xnames = df.columns.tolist().remove(ylabel) yname = ylabel xnames = df.columns.tolist()", "def from_data(cls, filename, sep=\",\", labeled=True): \"\"\"Creates a DataSet from a", "def __len__(self): \"\"\"Returns the number of data points.\"\"\" return self.X.shape[0]", "np.var(data[:, i], axis=0) _maxs = ...
[ "backlight(): pass def circle(): pass def clear(): pass def clearwin():", "drawTriangle(): pass def ellipse(): pass def fill(): pass def fillCircle():", "LIGHTGREY = 12632256 M5STACK = 6 MAGENTA = 16515327 MAROON", "nodename='esp32', release='1.11.0', version='v1.11-284-g5d8e1c867 on 2019-08-30', machine='ESP...
[ "WorkspaceClient from .ScimClient import ScimClient from .LibraryClient import LibraryClient from", "import ClustersClient from .WorkspaceClient import WorkspaceClient from .ScimClient import ScimClient", "from .LibraryClient import LibraryClient from .HiveClient import HiveClient from .parser", "import json,...
[ "General Public License for more details. # # See http://www.gnu.org/licenses/gpl.html", "# -*- coding: utf-8 -*- # SkinWeights command and component", "is free software: you can redistribute it and/or modify #", "# This program is distributed in the hope that it", "pyqt attribute sliders # Copyright (C) 20...
[ "attenuation.\"\"\" return status.attenuation[0] / 10 # type: ignore[no-any-return] def _retrieve_link_attenuation_received_state(", "class.\"\"\" value_fn: Callable[[FritzStatus, Any], Any] @dataclass class FritzSensorEntityDescription(SensorEntityDescription, FritzRequireKeysMixin): \"\"\"Describes", "max tra...
[ "add(self, e): self.fields[e.rtype] = e def __str__(self): return \"STEPHeader({f})\".format(f=\", \".join(map(lambda", "= e def __str__(self): return \"STEPHeader({f})\".format(f=\", \".join(map(lambda f: \"{n}: {v}\".format(n=f[0],", "derived (calculated) value, so it no longer makes sense to", "self.args =...
[ "element): if element not in self.data_dict: LOG.error(\"Error: invalid element requested", "self.congestion_await_sustained: self.congestion_status = self.STATUS_CONGESTED LOG.warn(\"Node %s (%s) is experiencing high", "ts # LOG.debug(\"%s: e = %s, v= %f\" % (self.node,", "%d\" % (self.node, ma_sma, ma_med, ...
[ "default=False, metadata={ \"help\": \"Whether to force the addition of a", "\"pbt_transformers\", \"reinit\": True, \"allow_val_change\": True } } logger.info(config) scheduler =", "# Run eval after every epoch. # eval_steps=(len(train_dataset) // config[\"per_gpu_train_batch_size\"])", "supported, but you c...
[ "path = encodeString('/dev/null') sock.sendall(bytearray(b'\\x0A')) # HASH request # sock.sendall(bytearray(b'\\x01')) #", "OK or \\xFF ERROR if resp != b'\\x00': print(\"Error byte", "0) + (8 if ignoreEmptyDirs else 0))]) if __name__ ==", "b'\\x00': print(\"Error byte received, errno is:\", struct.unpack(\"@...
[ "name='website_href', field=models.URLField(default='https://invest.great.gov.uk/contact/', help_text='Custom link for website (used for tracking)', max_length=255),", "-*- # Generated by Django 1.11.13 on 2018-09-11 10:05 from", "config.s3 from django.db import migrations, models class Migration(migrations.Mig...
[ "of threads in thread pools is set to 1.\"\"\" import", "<gh_stars>100-1000 \"\"\"Validate that number of threads in thread pools is", "threadpoolctl # APIs that return previous number of threads: assert", "import blosc import threadpoolctl # APIs that return previous number", "that return previous number o...
[ "label=\"U\") plt.colorbar() ax3.set_title('U/I') ax4 = fig.add_subplot(224) plt.pcolormesh(x, y, StokesV/StokesI, label=\"V\")", "StokesV def plotStokes_fromFEKOfiles(p_chan_file, q_chan_file, freq): (tvf_p, tvf_q) = (TVecFields(), TVecFields())", "elif args.p_chan_file.endswith(GRASPsuffix): print(\"Not imple...
[ "current < total-1: sys.stdout.write('\\r') else: sys.stdout.write('\\n') sys.stdout.flush() def set_lr(optimizer, lr):", "= cur_time tot_time = cur_time - begin_time L = []", "sys import time import math import torch import torch.nn as", "sys.stdout.write('\\r') else: sys.stdout.write('\\n') sys.stdout.flush...
[ "print(self.nbins, self.ndim, self.nbins ** self.ndim) raise Exception(\"Invalid index %s. You", "np.empty((len(vector),) + grid_shape) for idx, v in enumerate(vector): grids[idx] =", "= logging.getLogger(\"indexconverter\") class IndexConverter(object): def __init__(self, ndim, ngrid): self.ndim =", "ndim se...
[]
[ "in qubits if a != b]) ) # pylint: enable=missing-raises-doc", "are handled internally by Pasqal. \"\"\" def __init__(self, qubits: Sequence[cirq.Qid])", "in the distance computation q: qubit involved in the distance", "device.') if isinstance(operation.gate, cirq.MeasurementGate): if operation.gate.invert_ma...
[ "\"%.3f\", } for rlist in reflections: from dials.algorithms.shoebox import MaskCode", "to be true. So we have to reinstatiate # the", "each scan point.\" show_shared_models = False .type = bool .help", "text.append(\"\") text.append(show_beam(expt.detector, expt.beam)) if expt.scan is not None: text.append(s...
[ "LOG_LEVEL_CONSOLE = \"WARNING\" LOG_LEVEL_FILE = \"INFO\" APP_FOLDER = os.getenv(\"JESA_MINE2FARM_HOME\", \"C:/GitRepos/mine2farm/\")", "\"Capacity\", \"Input\", \"Item\", \"Product\", \"Unit\"], \"capex\": [\"Location\", \"Process\", \"Capacity\", \"Item\",", "PipelineLayer.LOGISTICS: { \"type\": PipelineType...
[ ": id : int img : str date : int", "Create your models here. class Destination(models.Model) : name = models.CharField(max_length", "here. class Destination(models.Model) : name = models.CharField(max_length = 100) img", "date : int month : str headline : str category", "= False) class News() : id : int img...
[ "style={'margin-left': '750px'}), html.H4('Classe prédite : {}'.format(CLASSES[predicted_class]), style={'textAlign': 'center'}), html.Hr(), #html.Div('Raw", "y2) image = np.array(image) images_list.append(image) return model.predict_classes(np.array(images_list)) app = dash.Dash('Traffic", "Load DNN model clas...
[ "json_data['title'] = data['Items'][0]['Item']['title'] json_data['publisher'] = data['Items'][0]['Item']['publisherName'] json_data['pubdate'] = data['Items'][0]['Item']['salesDate'] json_data['cover']", "json.loads(r.text) if data['count'] == 0: return None json_data = {}", "from django.conf import settings c...
[]
[ "role_definition_id: Optional[str] = None, principal_id: Optional[str] = None, can_delegate: Optional[bool]", "Optional[List[str]] = None, not_data_actions: Optional[List[str]] = None, **kwargs ): super(Permission,", "The error message. :vartype message: str :ivar target: The error", "'name': {'key': 'name', ...
[ "TEACHER LOGIN SECTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN(by sumit) @login_required(login_url='teacherlogin') @user_passes_test(is_teacher) def teacher_dashboard_view(request): teacherdata=models.TeacherExtra.objects.all().filter(status=True,user_id=request.user.id) notice=models.Notice.objects.all()", "if form...
[ "iounet_backbone_features = TensorList([ output_features[layer] for layer in self.iounet_feature_layers ]) self.iounet_backbone_features", "SiamMask_ResNet50_base from pytracking.admin.environment import env_settings from pytracking.features.featurebase import MultiFeatureBase from", "= fluid.load_dygraph(net_p...
[ "0.0,' add } def\\n' if axis == 2: print >>self.fout,", "in titleLines: if len(t) > 0: print >>self.flog, ' '+t", "'endFunction\\n' print >>self.fout, '18 { 0.72 0.52 0.5 setrgbcolor }", "self.fout.write(' ]') if ztitle != '': print >>self.fout, '('+ztitle+') vaxis2'", "' -g1200x1100 ' cmdStr = gsPath + ' -...
[ "dependencies = [ ('exercises', '0002_auto_20161128_1718'), ] operations = [ migrations.RenameModel(", "from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration):", "= [ ('exercises', '0002_auto_20161128_1718'), ] operations = [ migrations.RenameModel( old_na...
[ "Copyright 2021 Northern.tech AS # # Licensed under the Apache", "version_string_line = open(VERSIONFILE, \"rt\").read() VSRE = r\"^__version__ = ['\\\"]([^'\\\"]*)['\\\"]\" match", "re.M) if match: version_string = match.group(1) else: raise RuntimeError(\"Unable to", "# # http://www.apache.org/licenses/LICE...
[ "> len(self.hi): heappush(self.hi, -heappop(self.lo)) def findMedian(self) -> float: if len(self.hi)", "len(self.hi) > len(self.lo): return self.hi[0] if len(self.hi) == len(self.lo): return", "heappush(self.lo, -heappushpop(self.hi, num)) while len(self.lo) > len(self.hi): heappush(self.hi, -heappop(self.lo)) ...
[ "ground = world.addGround() world.setTimeStep(0.001) world.setMaterialPairProp(\"steel\", \"steel\", 0.1, 1.0, 0.0) pin1", "0.0, 3.0) pin3.setBodyType(raisim.BodyType.STATIC) pin4 = world.addSphere(0.1, 0.8) pin4.setAppearance(\"1,0,0,0.3\") pin4.setPosition(0.9, 0.0,", "ball2, 0, np.zeros(3), 2.0) world.addSti...
[ "get_disk_resource_path(self, connection_info): disk_paths = self._connector.get_volume_paths(connection_info['data']) if not disk_paths: vol_id =", "helper. conn = connector.get_connector_properties( root_helper=None, my_ip=CONF.my_block_storage_ip, multipath=CONF.hyperv.use_multipath_io, enforce_multipath=True,...
[ "banks['Loan_Amount_Term'].apply(lambda x: int(x)/12 ) big_loan_term=len(loan_term[loan_term>=25]) print(big_loan_term) columns_to_show = ['ApplicantIncome', 'Credit_History']", "'mean') print(avg_loan_amount) loan_approved_se = banks[ (banks['Self_Employed'] == \"Yes\") & (banks['Loan_Status']", "# code starts...
[ "p.requires_grad, model.parameters()), 1) # update parameters cap_train_loss = cap_loss.item() cms_train_loss", "%.6f, cms_train_loss = %.6f,' ' current step = %d, current", "opt['att_max_len'] # model initialization. from model.S2VTModel import S2VTModel model =", "VideoDataset from model.transformer.Optim i...
[ "= \"http://localhost:9999\" client = InfluxDBClient(url=url, token=token, org=org) writeApi = client.write_api()", "org = \"Energy Monitor\" token = \"miQdAvNXHiNDVVzPzV5FpkCaR_8qdQ-L1FlPCOXQPI325Kbrh1fgfhkcDUZ4FepaebDdpZ-A1gmtnnjU0_hViA==\" url = \"http://localhost:9999\"", "\"my-org\", [{\"measurement\": \"h...
[ "in instance.users.items(): if user == username and passwd == password:", "we should have added. for _, instance in manhole.protocol.portal.checkers.items(): found", "self.assertRaises(AssertionError): manhole_factory({}, None, \"\") with self.assertRaises(AssertionError): manhole_factory({}, \"\", None) def", ...
[ "# coding: utf-8 \"\"\" 插入所有需要的库,和函数 \"\"\" #---------------------------------------------------------------------- def klSigmode(self): \"\"\"查找模式\"\"\"", "if self.mode == 'deal': self.canvas.updateSig(self.signalsOpen) self.mode = 'dealOpen' else: self.canvas.updateSig(self.signals)", "'deal': self.canvas.upd...
[ "exportSVG: toPNG(full_segments, vectorized, os.path.join('workshop', 'thin.png')) if geoloc: if exportJSON: project_name", "nodes_grid[x, y]: end = True else: end = True return", "degrees of the nodes (2=endpoint, 4=crossroads of 3 streets, 5=crossroads", "segments: coords = [] for point in segment: coords.a...
[ "import TestCase from unittest.mock import patch from easy2fa import cli", "unittest import TestCase from unittest.mock import patch from easy2fa import", "mock_input.return_value = '' self.assertEquals(cli.check_input('prompt', default='one'), 'one') mock_input.return_value = 'two' self.assertEquals(cli.check_...
[ "def create_loaders(self): \"\"\" Create Torch dataloaders for data splits \"\"\"", "print(\"finished creating dataloaders\") \"\"\" ** FOR DEBUGGING ** if __name__", "{ \"train\": \"./datasets/hasoc_dataset/hasoc_german_train.csv\", \"dev\": \"./datasets/hasoc_dataset/hasoc_german_validation.csv\", \"test\": \...
[ "train_dataset = data.ConcatDataset( [mnist_train_dataset, AmbiguousMNIST(root=root, train=True, device=device),] ) valid_dataset =", "valid_subset = Subset(valid_dataset, valid_idx) train_loader = torch.utils.data.DataLoader(train_subset, batch_size=batch_size, num_workers=0, shuffle=True)", "data from torch.u...
[ "'{user.username}'\") # generate a token that can reset their password", "requested for '{user.username}'\") # generate a token that can reset", "an email\"} # obtain username/email from request' body = request.get_json()", "coding: utf-8 -*- import logging import datetime from flask import", "import reques...
[ "Several middlewares can be chained. message_middleware = [middleware_function] # Some", "**kwargs) # There's also the possibility to pass in extra", "to pass in extra arguments or keywords arguments, for example:", "= \"INFO\" uuid = str(os.environ.get(\"SERVICE_UUID\") or \"\") # Build own", "for testing ...
[ "= False joke_evaluation = \"Isn't that joke so funny?! {}\"", "do_not = \"don't\" y = f\"Those who know {binary} and", "so funny?! {}\" print(joke_evaluation.format(hilarious)) w=\"This is the left side of...\"", "y = f\"Those who know {binary} and those who {do_not}.\"", "also said: '{y}'\") hilarious = F...
[ "return '%s=%s' % (key, value) args = [] for input", "return self.statement('from dlconv.%s import %s\\n' % (self.target, self.net)) def emit_class_def(self,", "<title>Keras</title> </head> <body> <img alt=\"Model Graph\" src=\"data:image/png;base64,{base64_str}\" /> </body> </html>\"\"\".format(base64_str=enco...
[ "if matrix[r][c]==\"1\": heights[c]+=1 else: heights[c]=0 res = max(res,self.largestRectangleArea(heights)) def largestRectangleArea(self,", "的二维二进制矩阵, 找出只包含 1 的最大矩形, 并返回其面积。 \"\"\" from typing import List", "window_L + 1) res = max(res, cur_area) ascend_stack.append(i) return res", "ascend_stack = [] for i i...
[ "pp.create_piecewise_linear_cost(net, 0, \"sgen\", np.array([[-150, -100], [-75, -50], [0, 0]])) #", "assert result def test_get_costs(): \"\"\" Testing a very simple network", "pp.create_ext_grid(net, 0) pp.create_line_from_parameters(net, 0, 1, 50, name=\"line2\", r_ohm_per_km=0.876, c_nf_per_km=260.0, max_i_...
[ "while 1: cookie_list = red.smembers(config.REDIS_KEY_COOKIE) if len(cookie_list) >= config.COOKIE_COUNT: break", "1: cookie_list = red.smembers(config.REDIS_KEY_COOKIE) if len(cookie_list) >= config.COOKIE_COUNT: break cookie_login.run_cookie_login(1)", "# @CreateTime: 2022-01-20 # @UpdateTime: 2022-01-20 impo...
[ "from feemodel.app.transient import TransientOnline from feemodel.app.pools import PoolsOnlineEstimator from feemodel.app.predict", "from feemodel.app.pools import PoolsOnlineEstimator from feemodel.app.predict import Prediction from feemodel.app.simonline", "import PoolsOnlineEstimator from feemodel.app.predic...
[ "-*- from __future__ import unicode_literals # start tutorial from django.db", "blank=True, null=True) class SubscribeForm(NgModelFormMixin, NgFormValidationMixin, Bootstrap3ModelForm): use_required_attribute = False scope_prefix", "NgFormValidationMixin from djng.styling.bootstrap3.forms import Bootstrap3Model...
[ "OF ANY # KIND, either express or implied. See the", "input_b, output_layout: str, input_a_layout: str, input_b_layout: str, op_name: str, ):", "more contributor license agreements. See the NOTICE file # distributed", "topi\"\"\" return topi.add(input_a, input_b) def subtract_broadcast_compute(input_a, input_...
[ "image, build_cm=do_nothing, path=None): return super(DagsterDockerImage, cls).__new__( cls, check.str_param(image, \"image\"), check.callable_param(build_cm,", "to the image's path. Defaults to docker/images/<IMAGE NAME> \"\"\" def", "last_updated timestamp for a particular python_version of this image.\"\"\" ...
[ "return self._GetLoginStatus(browser)['isScreenLocked'] def _LockScreen(self, browser): self.assertFalse(self._IsScreenLocked(browser)) extension = self._GetAutotestExtension(browser) self.assertTrue(extension.EvaluateJavaScript(", "def _AttemptUnlockBadPassword(self, browser): logging.info('Trying a bad password...