ngram
listlengths
0
67.8k
[ "NEVER be displayed outside the admin panel. \"\"\" anonymous_user = models.GenericIPAddressField(blank=True, null=True) def", "Poll class BasePollTelemetry(models.Model): \"\"\" This Base class gives a hint that in the", "UsersPollTelemetry(BasePollTelemetry): users = models.ManyToManyField(db_index=True, to=g...
[ "BaseBEVBackbone from .decouple_bev_backbone import DecoupledBEVBackbone __all__ = { 'BaseBEVBackbone': BaseBEVBackbone, 'DecoupledBEVBackbone': DecoupledBEVBackbone, }", "import BaseBEVBackbone from .decouple_bev_backbone import DecoupledBEVBackbone __all__ = { 'BaseBEVBackbone': BaseBEVBackbone, 'DecoupledBEVBa...
[ "as exc_info: self.param.from_json(\"42\", self.trans, {\"input_bam\": model.HistoryDatasetAssociation()}) assert str(exc_info.value) == \"parameter 'my_name': requires a", "overlap here with DataToolParameterTestCase, # refactor. def setUp(self): super().setUp() self.test_history = model.History() self.app.model...
[ "#!/usr/bin/env python # -*- coding: utf-8 -*- \"\"\"recumpiler Recompile text to be semi-readable", "python # -*- coding: utf-8 -*- \"\"\"recumpiler Recompile text to be semi-readable memey", "Recompile text to be semi-readable memey garbage. \"\"\" __version__ = (0, 0, 0)", "-*- coding: utf-8 -*- \"\"\"recu...
[ "'http/http_pipelined_host_forced.h', 'http/http_pipelined_host_impl.cc', 'http/http_pipelined_host_impl.h', 'http/http_pipelined_host_pool.cc', 'http/http_pipelined_host_pool.h', 'http/http_pipelined_stream.cc', 'http/http_pipelined_stream.h', 'http/http_proxy_client_socket.cc', 'http/http_proxy_client_socket.h', ...
[ "% (gpu_count)) self.__model = nn.DataParallel(self.model) self.__set_model2cuda() else: self.__set_model2cuda() def __set_optimizer(self): self.__optimizer = torch.optim.RMSprop(", "__init__(self, lr=0.001): self.lr = lr self.__model = None self.__optimizer = None self.__criterion =", "as nn from abc import AB...
[ "'as {0} as', }) return ('Place #{p1} is {rating} place #{p2}').format( p1=self.place1, p2=self.place2,", "this rating compares \"\"\" score = models.IntegerField() \"\"\" The rating score. 1 means", "= models.CharField(max_length=32, choices=SOURCES) location_data = models.CharField(max_length=2048) \"\"\" The...
[ "TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE", "BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED", "AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL", "CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,...
[]
[ "= None password = <PASSWORD> id = None account_number = None production =", "None account_number = None production = None from estafeta.core.error import EstafetaWrongData, EstafetaEmptyField __url_label__", "import EstafetaClient user = None password = <PASSWORD> id = None account_number =", "<PASSWORD> id ...
[ "yunionclient.common import base class FlavorManager(base.StandaloneManager): keyword = 'flavor' keyword_plural = 'flavors' _columns =", "class FlavorManager(base.StandaloneManager): keyword = 'flavor' keyword_plural = 'flavors' _columns = ['ID', 'Name', 'VCPU_count',", "keyword = 'flavor' keyword_plural = 'fla...
[ "26 স 27 ষ 28 ই 29 আ 30 ছ 31 গ 32", "{} index_map = {} for line in char_map_str.strip().split('\\n'): ch, index = line.split() char_map[ch]", "র 17 ণ 18 ক 19 ড 20 হ 21 উ 22 প", "text and integer sequences. \"\"\" char_map_str = \"\"\" ' 0 <SPACE> 1 ব", "90 ঋ 91 i 92 z 93 m 94 e 95 ঊ 96", "আ 30 ছ 31 গ 32 ু...
[ "Api # from restful import Api from resources.Hello import CategoryResource api_bp = Blueprint('api',", "import Api from resources.Hello import CategoryResource api_bp = Blueprint('api', __name__) api = Api(api_bp)", "flask import Blueprint from flask_restful import Api # from restful import Api from", "impor...
[ "} else: message = {'unknown_signal': args } socketio.emit('message', json.dumps(message)) def dbus_monitor(): bus.subscribe(iface =", "bus.subscribe(iface = 'org.ofono.Modem', signal_fired = cb_server_signal_emission) bus.subscribe(iface = 'org.ofono.NetworkRegistration', signal_fired = cb_server_signal_emission...
[ "def search(env, r, *args): return r.execute_command('ft.search', *args) def testTagIndex(env): r = env env.expect('ft.create',", "if not env.is_cluster(): forceInvokeGC(env, 'idx1') forceInvokeGC(env, 'idx2') forceInvokeGC(env, 'idx3') forceInvokeGC(env, 'idx4') forceInvokeGC(env, 'idx5')", "idx3 SCHEMA t TAG ...
[ "cant replace 1 with \"Target.None.value\" because \".None\" doesnt seem to be a valid", "range(-distance, distance + 1, placement_step)] ) ] res = await self._client.query_building_placement(building, possible_positions) possible", "and unit.distance_to(target) <= cast_range ): # cant replace 1 with \"Target.N...
[ "str, ) -> JVMLockfileMetadataV1: metadata = _get_metadata(json_dict, lockfile_description, error_suffix) requirements = metadata( \"generated_with_requirements\",", "typing import Any, Iterable, cast from pants.core.util_rules.lockfile_metadata import ( LockfileMetadata, LockfileMetadataValidation, LockfileScope...
[ "filename) includes = include_pattern.findall(dbc_file_in) output_filename = filename.replace('.dbc', '_generated.dbc') output_file_location = os.path.join(output_path, output_filename) with", "filename) core_dbc = include_pattern.sub('', dbc_file_in) dbc_file_out.write(core_dbc) def create_all(output_path): for ...
[ "\"\"\" Breed ModelAdmin. \"\"\" search_fields = ['name'] class SubBreedAdmin(admin.ModelAdmin): \"\"\" SubBreed ModelAdmin. \"\"\"", "\"\"\" search_fields = ['name', 'owner__name'] autocomplete_fields = ['owner', 'breed', 'sub_breed'] list_display = ['name',", "Dog, Breed, SubBreed class OwnerAdmin(admin.Model...
[ "__future__ import absolute_import from redis import Redis from rq.decorators import job from kaneda.utils", "connection=Redis()) def report(name, metric, value, tags, id_): \"\"\" RQ job to report metrics", "get_backend backend = get_backend() @job(queue='kaneda', connection=Redis()) def report(name, metric, v...
[ "= f\"{self.ripped_certs_path}\\\\{file_name}.pdf\" with open(output_file_name, \"wb\") as out: pdf_writer.write(out) print( f\"\\x1b[95m[{process_index}]\\x1b[0m Ripped \\x1b[92m[{file_name}]\\x1b[0m from", "pdf_writer = PdfFileWriter() pdf_writer.addPage(page) output_file_name = f\"{self.ripped_certs_path}\\\\{...
[ "num8 = ibm_db.field_num(stmt, \"WEIGHT\") else: num1 = ibm_db.field_num(stmt, \"ID\") num2 = ibm_db.field_num(stmt, \"BREED\")", "= ibm_db.field_num(stmt, \"Breed\") num6 = ibm_db.field_num(stmt, 8) num7 = ibm_db.field_num(stmt, 1) num8 =", "if conn: ibm_db.autocommit(conn, ibm_db.SQL_AUTOCOMMIT_OFF) insert = ...
[ "reverse, NoReverseMatch from django.utils.translation import ugettext_lazy as _ from .models import PageBannerExtension _banner_change_url", "= (reverse(_banner_add_url) + '?extended_object=%s' % self.page.pk) except NoReverseMatch: # not in urls pass", "not self.page: # Nothing to do return # check global per...
[ "are ['LSTM', 'GRU', 'RNN_TANH' or 'RNN_RELU']\"\"\") self.rnn = nn.RNN(ninp, nhid, nlayers, nonlinearity=nonlinearity, dropout=dropout)", "else: self.decoder = decoder def _generate_square_subsequent_mask(self, sz): mask = (torch.triu(torch.ones(sz, sz)) == 1).transpose(0,", "decoder def _generate_square_subse...
[ "main(): a=input(\"The enter the first number :\") b=input(\"The enter the second number :\")", "enter the second number :\") range=input(\"Please enter the range\") i=0;count=0; print a print", "def main(): a=input(\"The enter the first number :\") b=input(\"The enter the second number", "first number :\") b...
[]
[ "判定する数字 Returns: str: 答えのmax(答えになりうる値の最大)を変更する。デフォは50 1にするとマジ?と訊かれる。それだけ。 不可思議な数字は0である ''' global answer global max # 入力された値に応じて返答を構成、maxを変更、ニューゲーム", "'''number 判定 Args: num (int): 判定する数字 Returns: str: num が answer より大きい: 'Too", "if num > answer: return ' is too large. The answer is more", "が answer より小さい: 'T...
[ "funcv.bindings: func = funcb.data log.info(\"Trying %s with fake arguments\", func) if isinstance(func, abstract.INTERPRETER_FUNCTION_TYPES):", "node2 = self.maybe_analyze_method(node1, val, cls) node2.ConnectTo(node0) return node0 def bind_method(self, node, name, methodvar,", "proc = subprocess.Popen([\"/usr...
[ "pooled_gff, demux_count_file, output_prefix, out_group_dict, in_fafq=None ): \"\"\" :param pooled_sam: SAM file :param demux_count_file:", "group} GFFs If input fasta/fastq is given, optionally also output per-{barcode group} FASTA/FASTQ", "eval(outgroup_dict) out_group_dict = dict([tmp]) if len(tmp) == 1 else...
[ "skimage.util import random_noise maxSlope = 10 # restrict the maximum slope of generated", "image to draw to cX -- x value of circle center cY --", "of line parameters (intercept, slope) scores -- hypotheses scores, array shape (NxM), see", "self.bg_clr = bg_clr def draw_circle(self, data, cX, cY, r, clr, al...
[ "print('Converting Seprsco to WAV Audio') wav_tracks = [] for track in seprsco_tracks: wav", "dropout = .1 maxnorm = None vae_b1 , vae_b2 = .02 , .1", ".1 maxnorm = None vae_b1 , vae_b2 = .02 , .1 print('Reinitiating VAE", "than each of the four voices present in an NESM track. To do", "load data training_f...
[ "and self.syslog not in (False, 0): if isinstance(self.syslog, (list, tuple)): _addr = tuple(self.syslog)", "fmt if fmt is not None else \"%(asctime)-15s %(name)s %(levelname)s %(message)s\" if 'LOGLEVEL'", "_addr = \"/dev/log\" if os.path.exists(\"/dev/log\") else None if _addr is not None: handler", "(list,...
[ "#Author <NAME> print(\"Hello World\") hello_list = [\"Hello World\"] print(hello_list[0]) for i in hello_list:", "<NAME> print(\"Hello World\") hello_list = [\"Hello World\"] print(hello_list[0]) for i in hello_list: print(i)" ]
[ "namedtuple('_', ['qtype', 'kb_ident']) class FakeDoc: def __init__(self, text, qtype, kb_ident): self._ = _fake_ext(qtype,", "def __init__(self, text, qtype, kb_ident): self._ = _fake_ext(qtype, kb_ident) self.text = text def", "kb_ident): self._ = _fake_ext(qtype, kb_ident) self.text = text def __str__(self):...
[ "import ABCMeta, abstractmethod from typing import Tuple, Callable class BaseTradeStrategy(object, metaclass=ABCMeta): @abstractmethod def", "asset_precision: int, min_cost_limit: float, min_amount_limit: float): pass @abstractmethod def trade(self, action: int, n_discrete_actions:", "abstractmethod from typing...
[ "= Book(); print(b1.category) b2 = b1; print(b2.category) print(Book.category) Book.category = '수필' print(b2.category); print(b1.category)", "b2 = b1; print(b2.category) print(Book.category) Book.category = '수필' print(b2.category); print(b1.category) ; print(Book.category) b2.category", "Book04_1.py class Book:...
[ "underlying C context.\"\"\" self._lib_vscf_kdf1.vscf_kdf1_delete(self.ctx) def set_hash(self, hash): self._lib_vscf_kdf1.vscf_kdf1_use_hash(self.ctx, hash.c_impl) def alg_id(self): \"\"\"Provide algorithm", "context.\"\"\" self._lib_vscf_kdf1 = VscfKdf1() self._c_impl = None self._ctx = None self.ctx = self._lib...
[ "dog = models.Dog(name='Snoopy') self.assertEqual(dog.says(), 'woof') def test_cat_says(self): \"\"\"test cat says meow of not", "test_cat_says(self): \"\"\"test cat says meow of not \"\"\" cat = models.Cat(name='Garfield') self.assertEqual(cat.says(), 'meow')", "models class AnimalTestCase(TestCase): \"\"\"Tes...
[ "print('Digite seu nome completo: ') nome = input().strip().upper() print('Seu nome tem \"Silva\"?') print('SILVA'", "seu nome completo: ') nome = input().strip().upper() print('Seu nome tem \"Silva\"?') print('SILVA' in", "nome completo: ') nome = input().strip().upper() print('Seu nome tem \"Silva\"?') print(...
[ "= 'data/datasets/stvqa/defaults/annotations/' vocab_path = 'data/datasets/stvqa/defaults/extras/vocabs/' train_datasets = ['train'] test_datasets = ['val'] reader_train_cfg =", "+ 'ocr_en_frcn_features.lmdb', ), mix_annotations=dict( train=data_root + annotation_path + 'imdb_subtrain.npy', val=data_root + annota...
[ "field=models.ManyToManyField(blank=True, to='rpocore.FormalStatement', verbose_name='Formal statements'), ), migrations.AlterField( model_name='statementpage', name='informal_statements', field=models.ManyToManyField(blank=True, to='rpocore.InformalStatement', verbose_name='Informal statements'), ),", "to='rpoco...
[ "gpiozero import LineSensor from time import sleep from signal import pause def lineDetected():", "from gpiozero import LineSensor from time import sleep from signal import pause def", "import pause def lineDetected(): print('line detected') def noLineDetected(): print('no line detected') sensor =", "from tim...
[ "71 72 96 95 94 93 -\"], [\"J2\", \"- 136 135 134 133", "Pins(\"138 142 9 11 12 139 8 10\"), IOStandard(\"LVCMOS33\")), ] # Connectors ---------------------------------------------------------------------------------------", "1, Pins(\"59\"), IOStandard(\"LVCMOS33\")), (\"user_btn\", 2, Pins(\"60\"), IOStandard...
[ "= np.zeros((N, len(self.actions))) new_test = self.test.get_subset(chosed_actions) virtual_t \\ = self.predictor.get_predict_samples(self.training, new_test, N) for", "= virtual_t[n, :] if virtual_train.Z is None: train.add(virtual_train.X, virtual_train.t) else: train.add(virtual_train.X, virtual_train.t, virtu...
[ "def _disable_linecache(): import linecache def fake_getline(*args, **kwargs): return \"\" linecache.orig_getline = linecache.getline linecache.getline", "_disable_linecache(): import linecache def fake_getline(*args, **kwargs): return \"\" linecache.orig_getline = linecache.getline linecache.getline =", "impor...
[ "#locate image_loc = html.findAll('img') #create folder for located imgs if not os.path.exists('imgs'): os.makedirs('imgs')", "requests.get(url) html = bs(page.text, 'html.parser') #locate image_loc = html.findAll('img') #create folder for located", "image in image_loc: try: url = image['src'] source = requests...
[ "time from appium import webdriver import queue # 声明一个python队列 driver_queue = queue.Queue() class", ": %s' % command) subprocess.Popen(command, stdout=open(SYSTEMPATH, 'a+'), stderr=open(ERRORPATH, 'a+'), shell=True) def test_server(self): #", "2、启动driver ''' from lib.tools import Tool import subprocess from li...
[ "flag: ans.add((iR + 1, iC)) if (iR+1, iC + 1) in flag: ans.add((iR+1,", "from collections import deque class Solution: def pondSizes(self, land: List[List[int]]) -> List[int]: def", "提示: 0 < len(land) <= 1000 0 < len(land[i]) <= 1000 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/pond-sizes-lcci", "0 < ...
[ "\"\"\" Return a dict whose keys are instances of :class:`re.Match` and whose values", "(latsec != '00' or longsec != '00'): precision = Decimal('0.000001') elif (latmin !=", "longsec = '00' else: latsec = parts.get('latsec', '') or '00' longsec = parts.get('longsec',", "longsec > 59: # Assume that 'seconds' ...
[ "package_data={ 'pokedex': ['data/csv/*.csv'] }, install_requires=[ 'SQLAlchemy>=1.0,<2.0', 'whoosh>=2.5,<2.7', 'markdown==2.4.1', 'construct==2.5.3', 'six>=1.9.0', ], entry_points={ 'console_scripts':", "'markdown==2.4.1', 'construct==2.5.3', 'six>=1.9.0', ], entry_points={ 'console_scripts': [ 'pokedex = pokede...
[ "for i in range(p.num_lstm_layers): if i == 0: input_dim = self._first_lstm_input_dim else: input_dim", "# cnn/batch-norm/relu -> # bidirectional conv-lstm -> # cnn/batch-norm/relu # bidirectional lstm ->", "# requirement from FRNN). first_lstm_input_dim_unpadded = lstm_input_shape[2] * lstm_input_shape[3] if s...
[ "백분율 텍스트 표시 else: ## 총합을 100으로 맞추기위해 마지막 백분율은 100에서 백분율 누적값을", "누적값을 빼준다. ax.text(x, y, f'{100 - sum_pct:.2f}%', ha='center', va='center',size=22,color='white', weight='bold') # pie.rc('font', family=font_name)", "matplotlib.pyplot as plt import numpy as np font_location = './wordcloud_file/malgun.ttf' # For Wi...
[ "<reponame>kbilak/City-portal from django.shortcuts import render from django.views.generic import TemplateView def index(request): return render(request,", "from django.shortcuts import render from django.views.generic import TemplateView def index(request): return render(request, 'index.html')" ]
[ "return redirect('detail', myloc_id=myloc.id) else: activity_form = NewActivityForm() return render(request, 'new_activity.html', {\"form\": activity_form,'myloc':myloc}) @login_required(login_url=\"/accounts/login/\")", "= current_user post.myloc=myloc post.save() return redirect('detail', myloc_id=myloc.id) els...
[ "part2 if __name__ == \"__main__\": # trying out the new walrus[:=] oprtr in", "part1, part2 if __name__ == \"__main__\": # trying out the new walrus[:=] oprtr", "Day 1 Main Module \"\"\" from day01 import parse_input, part1, part2 if __name__", "day01 import parse_input, part1, part2 if __name__ == \"__main_...
[ "key used in production secret! SECRET_KEY = os.environ.get('SECRET_KEY') # SECURITY WARNING: don't run", "http://developer.yahoo.com/performance/rules.html#expires 'Expires': 'Thu, 31 Dec 2099 20:00:00 GMT', 'Cache-Control': 'max-age=94608000', } AWS_STORAGE_BUCKET_NAME =", "= [ { 'NAME': 'django.contrib.auth....
[ "where toppling occurs. ''' # size is either batch_size, or shorter if we're", "def next_batch(self, random_window=True, focus_toppling=False): ''' Returns the next batch of data. if random_window=True", "norm_info.density_offset self.density_max = norm_info.density_max self.mass_offset = norm_info.mass_offset ...
[ "= np.diag(confusion_matrix) list_raw_sum = np.sum(confusion_matrix, axis=1) each_acc = np.nan_to_num(truediv(list_diag, list_raw_sum)) average_acc = np.mean(each_acc)", "AA_andEachClassAccuracy(confusion_matrix): counter = confusion_matrix.shape[0] list_diag = np.diag(confusion_matrix) list_raw_sum = np.sum(conf...
[ "fname_out == '': path_out = '' # output in user's current directory file_out", "= arguments[\"-o\"] if \"-x\" in arguments: transform.interp = arguments[\"-x\"] if \"-r\" in arguments:", "is a wrapper for sct_WarpImageMultiTransform # # --------------------------------------------------------------------------...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "KIND, either express or implied. # See the License for the specific language", "# limitations under the License. \"\"\"Tests methods in plugin_bas...
[ "Address(raw=value) obj.save() return obj # A dictionary of named address components. elif isinstance(value,", "= Country.objects.create(name=country, code=country_code) else: country_obj = None # Handle the state. try: state_obj", "txt = '%s' % self.raw return txt def clean(self): if not self.raw: raise", "=...
[ "can be run as tasks. \"\"\" from __future__ import (absolute_import, division, print_function, unicode_literals)", "utf-8 -*- \"\"\" Modules for exposing functions that can be run as tasks.", "# -*- coding: utf-8 -*- \"\"\" Modules for exposing functions that can be", "that can be run as tasks. \"\"\" from _...
[ "'name': line.name, 'partner_id': line._get_partner_id(credit_account=True), 'account_id': credit_account_id, 'journal_id': slip.journal_id.id, 'date': date, 'debit': amount <", "raise UserError(_('The Expense Journal \"%s\" has not properly configured the Credit Account!') %", "odoo.tools import float_compare,...
[ "hspace=0.05) font = {\"family\": \"serif\", \"weight\": \"bold\"} plt.suptitle(title) j = 0 for i", "else: ax1.imshow(x[idx, ...], cmap=cmap) plt.axis(\"off\") j += 1 plt.show() def plot_2D(x, y, title,", "list(np.where(y == list(labels.keys())[i])[0][: grid_x - 1]) label = labels[list(labels.keys())[i]] for k...
[ "logger.setLevel(logging.INFO) self.logger = logger def run(self): self.state.run(self) @property def state(self): return self._state @state.setter", "'user3', 'user4', 'user5'] FACILITY = ['KERN', 'USER', 'MAIL', 'DAEMON', 'AUTH', 'SYSLOG', 'LPR', 'NEWS',", "'hostip': HOSTIP[1], 'severity': SEVERITY[1], 'facil...
[]
[ "<reponame>utiasASRL/pysteam from typing import Optional import numpy as np from . import Evaluator", "vector space state variable\"\"\" def __init__(self, meas: np.ndarray, state_vec: VectorSpaceStateVar) -> None: super().__init__()", "import VectorSpaceStateVar class VectorSpaceErrorEval(Evaluator): \"\"\"Err...
[]
[ "import hashlib def is_address(ck: PyAddress, hrp, ver): \"\"\"check bech32 format and version\"\"\" try:", "-> PyAddress: assert len(dummy_identifier) == 20 return PyAddress.from_param('dummy', 0, dummy_identifier) __all__ = [", "\"\"\"check bech32 format and version\"\"\" try: if ck.hrp != hrp: return False i...
[ "\", \".join(steps)) logger.info(\"Submitting with sbatch...\") jids: typing.Dict[str, str] = {} for step in", "[jids[dep] for dep in common.DEPENDENCIES[step] if dep in jids] cmd = [\"sbatch\"] if", "from logzero import logger from toposort import toposort from . import common from", "stdout_raw = subprocess...
[ "2D and 3D operators. \"\"\" grid = Grid(shape=shape) buffer = StringIO() temporary_handler =", "numpy as np from devito import Grid, Function, TimeFunction, Eq, Operator, configuration, silencio", "ImportError: # Python3 compatibility from io import StringIO import pytest from conftest import", "to in [1, 2,...
[ "parser = argparse.ArgumentParser() parser.add_argument('--img_dir', type=str) parser.add_argument('--gt_dir', type=str) parser.add_argument('--data_list', type=str) parser.add_argument('--out_dir', type=str) parser.add_argument('--out_name', type=str)", "'segmentation': [word.bbox.val], 'category_id': word.label...
[ "import run as running_run @app.command() def run( targets: Optional[List[str]] = Argument(None), handout: bool", "import Paths from deckz.running import run as running_run @app.command() def run( targets: Optional[List[str]]", "Path(\".\"), ) -> None: \"\"\"Compile main targets.\"\"\" paths = Paths.from_defaul...
[ "django import template register = template.Library() @register.filter(name='isboolean') def isboolean(value): return isinstance(value, bool) @register.filter(name='vartypename')", "register = template.Library() @register.filter(name='isboolean') def isboolean(value): return isinstance(value, bool) @register.filt...
[ "app = FastAPI() app.mount(\"/static\", StaticFiles(directory=\"static\"), name=\"static\") app.add_middleware(CustomHeaderMiddleware) app.include_router(apirest.router) app.include_router(websockets.router) @app.on_event(\"startup\") async def handle_startup()", "encoding='utf-8', maxsize=20) cvar_redis.set(pool...
[ "image file name', required=True) opts = parser.parse_args() if opts.action == 'encode': autoencoder.encode(opts.model, opts.input,", "= parser.add_subparsers(dest=\"action\") encode_parser = subparsers.add_parser('encode') addTrainablesArg(encode_parser) encode_parser.add_argument('--input', dest='input', help='...
[ "the client requested some type of Pluggable Transport. \"\"\" transport = None logging.debug(\"Parsing", "had its filters generated via :meth:`~EmailBridgeRequest.generateFilters`. \"\"\" request = EmailBridgeRequest() skippedHeaders = False", "bridge distribution system. # # :authors: <NAME> <<EMAIL>> # <NAME...
[ "docstring \"\"\" def _impl(_ctx): \"\"\" Function docstring \"\"\" pass some_rule = rule( attrs", "attrs = { \"attr1\": attr.int( default = 2, mandatory = False, ), \"attr2\":", "= { \"attr1\": attr.int( default = 2, mandatory = False, ), \"attr2\": 5,", "def _impl(_ctx): \"\"\" Function docstring \"\"\" pas...
[ "connection import * from jinja2 import Environment, FileSystemLoader import webbrowser def print_report(id): env", "import Environment, FileSystemLoader import webbrowser def print_report(id): env = Environment(loader=FileSystemLoader('.')) template = env.get_template(\"src/template.html\")", "with open('print...
[ "user may want {None} as the default # value; we need a way", "my name yield renderer.trait(name=self.name, value='') # go through the items for item in", "value, workload): \"\"\" Render {value} using {renderer} \"\"\" # get my schema schema", "want {None} as the default # value; we need a way to know", "c...
[ "other energies are reported. energy_fermi = sec_scc.energy.fermi if energy_fermi is None: continue energy_fermi", "def init_quantities(self): self._quantities = [] self._quantities.append( Quantity( 'fermi_energy', r'Fermi Energy:\\s*([\\d\\.]+)\\s*', unit=ureg.hartree, repeats=False)) def", "float(v[1]) * ure...
[ "required parameter `user_id` when calling `get_file_metadata`\") # noqa: E501 collection_formats = {} path_params", "noqa: E501 return self.api_client.call_api( '/locations/{location_id}/files/{fileId}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_f...
[ "2021-10-22 14:23 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('reservation_management', '0020_greenpass'),", "# Generated by Django 3.2.7 on 2021-10-22 14:23 from django.db import migrations class", "dependencies = [ ('reservation_management', '0020_greenpass'), ] o...
[ "bw = 2*np.pi*f t = np.arange(0, dur, dt) np.random.seed(0) noise_power = None if", "output_ext) output_count += 1 fig_title = 'Signal Decoded Using Leaky IAF Population Decoder'", "a # display: import matplotlib matplotlib.use('AGG') from bionet.utils.misc import func_timer import bionet.utils.band_limited as"...
[ "= function( x,y ): return x+y def main(): TestError( F(1,2) == 3 )", "expr\"\"\" F = function( x,y ): return x+y def main(): TestError( F(1,2) ==", "\"\"\"func expr\"\"\" F = function( x,y ): return x+y def main(): TestError( F(1,2)", "F = function( x,y ): return x+y def main(): TestError( F(1,2) == 3" ]
[ "return media # Block Views def block_top_toolbar(self, context, nodes): if self.sortable_fields: pass #", "sortable_fields = ['sort'] # Media def get_media(self, media): if self.sortable_fields and self.request.GET.get(SORTBY_VAR): media", "= self.request.GET.get(REFRESH_VAR) # context.update({ # 'has_refresh'...
[ "@celery.task() def charge_cards(): lock = Lock(key=\"charge-cards-lock\") lock.acquire() log = Log() log.it(\"---Starting batch job...\")", "pass class Lock(object): \"\"\" Claim an exclusive lock. Using Redis. \"\"\" def __init__(self,", "today = datetime.now(tz=zone).strftime(\"%Y-%m-%d\") opportunities = Op...
[ "# pylint: disable=unused-argument ): \"\"\"TODO for this test. Either: 1. Not use own", "been called' addr2 = '0x78a087fCf440315b843632cFd6FDE6E5adcCc2C2' with etherscan_patch, ethtokens_max_chunks_patch, patch.object(blockchain, 'query_balances') as mock: #", "not have been called' addr2 = '0x78a087fCf440315b...
[ "(c) I am 2017 # Licence: <your licence> #------------------------------------------------------------------------------- def main(): pass if", "Created: 02/11/2017 # Copyright: (c) I am 2017 # Licence: <your licence> #-------------------------------------------------------------------------------", "02/11/2017...
[ "SQLAlchemy(metadata=metadata) migrate = Migrate() login = LoginManager() login.login_view = \"auth.login\" moment = Moment()", "# migrate.init_app(app, db) login.init_app(app) moment.init_app(app) md.init_app(app) bootstrap.init_app(app) from app.errors import bp as errors_bp", "import bp as cli_bp app.registe...
[ "sampled (s,pi,z)'s from the buffer # ~ 0.1s # TODO: if error, set", "== config.period_token: new_array[i, :j + 1] = 1 break elif array[i, j] ==", "np.concatenate(z_tmp, 0) # print('io time: ',time() - start_time) # decompresses sampled pi's #", "(s,pi,z)'s from the buffer # ~ 0.1s # TODO: if error, set a", ...
[ "code += f'execute if score {target[0]} {NAMESPACE} matches 0 run function {NAMESPACE}:{f2}\\n' else:", "+= c1 code += t1.cast(ot, tt1, target) code += c2 code += ot.binary(expression.op,", "= Int() if target is None or target == []: target = [get_temp()", "ttt in tt1: used_temps.remove(ttt) for ttt in tt2: u...
[ "if len(args) > 1: error(\"too many arguments\") in_fname = args[0] try: out_fname except", "--help show this help message and exit\" print >> sys.stderr, \" -o FILENAME,", "<stdint.h>\\n\\n\") h_file.write(\"#include <stdint.h>\\n\\n\") addr = 0 i = 0 for line in in_file:", "= int(m[0][0], 16) name = m[0][1]...
[ "os.path.join(os.getcwd(), \"nonexistent\") under_test.set_screenshot_folder(path) logger.error.assert_called_with('Given screenshots path \"%s\" does not exist' % path) logger.warn.assert_called_with(", "== os.getcwd() def test_set_screenshot_folder_nonexistent(mocker: MockerFixture, under_test: x3270): mocker.p...
[ "'rsr' in FILTERS[filt]['method']: rsr = kwargs.get('rsr',True) # Read in filter if isinstance(custom,bool) and", "not isinstance(ftrans,numpy.ndarray): raise ValueError('\\nProblem reading in {}'.format(filterFolder+FILTERS[filt]['file'])) fwave = fwave[~numpy.isnan(ftrans)]*u.micron ftrans = ftrans[~numpy.isnan...
[ "def to_timestamp(date): print(date.timestamp()) return int(date.timestamp()) def to_minutes(duration): return duration / ONE_MINUTE def to_days(duration):", "int(date.timestamp()) def to_minutes(duration): return duration / ONE_MINUTE def to_days(duration): return duration / ONE_DAY", "def to_minutes(duration)...
[ "profile object with no z_dim (vertical dimension). Provide an array of netcdf files", "range(n_ax): ur_index = np.unravel_index(ii, (n_r, n_c)) # Select season if required if plot_seasons:", "fn_out = \"/Users/dbyrne/transfer/surface_gridded_errors_{0}.png\".format(run_name) #%% General Plot Settings var_name ...
[ "documents. :returns: tf-idf of corpus. \"\"\" return TfidfVectorizer().fit_transform(corpus) if __name__ == '__main__': sample_corpus", "- inverse document frequency (idf). :param corpus: List of documents. :returns: tf-idf of", "if __name__ == '__main__': sample_corpus = [ 'This is sample document.', 'another...
[ "writting to destinations. \"\"\" dest_obj = dict() lock_obj = threading.Lock() class ThreadedUDPServer(socketserver.ThreadingMixIn, socketserver.UDPServer):", "== b\"Register\": LOCK.acquire() name = params[1] if b\"FSW\" in name: if FSW_clients: process_id", "\"\"\" dest_list = [] # Process data here... head,...
[ "range(4) logging.basicConfig( format=\"%(asctime)s - %(name)s - %(levelname)s - %(message)s\", level=logging.INFO ) logger =", "DELETE_DB, UPDATE_TG, UPDATE_BTB, PANIC_BUTTON, CUSTOM_SCRIPT, ) = range(8) BOUGHT, BUYING, SOLD, SELLING =", "import time ( MENU, EDIT_COIN_LIST, EDIT_USER_CONFIG, DELETE_DB, UPDATE_...