ngram
listlengths
0
82k
[ "user to set this property. For more information, please refer", "core.VarDesc.VarType.FP16 or dtype == core.VarDesc.VarType.BF16) return is_fp_dtype def is_integer(x): \"\"\"Return", "\"\"\" Returns a new tensor containing imaginary values of input", "return core.VarDesc.VarType.FP32 elif dtype == core.VarDe...
[ "\"\"\"Raised when a release has a non-string 'date' value\"\"\" class", "non-string 'date' value\"\"\" class InconsistentTypeError(OCDSMergeError, TypeError): \"\"\"Raised when a path", "message): self.key = key self.message = message def __str__(self): return", "same array have the same value for the 'id' f...
[ "buttons1_state = buttons1_state | self.state[\"BTN_A\"] buttons1_state = buttons1_state | self.state[\"BTN_B\"]", "<< 3 buttons2_state = buttons2_state | self.state[\"BTN_TL\"] << 4 packet", "buttons2_state = buttons2_state | self.state[\"BTN_TL\"] << 4 packet = struct.pack('6h2c',", "'{0:06b}'.format(int.fr...
[ "run at 640x480 in grayscale... def barcode_name(code): if(code.type() == image.EAN2):", "# must turn this off to prevent image washout... sensor.set_auto_whitebal(False)", "a higher resolution # to work well so it should", "higher resolution # to work well so it should always", "# V Res of 80 == less work ...
[ "<reponame>devaslooper/Code-Overflow n=int(input(\"Enter number \")) fact=1 for i in range(1,n+1): fact=fact*i", "n=int(input(\"Enter number \")) fact=1 for i in range(1,n+1): fact=fact*i print(\"Factorial", "\")) fact=1 for i in range(1,n+1): fact=fact*i print(\"Factorial is \",fact)", "number \")) fact=1 fo...
[ "o paramêtro. Permite atribuir inumeros parametros. def maior(* num): contador", "= contador + 1 print(f'{v} ', end='', flush=True) time.sleep(0.3) if", "1: maior = v else: if v > maior: maior", "import time # O * é para desempacotar o paramêtro.", "if contador == 1: maior = v else: if v", "7) maior(5, 4,...
[ "can only be 2-dimensional.\"): values = torch.rand((100, 50, 2), device=device)", "80], dtype=torch.int64, device=device) padded_to_packed(values, first_idxs, 20) with self.assertRaisesRegex(ValueError, \"input can", "device=device) first_idxs = torch.tensor([0, 80], dtype=torch.int64, device=device) packed_to...
[ "geotiff.get_header('file/tiff_test/2_12.tif')) imarray, offset = geotiff.clip_roi(poly_pixel, 'file/tiff_test/2_12.tif', is_geo=False) assert len(imarray) ==", "because WGS 84 / UTM ... should be full out_dict", "rgb, lzw * 256 image_width (1H) 19436 * 257 image_length", "to int, fixed by astype(float) mean_...
[ "self._city @city.setter def city(self, city): \"\"\"Sets the city of this", "\"\"\" self._address_line2 = address_line2 @property def city(self): \"\"\"Gets the city", "lambda x: x.to_dict() if hasattr(x, \"to_dict\") else x, value ))", "help, refer to <a href='https://developer.ebay.com/api-docs/buy/marketp...
[ "100 data.sort(key=lambda x: x[1]/x[2], reverse=True) profit=0 ans=[] i=0 while i<n:", "[40,50,30,10,10,40,30] pro = [30,20,20,25,5,35,15] n = len(wt) data = [", "for i in range(n) ] bag = 100 data.sort(key=lambda x:", "reverse=True) profit=0 ans=[] i=0 while i<n: if data[i][2]<=bag: bag-=data[i][2] ans.appen...
[ "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "'avx512') _emit_function(fe, avx512_kmask_op, 'avx512_maskop') _emit_function(fe, avx_isa_sets, 'avx') _emit_function(fe, sse_isa_sets, 'sse')", "in SSE are # \"SSE-opcodes\" with memop operands. One can", "and not re.sea...
[ "deleted.' @pytest.mark.vcr() def test_target_groups_edit(client, new_target_group): target_group = new_target_group edited_name =", "'test_target_group_edit' edited_group = client.target_groups_api.edit(TargetListEditRequest(name=edited_name), target_group.id) assert isinstance(edited_group, TargetGroup), u'The ...
[ "= torch.sqrt(CQT_real.pow(2)+CQT_imag.pow(2)+1e-8) return CQT elif output_format=='Complex': return torch.stack((CQT_real,CQT_imag),-1) elif output_format=='Phase':", "value is 'hann' pad_mode : str The padding method. Default", "function to get back another half if onesided: X =", "time)) if return_extras: ...
[ "= get_kobart_tokenizer() else: self.tok = tok self.num_workers = num_workers @staticmethod", "pytorch_lightning import loggers as pl_loggers from torch.utils.data import DataLoader, Dataset", "'step', 'frequency': 1} return [optimizer], [lr_scheduler] class KoBARTConditionalGeneration(Base): def __init__(self,...
[ "state_class=sensor.STATE_CLASS_MEASUREMENT, last_reset=LAST_RESET_UPTIME, ), (\"roller\", \"rollerEnergy\"): BlockAttributeDescription( name=\"Energy\", unit=ENERGY_KILO_WATT_HOUR, value=lambda value:", "-> None: \"\"\"Initialize sensor.\"\"\" super().__init__(wrapper, block, attribute, description) self._last_v...
[ "QUERY_KWARGS['GET']['facet_size']['default'] = 3 QUERY_KWARGS['GET']['facet_size']['max'] = 5 QUERY_KWARGS['POST']['q']['jsoninput'] = True #", "'bts_test' ES_DOC_TYPE = 'gene' ES_SCROLL_SIZE = 60 # ***************************************************************************** #", "\"\"\" import os from biothin...
[ "try: model.image.render_variations(replace=False) except FileNotFoundError: logger.error(f\"ERROR: Image file '{img}' is missing\")", "from django.db.utils import OperationalError, ProgrammingError from company.models import Company from", "importing a new dataset, for example \"\"\" import os import", "miss...
[ "184, 195, 1)\" elif background[0] == \"#\" or \"(\" not", "text[:last_percent] _carbon_url = \"https://carbonnowsh.herokuapp.com/\" def code_to_url(code: str) -> str: return", "hex (str): \"\"\" return tuple(int(hex.lstrip(\"#\")[i : i + 2], 16)", "text[:2000].rindex(\"%25\") return text[:last_percent] _carb...
[ "URN or URL import spotipy_twisted import sys import pprint if", "if len(sys.argv) > 1: urn = sys.argv[1] else: urn =", "import spotipy_twisted import sys import pprint if len(sys.argv) > 1:", "a URN or URL import spotipy_twisted import sys import pprint", "info for a URN or URL import spotipy_twisted impor...
[ "MCP from adafruit_mcp3xxx.analog_in import AnalogIn # create the spi bus", "AnalogIn(mcp, MCP.P0) print(\"Raw ADC Value: \", chan.value) print(\"ADC Voltage: \"", "# create the spi bus spi = busio.SPI(clock=board.SCK, MISO=board.MISO, MOSI=board.MOSI)", "Value: \", chan.value) print(\"ADC Voltage: \" + str(c...
[ "['tabular_data'] @data_factory(label=\"ASCII Table\", identifier=has_extension('csv txt tsv tbl dat ' 'csv.gz", "in [astropy_tabular_data, pandas_read_table]: try: return fac(path, **kwargs) except Exception: pass", "has_extension from glue.config import data_factory __all__ = ['tabular_data'] @data_factory(la...
[ "( Author.objects.filter(project__in=project_list).distinct().exclude(pk=author_id) ) return render( request, \"code_doc/authors/author_details.html\", { \"project_list\": project_list,", "projects = Project.objects.filter(administrators=maintainer) return render( request, \"code_doc/maintainer_details.html\", {\...
[ "\"generated_files\" # TODO: ugly parent.parent pathing if os.path.exists(GEN_FILE_DIR): sys.path.append(GEN_FILE_DIR) if", "{}\".format(dtb_json.split(os.sep)[-1], arch, soc_sloc)) # Final stats ac.print_mean_median_std_dev_for_dict_of_lists(soc_sloc_by_arch, \"\\nSloc Per Soc,", "import analyses_common as ac ...
[ "decay progress = float(self.tokens - self.warmup_tokens) / float( max(1, self.final_tokens", "progress))) lr = self.learning_rate * lr_mult for param_group in optimizer.param_groups:", "(i.e. label is not -100) if self.tokens < self.warmup_tokens: #", "linear warmup lr_mult = float(self.tokens) / float(max(1...
[ "set to True, all Apprise Config files marked to be", "dealing # with a YAML file. # - If we", "LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A", "six.string_types): # We're just a simple URL string... schema =", "if not otherwise detected encoding = 'utf-8' # The default", "when working wit...
[ "AV_LOG_QUIET = \"quiet\" AV_LOG_PANIC = \"panic\" AV_LOG_FATAL = \"fatal\" AV_LOG_ERROR", "\"panic\" AV_LOG_FATAL = \"fatal\" AV_LOG_ERROR = \"error\" AV_LOG_WARNING = \"warning\"", "\"info\" AV_LOG_VERBOSE = \"verbose\" AV_LOG_DEBUG = \"debug\" ffmpeg_loglevel = AV_LOG_ERROR", "'win32' in str(sys.platform)....
[ "setuptools import setup setup( name=\"nmn-iwp\", version=\"0.1\", keywords=\"\", packages=[\"vr\", \"vr.models\"] )", "from setuptools import setup setup( name=\"nmn-iwp\", version=\"0.1\", keywords=\"\", packages=[\"vr\", \"vr.models\"]" ]
[ "prepare_add(self, num_add_nodes): \"\"\" Make sure that ``num_add_nodes`` can be added", "are subdivided their identity is not lost. \"\"\" tri_nums =", "the uniformly spaced grid points x_grid = np.arange(x_min, x_max +", "veh_up = np.array([0., 1., 0.]) rot_around = np.cross(veh_up, np.array([0, 0,", "ar...
[ "locked pad. 2. decrypt(cipher_text,locked_pad,passphrase) - Decrypt the cipher text encrypted", "operated=contain(int(target_list[counter])-pad[counter],ascii_value) result.append(operated) return result def locker(pad,passphrase): cutter=round(len(passphrase)/2) splited=[passphrase[:cutter],passphrase[cutter:]]...
[ "__init__(self, error_element, error_namespace, error_name=None): self.error_name = error_name self.element = ET.Element(error_element)", "def __unicode__(self): if self.error_name is not None: self.element.append(ET.Element(self.error_name)) return unicode(ET.tostring(self.element))", "= ET.Element(error_eleme...
[ "== 'left': return {'type': 'head-on', 'identifier': 'left', 'direction': direction} elif", "head['x'] == width and direction =='down' or head['x'] == width", "2 else: return len(my_position) def getMyDirection(gamedata): me = gamedata['you'] my_position", "and direction == 'up' or head['x'] == 0 and directio...
[ "str, has_master: bool, master_only: bool, bullet: bool, mates: bool) ->", "score.mate() if mate is not None: return 1 if mate", "import chess import chess.engine from model import EngineMove, NextMovePair from", "480) except: return True def exclude_rating(line: str, mates: bool) ->", "False try: return in...
[ "from datetime import datetime def main(): while True: a =", "= datetime.now() if n.hour == 6 and (n.minute-(n.minute%5)) == 15:", "time, morning from datetime import datetime def main(): while True:", "time.mktime(datetime.now().timetuple()) n = datetime.now() if n.hour == 6 and (n.minute-(n.minute%5))", "...
[ "inside a context manager context_mock = Mock() invoke_context_mock.return_value.__enter__.return_value = context_mock", "@patch(\"samcli.commands.local.start_lambda.cli.InvokeContext\") def test_must_raise_user_exception_on_invalid_sam_template(self, invoke_context_mock): invoke_context_mock.side_effect = Invali...
[ "def test_get_data_correct_df(self): \"\"\"Whether it returns correct df when input is", "indicator type self.assertEquals( Getter(table_name=IndicatorType, df_flag=True, param_list=self.param_list_indicator_type).get_data() .equals( Converter(obj_list=list(IndicatorType.objects.filter(**self.param_list_indicator...
[ "..registry import TRAINERS @TRAINERS.register_module() class MMDetectionTrainer(BaseTrainer): def __init__(self): super(MMDetectionTrainer, self).__init__()", "Corporation Licensed under the Apache License, Version 2.0 (the \"License\");", "for t in cfg.data.train.pipeline if t['type'] == 'Resize'][0][ 'img_sc...
[ "complixities # for each file files = {} # Build", "containing the number of potentially duplicated # constants by file", "of potentially duplicated # constants by file for result in", "in: ([^:]+).+\\n?', cyclostats) files = {} # Build an array", "occurrence\\(s\\) of \\\"(.+)\\\" found in: ([^:]+).+\\n?',...
[ "bool(_get_error_list(code)) i1 = 'from __future__ import division' i2 = 'from", "('1 +\\n', [(1, 3)]), ('1 +\\n2 +', [(1, 3), (2,", "can't assign to keyword\", 'SyntaxError: cannot assign to __debug__'], line_nr", "0)]), ('def x():\\n 1\\n 2', [(3, 0)]), ('def x():\\n 1\\n", "+ '\\n' + i2) assert not is_is...
[ "'+': modifier = PROMOTE else: modifier = None yield Move(color[step", "import Coords, Move, BLACK, WHITE, DROP, PROMOTE RANKNUM = {", "unicode_literals from shogitk.shogi import Coords, Move, BLACK, WHITE, DROP, PROMOTE", "elif line[0].isupper(): dst = Coords(int(line[2]), RANKNUM[line[3]]) yield Move(color[...
[ "collateral ratio\") @click.option( '--liquidation-duration', type=int, help=\"The liquidation duration in minutes\")", "import click from . import utils @click.group() def main(): \"Simple", "score) tx_hash = utils.send_transaction(func, 0, private_key) return tx_hash @main.command() @click.option(", "the tr...
[ "= self.machine.session() self.session.run(f\"cd {project_path}\") return old_apply(self, project) cls.apply = new_apply", "new_apply(self, project): with self.machine.tempdir() as tempdir: project_path = tempdir /", "project.files(): if f.name in existing_files: copy(f.path, project_path / f.name) with", "us...
[ "float(input('digite o seu salario: ')) aumento = (salario + (salario", "seu salario: ')) aumento = (salario + (salario * 15)/100", "15)/100 if salario <= 1250 else salario + (salario *", "if salario <= 1250 else salario + (salario * 10)/100)", "o seu salario: ')) aumento = (salario + (salario *", "salari...
[ "t = get_tree(\"local-branches\") self.assertEqual(t, []) t = get_tree(\"remote-branches\") self.assertEqual(t, [])", "import os import os.path import airflow import airflow.plugins_manager from airflow", "airflow import configuration from flask import Flask from unittest import", "0) self.assertTrue('git' in...
[ "= \"super-secret\" # Change this! jwt = JWTManager(app) # Standard", "a fresh access token and # a refresh token @app.route(\"/login\",", "to be used if we need to # make a", "methods=[\"GET\"]) @fresh_jwt_required async def protected_fresh(): username = get_jwt_identity() return dict(fresh_logged_in_as=user...
[ "import Any, Dict, Union __all__ = 'AnyDict' AnyDict = Dict[str,", "= Dict[str, Any] # pragma: no mutate datetime_or_str = Union[datetime,", "'AnyDict' AnyDict = Dict[str, Any] # pragma: no mutate datetime_or_str", "Any] # pragma: no mutate datetime_or_str = Union[datetime, str] #", "Union __all__ = 'AnyDic...
[ "preds = Dense(1,activation='linear')(inputs) model = Model(inputs=inputs,outputs=preds) sgd = keras.optimizers.SGD() model.compile(optimizer=sgd", "= Model(inputs=inputs,outputs=preds) sgd = keras.optimizers.SGD() model.compile(optimizer=sgd ,loss='mse') model.fit(x_,y_, batch_size=1, verbose=1,", "import kera...
[ "the hardware layer to avoid errors. from ledshimdemo.canvas import Canvas", "unittest.mock import Mock, patch import sys sys.modules['smbus'] = Mock() #", "type: int def test_cheerlight_call(self): canvas = Canvas(self.TEST_CANVAS_SIZE) effect = CheerLightsEffect(canvas)", "= 3 # type: int def test_cheerligh...
[ "tqdm(chunked)] out_dict = {} for i, d in enumerate(dicts): for", "from tqdm import tqdm import os import tifffile def chunk_list(l,", "'All cells must have the same data elements' out_dict =", "import add_readout_noise, draw_poisson from colicoords import load import numpy as", "shape, max_dist=5): thetas ...
[ "self._id = settings[\"id\"] self._title = settings[\"title\"] self._type = settings[\"type\"][\"name\"] self._value", "DeviceSettings: def __init__(self, settings): self._id = settings[\"id\"] self._title = settings[\"title\"]", "= settings[\"title\"] self._type = settings[\"type\"][\"name\"] self._value = set...
[ "a word: \") if word == \"a\": print(\"one; any\") elif", "print(\"one; any\") elif word == \"apple\": print(\"familiar, round fleshy fruit\")", "any\") elif word == \"apple\": print(\"familiar, round fleshy fruit\") elif", "word: \") if word == \"a\": print(\"one; any\") elif word", "elif word == \"rhinoce...
[ "0 for i in range(len(num)): sum = sum + num[i]", "input())) sum = 0 for i in range(len(num)): sum =", "int(input()) num = list(map(int, input())) sum = 0 for i", "<gh_stars>0 cnt = int(input()) num = list(map(int, input())) sum =", "for i in range(len(num)): sum = sum + num[i] print(sum)", "list(map(int,...
[ "version = '0.1', description = 'Kubernetes resource discovery toolkit', author", "repo download_url = 'https://github.com/sdnhub/kube-navi/archive/0.1.tar.gz', # I'll explain this in a", "above version = '0.1', description = 'Kubernetes resource discovery toolkit',", "= ['testing', 'logging', 'example'], # a...
[ "OF ANY # KIND, either express or implied. See the", "stringValue from ai_flow.common.properties import Properties from ai_flow.meta.metric_meta import MetricMeta, MetricType,", "= ast.literal_eval(properties) return MetricMeta(uuid=metric_meta_result.uuid, name=metric_meta_result.name, dataset_id=metric_meta_r...
[ "initElement(self): self.打开帮助按钮 = QPushButton(self.tr('打开帮助文档')) self.ffmpegMannualNoteButton = QPushButton(self.tr('查看作者的 FFmpeg 笔记')) self.openVideoHelpButtone", "PySide2.QtCore import Signal from moduels.component.NormalValue import 常量 from moduels.component.SponsorDialog import", "def __init__(self): super(...
[ "typing import Callable, Optional, Type, cast from fastapi import APIRouter,", "import users from app.common.user import ErrorCode, run_handler from app.users.user import", "from app.models import users from app.common.user import ErrorCode, run_handler from", "Optional, Type, cast from fastapi import APIRout...
[ "= np.where(nans) flow_magnitude[nans] = 0. # Normalize hsv[..., 0] =", "coding: utf-8 -*- import cv2 import numpy as np def", "np.any(nans): nans = np.where(nans) flow_magnitude[nans] = 0. # Normalize hsv[...,", "import numpy as np def flow_to_img(flow, normalize=True): \"\"\"Convert flow to", "we do here....
[ "B*ratr < R: leafcount = leafcount + 1 total =", "speed = 8 leafcount = 0 total = 0 for", "= 0 total = 0 for i in range(0, int(imWidth/speed)):", "G and B*ratgb < G and B*ratr < R: leafcount", "parser = argparse.ArgumentParser() parser.add_argument('fname') parser.add_argument('pref', default=\"\", nargs=\"...
[ "choices=['GiB', 'TiB', 'gib', 'tib'], default='TiB') args = parser.parse_args() vip =", "consumed / capacity, 0) storageReduction = round(float(logicalSize) / consumed, 1)", "% (startMsecs, cluster['clusterId'], endMsecs)) parseStats(cluster['name'], capacityStats['dataPointVec'][0], 'capacity') parseStats(clu...
[ "number): im = Image.open(self.filename) im1 = im.resize((64,64), Image.ANTIALIAS); # 转换为64x64", "classname = n[num] proba = knn.predict_proba(query_feature) msg = [num, classname,", "def classifyImage(self, feature_X, label_y, number): im = Image.open(self.filename) im1 =", "= b.query(self.feature, k=3) prin...
[ "\"mygroup\", }, ) judge_command( \"XINFO GROUPS mystream\", {\"command\": \"XINFO\", \"stream_groups\":", "STREAMS mystream writers 0-0 0-0\", { \"command\": \"XREAD\", \"count_const\": \"COUNT\",", "}, ) judge_command( \"XINFO STREAM mystream FULL count 10\", {", "\"stream_id\": [\"1526985054069\", \"152698...
[ "def test_main(self): with patch('find_forks.find_forks.find_forks', return_value=None) as find_forks_mock: main() sent_args =", "in test_interesting.py.\"\"\" response_mock = MagicMock() response_mock.read = Mock(return_value=json_response) if PY3:", "else: response_mock.code = 200 response_mock.info = Mock(re...
[ "if self.dist_fip_count == 0: #remove default route entry device =", "get_floating_ips(self): \"\"\"Filter Floating IPs to be hosted on this agent.\"\"\"", "fip_cidr): \"\"\"Remove floating IP from FIP namespace.\"\"\" floating_ip = fip_cidr.split('/')[0]", "= ('POSTROUTING', '! -i %(interface_name)s ' '! -o ...
[ "module defines several custom warning category classes. \"\"\" class SiderWarning(Warning):", "class SiderWarning(Warning): \"\"\"All warning classes used by Sider extend this", "for warnings about performance worries. Operations that warn this category", "\"\"\"The category for warnings about performance wo...
[ "siteUrl isAdult nextAiringEpisode { timeUntilAiring episode } } } \"\"\"", "native } synonyms status description startDate { year month day", "} bannerImage genres averageScore siteUrl isAdult popularity } } }", "User(search: $search) { id name html_about: about(asHtml: true) about avatar", "$sort: [MediaS...
[ "suite = unittest.TestSuite() all_names = globals() for name in all_names:", "chainop class BasicChainTest (unittest.TestCase): def testBasicChain(self): double = lambda x:", "def testMultiChain(self): double = lambda x: x * 2 self.assertEqual([62,", "lambda x: x * 2 self.assertEqual(62, chainop.basic_chain((...
[ "from algs import trpo from env_makers import EnvMaker from models", "os.system(\"rm -rf {}\".format(log_dir)) with logger.session(log_dir): env_maker = EnvMaker('Pendulum-v0') env =", "logger.session(log_dir): env_maker = EnvMaker('Pendulum-v0') env = env_maker.make() policy = GaussianMLPPolicy(", "import nu...
[ "10:17 # @Author: <EMAIL> \"\"\" 正则解析器 \"\"\" try: import xml.etree.cElementTree", "et import re class RegexEngine: def __init__(self, xml, str_): \"\"\"加载正则表。正则表为xml", "'False').lower() == 'true': self._part_tag(root) return list(filter(lambda x: x[1], self.data)) else:", "import xml.etree.ElementTree as et ...
[ "internal sklearn DecisionTreeClassifier \"\"\" def __init__(self, kwargs={}): self.kwargs = kwargs", "A dictionary containing metrics for judging network performance. fit_kwargs :", "Input data matrix. Returns ------- X_transformed : ndarray The transformed", "identify if the network is pretrained. compile_k...
[ "self.n_states = len(np.unique(self.states)) self.trans = self.model.transmat_.copy() def rho_dt_bins(self, rho, theta,", "<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. Time series modeling of", "projection (str): cartesian or polar. ymax (int) \"\"\" avail_proj =", "dt.sum() def norm_state_time(self): \"\"...
[ "redirect from django.views import View from django.views.generic import ( ListView,", "user = Account.objects.filter(is_superuser=False).count() rest = Restaurant.objects.all().count() rating = RestaurantReview.objects.exclude(rating__isnull=True).count() review", "import * from account.forms import * from dat...
[ "= asyncio.create_task(preview_window(dst_queue, threadpool)) try: while True: im = await ws.receive_bytes()", "= [int(cv2.IMWRITE_JPEG_QUALITY), 40] _, im = await loop.run_in_executor(threadpool, lambda: cv2.imencode('.jpg',", "loop.run_in_executor(threadpool, src.read) im = cv2.resize(im, (640, 384)) enc_para...
[ "+ str(len(self._cache)) + ' size: ' + bytes_2_human_readable( sys.getsizeof(self._cache))) def", "Read cache entries :param key: :return: \"\"\" self._lock.acquire() result =", "\"\"\" Read complex cache entries \"\"\" return self.get(self._get_id(list_of_keys)) def cache_complex(self,", "are some old entrie...
[ "if __name__ == '__main__': parser = ArgumentParser() parser.add_argument(\"--nsst_file\", default=\"output/nsst_tss20_th4_nSt100_Q0.pkl\", help=\"nsst", "word in src.split(\" \") if len(word)] token_tgt = [nsst.tokenization_tgt[word] if", "[w for w in reg[0].split(' ') if len(w)] pred_str =", "= ArgumentPars...
[ "sum(data) / len(data) def stddev(data, size): sum = 0 for", "functionts def mean(data): return sum(data) / len(data) def stddev(data, size):", "= sum + (data[i] - mean(data)) ** 2 return math.sqrt(sum", "math # Define functionts def mean(data): return sum(data) / len(data)", "Import library import math # D...
[ "if len(word1)==1: code+=word1+word2 return code else: code+=word1[0]+word2[0] return decode(word1[1:],word2[1:],code) Alice='Ti", "code+=word1[0]+word2[0] return decode(word1[1:],word2[1:],code) Alice='Ti rga eoe esg o h ore\"ermetsCmuainls'", "else: code+=word1[0]+word2[0] return decode(word1[1:],word2[1:],co...
[ "2.0 (the \"License\"); # you may not use this file", "} ) self._plot_factory(g) return g def _plot_factory(self, graph): graph.new_plot( zoom=True,", "= True elif has_bounds: g.clear() self._plot_factory(g) self.warning_dialog(\"{} does not have", "zoom=True, pan=True, padding=[50, 10, 10, 40], xtitle=\"Setp...
[ "detransposed recorded games for the next move recommended_move = maximin(maximin_list)", "these_probs = reoriented_candidates[this_game][\"probs\"][num_moves].copy( ) # tack on the cell #", "in range(len(reoriented_candidates)): these_probs = [] # get the probability element", "tg_list) # for each of the 8 t...
[ "# python 线程测试 import _thread import time from yvhai.demo.base import", "in range(times): time.sleep(interval) print(\" -- %s: %s\" % (thread_name, time.ctime(time.time())))", "print_time(thread_name, interval, times): for cnt in range(times): time.sleep(interval) print(\" --", "6)) except: print(\"Error: 无法启...
[ "\"similarity_type\" LOSS_TYPE = \"loss_type\" NUM_NEG = \"number_of_negative_examples\" MAX_POS_SIM = \"maximum_positive_similarity\"", "constants for configuration parameters of our tensorflow models LABEL =", "by tf.one_hot. LABEL_PAD_ID = -1 HIDDEN_LAYERS_SIZES = \"hidden_layers_sizes\" SHARE_HIDDEN_LAYERS ...
[ "= normaiseAngle(self.start_heading + 80 * -(1 if self.left_or_right == self.RIGHT", "= 1 * math.pi / 180 steer_speed = speed *", "self.ds_index = distance_sensor_index self.wall_point_kind = wall_point_kind self.left_mid_point_index = left_mid_point_index self.left_point_index", "== MazeAttitude.LEFT_WALL: w...
[ "['Metric'], 'spaceone.monitoring.interface.grpc.v1.project_alert_config': ['ProjectAlertConfig'], 'spaceone.monitoring.interface.grpc.v1.escalation_policy': ['EscalationPolicy'], 'spaceone.monitoring.interface.grpc.v1.event_rule': ['EventRule'], 'spaceone.monitoring.interface.grpc.v1.webhook': ['Webhook'], 'spaceo...
[ "= models.ForeignKey(OrgUnit) class House(models.Model): address = models.CharField(max_length=32) class OrderedPerson(models.Model): name", "= models.TextField() class Contact(models.Model): label = models.CharField(max_length=100) class Email(Contact): email_address", "models.CharField(max_length=25) awards =...
[ "descriptors with SIFT kp1, des1 = sift.detectAndCompute(img1,None) kp2, des2 =", "# Display Images cv2.imshow(\"Objects Detected\",raw_image) cv2.waitKey(0) cv2.destroyAllWindows() return cX,cY ############################################################", "(cX2-cX) deltaY = -(CY2-cY) # Write X and Y values", ...
[ "dash.dependencies import Input, Output, State import dash_bootstrap_components as dbc import", "right provides some \" \"close alternatives.\" ), className=\"card-text\", ), ]", "i in range(2, 6)], *[Output(f\"other-results-tooltip-{i}\", \"children\") for i in range(2,", "ids = [] i = 2 for index, row in", ...
[ "a closure turning objectify into a single argument function. This", "properties for a given class. Recursively calls up to parent", "an instance of the class created using the JSON data.", "obj.__class__ # Create empty data data = {} sprops,cprops =", "a given class. Recursively calls up to parent classes ...
[ "Processing the arguments args = vars(ap.parse_args(argv)) type_ = str(args[\"type\"]) verbosity_level", "the trained modeL. :param type_acquisition: String, \"SEM\" or \"TEM\" :param", "dictionary version of the configuration file from the path where", "= acquisition_name.stem if selected_model == \"default_...
[ "h_testing.bootstrap_CI(5000) print (mean_SD(s1), mean_SD(s2)) print (\"h_testing.d, analytic, correction = \",", "(a - b) < math.fabs((a + b) / (count_error *", "in range(length): sample.append(random.gauss(mean, sigma)) return sample def close_enough (a, b,", "= \", h_testing.d, (m2 - m1) / sig, h_testing.c...
[ "import path from . import views urlpatterns = [ path('',", "path from . import views urlpatterns = [ path('', views.Records,", ". import views urlpatterns = [ path('', views.Records, name =\"fRec\"),", "django.urls import path from . import views urlpatterns = [", "from django.urls import path from . impor...
[ "\"transformer\" \"\"\" # Xfail this until the new spaCy rc", "in range(2): losses = {} nlp.update(train_examples, sgd=optimizer, losses=losses) doc =", "\"textcat\"] train_examples = [] for text, annotations in TRAIN_DATA: train_examples.append(Example.from_dict(nlp.make_doc(text),", "happy.\", {\"cats\": {\...
[ "command: \") action_creator = ActionCreator() while True: input_data = await", "= config async def run(self): await asyncio.sleep(1) print(\"Insert command: \")", "input_data: for task in asyncio.all_tasks(): task.cancel() break action = action_creator.parse(*input_data.split())", "True: input_data = await i...
[ "float(linear_loss.data[0]), global_step) writer.add_scalar(\"linear_l1_loss\", float(linear_l1_loss.data[0]), global_step) writer.add_scalar(\"linear_binary_div_loss\", float( linear_binary_div.data[0]), global_step) if", "plot_alignment(attn.T, path, info=\"{}, {}, step={}\".format( hparams.builder, time_string...
[ "find_faces(capture) for bbox in faces: rect = pygame.Rect(bbox.left(), bbox.top(), bbox.width(),", "import pygame.camera # Init display screen = pygame.display.set_mode((0,0), pygame.FULLSCREEN) pygame.display.set_caption(\"Magic", "pygame.event.get(): if event.type in (pygame.QUIT, pygame.KEYDOWN): return cap...
[ "in Django. \"\"\" from resolwe.__about__ import ( # noqa: F401", "Resolwe ======= Open source enterprise dataflow engine in Django. \"\"\"", "( # noqa: F401 __author__, __copyright__, __email__, __license__, __summary__, __title__,", "source enterprise dataflow engine in Django. \"\"\" from resolwe.__about__...
[ "fig.savefig(f'./output_{FILE_PREFIX}/{FILE_PREFIX}_activation_matrix.png', bbox_inches='tight', transparent=True) # %% [markdown] # ## Visualizing distribution", "%% for column in df.iloc[:, 3:-1].columns: hmap = som.get_weights()[:, :,", "'grupo' class_assignments = som.label_map(np.array(df_train), np.array(...
[ "the supplied competition code. \"\"\" # return Competition return Competition", "results. Returns ------- Competition A Competition object with the most", "competition): \"\"\" Retrieve data and enrich the supplied competition with", "a UpdateEngine object.\"\"\" def get_competition(self, code): \"\"\" Retri...
[ "deckgl_doc_url = DECKGL_URL_BASE + deckgl_docs_layer_name # Create new .html examples", "f in EXAMPLE_GLOB] if not candidate_files: raise Exception(\"No files found", "for rtfd.io, set this variable from the Admin panel raise", "), shell=True, ) python_code = open(pydeck_example_file_name, \"r\").read() doc_...
[ "isRot(value): try: a = int(value.split('_')[0].split('R')[1]) b = int(value.split('_')[1][0]) c =", "-1, -1, -1 # return true if it has a", "of 'Ri' # return true if it is a float", "COM (center of mass) position and velocity\\n') out_file.write(' * feet", "xg out_file.write('\\n // jacobian com absolute p...
[ "(for example 5d or 12h or 30m).\") parser.add_argument(\"-o\", \"--output\", help=\"Output", "coding: utf-8 -*- from pymisp import PyMISP from keys import", "5d or 12h or 30m).\") parser.add_argument(\"-o\", \"--output\", help=\"Output file\") args", "# Usage for pipe masters: ./last.py -l 5h | jq", "| jq ...
[ "from .widget.scene.urls import urlpatterns as scene_urls from .widget.benefit.urls import urlpatterns", "import urlpatterns as special_page_urls from .store.bank_account.urls import urlpatterns as bank_account_urls", "---------------------------------------------- urlpatterns = [ url(r'^$', core_views.index, n...
[ "sys import torch import yaml from functools import partial sys.path.append('../../../../')", "torch import yaml from functools import partial sys.path.append('../../../../') from trainers", "sys.path.append('../../../../') from trainers import trainer, frn_train from datasets import dataloaders", "import os ...