ngram
listlengths
0
67.8k
[ "my_32bit_int - my_64bit_int - my_double - my_string - my_binary - my_string_string_map - my_string_enum_map", "not None: oprot.writeFieldBegin('my_byte', TType.BYTE, 2) oprot.writeByte(self.my_byte) oprot.writeFieldEnd() if self.my_16bit_int is not None: oprot.writeFieldBegin('my_16bit_int',", "9: if ftype == ...
[ "copy_data('external_file_08.txt','data_file.txt') write_config_file(mode='update',reuse_flag='false',fast_match='true',file='data_file.txt') self.doTest(32) def test_33_gpload_reuse_table_merge_mode_with_fast_match_and_external_schema(self): \"33 gpload update mode with fast match and", "psql -d reuse_gptest -c ...
[ "'dot' { 'd': 3 }, # 4. 'digit' after 'dot' (‘blank’ before 'dot')", "'d': 7, ' ': 8 }, # 7. 'digit' after 'e' { '", "3. 'digit' after 'dot' { 'd': 3 }, # 4. 'digit' after 'dot'", "{ 'd': 7 }, # 6. 'sign' after 'e' { 'd': 7, '", "'e': 5, ' ': 8 }, # 3. 'digit' after 'dot' { 'd':", "8. end with 'blank' ] p...
[ "u'start': u'192.168.27.3', u'end': u'192.168.27.254' } ], u'host_routes': [], u'ip_version': 4, u'gateway_ip': u'192.168.27.2', u'cidr':", "= neutron_exceptions.NeutronException() self.neutron_client_mock.side_effect = exc self.assertRaises(self.provider.NetworkProviderException, self.provider._get_neutron_clien...
[]
[ "tag, 'post_list': post_list, 'sidebars': SideBar.get_all(), } context.update(Category.get_navs()) return render(request, 'blog/list.html', context=context) def post_detail(request,", "post_list, category=Post.get_by_category(category_id) else: post_list = Post.latest_posts() context = { 'category': category, 'ta...
[ "May 7 11:38:18 2016 @author: thomasbarillot VMI control \"\"\" from ctypes import cdll", "#%% print test.GetFilename() #%% test.setFilename('20161115_1841.dat') print test.GetFilename() #%% test.StartAcquisitionPrev() #%% test.StopAcquisition() #%% img=test.RecallImagePrev()", "\"\"\" from ctypes import cdll #...
[ "version('1.0.1h', sha256='9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093') version('1.0.1e', sha256='f74f15e8c8ff11aa3d5bb5f276d202ec18d7246e95f961db76054199c69c1ae3') variant('systemcerts', default=True, description='Use system certificates') depends_on('zlib') depends_on('perl@5.14.0:', type=('...
[ "message list if no parent profiler. \"\"\" if self._finished or self.disable: return self._finished", "%0.4f ms\", self._name, (ptime.time() - self._firstTime) * 1000) type(self)._depth -= 1 if self._depth", "method qualifier = caller_object_type.__name__ func_qualname = qualifier + \".\" + caller_frame.f_code...
[ "user.USERNAME_FIELD = 'email' user.email = 'test_email' assert BaseProcessor('entity-id').get_user_id(user) == 'test_email' def test_extract_user_id_configure_by_settings(self, settings):", "settings.SAML_IDP_DJANGO_USERNAME_FIELD = 'first_name' user = User() user.first_name = 'test_first_name' assert BaseProces...
[ "== ele: is_node_deleted = True prev_node.next = temp_head.next break prev_node = temp_head temp_head", "None: if temp_head.data == ele: is_node_deleted = True prev_node.next = temp_head.next break prev_node", "= self.head while temp_head.next is not None: temp_head = temp_head.next; temp_head.next = new_node;"...
[]
[ "response_header: Optional[str] class Result(BaseModel): url_key: str = Field(alias=\"urlkey\") timestamp: datetime url: str mime:", "Field(alias=\"urlkey\") timestamp: datetime url: str mime: str mime_detected: str = Field(alias=\"mime-detected\") status: int", "pages in this index for a given url.\"\"\" index...
[ "errors.OperationFailed) if _errno == errno.EACCES and sys.platform == \"win32\": if getattr(exc_value, 'args', None)", "errors.ResourceNotFound, errno.ESRCH: errors.ResourceNotFound, errno.ENOTEMPTY: errors.DirectoryNotEmpty, errno.EEXIST: errors.FileExists, 183: errors.DirectoryExists, #errno.ENOTDIR: errors.Di...
[ "and the following disclaimer in the documentation # and/or other materials provided with", "%s\" % status.brief()) exit(0) print (\"\\n\") print (\">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\") print (\">>> Demo End\") print", "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #...
[ "=parsed_json['image2'] _read=parsed_json['read'] if _read: if _image1 is not None and _image2 is not", "on_message(client, userdata, msg): try: parsed_json=json.loads(convertJson(msg.payload)) if msg.topic==\"detection_find\": print(parsed_json) _image1 =parsed_json['image1'] _image2 =parsed_json['image2'] _read...
[ "left_sum = 0 for n in A[:-1]: left_sum += n v = abs(total", "v = abs(total - 2*left_sum) if v < m: m = v return", "= float('inf') left_sum = 0 for n in A[:-1]: left_sum += n v", "A[:-1]: left_sum += n v = abs(total - 2*left_sum) if v < m:", "m = float('inf') left_sum = 0 for n in A[:-1]: left_sum += n", ...
[ "page accordingly. soup = BeautifulSoup(page.content.raw) for img_tag in soup.findAll('img'): if img_tag['src'] == path:", "different formats that pep2html.py outputs \"\"\" check_paths() data = { 'title': None, }", "actual pep, so we return both Page objects. \"\"\" pep0_content = convert_pep0() pep0_page,", ...
[]
[]
[ "0x100: hexstr += \"00\" else: hexstr += \"%02X\" % LE expected = hexstr", "+= pysatl.Utils.hexstr(data, separator=\"\") if LE>0: if case4e: if LE == 0x10000: hexstr +=", "P1=0x22, P2=0x33)) check(\"00 11 22 33\", CAPDU(CLA=0x00, INS=0x11, P1=0x22, P2=0x33)) check(\"0x00,0x11,0x22,0x33\", CAPDU(CLA=0x00, INS=0x...
[ "tan, atan, pi, acos, sqrt, exp, log10 import sys, os import copy import", "bootstrapping_stats = parallel_Mdim_bootstrapping(Globals.n_bootstrapping) print \"\\n//BOOTSTRAPPING:// {1.0, 0.1, 0.01, 0.001}%\" print \"FAP Levels:\", fap_levels(bootstrapping_stats)", "zip(*comb_rv_err) \"\"\" #allowing repetition ...
[ "of Index Servers number_of_links = 5 # number of links to be sent", "total number rows of Index Servers number_of_links = 5 # number of links", "number of links to be sent to Crawler number_of_chunks = 5 # number", "all constants used by the device manager Author: - <NAME> (<EMAIL> at <EMAIL>", "= 3 # tota...
[ "dict( size=0, sigma=0.6, eps=-15, phi=10e8, k=2.5, gamma=0.97 ) def gen_xdog_image(src, dst): gray =", "g2 = cv2.GaussianBlur(image, (size, size), sigma*k) return g1 - gamma * g2 def", "255 # This config is found by the author # modify if not", "eps /= 255 d = DoG(image, size, sigma, k, gamma) d /= d.max()",...
[ "comma separated).\") flags.DEFINE_string( \"output_dir\", None, \"The output directory where the model checkpoints will", "None, \"The Cloud TPU to use for training. This should be either the", "FLAGS = flags.FLAGS ## Required parameters flags.DEFINE_string( \"config_file\", 'configs/base.json', \"The config j...
[ "print(\"ERROR: %s is not a valid model!\" % model) return a = InformationGain(gp,", "rng=rng, normalize_output=False, normalize_input=True, lower=lower, upper=upper) elif model == \"gp_mcmc\": gp = GaussianProcessMCMC(kernel, prior=prior,", "= [inc for inc in bo.incumbents] results[\"incumbent_values\"] = [val...
[ "migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0095_bisericapage_utitle'), ] operations = [", "class Migration(migrations.Migration): dependencies = [ ('app', '0095_bisericapage_utitle'), ] operations = [ migrations.AddField( model_name='bisericapage',", "dependencies = [ (...
[ "<reponame>bcgov/mds from app.api.utils.models_mixins import Base from app.extensions import db class MMSSurfaceBulkSampleActivity(Base): __tablename__ =", "app.api.utils.models_mixins import Base from app.extensions import db class MMSSurfaceBulkSampleActivity(Base): __tablename__ = \"surface_bulk_sample_activit...
[ "Enum class RemoteControlLock(Enum): OFF = 0 ON = 1 def map_to_state(data: int): return", "self._send_command(self._command, 255)) async def set_state(self, state: RemoteControlLock): return map_to_state(await self._send_command(self._command, state.value)) def on(self):", "RemoteControlLock(Enum): OFF = 0 ON =...
[ "class PowerOf2: def start(self): number=int(sys.argv[1]) print(number) for i in Utility().powerof2(number): print(i) return PowerOf2().start()", "com.bridgelabz.utility.Utility import Utility class PowerOf2: def start(self): number=int(sys.argv[1]) print(number) for i in Utility().powerof2(number):", "import U...
[ "+ \"//Job_Openings.xlsx\" print(\"-\" * 75, \"-\" * 75, \"\\n\\t\\t\\t\\t\\t\\t\\t JOB WEB SCRAPER\", \"-\"", "\"-\" * 75, sep=\"\\n\") workbook, worksheet = excel.load_xlsx(file_path) last_scrape_date = excel.get_first_job_date(worksheet) last_scrape_date =", "already exists then append the jobs not already i...
[ "(sorted) list of decoders to include in block n, assuming decoders are split", "to use for the given filename\"\"\" return filename.replace(\"/\", \"_\").replace(\".\", \"_\").upper() + \"_\" def", "number of code blocks to break classes into.\"\"\" num_blocks = len(separators) + 1", "\"\"\" HEADER_BOILERPLA...
[ "\"\"\" num_images = 100 images_array = np.zeros((num_images, np.prod(image_shape)), dtype=np.float32) targets_array = np.zeros(num_images, dtype=int)", "as a Mx3x32x32 numpy array. \"\"\" return load_img(path, img_nums, (3, 32, 32)) def", "\"\"\" Loads a image in the human-readable format. Args: path: The path...
[ "self.frame.setFrameShape(QFrame.StyledPanel) self.frame.setFrameShadow(QFrame.Raised) self.frame.setLineWidth(0) self.label = 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\"))", "330...
[ "keys = (keys,) keystr = ', PRIMARY KEY (%s)' % ','.join(keys) template =", "to DBAPI2.0 compliant format\"\"\" args = [sql] if params is not None: if", "\"\"\" Make a data_frame's column type align with an sql_table column types Need", "copy=False) # Handle date parsing if col_name in parse_dates: try: fmt =...
[ "str :rtype: int \"\"\" cnt, tail = 0, len(s) - 1 while tail", "def XXX(self, s): \"\"\" :type s: str :rtype: int \"\"\" cnt, tail =", "len(s) - 1 while tail >= 0 and s[tail] == ' ': tail", "while tail >= 0 and s[tail] != ' ': cnt += 1 tail", "tail >= 0 and s[tail] == ' ': tail -= 1 while tail", "\"\"\" c...
[ "def get_magics(object: Object) -> Dictionary: \"\"\"Gets the magic methods of an object.\"\"\" return", "metaclass to customize the behavior of all classes.\"\"\" def __new__(self, name: str, bases:", "**keys - Any Keyword arguments to pass in \"\"\" # Creating a new", "= value # Adds attributes to __protect...
[ "for bank in banks: check( c.rpc( \"BK_register\", {\"bank_id\": bank.ccf_id, \"country\": bank.country}, ), result=bank.ccf_id,", "primary.node_client() as mc: check_commit = infra.checker.Checker(mc) with primary.user_client(format=\"msgpack\", user_id=manager.name) as c: check( c.rpc(", "add(parser): parser....
[ "H_dir for h in H_norms] m_avg = hysteresis(sim, H_vals, fun=lambda sim: sim.m_average, **kwargs)", "its docstring for more details). fun: callable The user can pass a function", "all values in H_ext_list are exhausted. Note: The fields in H_ext_list are applied", "return values of `fun` after each stage. Oth...
[ "brush = QtGui.QBrush(QtGui.QColor(51, 51, 51)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) gradient = QtGui.QRadialGradient(0.3, -0.4,", "brush = QtGui.QBrush(QtGui.QColor(84, 84, 84)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtG...
[ "from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('myApp', '0016_usergroup_buyer'), ]", "Migration(migrations.Migration): dependencies = [ ('myApp', '0016_usergroup_buyer'), ] operations = [ migrations.CreateModel( name='Chat', fields=[", "models class Migration(...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "You may obtain a copy of the License at # # http://www.apache.org...
[ "config: configuration settings :rtype: tuple :return: pfxfile, passphrase, sha1 tp \"\"\" pfxfile =", "settings.batch_shipyard_encryption_pfx_sha1_thumbprint( config) # manually get thumbprint of pfx if not exists in config", "bool shell: execute with shell :param bool tty: allocate pseudo-tty :param tuple ssh...
[ "2 USE_DROPOUT = False KEEP_PROB = 1.0 SHOW_SCORE_THRSHOLD = 0.6 # only show", "channel is BGR IMG_SHORT_SIDE_LEN = 800 IMG_MAX_LENGTH = 1333 CLASS_NUM = 80 #", "= 20 SMRY_ITER = 200 SAVE_WEIGHTS_INTE = 80000 SUMMARY_PATH = ROOT_PATH + '/output/summary'", "SHOW_SCORE_THRSHOLD = 0.6 # only show in tensorboard ...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "Project Authors. # # Licensed under the Apache License, Version 2.0 (the \"License\");", "writing, software # distributed under the License is distributed on an \"AS IS\"", "delta.exceptions as exceptions from delta.testing.utils ...
[ "= int(input(\"Enter the no of rows\")) c = int(input(\"Enter the no of columns\"))", "check_matrix(first_matrix,sec_matrix): if(first_matrix==sec_matrix): print(\"same\") else: print(\"not same\") print(\"Enter the 1st matrix\") first_matrix = matrix_form()", "else: print(\"not same\") print(\"Enter the 1st ma...
[ "import os.path import csv import numpy as np from time import time from", "hf = h5py.File(subject+'_ef.h5', 'w') hf.create_dataset('Y', data=Y) hf.create_dataset('Z', data=Z) hf.close() session = Session(aws_access_key_id=config[0],aws_secret_access_key=config[1]) s3", "as K from keras.utils import multi_gpu_m...
[ "= alpha*chi**2 return (r0*vr0/np.sqrt(mu))*chi*(1 - alpha*chi**2*S(z)) + \\ (1 - alpha*r0)*chi**2*C(z) + r0", "''' Solve Kepler's Equation in the form containing Eccentric Anomaly (E), eccentricity (e),", "alpha) r_1 = f*r_0 + g*v_0 r1 = np.linalg.norm(r_1) fd = calc_fd(mu, r1,", "= np.linalg.norm(v_0) # (km...
[ "'pressure', 'sampletable', 'pilz', 'detector', 'collimation', ] devices = dict( mcasink = device('nicos_mlz.pgaa.devices.MCASink', settypes", "settypes = {'point'}, detectors = ['_60p', 'LEGe'], ), chnsink = device('nicos_mlz.pgaa.devices.CHNSink', settypes =", "= \"\"\" SetDetectors('_60p', 'LEGe') SetEnviron...
[ "w = tvm.size_var(\"n\"), 10, 224, 224 x = relay.var(\"x\", relay.ty.TensorType((n, c, h, w),", "kernel = np.random.uniform(-scale, scale, size=kshape).astype(dtype) ref_res = topi.testing.conv2d_nchw_python( data.astype(out_dtype), kernel.astype(out_dtype), 1, padding, groups=groups)", "run_infer_type(y) asser...
[ "return tokenizer.Subtokenizer(temp_file.name, reserved_tokens=[]) def test_encode(self): vocab_list = [\"123_\", \"test\", \"ing_\"] subtokenizer = self._init_subtokenizer(vocab_list)", "reserved_tokens = [\"reserved\", \"tokens\"] vocab_list = tokenizer._generate_subtokens(token_counts, alphabet, min_count, num...
[]
[ "2020 Soil, Inc. from soil.openstack.base import DataBase from soil.openstack.base import SourceBase class SnapshotData(DataBase):", "data\"\"\" def __init__(self, data): self.data = data['snapshot'] class Snapshot(SourceBase): \"\"\"A class for openstack", "status = snapshot_info['snapshot']['status'] if statu...
[ "all((data['username'], data['password'])): login = data['username'] if login not in results: results[login] = {}", "Pypykatz(ModuleInfo): \"\"\" Pypykatz dumps all secrets from the lsass.exe memory It does not", "password for i in ['credman_creds', 'ssp_creds', 'livessp_creds', 'tspkg_creds', 'wdigest_creds']:...
[ "return self._make_release(tracks) def test_parse_media_for_tracks(self): tracks = [self._make_track('TITLE ONE', '1', '01:01'), self._make_track('TITLE TWO', '2',", "3) def test_parse_minimal_release(self): \"\"\"Test parsing of a release with the minimal amount of", "1) self.assertEqual(t[2].medium_index, 1) ...
[ "= self.length - 1 \"\"\"Reports item at the front of self @return item", "rotate queue\"\"\" def rotate(self, rotation): for i in range(rotation): temp = self.stack[0] self.stack", "(represented by a list with pop and append)\"\"\" class Queue: def __init__(self): self.stack", "= self.stack[0] self.stack = s...
[ "io.StringIO() with open(config_file) as fin: for line in fin: if line.startswith('['): section =", "'darknet' return mygraph if __name__ == '__main__': config_path = sys.argv[1] weights_path = sys.argv[2]", "'BiasAdd' node.input = [prev_output] node.input_norm = node.input #node.attr = [] node.bias = conv_bias...
[ "class Song(models.Model): user = models.ForeignKey(User, default=1,on_delete=models.CASCADE) album = models.ForeignKey(Album, on_delete=models.CASCADE, null=True) song_title =", "models.ForeignKey(User, default=1,on_delete=models.CASCADE) album = models.ForeignKey(Album, on_delete=models.CASCADE, null=True) song...
[ "cur = db.cursor() try: for row in df.itertuples(): ts = row.Time / 1000", "def connect_to_db(): config = json.load(open('dbconn.json'))[\"mysql\"] db = M.connect(host = config[\"host\"], user = config[\"user\"],", "import calendar import requests import pandas as pd import json import os.path import", "time ...
[ "\"\"\"Configures a Kafka Connector for Postgres Station data\"\"\" import json import logging import", "connect connector...\") resp = requests.get(f\"{KAFKA_CONNECT_URL}/{CONNECTOR_NAME}\") if resp.status_code == 200: logging.debug(\"Connector already created skipping", "\"value.converter\": \"org.apache.kafk...
[ "Sampler logger = logging.getLogger(__name__) def load_word_embeddings(file): embeddings_index = {} fin = io.open(file, 'r',", "'type': type, 'head': head, 'subject': ex.subj_text, 'object': ex.obj_text, 'subject_pos': subj_position, 'object_pos': obj_position, 'relation':", "knn_size) sentence.knn_words = knn_...
[ "Cython from Cython.Build import build_ext cmdclass[\"build_ext\"] = build_ext module_src = \"cgranges/python/cgranges.pyx\" except ImportError:", "\"\"\" setup_kwargs.update( { \"ext_modules\": [ Extension( \"cgranges\", sources=[module_src, \"cgranges/cgranges.c\"], depends=[ \"cgranges/cgranges.h\", \"cgranges...
[]
[ "'applying_cream', 'archery', 'arm_wrestling', 'arranging_flowers', 'assembling_computer', 'auctioning', 'baby_waking_up', 'baking_cookies', 'balloon_blowing', 'bandaging', 'barbequing', 'bartending', 'beatboxing',", "'playing_xylophone', 'pole_vault', 'presenting_weather_forecast', 'pull_ups', 'pumping_fist', 'p...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "permissions and # limitations under the License. from datetime import datetime from qf_lib.common.tickers.tickers", "under the License. from datet...
[ "value == wtypes.Unset: self._audit_uuid = wtypes.Unset elif value and self._audit_uuid != value: try:", "action_plans with detail. :param marker: pagination marker for large data sets. :param limit:", "Unless required by applicable law or agreed to in writing, software # distributed", "[{'description': 'Test...
[ "**options) @albums.route('/albums') def albums_route(): options = { \"edit\": False } return render_template(\"albums.html\", **options)", "__name__, template_folder='templates') @albums.route('/albums/edit') def albums_edit_route(): options = { \"edit\": True } return render_template(\"albums.html\",", "<repo...
[ "import debug_logger from dfirtrack_main.models import Division class DivisionList(LoginRequiredMixin, ListView): login_url = '/login' model", "import DivisionForm from dfirtrack_main.logger.default_logger import debug_logger from dfirtrack_main.models import Division class DivisionList(LoginRequiredMixin, ListVi...
[ "torch.backends.cudnn.deterministic = True # 保证每次结果一样 start_time = time.time() print(\"Loading data...\") vocab, train_data, dev_data,", "help='random or pre_trained') parser.add_argument('--word', default=False, type=bool, help='True for word, False for char') args", "torch.manual_seed(1) torch.cuda.manual_see...
[ "'resource-0-description': 'new resource name', 'resource-0-resource': resource_one.resource, 'resource-1-id': resource_two.id, 'resource-1-DELETE': True, 'resource-1-description': resource_two.description, 'resource-1-resource':", "response.status_code == 200 with scope(event=submission.event): submission.refres...
[ "3 MB_MAX_WRITE_REGNUM = 123 MB_MAX_READ_REGNUM = 125 MB_MAX_REG_ADDR = 65535 MB_MAX_REG_VAL = 65535", "mb_bsp.alarm_cb.status_timeout == 1: print('*** Test FAILED: ', status , ' timeout ***') mb_bsp.alarm_cb.status_timeout", "= pdu.copy() bytecount = regnum_l << 1 pdu.append(bytecount) for i in range(regnum_l)...
[ "num_unanswered = ndb.IntegerProperty() total_question_views = ndb.IntegerProperty() status = ndb.StringProperty() status_string = ndb.StringProperty() def", "result = {} result['requested_time'] = dthandler(self.requested_time) result['num_tagged_questions'] = self.num_tagged_questions result['num_questions_by_t...
[ "True: start = time.clock() while time.clock() - start < busyTime: pass time.sleep(busyTime /", "while True: start = time.clock() while time.clock() - start < busyTime: pass time.sleep(busyTime", "-*- import time busyTime = 10 idleTime = busyTime while True: start =", "import time busyTime = 10 idleTime = bus...
[ "\"\"\" Initializes a BaseMap instance :param auth_client: Auth client \"\"\" super(BaseMap, self).__init__(auth_client) def", "endpoint = (self.Meta.collection_endpoint + \"{template_id}\"). \\ format(template_id=self.template_id) if (auth is not None): endpoint", "to download data :rtype: str :raise: CartoExc...
[ "kv_client.kv_client import KVClient def main(): kvSlave = KVClient(1, \"127.0.0.1\", 3456) kvSlave.start() if __name__", "def main(): kvSlave = KVClient(1, \"127.0.0.1\", 3456) kvSlave.start() if __name__ == \"__main__\": main()", "KVClient def main(): kvSlave = KVClient(1, \"127.0.0.1\", 3456) kvSlave.start()...
[ "mode, input_size, offset, sparse, include_last_offset, device): self.embedding = torch.nn.EmbeddingBag( num_embeddings=embeddingbags, embedding_dim=dim, mode=mode, include_last_offset=include_last_offset,", "op_bench import torch import numpy from . import configs \"\"\"EmbeddingBag Operator Benchmark\"\"\" clas...
[ "import backend as F from .. import ndarray as nd def _farthest_point_sampler(data, batch_size,", "Returns ------- a 1-D tensor A vector with each element that indicates the", "number of points to sample in each batch. dist : tensor Pre-allocated tensor", "The number of points to sample in each batch. dist : ...
[ "None): self.__data_name__ = data_name self.__parent__ = parent self.__bucket__ = bucket self.__protected_parent_methods__ = protected_parent_methods", "last_modified_time = getmtime(str(self.path)) if require_update \\ or 'sha256' not in self.metadata \\ or", "not self.path.exists(): return None with open(str(...
[ "If you want to process the gradient before applying then call `tf.GradientTape` and", "hold the slot value. This can be useful if you want to log", "without the optimizer; # it's a dependency hypergraph with edges of the form", "dimension of `values` (as in an IndexedSlices object). Returns: A tuple of (`sum...
[ "<PASSWORD>' } url_base_cursos = 'http://127.0.0.1:8000/api/v2/cursos' url_base_avaliacoes = 'http://127.0.0.1:8000/api/v2/avaliacoes' resultado = requests.get(url=url_base_cursos, headers=headers) assert", "url_base_cursos = 'http://127.0.0.1:8000/api/v2/cursos' url_base_avaliacoes = 'http://127.0.0.1:8000/api/v...
[ "a rule to parse body as xml for requests with /broker/xml uri xml_rule", "some specific rules for crs_group in waf_policy_obj.get(\"crs_groups\", []): group_id = get_id_from_group(crs_group) if group_id", "\"description\": \"WAF will buffer the whole request body first and then release to", "\"allowlist-star...
[ "(False, \"/category,5/department,3440/department,3443/\", \"id\", 3443), (True, \"/category,5/\", \"category_id\", 5), (False, \"/category,5/\", \"category_id\", 5), (True,", "attributes_mapping == expected def test_get_attributes_mapping_other(self): pc = ProfileCategory.objects.get_default() attributes_mapping...
[ "run_benchmark, # get_benchmarks, # post_benchmark, # plot_benchmark, # ) from votesim.benchmarks import runtools,", "# get_benchmarks, # post_benchmark, # plot_benchmark, # ) from votesim.benchmarks import runtools, simple", "# from votesim.benchmarks.benchrunner import ( # run_benchmark, # get_benchmarks, # p...
[ "= str(row[4]) # all_lines.append({'date':date_obj, 'location':location, 'order':order, 'total':total}) # return cached_list # print(all_lines) app.start_app(all_lines,", "total = str(row[4]) # all_lines.append({'date':date_obj, 'location':location, 'order':order, 'total':total}) # return cached_list # print(all_...
[ "Crown Copyright 2017-2021 Met Office. # All rights reserved. # # Redistribution and", "and the following disclaimer in the documentation # and/or other materials provided with", "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES", "has a multi valued threshold coordinate....
[ "self.auth = auth def add_item( self, name, price, quantity, image, category_id, reorder_point, auth):", "available''' model = ModelSetup() self.conn = model.conn self.cur = model.cur query = \"\"\"UPDATE", "self.conn = model.conn self.cur = model.cur query = \"\"\"INSERT INTO items(name, price, quantity,", "...
[ "else: # Simple class name; find from the pre-calculated mappings. if text not", "javadoc_dir = os.path.abspath(env.config['javadoc_dir']) # Build the mappings from a simple class name to", "options, content) def api_role_internal(plural, role, rawtext, text, lineno, inliner, options, content): set_classes(opti...
[ "for lock_name in lock_names: self.locker.init(lock_name) def loop(self): self.running = True while self.running: self.run()", "__init__(self, manager, interval, *locks): self.manager = manager self.storage = manager.storage self.interval = interval", "interval def init_locker(self, *lock_names): self.locker = ...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "else: url = os.path.join(url, 'binary-%s' % target.arch, 'Packages.gz') cache_filename = fetch_and_cache_gzip(url, cache_dir) logging.debug('Reading...
[]
[ "Conv2d_params = {} Conv2d_params['layer_name'] = layer_name # in_channel in_channel = layer.__dict__.get('in_channels') Conv2d_params['in_channel'] =", "in range(len(last_connections)): print(last_connections[i]) for i in range(len(featuremap)): if not isinstance(featuremap[i], list): print('=========', i,", "...
[ "param.data.add_(r_at) param.data = self.project(name, param.data, epsilon) def restore(self, emb_name='emb.'): # emb_name这个参数要换成你模型中embedding的参数名 for name,", "self.emb_backup[name] = param.data.clone() norm = torch.norm(param.grad) if norm != 0 and not torch.isnan(norm):", ">>> loss_adv.backward() # 反向传播,并在正常的...
[ "= torch.matmul(jacobian_diff, kp_source['jacobian']) return kp_new def load_checkpoints(config_path, checkpoint_path, cpu=False): with open(config_path) as f:", "OcclusionAwareGenerator(**config['model_params']['generator_params'], **config['model_params']['common_params']) if not cpu: generator.cuda() kp_detect...
[ "import ChanceConstraintConstant # to do list # 0. implement zero, Hessian term #", "3. scaling with repsect to mesh (design + uncertainty), trace, variance reduction, #bfgs", "samples and states at different design # 2. table for variance reduction #", "CostFunctionalQuadraticMultiPDE # from .chanceConstrain...
[ "from get_config import get_config config = get_config() MEAN = np.array([0.485, 0.456, 0.406]) STD", "ToTensor(), ] ) return transform_valid def denormalize(z, mean=MEAN.reshape(-1,1,1), std=STD.reshape(-1,1,1)): return std*z + mean", "return transform_train def get_transforms_valid(): transform_valid = Compos...
[ "z def contains(self, cub): \"\"\"Tests if another cuboid is contained by this one", "start.z)) @property def length(self): return self.end.x - self.start.x class VSegment(Segment): \"\"\"Vertical Segment\"\"\" def", "None if there is no intersection. Arguments: cub (Cuboid): The other cuboid. edges", "the ar...
[ "fields that are omitted from # the request will not be modified in", "recipes\"\"\" sample_recipe(user=self.user) sample_recipe(user=self.user) # we're going to access them by retrieving # all", "# check that the images in the response so that's the path to", "# pillow, this will import our image class which...
[ "multiplication(num1,num2): print(\"Multiplication = \",num1*num2) @getInput def division(num1,num2): print(\"Division = \",num1/num2) addition() subtraction() multiplication()", "\",num1-num2) @getInput def multiplication(num1,num2): print(\"Multiplication = \",num1*num2) @getInput def division(num1,num2): print...
[ "Parameters ---------- naxes : int Number of axes. axes_type : str One of", "utils as astutil from astropy import coordinates as coord from astropy.extern import six", "object\"\"\" raise NotImplementedError(\"Subclasses may implement this\") class CelestialFrame(CoordinateFrame): \"\"\" Celestial Frame Represe...
[ "modifierModoItem, hostModoItem): \"\"\" Allows for attaching modifier to locator type item. Attached item", "Parameters ---------- modoItem : modo.Item The constraint modo item. \"\"\" Operation = TransformConstraintOperation", "self._item.channel('matrixOutput') @property def isRotationConstraint(self): \"\"\...