ngram
listlengths
0
82k
[ "else self.my_string) oprot.writeFieldEnd() if self.my_enum is not None: oprot.writeFieldBegin('my_enum', TType.I32,", "_val13 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 11: if ftype", "None: oprot.writeFieldBegin('my_string_enum_map', TType.MAP, 10) oprot.writeMapBegin(TType.STRING, TType.I32, len(...
[ "str(re.sub('\\n','',line)) def copy_data(source='',target=''): cmd = 'cp '+ mkpath('data/' + source)", "add init_file suitePath = f1[0:f1.rindex( \"/\" )] if os.path.exists(suitePath +", "2 == 0: # f.write('1997,Ford,E350,\"ac, abs, moon\",3000.00,a\\n') # else: #", "test_30_gpload_reuse_table_update_mode_wi...
[ "4 }, # 0. start with 'blank' { 'd': 2,", "}, # 3. 'digit' after 'dot' { 'd': 3 },", "5. 'e' { 'd': 7 }, # 6. 'sign' after", "'digit' after 'dot' (‘blank’ before 'dot') { 's': 6, 'd':", "'e' { ' ': 8 } # 8. end with", "''' 请实现一个函数用来判断字符串是否表示数值(包括整数和小数)。例如,字符串\"+100\"、\"5e2\"、\"-123\"、\"3.1416\"、\"-1E-16\"...
[ "[], u'admin_state_up': True, u'network_id': u'NETWORK1', u'tenant_id': u'TENANTID', u'extra_dhcp_opts': [], u'binding:vif_type':", "u'10.0.0.1', u'cidr': u'10.0.0.0/24', u'id': u'SUBNET1' } SUBNET2_RESPONSE = { u'name':", "Rackspace, Inc. Licensed under the Apache License, Version 2.0 (the", "} ], u'id': u'P...
[ "global brightness global calibration_mode brightness = 500 calibration_mode = False", "def init(): global brightness global calibration_mode brightness = 500 calibration_mode", "init(): global brightness global calibration_mode brightness = 500 calibration_mode =" ]
[ "from django.db.models import Q, F from django.shortcuts import render from", "+ 1, uv=F('uv') + 1) elif increase_pv: Post.objects.filter(pk=self.object.id).update(pv=F('pv') + 1)", "class IndexView(CommonViewMinxin, ListView): queryset = Post.latest_posts() paginate_by = 5 context_object_name", "1, 1*60) #1分...
[ "coding: utf-8 -*- \"\"\" Created on Sat May 7 11:38:18", "Created on Sat May 7 11:38:18 2016 @author: thomasbarillot VMI", "<reponame>thomasbarillot/DAQ # -*- coding: utf-8 -*- \"\"\" Created on Sat", "import pyplot as plt #%% b=np.reshape(a,[400,400]) print b plt.figure() plt.pcolor(np.reshape(a,[400,400]))...
[ "= Executable('./config') config('--prefix=%s' % prefix, '--openssldir=%s' % join_path(prefix, 'etc', 'openssl'),", "* import spack.architecture import os class Openssl(Package): # Uses Fake", "must remain http:// so Spack can bootstrap curl url =", "them. filter_file(r'-arch x86_64', '', 'Makefile') make() i...
[ "create a new profiler based on caller's qualname. \"\"\" if", "len(cls._profilers) == 0)): return cls._disabled_profiler # determine the qualified name", "1 new_time = ptime.time() elapsed = (new_time - self._last_time) *", "License. See LICENSE.txt for more info. # Adapted from PyQtGraph", "(ptime.time() ...
[ "test_extract_user_id_configure_by_user_class(self): user = User() user.USERNAME_FIELD = 'email' user.email = 'test_email'", "field\"\"\" settings.SAML_IDP_DJANGO_USERNAME_FIELD = 'first_name' user = User() user.first_name = 'test_first_name'", "get_user_model() class TestBaseProcessor: def test_extract_user_id...
[ "class Node: def __init__(self, data): self.data = data self.prev =", "False while temp_head is not None: if temp_head.data == ele:", "contains(self, ele): temp_head = self.head while temp_head is not None:", "self.next = None class SingleLinkedList: def __init__(self): self.head = None", "temp_head.next br...
[]
[ "be fetched.\"\"\" index: Index url: str page: int output: str", "this index for a given url.\"\"\" index: Index url: str", "datetime import datetime from typing import Any, List, Optional, Union", "strings warc_request_meta: Optional[str] response_header: Optional[str] class Result(BaseModel): url_key: str =...
[ ") if exc_type and isinstance(exc_value, EnvironmentError): _errno = exc_value.errno fserror", "# pragma: no cover fserror = errors.ResourceLocked reraise( fserror, fserror(", "to FS Errors. \"\"\" FILE_ERRORS = { 64: errors.RemoteConnectionError, #", "self._directory else self.FILE_ERRORS ) if exc_type and i...
[ "'%s' is connected to the Controller\" % nodeName) else: print", "permission. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS", "ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,", "result = vrouter.get_cfg() status = result.get_status() if(status.eq(STATUS.OK)): print (\"'%s' configurati...
[ "is not None: item=str(json.dumps(parsed_json)) print(item) #client.publish(\"message\",item) client.publish(\"detection\",item) else: throw('Not correct", "on_connect(client, userdata, rc): print(\"Connected to MQTT-broker on \" + MQTT_BROKER", "not None: percent=faceDetection.getDifference(_image1,_image2) pr...
[ "= sum(A) m = float('inf') left_sum = 0 for n", "n in A[:-1]: left_sum += n v = abs(total -", "m = float('inf') left_sum = 0 for n in A[:-1]:", "abs(total - 2*left_sum) if v < m: m = v", "n v = abs(total - 2*left_sum) if v < m:", "0 for n in A[:-1]: left_sum += n v =", "- 2*left_sum) if v < m: m = v ret...
[ "str(pep_number) pep_number_string = re.sub(r'^0+', '', pep_number_string) pep_page.title = pep_content['title'] pep_page.content", "used as the directory index, but it's also an actual", "display purposes pep_number_string = str(pep_number) pep_number_string = re.sub(r'^0+', '', pep_number_string)", "path=\"...
[]
[ "import Flask app = Flask(__name__, static_folder='static') from app import routes", "from flask import Flask app = Flask(__name__, static_folder='static') from app", "flask import Flask app = Flask(__name__, static_folder='static') from app import" ]
[ "\"+hexstr+\"\\nExpected: \"+expected) b = capdu.to_bytes() assert(type(b) is bytes) return (hexstr,", "+= \"0000\" else: hexstr += \"%04X\"%LE elif LE == 0x10000:", "P2=0x33)) check(\"00 11 22 33\", CAPDU(CLA=0x00, INS=0x11, P1=0x22, P2=0x33)) check(\"0x00,0x11,0x22,0x33\",", "tolerate less well formed input...
[ "shuffle \"\"\" cpu_periodogram = list() for iter in range(n_runs): \"\"\"", "available #run parallell execution try: out = pool.map_async(_gls_instance_Ndim_bootstrapping, n_runs).get(1./.0001) pool.terminate()", "for j in range(len(out_spectra)): bootstrapping_stats.append(out_spectra[j]) return bootstrapping...
[ "constants used by the device manager Author: - <NAME> (<EMAIL>", "sent to Index Builder number_of_comps = 10 # number of", "\"\"\" number_of_rows = 3 # total number rows of Index", "5 # number of links to be sent to Crawler", "number of chunks to be sent to Index Builder number_of_comps", "= 10 # number ...
[ "but it depends on the image so I made it", "is found by the author # modify if not the", "eps /= 255 d = DoG(image, size, sigma, k, gamma)", "out if this is not needed XDoG_config['gamma'] += 0.01 *", "k=2.5, gamma=0.97 ) def gen_xdog_image(src, dst): gray = cv2.imread(src, cv2.IMREAD_GRAYSCALE)", "= cv2...
[ "TF example files (can be a glob or comma separated).\")", "2.0 (the \"License\"); # you may not use this file", "to use.\") # This is a handy little utility so", "the perplexities to TPU class gcloudwriter(): def __init__(self, gcloud_name): assert", "= bucket.blob(blob_name) def __enter__(self): self.temp...
[ "= bo.time_overhead results[\"X\"] = [x.tolist() for x in bo.X] results[\"y\"]", "cov_amp = 2 n_dims = lower.shape[0] initial_ls = np.ones([n_dims]) exp_kernel", "space num_iterations: int The number of iterations (initial design +", "from robo.maximizers.random_sampling import RandomSampling from robo.maximi...
[ "3.1.13 on 2021-10-29 11:07 from django.db import migrations, models class", "= [ ('app', '0095_bisericapage_utitle'), ] operations = [ migrations.AddField( model_name='bisericapage',", "11:07 from django.db import migrations, models class Migration(migrations.Migration): dependencies =", "models class Migrat...
[ "import Base from app.extensions import db class MMSSurfaceBulkSampleActivity(Base): __tablename__ =", "primary_key=True) messageid = db.Column(db.Integer, db.ForeignKey('mms_now_submissions.application.messageid')) mms_cid = db.Column(db.Integer) type =", "db.Column(db.Numeric(14, 2)) timbervolume = db.Column(...
[ "get_state(self): return map_to_state(await self._send_command(self._command, 255)) async def set_state(self, state: RemoteControlLock):", "set_state(self, state: RemoteControlLock): return map_to_state(await self._send_command(self._command, state.value)) def on(self): return", "self._send_command(self._comman...
[ "class PowerOf2: def start(self): number=int(sys.argv[1]) print(number) for i in Utility().powerof2(number):", "from com.bridgelabz.utility.Utility import Utility class PowerOf2: def start(self): number=int(sys.argv[1]) print(number)", "start(self): number=int(sys.argv[1]) print(number) for i in Utility().power...
[ "web_scraper.search_for_jobs(soup, last_scrape_date, driver) print(\"Scraping finished. Updating and saving Excel workbook.\",", "# by checking the date of the first job in", "\"//Job_Openings.xlsx\" print(\"-\" * 75, \"-\" * 75, \"\\n\\t\\t\\t\\t\\t\\t\\t JOB WEB", "+ '//Workbooks' + \"//Job_Openings.xlsx\" ...
[ "to use for the given filename\"\"\" return filename.replace(\"/\", \"_\").replace(\".\", \"_\").upper()", "index in the range [1, num_blocks].\"\"\" for block in range(1,", "blocks to break classes into.\"\"\" num_blocks = len(separators) + 1", "and n <= num_blocks return [decoder for decoder in decoders", ...
[ "list) -> np.array: \"\"\" Loads a mnist image from the", "-> np.array: \"\"\" Loads a image in the human-readable format.", "file: for j in range(num_images): line_arr = file.readline().split(\",\") targets_array[j] =", "numpy array. \"\"\" images = np.zeros((len(img_nums), *shape), dtype=float) for idx,", ...
[ "= QLabel(self.frame) self.label.setObjectName(u\"label\") self.label.setGeometry(QRect(0, 0, 720, 425)) self.label.setLineWidth(0) self.label.setPixmap(QPixmap(u\"img/SS_logo.jpg\")) self.label.setIndent(0)", "self.label.setGeometry(QRect(0, 0, 720, 425)) self.label.setLineWidth(0) self.label.setPixmap(QPixmap(u...
[ "as a column Notes ----- This function is deprecated in", "return True else: return False def get_table(self, table_name): return self.meta.tables.get(table_name)", "'mysql': warnings.warn(_MYSQL_WARNING, FutureWarning) return PandasSQLLegacy(con, flavor, is_cursor=is_cursor) except ImportError: if", "np.date...
[ "0, len(s) - 1 while tail >= 0 and s[tail]", "== ' ': tail -= 1 while tail >= 0", "\"\"\" :type s: str :rtype: int \"\"\" cnt, tail =", "<filename>Dataset/Leetcode/train/58/28.py class Solution: def XXX(self, s): \"\"\" :type s: str", "!= ' ': cnt += 1 tail -= 1 return", "cnt, tail = 0, len(s) - 1 while t...
[ "class bases - tuple[type, ...] A tuple of classes to", "object.\"\"\" return object.__publics__ def get_privates(object: Object) -> Dictionary: \"\"\"Gets the", "else: # Adds attributes to __privates__ if name.startswith(\"__\"): self.__privates__[name] =", "Adds attributes to __privates__ if name.startswith...
[ "result={ \"amt\": amount, \"bank_id\": bank.ccf_id, \"dst\": transaction[\"dst\"], \"dst_country\": transaction[\"dst_country\"], \"src\":", "e[\"code\"] == infra.jsonrpc.ErrorCode.INVALID_PARAMS.value, ) # get from flagged txs, try", "user_data = {{ privileges = {{ REGISTER_REGULATORS = true, REGISTER_BANKS",...
[ "In particular, if only one external field should be present", "m_vals is a list of scalar values containing, for each", "H_ext_list: list of 3-vectors List of external fields, where each", "at which a relaxation is performed and m_vals is a", "H = Zeeman((0, 0, 0)) sim.add(H) # We keep track", "fun(sim) ...
[ "gradient.setColorAt(1.0, QtGui.QColor(136, 136, 136)) brush = QtGui.QBrush(gradient) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)", "0.3, fy: -0.4,\\n\" \" radius: 1.35, stop: 0 #fff, stop:", "_translate(\"MainWindow\", \"md5\")) self.Algorithms.setItemText(3, _translate(\"MainWindow...
[ "by Django 3.0.2 on 2020-03-17 08:44 from django.db import migrations,", "2020-03-17 08:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies", "migrations, models class Migration(migrations.Migration): dependencies = [ ('myApp', '0016_usergroup_buyer'), ]", "name='Ch...
[ "permissions and # limitations under the License. \"\"\"Controllers for miscellaneous", "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "License. \"\"\"Controllers for miscellaneous services.\"\"\" __author__ = '<NAME>' import base64", "# # Licensed under the Apache Lic...
[ "key prefix :rtype: str :return: ssh key prefix \"\"\" return", "delete=False) f.close() try: subprocess.check_call( ['openssl', 'req', '-new', '-nodes', '-x509', '-newkey',", "file :param dict config: configuration dict :rtype: str :return: sha1", "LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR ...
[ "False KEEP_PROB = 1.0 SHOW_SCORE_THRSHOLD = 0.6 # only show", "RPN_TOP_K_NMS_TEST = 6000 RPN_MAXIMUM_PROPOSAL_TEST = 1000 # -------------------------------------------Fast-RCNN config ROI_SIZE", "show in tensorboard FAST_RCNN_NMS_IOU_THRESHOLD = 0.5 # 0.6 FAST_RCNN_NMS_MAX_BOXES_PER_CLASS =", "tensorflow as ...
[ "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "self.assertRaises(exceptions.ConcurrentAppendException, lambda: self._raise_concurrent_exception(e)) def test_capture_concurrent_delete_read_exception(self): e = self.spark._jvm.io.delta.exceptions.ConcurrentDeleteReadExcepti...
[ "no of columns\")) matrix=[] print(\"Enter the enteries\") for i in", "print(\"same\") else: print(\"not same\") print(\"Enter the 1st matrix\") first_matrix =", "def matrix_form(): r = int(input(\"Enter the no of rows\")) c", "c = int(input(\"Enter the no of columns\")) matrix=[] print(\"Enter the", "r = i...
[ "length = len(Y) U = [cid] * length else: X", "s3 = session.resource('s3') s3 = boto3.client ('s3') s3.download_file('for-ndar',os.path.join(\"metadata/\", subject +", "0 for cell in Cells: print(cell) cell_size=0 cell_ids = []", "from keras.models import Model from keras import backend as K", "cell_ids: ci...
[ "r0 def d2kepler_dchi2(chi, alpha, r0, vr0, mu, dt): ''' Second", "before breaking :return: (km) final position 3-vector, (km/s) final velocity", "anomaly, modified for use in numerical solvers. ''' z =", "f(E, e, Me)/fp(E, e) iters = 0 while abs(ratio) >", "velocity magnitude vr0 = np.dot(v_0, r_0)/r0 # (k...
[ "'PGAA setup with XYZOmega sample table' group = 'basic' sysconfig", "'pilz', 'detector', 'collimation', ] devices = dict( mcasink = device('nicos_mlz.pgaa.devices.MCASink',", "settypes = {'point'}, detectors = ['_60p', 'LEGe'], ), chnsink =", "includes = [ 'system', 'reactor', 'nl4b', 'pressure', 'sampletabl...
[ "_test_pool3d(relay.nn.avg_pool3d, padding=(2, 0, 0, 2, 0, 0), out_shape=(1, 3, 18,", "y = opfunc(x, pool_size=(2, 2, 2), strides=(2, 2, 2), padding=padding)", "\"int8\")) y = relay.nn.conv2d(x, w, out_dtype=\"int32\") assert \"out_dtype=\\\"int32\\\"\" in y.astext()", "\"sp\", [8, 1]], \\ [\"tile_ow\", \"sp\...
[ "Unicode: 4\", unescaped_token) def test_list_to_index_dict(self): lst = [\"test\", \"strings\"] d", "self._init_subtokenizer(vocab_list) s = \"testing 123\" encoded_list = subtokenizer.encode(s) self.assertEqual([1, 2,", "# testing 123 decoded_str = subtokenizer.decode(encoded_list) self.assertEqual(\"testing ...
[]
[ "for openstack snapshot data\"\"\" def __init__(self, data): self.data = data['snapshot']", "= SnapshotData(self.show()) return self._snapshot_obj def show(self): return self.plugin.cinder.show_snapshot(self.source_id) def delete(self):", "is not None: return self._snapshot_obj self._snapshot_obj = SnapshotData...
[ "secrets from the lsass.exe memory It does not work if:", "# -*- coding: utf-8 -*- # Thanks to @skelsec for", "access \"\"\" def __init__(self): ModuleInfo.__init__(self, 'pypykatz', 'windows', system_module=True) def run(self):", "hash for data in user.get('msv_creds', []): if data['username']: login =", "...
[ "\"\"\"Test standard Discogs position 12.2.9#4: \"multiple CDs\".\"\"\" release = self._make_release_from_positions(['1-1',", "release.data['tracklist'][1]['title'] = 'TRACK GROUP TITLE' release.data['tracklist'][1]['sub_tracks'] = [ self._make_track('TITLE ONE',", "self.assertEqual(d.mediums, 2) self.assertEqu...
[ "self @return item at front of self.stack\"\"\" def front(self): front", "@return dequeued item that was dequeued\"\"\" def get(self): self.rotate(1) dequeued", "front of self @return item at front of self.stack\"\"\" def", "dequeued \"\"\"Rotates the queue {@code rotation} times @param rotation number", "t...
[ "width, in_dim, out_dim) # TODO: Add check for Theano dim", "in_dim, out_dim) # TODO: Add check for Theano dim ordering.", "#print('mylist is ', mylist, 'the from_ is ', from_, 'node", "= node # start here prev_output = node.name prev_layer_filters =", "fallback = 1) op = 'DepthwiseConv2dNative' size = sec....
[ "+ '-' + self.artist + '-' + self.genre class Song(models.Model):", "on_delete=models.CASCADE, null=True) song_title = models.CharField(max_length=250) audio_file = models.FileField(default='') song_visibility =", "+ '-' + self.genre class Song(models.Model): user = models.ForeignKey(User, default=1,on_delete=m...
[ "= cur_end_unixtime + 60 #to prevent duplicates count = count", "df_tmp.columns = ['Time', 'Open', 'Close', 'High', 'Low', 'Volume'] #df.set_index('Time') df", "10 requests per minute df = df.sort_values(by = ['Time']) return", "json import os.path import time import MySQLdb as M from", "df def main(): db =...
[ "appropriate topic prefix would be, and how frequently Kafka #", "configures the Kafka Connect connector\"\"\" logging.debug(\"Creating or updating kafka connect", "was given resp.raise_for_status() logging.info(\"-------Connector created successfully-------\") if __name__ == \"__main__\":", "configure_connec...
[ "# store KNN word info if knn_dict: sentence.tgt_lang = tgt_lang", "model, iseval): \"\"\"Torchify a single example.\"\"\" words = ['!{}_{}'.format(ex.language, w)", "for w in ex.words] words = [model.word_dict[w] for w in", "f: data = json.load(f) knn_dict = None if knn_file: with", "return vectorize(self....
[ "except ImportError: # without Cython module_src = \"cgranges/python/cgranges.c\" def build(setup_kwargs):", "Extension cmdclass = {} try: # with Cython from Cython.Build", "import build_ext cmdclass[\"build_ext\"] = build_ext module_src = \"cgranges/python/cgranges.pyx\" except ImportError:", "is mandatory i...
[ "<filename>icarus/models/service/__init__.py<gh_stars>1-10 # -*- coding: utf-8 -*- from .compSpot import *" ]
[ ">= self.new_length: offset = random.randint(0, average_duration - self.new_length) # No", "'triple_jump', 'tying_bow_tie', 'tying_knot_-not_on_a_tie-', 'tying_tie', 'unboxing', 'unloading_truck', 'using_computer', 'using_remote_controller_-not_gaming-', 'using_segway', 'vault',", "'riding_camel', 'riding_eleph...
[ "not isinstance(other, FutureContract): return False return (self.ticker, self.exp_date, self.data) ==", "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "isinstance(other, FutureContract): return False return (self.ticker, self.exp_date, self.data) == (other.ticker,", "...
[ "parent = pecan.request.path.split('/')[:-1][-1] if parent != \"action_plans\": raise exception.HTTPNotFound expand", "kwargs.get('strategy_id', wtypes.Unset)) fields.append('strategy_name') setattr(self, 'strategy_name', kwargs.get('strategy_id', wtypes.Unset)) @staticmethod def _convert_with_links(action_plan,"...
[ "**options) @albums.route('/albums') def albums_route(): options = { \"edit\": False }", "albums = Blueprint('albums', __name__, template_folder='templates') @albums.route('/albums/edit') def albums_edit_route(): options =", "* albums = Blueprint('albums', __name__, template_folder='templates') @albums.route('/...
[ "from dfirtrack_main.models import Division class DivisionList(LoginRequiredMixin, ListView): login_url = '/login'", "division = self.get_object() form = self.form_class(request.POST, instance=division) if form.is_valid(): division", "return render(request, self.template_name, {'form': form}) def post(self, req...
[ "help='choose a model: TextCNN') parser.add_argument('--embedding', default='pre_trained', type=str, help='random or pre_trained')", "# train config.n_vocab = len(vocab) model = x.Model().to(config.device) init_network(model) print(model.parameters)", "np.random.seed(1) torch.manual_seed(1) torch.cuda.manual_se...
[ "def test_can_confirm_submission(speaker_client, accepted_submission): response = speaker_client.get(accepted_submission.urls.confirm, follow=True) accepted_submission.refresh_from_db() assert response.status_code", "response = other_speaker_client.post( rejected_submission.urls.user_base, follow=True, data=data ...
[ "SLAVE_ADDR_REG = 2 CS_REG = 3 MB_MAX_WRITE_REGNUM = 123 MB_MAX_READ_REGNUM", "LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A", "mb_bsp.get_error_count() print() print('master_parity_err_count = ', error_tuple[0][0]) print('master_start_bit_err_count = ', error_tuple[0][1])", "size mb_bsp.write...
[ "ndb.IntegerProperty() status = ndb.StringProperty() status_string = ndb.StringProperty() def as_dict(self): result", "result['tags'] = [t for t in self.tags] result['is_answered'] = self.is_answered", "result def update_to_stackexchange_question(self, stackexchange_question): updated = False if stackexchange_q...
[ "while time.clock() - start < busyTime: pass time.sleep(busyTime / 1000)", "= 10 idleTime = busyTime while True: start = time.clock()", "UTF-8 -*- import time busyTime = 10 idleTime = busyTime", "True: start = time.clock() while time.clock() - start < busyTime:", "-*- import time busyTime = 10 idleTime = bu...
[ "are not saved to the backend self.optional_fields = [\"template_id\", \"layergroupid\",", "'metadata'] super(AnonymousMap, self).__init__(auth_client) def instantiate(self, params): \"\"\" Allows you to", "instance :param auth_client: Auth client \"\"\" super(BaseMap, self).__init__(auth_client) def get_tile_u...
[ "= KVClient(1, \"127.0.0.1\", 3456) kvSlave.start() if __name__ == \"__main__\": main()", "kvSlave = KVClient(1, \"127.0.0.1\", 3456) kvSlave.start() if __name__ == \"__main__\":", "from kv_client.kv_client import KVClient def main(): kvSlave = KVClient(1, \"127.0.0.1\",", "def main(): kvSlave = KVClient(1, \...
[ "1) self.input = torch.tensor(numpy.random.randint(0, embeddingbags, input_size), device=device).long() offsets = torch.LongTensor([offset],", "dim, mode, input_size, offset, sparse, include_last_offset, device): self.embedding = torch.nn.EmbeddingBag(", "init(self, embeddingbags, dim, mode, input_size, offset,...
[ "to sample in each batch. dist : tensor Pre-allocated tensor", "procedure keeps picking an unmarked vertex and matching it with", "int The number of points to sample in each batch.", "option for `unique` # function in backend for efficiency. if", "shape (N, ) for to-sample distance. start_idx : tensor of", ...
[ "self.metadata['sha1-timestamp'] = datetime.now().timestamp() return result else: return self.metadata['sha1'] def sha256(self,", "str(dst_path)) def __calc_hash__(self, h, buffer_size: int = 131072): if not", "getmtime(str(self.path)) if require_update \\ or 'sha256' not in self.metadata \\", "self.init_meta...
[ "import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import tensor_util", "of (gradient, variable) pairs. Variable is always present, but gradient", "this may mean that scopes intended to catch # `variable`", "grads = [ clip_ops.clip_by_value(g, -self.clipvalue, self.cli...
[ "import requests headers = { 'content-type': 'application/json', 'Authorization': 'Token <PASSWORD>'", "= 'http://127.0.0.1:8000/api/v2/avaliacoes' resultado = requests.get(url=url_base_cursos, headers=headers) assert resultado.status_code == 200", "'content-type': 'application/json', 'Authorization': 'Token <P...
[ "get_crs(api): tested_crs = \"CRS-2021-1\" resp = api.get(\"wafcrs?name=\" + tested_crs) if", "in waf_policy_obj[\"pre_crs_groups\"]: if pre_crs[\"name\"] == \"VDI_409_ENFORCE_XML\": pre_crs[\"rules\"] = xml_rule pre_crs[\"enable\"]", "waf_policy_obj[\"whitelist\"][\"rules\"].append(allowlist_rule) def get_id_f...
[ "= ResourceType.get_attributes_mapping(pc) assert attributes_mapping == {} @pytest.mark.parametrize( \"dep_chain,expected\", [ (", "(False, \"/category,5/\", \"category_id\", 5), (True, \"/department,3440/department,3443/\", \"parent_id\", 3443), (False, \"/department,3440/department,3443/\",", "pytest.mark.dja...
[ "<filename>votesim/benchmarks/__init__.py # from votesim.benchmarks.benchrunner import ( # run_benchmark, # get_benchmarks,", "import ( # run_benchmark, # get_benchmarks, # post_benchmark, # plot_benchmark,", "post_benchmark, # plot_benchmark, # ) from votesim.benchmarks import runtools, simple", "# from vote...
[ "in csv_data: # datestr = row[0] #.replace('/', '-') # #", "os.environ[\"host\"] port = os.environ[\"port\"] user = os.environ[\"user\"] password = os.environ[\"pass\"]", "all_lines = [line for line in csv_data] # print(data) #", "print(datestr) # date_obj = datetime.strptime(datestr, '%d/%m/%Y %H:%M') # # pr...
[ "# and/or other materials provided with the distribution. # #", "ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,", "must reproduce the above copyright notice, # this list of", "above copyright notice, # this list of conditions and the", "# # Redistribution and use in source and binary form...
[ "FROM items WHERE name LIKE %s AND price = %s;\"\"\"", "%s, created_by = %s WHERE item_id= %s \"\"\" self.cur.execute( query,", "the databas and returns them''' model = ModelSetup() self.conn =", "of the items section''' def __init__( self, name=None, price=None, quantity=None,", "self.name = name self.pric...
[ "'</a>') # Append a plural suffix. if node.attributes['is_plural']: self.body.append(self.starttag(node, 'span',", "self.body.append(self.starttag(node, 'code', suffix='', CLASS='docutils literal javadoc')) self.body.append(self.starttag(node, 'a', suffix='', CLASS='reference", "text).replace('$', '.') else: # ...
[ "Base(object): def __init__(self, manager, interval, *locks): self.manager = manager self.storage", "LICENSE file. import time from feaas import storage class Base(object):", "the LICENSE file. import time from feaas import storage class", "__init__(self, manager, interval, *locks): self.manager = manager sel...
[ "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "# # Licensed under the Apache License, Version 2.0 (the", "compliance with the License. # You may obtain a copy", "an \"AS IS\" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF", "2.0 (the \"License\"); # you may not use th...
[]
[ "params[1] padding = params[2] output_size = (int((last_z.shape[2]-pooling[0]+2*padding[0])/stride[0]+1), \\ int((last_z.shape[3]-pooling[0]+2*padding[0])/stride[0]+1)) dLoss_dz", "in key1 or 'None' in value1: print('Not completed for '+key+'", "add_nodes(u[0]) if hasattr(var, 'saved_tensors'): for t in var.sav...
[ "module (:obj:`torch.nn.Module`): 模型 Examples:: >>> pgd = PGD(module) >>> K", "= self.project(name, param.data, epsilon) def restore(self, emb_name='emb.'): # emb_name这个参数要换成你模型中embedding的参数名 for", "epsilon * r / torch.norm(r) return self.emb_backup[param_name] + r def", ">>> if t != K-1: >>> optimizer.zero_g...
[ "forward( source, driving_resized, kp_source, kp_driving_initial, generator, kp_detector, relative=opt.relative, adapt_scale=opt.adapt_scale, cpu=opt.cpu", "OcclusionAwareGenerator from modules.keypoint_detector import KPDetector from sync_batchnorm import DataParallelWithCallback #from", ":3] source = torch.te...
[ "# 3. impelement SAA # to do list # 1.", "approximation does not converge well, even without variance, does not", "from .costFunctionalConstantMultiPDE import CostFunctionalConstantMultiPDE from .costFunctionalLinear import CostFunctionalLinear from .costFunctionalLinearMultiPDE", "different design # 2. table...
[ "contrast_limit=0.5, brightness_by_max=True,p=0.5), HueSaturationValue(hue_shift_limit=30, sat_shift_limit=30, val_shift_limit=0, p=0.5), CoarseDropout(max_holes=2, max_height=config['input_resolution'][0]//4, max_width=config['input_resolution'][1]//4, min_holes=1,", "CenterCrop, RandomBrightnessContrast, HueSat...
[ "left(self): return min(self.start.x, self.end.x) @property def ineye(self): return max(self.start.z, self.end.z)", "x self.y = y self.z = z self.rid = rid", "cuboid and the operation is successful then this cuboid is", "is Up/Down from this if self.left == other.left and self.width", "intersects or not Ret...
[ "that is provided in the request that means if you", "on the system from PIL import Image # pillow, this", "the details of that won't change # unless you do", "creating objects # in an API. recipe = Recipe.objects.get(id=res.data['id']) #", "to simulate the list view in our serializer self.assertEqual(res.s...
[ "# Assignment 2 day 8 # you need to develop", "# any kind of function you want to build def", "8 # write a decorator function for taking input for", "it and handlethe subsequent errorusing Exception Handling try: f=open(\"abc.txt\",\"r\"); f.write(\"Heyy,", "input for you # any kind of function you want", ...
[ "2D coordinate frame. Parameters ---------- axes_order : tuple of int", "of this frame. \"\"\" def __init__(self, axes_order=(0, 1), unit=(u.pix, u.pix),", "in self.frames: fargs = [args[i] for i in frame.axes_order] print(frame,", "self.__class__.__name__ else: self._name = name if reference_position is not ...
[ "the locator item in item list (you can unfold it", "Attached item will show up under the locator item in", "def isRotationConstraint(self): \"\"\" Tests if this is rotation constraint. Returns", "constraint offset vector. Returns ------- modo.Vector3 \"\"\" x = self._item.channel('offset.X').get()", "class...