ngram
listlengths
0
67.8k
[ "model: The model to evaluate. X_test: The features matrix of the test set.", "test set, and returns the loss. Args: model: The model to evaluate. X_test:", "def default_evaluator(model, X_test, y_test): \"\"\"A simple evaluator that takes in a model, and", "features matrix of the test set. y_test: The one-ho...
[ "a = random.choice(self.input_size) self.num=self.num+1 if self.num<3: return a else: raise StopIteration yolo=Yolov3() for", "= random.choice(self.input_size) self.num=self.num+1 if self.num<3: return a else: raise StopIteration yolo=Yolov3() for data", "return self def __next__(self): a = random.choice(self.i...
[ "spectrogram back into a waveform.\"\"\" denormalized = denormalize(mel) amp_mel = db_to_amp(denormalized) S =", "S = amp_to_db(linear_to_mel(np.abs(D))) return normalize(S) def stft(y): return librosa.stft( y=y, n_fft=hp.n_fft, hop_length=hp.hop_length, win_length=hp.win_length)", "import lfilter import soundf...
[ "pass class NA_Talon_Jng_Draven(Ratings): pass class NA_Talon_Jng_DrMundo(Ratings): pass class NA_Talon_Jng_Ekko(Ratings): pass class NA_Talon_Jng_Elise(Ratings): pass", "pass class NA_Talon_Jng_Akali(Ratings): pass class NA_Talon_Jng_Alistar(Ratings): pass class NA_Talon_Jng_Amumu(Ratings): pass class NA_Talon_J...
[ "the rest to lowercase letters. Returns string. \"\"\" m = self.text.split() res =", "-- Turkish text to be handled \"\"\" text = \"\" l = ['ı',", "def __init__(self, text): self.text = text def upper(self): \"\"\"Converts the text into uppercase", "for i in self.text: if i in self.l: res += self.u[self.l.ind...
[]
[ "tf.estimator.TrainSpec(input_fn=lambda: input_func(input_func_dict), max_steps=500) # evaluation spec eval_spec = tf.estimator.EvalSpec(input_fn=lambda: input_func(eval_func_dict)) # Run the", "input_func(input_func_dict), max_steps=500) # evaluation spec eval_spec = tf.estimator.EvalSpec(input_fn=lambda: input_...
[ "output_path): \"\"\" archive this up into a zipfile. Note this is a classmethod,", "in helper_paths or helper_paths[helper_name] is None: # note, find_executable returns None is not", "class {}: {}\".format(cls.__name__, helper_name)) is_present = False break return is_present @classmethod def is_archive_exten...
[ "def runenv_from_cpp_info(conanfile, cpp_info): \"\"\" return an Environment deducing the runtime information from a", "\"\"\" return an Environment deducing the runtime information from a cpp_info \"\"\" dyn_runenv", "private one = BINARY_SKIP return dyn_runenv if cpp_info.bin_paths: # cpp_info.exes is not def...
[ "********************************************************************************** \"\"\" from enum import Enum from dataclasses import dataclass from uuid import", "ListType(str, Enum): LIST : str = 'list' TEMPLATE: str = 'template' @classmethod def", "= 'list' TEMPLATE: str = 'template' @classmethod def _mis...
[ "main_power_change(self, entity, attribute, old, new, kwargs): \"\"\"Sustained Power ALARM logic control.\"\"\" try: new", "ALERT_ON = 1 ALERT_CRITICAL = 2 def make_ios_push_data(self, data_msg: dict) -> dict: if", "= \"\" if self.get_state(BIG_CONSUMER_1_CLIMATE) == \"on\": devices_turning_off = BIG_CONSUMER_1...
[ "else: import gtk self.__pending = gtk.events_pending self.__iteration = gtk.main_iteration self.__crash = _our_mainquit self.__run", "and set up some # signal handling which pygtk won't mess with. This", "Windows. Sockets aren't supported by GTK+'s input_add on Win32. \"\"\" _simtag = None", "else: self._sou...
[ "a in assets: print(\"asset\", a) filt = indexes[\"set\"][~pd.isna(wide_close[a])] counts = filt.value_counts() df =", "import multiprocessing import random import os from tensorflow.keras.models import Sequential from tensorflow.keras.layers import", "in asset_details[\"Asset_ID\"]] \"\"\" Preprocess \"\"\" cl...
[ "except Exception as e: bot.reply_to(message, 'oooops') @bot.message_handler(func=lambda message: True) def message_handler(message): us =", "markup = InlineKeyboardMarkup() markup.row_width = 1 markup.add(InlineKeyboardButton(\"Azo bo'ling\", callback_data=\"cb_yes\", url='t.me/onideal'), InlineKeyboardButton(\"...
[ "rectangle_area([0, 0, 1, 1]) == 1.0 def test_large_square(): assert rectangle_area([1, 1, 4, 4])", "assert rectangle_area([0, 0, 1, 1]) == 1.0 def test_large_square(): assert rectangle_area([1, 1, 4,", "rectangle_area def test_unit_square(): assert rectangle_area([0, 0, 1, 1]) == 1.0 def test_large_square(): a...
[ "# -*- coding: utf-8 -*- from unittest import TestCase, TestLoader from radio import", "trying to bound handler that is already bounded. ''' def foo_handler(): pass self.radio.reply('foo',", "TestCase, TestLoader from radio import (Radio, ListenerNotFound, ReplyHandlerAlreadyBound, HandlerAlreadyBound) def init...
[ "<gh_stars>1-10 class APIError(Exception): \"\"\" Base exception for the API app \"\"\" pass class", "Raised when an app tries to override an existing URL regular expression pattern", "app \"\"\" pass class APIResourcePatternError(APIError): \"\"\" Raised when an app tries to override", "an app tries to overr...
[ "def test_lazy_append_access(): reqs = (Request(r.SerializeToString(), EnvelopeProto()) for r in request_generator(random_docs(10))) for r in", "not r.is_used # write access r.train r.index.ClearField('docs') # now it is read assert", "('search', jina_pb2.RequestProto.SearchRequestProto), ('control', jina_pb2.R...
[ "= os.path.abspath( os.path.dirname( __file__ ) ) def Settings( **kwargs ): return { 'interpreter_path':", "sys DIR_OF_THIS_SCRIPT = os.path.abspath( os.path.dirname( __file__ ) ) def Settings( **kwargs ): return", "Settings( **kwargs ): return { 'interpreter_path': sys.executable, 'sys_path': [ os.path.join( D...
[ "Linux\", \"License :: OSI Approved :: Apache 2.0 License\", \"Programming Language :: Python", "description='Utils for the SmartCache project', long_description=\"To do...\", install_requires=open(\"requirements.txt\").read(), classifier=[ \"Operating System :: POSIX", "\"License :: OSI Approved :: Apache 2.0 ...
[ "binary sensors.\"\"\" from __future__ import annotations import logging from pyeight.eight import EightSleep from", "DOMAIN _LOGGER = logging.getLogger(__name__) async def async_setup_platform( hass: HomeAssistant, config: ConfigType, async_add_entities: AddEntitiesCallback,", "sensor.\"\"\" super().__init__(c...
[ "assert request.call_count == 1 assert request.call_args[1]['params'] == params @pytest.mark.usefixtures('db') def test_raises_timeout(mocker): request =", "'https://ravem.test/api/v2/sub/final_endpoint'), ('https://ravem.test/', '', 'https://ravem.test/'), ('https://ravem.test/api/', '', 'https://ravem.test/api/...
[ "import url from .views import OrgView, AddUserAskView, OrgHomeView, OrgCourseView, OrgDescView, OrgTeacherView, AddFavView from", "OrgTeacherView, AddFavView from .views import TeacherListView, TeacherDetailView urlpatterns = [ url(r'^list/$', OrgView.as_view(), name=\"org_list\"),", "OrgHomeView, OrgCourseVie...
[ "from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('filer',", "from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration):", "] operations...
[ "process=agedHFNose(process) return process def customise_aging_3000_ultimate(process): process=ageHcal(process,3000,7.5e34,\"ultimate\") process=turn_off_HE_aging(process) #avoid conflict between HGCal and Hcal", "process.mixData if hasattr(process,'mix') and hasattr(process.mix,'digitizers') and hasattr(process...
[ "in self.parts: remaining_params = body.update_params(remaining_params) if self.worldbody: self.update_initial_position() else: return remaining_params def get_body_names(self):", "self.set_params(new_params) self.update_xml() def get_smallest_z(self): pass def get_param_limits(self): pass def get_param_names(sel...
[ "Any Dependencies From The Service Container ''' self.request = Request def before(self): '''", "import Auth class LoadUserMiddleware: ''' Middleware class which loads the current user into", "loads the current user into the request ''' def __init__(self, Request): ''' Inject", "self.request def after(self): ...
[ "\"Fake Player2\", team=\"blue\") connected_players(player1, player2) self.setup_balance_ratings({(player1, 900), (player2, 799)}) when(self.db).get(any).thenReturn(\"3\") when(self.db).delete(any).thenReturn(None) when(self.db).exists(any).thenReturn(False) when(self.db).incr(any).thenReturn(None)", "801), (play...
[ "appId = '<KEY>' # 9.1. 创建荣联云 实例对象 sdk = SmsSDK(accId, accToken, appId) tid", "9.1. 创建荣联云 实例对象 sdk = SmsSDK(accId, accToken, appId) tid = '1' # 我们发送短信的模板,值", "tid = '1' # 我们发送短信的模板,值 只能是 1 因为我们是测试用户 mobile = '%s' % mobile", "10) # ('变量1', '变量2') 涉及到模板的变量 # 您的验证码为{1},请于{2} 分钟内输入 # 您的验证码为666999,请于5 分钟内输入 # 9.2....
[ "return [] def getFunctionName(): functionname = view.find_by_selector('entity.name.function') functionnamefiltered = [ n for n", "= view.find_by_selector( 'meta.function.parameters.delphi') param_name_region = view.find_by_selector( 'variable.parameter.function.delphi') params_region_filt = [ s for s", "def me...
[ "_createTensorFlowSavedModel(name_scope, save_path): \"\"\"Create a TensorFlow SavedModel for testing. Args: name_scope: Name scope to", "Unless required by applicable law or agreed to in writing, software # distributed", "which to save the model. \"\"\" graph = tf.Graph() with graph.as_default(): with tf.compa...
[ "if not DEFAULTSKIN == '': if os.path.exists(os.path.join(ADDONS, DEFAULTSKIN)): if DIALOG.yesno(AddonTitle, \"[COLOR %s]It seems", "control.loga(\"Invalid Skin Check Start\") DEFAULTSKIN = setting('defaultskin') DEFAULTNAME = setting('defaultskinname') DEFAULTIGNORE = setting('defaultskinignore')", "= skinlist...
[ "seealso:: accessory_driver.publish \"\"\" self.broker.publish(self.value, self, sender_client_addr) # pylint: disable=invalid-name def to_HAP(self): \"\"\"Create a", "\"unit\" PROP_VALID_VALUES = \"ValidValues\" PROP_NUMERIC = (PROP_MAX_VALUE, PROP_MIN_VALUE, PROP_MIN_STEP, PROP_UNIT) class CharacteristicError(E...
[ "dataset_type = 'UNITER_VqaDataset' data_root = '/home/datasets/mix_data/UNITER/VQA/' train_datasets = ['train'] test_datasets = ['minival'] #", "train_batch_size=20480, # 5120, val_batch_size=40960, # 10240, ) BUCKET_SIZE = 8192 train_data = dict(", "val_txt_db=data_root + 'vqa_devval.db', val_img_db=data_root...
[ "from django.conf.urls.static import static from django.contrib import admin from django.urls import path, include,", "from django.contrib import admin from django.urls import path, include, re_path from django.views.generic import", "import settings from django.conf.urls.static import static from django.contri...
[ "7) self.right_layout.addWidget(self.in_smtp_password, 3, 4, 1, 7) self.right_layout.addWidget(self.cb_smtp_ssl, 4, 4, 1, 7) self.right_layout.addWidget(self.in_smtp_test, 5,", "self.tbw_logs.setItem(i, j, item) except: QMessageBox.warning(self, 'Failed!', '資料庫連結失敗!', QMessageBox.Ok) else: db.__disconnect__() def...
[ "is None: # no option specified, default to valid mode self.pad = (0,", "self.filter_size[0], self.filter_size[1]) def get_params(self): return [self.W] + self.get_bias_params() def get_bias_params(self): return [self.b] if", "elif border_mode is None and pad is None: # no option specified, default", "- 1, se...
[ "4. add a post and restrict visibility to followers only c.begin_tx() c.create_node('post') c.set_node_property('type',", "ad.properties assert '25' in ad.properties['age'] assert 'e1' in ad.out_edges print 'Correctly executed 11", "'ad688' in ad.aliases assert 'type' in ad.properties assert 'user' in ad.proper...
[ "set_colored_logger(verbosity_level): class ColoredFormatter(logging.Formatter): def format(self, record): if record.levelname in COL: record.levelname = COLOR_SEQ", "for colored diffs\") print(u'\\n'.join(diff)) except UnicodeDecodeError: print(u\"Only in first\", unicode(sorted_first)) print(u\"Only in second\"...
[ "procfs DIPTBLS = (1 << 5) # iptables DNONLOC = (1 << 6)", "(1 << 10) # Packet mangling DPCAP = (1 << 11) # Pcap", "DDPFV = (1 << 8) # DPF (Dynamic Port Forwarding) Verbose DIPNAT =", "DNFQUEUE: 'NFQUEUE', DGENPKT: 'GENPKT', DGENPKTV: 'GENPKTV', DCB: 'CB', DPROCFS: 'PROCFS', DIPTBLS: 'IPTABLES', DNONLOC:", ...
[ "epochs) with tf.Session() as sess: summary_writer = tf.train.SummaryWriter( sum_dir, sess.graph) sess.run(tf.initialize_all_variables()) steps =", "the model rnn_model = MultiRnn( cell_type, state_size, output_size, batch_size, num_layer, learning_rate, num_steps) #", "for training the model ''' import tensorf...
[ "if all_daemons_healthy(instance, heartbeat_tolerance_seconds=_get_heartbeat_tolerance()): click.echo(\"Daemon healthy\") else: click.echo(\"Daemon not healthy\") sys.exit(1) @click.command( name=\"liveness-check\", help=\"Check", "@click.group( commands={\"heartbeat\": debug_heartbeat_command, \"heartbeat-dump\"...
[ "in Teams(): print(team.name) for player in team.roster.players: print(player.name) for game in team.schedule: print(game.dataframe)", "sys.path.append(os.path.dirname(os.path.dirname(sys.path[0]))) from sportsreference.nfl.teams import Teams for team in Teams(): print(team.name) for player in", "team in Teams(...
[ "0, 0, 1, 0, 0, omega] # parameters of the plane wave ex,", "bx = bx.reshape((nx, ny)) by = by.reshape((nx, ny)) bz = bz.reshape((nx, ny)) ex", "np.linspace(x0, x1, nx) ys = np.linspace(y0, y1, ny) # 2d array of (x,", "0] for x in xs for y in ys ] ) # for", "# lambdas y0 = 0 y1 = 20 # lambdas xs = np.linspa...
[ "batch in tqdm.tqdm(test_aug_gen, desc=\"live augumentations batch\"): xs, ys = batch var_f = predict_func(xs)", "np.save(os.path.join(dn, \"binary_labels.npy\"), labels) np.save(os.path.join(dn, \"uncertainties.npy\"), uncertainties) with open(os.path.join(dn, \"results.txt\"), \"w\") as f: for", "random_state...
[ "fa-list'), ParentItem( label='Generate new JAXid''s', url=f'/{APP_NAME}/manage/id_generate/jaxiddetail/import/', permissions='id_generate.change_jaxiddetail', icon='fa fa-rocket'), ParentItem( label='Generate new Box", "right form_submit_on_right = False # Hide name/\"original\" column for all tabular inlines. #...
[ "pretrained[\"model_weights\"][\"binary_dense_5\"][\"binary_dense_5\"][\"Variable_8:0\"] pret_c9 = pretrained[\"model_weights\"][\"binary_dense_5\"][\"binary_dense_5\"][\"Variable_9:0\"] pret_c10= pretrained[\"model_weights\"][\"binary_dense_5\"][\"binary_dense_5\"][\"Variable_10:0\"] pret_c11= pretrained[\"model_w...
[ "of classifiers (some may be abstract?): # ADTree, AODE, BayesNet, ComplementNaiveBayes, ConjunctiveRule, #", "java(cmd, classpath=_weka_classpath, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # Check if something went wrong: if stderr and", "to find weka.jar! Use config_weka() ' 'or set the WEKAHOME environ...
[ "= df.columns.tolist() for name in xnames: if name == yname: xnames.remove(yname) else: X", "axis=0) # _vars = np.var(data, axis=0) # _maxs = np.max(data, axis=0) # _mins", "output file path :type filename: str :param sep: The fields separator, defaults to", "= X self.Y = Y self.xnames = xnames if xnames else...
[ "16515072 RIGHT = -9004 VSPI = 2 WHITE = 16579836 YELLOW = 16579584", "16564426 PORTRAIT = 0 PORTRAIT_FLIP = 2 PURPLE = 8388736 RED = 16515072", "BMP = 2 BOTTOM = -9004 CENTER = -9003 COLOR_BITS16 = 16 COLOR_BITS24", "= 255 BMP = 2 BOTTOM = -9004 CENTER = -9003 COLOR_BITS16 =", "CYAN = 65535 DARKCYAN = 3289...
[ ".ClustersClient import ClustersClient from .WorkspaceClient import WorkspaceClient from .ScimClient import ScimClient from .LibraryClient", "datetime from cron_descriptor import get_description from .dbclient import dbclient from .JobsClient import JobsClient", "import get_description from .dbclient import dbc...
[ "distributed in the hope that it will be useful, # but WITHOUT ANY", "Copyright (C) 2018 <NAME> # Website: http://www.perryleijten.com # # This program is free", "PURPOSE. See the # GNU General Public License for more details. # #", "either version 3 of the License, or # (at your option) any later", "by # t...
[ "Any, Literal from fritzconnection.core.exceptions import ( FritzActionError, FritzActionFailedError, FritzConnectionException, FritzInternalError, FritzServiceError, ) from", "| None) -> datetime: \"\"\"Calculate uptime with deviation.\"\"\" delta_uptime = utcnow() - timedelta(seconds=seconds_uptime)", "), ) a...
[ "ifc_class, ifc_abstract_class, ifc_fallback_class @ifc_abstract_class class IfcEntity: \"\"\" Generic IFC entity, only for subclassing", "@ifc_class class REAL(IfcScalarValue): pass @ifc_class class BINARY(IfcScalarValue): pass @ifc_class class INTEGER(IfcScalarValue): pass @ifc_class", "__str__(self): return ...
[ "self.STATUS_NORMAL if self.congestion_status is self.STATUS_CONGESTED: if ma_med < self.congestion_await_sustained: self.congestion_status = self.STATUS_BUILDING def", "ma_sma, ma_med, ma_lar, self.congestion_await_sustained)) return self.congestion_status def set_data_caps(self, element, cap): if element in", ...
[ "Run eval after every epoch. # eval_steps=(len(train_dataset) // config[\"per_gpu_train_batch_size\"]) + # 1, #", "Unless required by applicable law or agreed to in writing, software # distributed", "[16, 32, 64], }) reporter = CLIReporter( parameter_columns={ \"weight_decay\": \"w_decay\", \"learning_rate\": \...
[ "# path = encodeString('/dev/null') sock.sendall(bytearray(b'\\x0A')) # HASH request # sock.sendall(bytearray(b'\\x01')) # choose MD5", "# len of path as unsigned short sock.sendall(path) resp = sock.recv(1) # response", "= get_connected_local_socket() path = encodeString('/dev/shm/exampleDir') # path = encodeS...
[ "# Generated by Django 1.11.13 on 2018-09-11 10:05 from __future__ import unicode_literals import", "[ ('investment_report', '0019_auto_20180820_1304'), ] operations = [ migrations.AddField( model_name='contact', name='website_href', field=models.URLField(default='https://invest.great.gov.uk/contact/', help_text=...
[ "assert blosc.set_nthreads(2) == 1 for d in threadpoolctl.threadpool_info(): assert d[\"num_threads\"] == 1, d", "to 1.\"\"\" import numexpr import blosc import threadpoolctl # APIs that return previous", "# APIs that return previous number of threads: assert numexpr.set_num_threads(2) == 1 assert", "blosc im...
[ "= fig.add_subplot(221) plt.pcolormesh(x, y, 10*numpy.log10(StokesI), label=\"I\") #plt.pcolormesh(x, y, StokesI, label=\"I\") plt.colorbar() ax1.set_title('I (dB)')", "<gh_stars>1-10 #!/usr/bin/env python \"\"\"A simple viewer for Stokes patterns based on two far-field", "tvf_p.load_ffe(p_chan_file) tvf_q.load...
[ "os import sys import time import math import torch import torch.nn as nn", "sys.stdout.write(' ') # Go back to the center of the bar. for i", "int(TOTAL_BAR_LENGTH*current/total) rest_len = int(TOTAL_BAR_LENGTH - cur_len) - 1 sys.stdout.write(' [') for i in", "set_lr : set the learning rate - clip_gradient :...
[ "ngrid self._modulus = [(ngrid - 1) ** (ndim - j - 1) for", "(self.ngrid - 1)) if len(vector.shape) > 1: grids = np.empty((len(vector),) + grid_shape) for", "in range(len(vector)): grid[tuple(self.convert_to_grid_idx(idx))] = vector[idx] return grid def convert_to_grid_idx(self, bin_idx): if bin_idx >=", "for...
[]
[ "isinstance(qub, self.supported_qubit_type): raise ValueError( '{} is not a valid qubit for gate {!r}.", "raise ValueError(\"Qubit not part of the device.\") if isinstance(p, GridQubit): return np.sqrt((p.row -", "unknown operation:', op) return op in self.gateset def validate_operation(self, operation: cirq.Op...
[ "if isinstance(col, flex.miller_index): col = col.as_vec3_double() rows.append( [ k, formats.get(k, \"%s\") % col.min(),", "== 1: return \"\" text = [] text.append(\"Experiment / Models\") text.extend(model_connectivity_impl(experiments, \"detector\")) text.extend(model_connectivity_impl(experiments,", "zip(*xy...
[ "SHUFFLE_WITH_PERMUTATIONS = 2 SHUFFLE_WITH_PERMUTATIONS_WITH_FILTERS = 3 SHUFFLE_WITH_UNNAMED = 4 SHUFFLE_LEVELS = { PipelineLayer.MINE:", "{ \"type\": PipelineType.PRODUCER, \"dico\": [\"granulation.name\", \"granulation.process\", \"granulation.product\", \"granulation.capex\", \"granulation.input\"], \"option...
[ "str date : int month : str headline : str category : str", "'pics') desc = models.TextField() price = models.IntegerField() offer = models.BooleanField(default = False) class", "Create your models here. class Destination(models.Model) : name = models.CharField(max_length = 100) img", "Destination(models.Mode...
[ "'textAlign': 'center', 'margin-top': '75px', 'margin-left': '370px', } ), html.Div(id='mon-image'), html.Div(id='ma-zone-resultat') ]) @app.callback(Output('mon-image', 'children'),", "def classify_image(image, model, image_box=None): \"\"\"Classify image by model Parameters ---------- content: image content", ...
[ "requests from django.conf import settings class rakuten: def get_json(self, isbn: str) -> dict:", "!= 200: # if failed return None data = json.loads(r.text) if data['count'] ==", "code status_code = r.status_code if status_code != 200: # if failed return None", "appid=appid) # execute r = requests.get(url) #...
[]
[ "'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, value: Optional[List[\"RoleDefinition\"]] =", "None, operations: Optional[List[\"ProviderOperation\"]] = None, **kwargs ): super(ResourceType, self).__init__(**kwargs) self.name = name self.display_name", "Optional[bool] = None, **kwargs...
[ "return render(request,'school/teacher_view_attendance_page.html',{'cl':cl,'mylist':mylist,'date':date}) else: print('form invalid') return render(request,'school/teacher_view_attendance_ask_date.html',{'cl':cl,'form':form}) @login_required(login_url='teacherlogin') @user_passes_test(is_teacher) def teacher_notice_...
[ "= self.net.bb_regressor self.layer_stride = { 'conv0': 2, 'conv1': 2, 'block0': 4, 'block1': 8,", "to output. net_path: Relative or absolute net path (default should be fine). use_gpu:", "= os.path.join(env_settings().network_path, self.net_path) self.net = SiamMask_ResNet50_base(backbone_pretrained=False, is_...
[ "0 for s in toStateList: if s == state: t1List.append(time1List[indx]) t2List.append(time2List[indx]) sList.append(0.10 +", "axis == 1: self.y1LogScale = v else: self.y2LogScale = v return #--- SetPlot(xbeg,xend,xinc,ybeg,yend,yinc,xtitle,ytitle,title)", "'+str(logOffset)+' add } ifelse }' else: logFlag = 0 v =...
[ "django.db import migrations class Migration(migrations.Migration): dependencies = [ ('exercises', '0002_auto_20161128_1718'), ] operations =", "# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-28 06:53", "2016-11-28 06:53 from __future__ import unicode_literals from django.db import migrations c...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "= r\"^__version__ = ['\\\"]([^'\\\"]*)['\\\"]\" match = re.search(VSRE, version_string_line, re.M) if match: version_string =", "KIND, either expr...
[ "structure here. \"\"\" self.hi = [] self.lo = [] def addNum(self, num: int)", "heappush(self.hi, -heappop(self.lo)) def findMedian(self) -> float: if len(self.hi) > len(self.lo): return self.hi[0] if", "295 find median from data stream hard \"\"\" from heapq import * class", "len(self.lo): return (self.hi[0]...
[ "1.0) ball3 = world.addSphere(0.1499, 0.8, \"steel\") ball3.setPosition(0.6, 0.0, 1.0) ball4 = world.addSphere(0.1499, 0.8,", "= world.addCompliantWire(pin5, 0, np.zeros(3), box, 0, np.zeros(3), 2.0, 200) wire5.setStretchType(raisim.StretchType.BOTH) wire6 = world.addCompliantWire(pin6,", "0.8) pin1.setAppearan...
[ "raise exception.VolumeAttachFailed( volume_id=connection_info['serial'], reason=ex) else: LOG.warning( _LW(\"Failed to attach volume %(connection_info)s \" \"to", "mapping = driver.block_device_info_get_mapping(block_device_info) for vol in mapping: connection_info = vol['connection_info'] volume_driver = self._...
[ "= 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'] loan_groupby=banks.groupby(['Loan_Status'])[columns_to_show] #", "print(big_loan_term) columns_to_show = ['ApplicantIncome', 'Credit_His...
[ "model_dict.update(cap_state_dict) model.load_state_dict(model_dict) optimizer = ScheduledOptim(optim.Adam(filter(lambda x: x.requires_grad, model.parameters()), betas=(0.9, 0.98), eps=1e-09), 512, opt['warm_up_steps'])", "cms_loss /= n_word loss = cms_loss + cap_loss loss.backward() optimizer.step_and_update_lr(...
[ "\"miQdAvNXHiNDVVzPzV5FpkCaR_8qdQ-L1FlPCOXQPI325Kbrh1fgfhkcDUZ4FepaebDdpZ-A1gmtnnjU0_hViA==\" url = \"http://localhost:9999\" client = InfluxDBClient(url=url, token=token, org=org) writeApi = client.write_api() write_api.write(\"my-bucket\",", "token = \"miQdAvNXHiNDVVzPzV5FpkCaR_8qdQ-L1FlPCOXQPI325Kbrh1fgfhkcDUZ...
[ "def test_wrap_long_line(self): class Foobar(object): a = \" \" * 90 output = StringIO()", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "textwrap import dedent try: from unittest.mock import...
[ "def klSigmode(self): \"\"\"查找模式\"\"\" if self.mode == 'deal': self.canvas.updateSig(self.signalsOpen) self.mode = 'dealOpen' else: self.canvas.updateSig(self.signals)", "klSigmode(self): \"\"\"查找模式\"\"\" if self.mode == 'deal': self.canvas.updateSig(self.signalsOpen) self.mode = 'dealOpen' else: self.canvas.upda...
[ "exportSHP) # Convert to B&W road_network = image.copy() road_network[road_network < 254] = 0", "'C', 41, 0) w.field('note', 'C', 32, 0) for i in range(len(simple_ways)): w.line([simple_ways[i]]) w.record('01',", "= [3, 7] elif direction == 3: wrong_paths = [2, 8] elif direction", "= 15, return_simple_ways = ...
[ "mock_input.return_value = '' self.assertEquals(cli.check_input('prompt', default='one'), 'one') mock_input.return_value = 'two' self.assertEquals(cli.check_input('prompt', default='one'), 'two') @patch('builtins.input')", "self.assertEquals(cli.check_input('prompt', default='one'), 'two') @patch('builtins.input'...
[ "= RandomSampler(train_data) self.train_dataloader = DataLoader( train_data, sampler=train_sampler, batch_size=self.batch_size ) validation_data = TensorDataset( self.german_data.validation_inputs,", "= { \"train\": \"./datasets/hasoc_dataset/hasoc_german_train.csv\", \"dev\": \"./datasets/hasoc_dataset/hasoc_ger...
[ "list(range(num_train)) split = int(np.floor(val_size * num_train)) np.random.seed(val_seed) np.random.shuffle(indices) train_idx, valid_idx = indices[split:], indices[:split]", "= data.ConcatDataset( [mnist_test_dataset, AmbiguousMNIST(root=root, train=False, device=device),] ) test_loader = torch.utils.data.Dat...
[ "username/email from request' body = request.get_json() username = body.get(\"username\") email = body.get(\"email\") if", "flasgger import swag_from from http import HTTPStatus from pathlib import Path from sqlalchemy.orm.exc", "from pathlib import Path from sqlalchemy.orm.exc import NoResultFound from vantage...
[ "(example: 'eu-west-1') \"aws_access_key_id\": None, # specify AWS access key (example: '<KEY>') \"aws_secret_access_key\": None,", "service.log(\"middleware after\") return return_value class ExampleAWSSNSSQSService(tomodachi.Service): name = \"example-aws-sns-sqs-service\" log_level = \"INFO\" uuid", "options...
[ "{do_not}.\" print(x) print(y) print(f\"I said: {x}\") print(f\"I also said: '{y}'\") hilarious = False", "{types_of_people} types of people.\" binary = \"binary\" do_not = \"don't\" y = f\"Those", "binary = \"binary\" do_not = \"don't\" y = f\"Those who know {binary} and", "False joke_evaluation = \"Isn't th...
[ "as f: f.write(self.emit()) with open(data_output_path, 'wb') as f: np.save(f, self.data) return code_output_path, data_output_path", "def emit_imports(self): return self.statement('from dlconv.%s import %s\\n' % (self.target, self.net)) def emit_class_def(self, name):", "in self.graph.topologically_sorted(): a...
[ "len(matrix) if rows == 0: return 0 columns = len(matrix[0]) res = 0", "并返回其面积。 \"\"\" from typing import List class Solution: def maximalRectangle(self, matrix: List[List[str]]) ->", "leetcode-85 给定一个仅包含 0 和 1 , 大小为 rows x cols 的二维二进制矩阵, 找出只包含 1", "max(res,self.largestRectangleArea(heights)) def largestRecta...
[ "< 1e-3 # check and assert result def test_get_costs(): \"\"\" Testing a very", "(IEE), Kassel. All rights reserved. import numpy as np import pytest from pandapower.optimal_powerflow", "def test_get_costs(): \"\"\" Testing a very simple network for the resulting cost value", "assert net.res_cost - net.res_sg...
[ "= redis.Redis( host=config.REDIS_HOST, port=config.REDIS_PORT, db=config.REDIS_DB, decode_responses=True, ) # 刷新cookie数量 def cookie_refresh(): while 1:", "red.smembers(config.REDIS_KEY_COOKIE) if len(cookie_list) >= config.COOKIE_COUNT: break cookie_login.run_cookie_login(1) app.logger.info(\"[cookie数量正常]-[%s]\"...
[ "TransientOnline from feemodel.app.pools import PoolsOnlineEstimator from feemodel.app.predict import Prediction from feemodel.app.simonline import SimOnline", "import PoolsOnlineEstimator from feemodel.app.predict import Prediction from feemodel.app.simonline import SimOnline __all__ = [", "feemodel.app.pools ...
[ "import models from djng.forms import NgModelFormMixin, NgFormValidationMixin from djng.styling.bootstrap3.forms import Bootstrap3ModelForm class SubscribeUser(models.Model):", "permit = models.FileField(\"Permit\", blank=True, null=True) class SubscribeForm(NgModelFormMixin, NgFormValidationMixin, Bootstrap3Mode...
[ "distributed on an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY", "add_broadcast_compute(input_a, input_b): \"\"\"Call the add op from topi\"\"\" return topi.add(input_a, input_b) def subtract_broadcast_compute(input_a,", "License for the # specific language governing permissions and limitations #...
[ "\"r\") as f: versions = yaml.safe_load(f.read()) image_info = versions.get(python_version, {}) docker_args = image_info.get(\"docker_args\",", "Docker arguments from this image's versions.yaml, and update with latest Dagster version. Also,", "self._get_last_updated_for_python_version(python_version) tag = pyth...
[ "lang == 'es' and region == 'es': return 'es-419' if lang == 'zh':", "import cros_interface from telemetry.unittest import options_for_unittests class CrOSAutoTest(unittest.TestCase): def setUp(self): options = options_for_unittests.GetCopy()", "self._is_guest = options.browser_type == 'cros-chrome-guest' self....