ngram
listlengths
0
67.8k
[ "from flask import current_app from feedgen.ext.base import BaseEntryExtension, BaseExtension from feed.domain import Author,", "The feed's root element. Returns ------- atom_feed : Element The feed's root element.", "nodes for entry_child in entry: if entry_child.tag == \"author\": author = entry_child for", ...
[ "import _BaseConfig global_variables = GlobalVariables() @dataclass class BaseNodeConfig(_BaseConfig, ABC): platform: str = None", "MB. master_disk_size_gib: str = None # disk size in GB. master_disk_count: int =", "None working_dir: str = consts.WORKING_DIR master_memory: int = None master_vcpu: int = None", ...
[ "class MemPool(object): def __init__(self): self.pool = {} # setup logging logging.basicConfig(level=logging.DEBUG) self.logger =", "import uint256_to_shortstr class MemPool(object): def __init__(self): self.pool = {} # setup logging logging.basicConfig(level=logging.DEBUG)", "return False self.pool[hash] = tx ...
[ "print('simple_command(%s)' % (list(p))) if getattr(p, 'PIPE', None): p.simple_command.pipetocmd = p.pipe_commands return p.simple_command @_('assignments',", "# 'arith_command' # 'cond_command', # 'arith_for_command' # ) # def shell_command(self, p): #", "DONE', # 'UNTIL compound_list DO compound_list DONE', #...
[ "lmp #avg pregnancy length is 281 days def compute_days_between_dates(original_date, target_date): this_year = datetime.date(target_date.year,", "dt.days def print_due_date_information(min_due_date, max_due_date, expected_due_date): print('Your expected due date is ', expected_due_date.strftime('%a %b", "3: pri...
[ "'inlineFormInputGroup', 'placeholder': '12'})) class NumPeopleForm(forms.Form): num_people = forms.IntegerField(validators=[MinValueValidator(1)], widget=forms.TextInput(attrs={'class': 'form-control', 'id': 'inlineFormInputGroup', 'placeholder':", "Valley, CA 00000'})) class DestinationForm(forms.Form): destina...
[ "user.id) if not json_rsp['code']: data = json_rsp['data'] gift_name = data[\"gift_name\"] gift_num = data[\"gift_num\"]", "(-2, (2, 4), room_id, raffle_id) next_step_settings.append(next_step_setting) bili_statistics.add2raffle_ids(raffle_id/1000000, 'STORM') return next_step_settings @staticmethod async def", ...
[ "between 2 nodes \"\"\" hyperparameter_names = (\"late_gate\",) children_container = treeano.core.DictChildrenContainerSchema( early=treeano.core.ChildContainer, late=treeano.core.ChildContainer, )", "subtree = children[\"subtree\"] cost = children[\"cost\"] cost_ref = tn.ReferenceNode(name + \"_costref\", refere...
[ "no cover import bz2 #pragma: no cover import lzma #pragma: no cover class", "#pragma: no cover class RawFile(object):#pragma: no cover def __init__(self,filename): self.filename = filename if", "cover import lzma #pragma: no cover class RawFile(object):#pragma: no cover def __init__(self,filename): self.filena...
[ "\"zh-CN,zh;q=0.8,en;q=0.6,zh-TW;q=0.4\", \"Cache-Control\": \"max-age=0\", } class TestConf(BaseConf): REDIS_URL = \"redis://:{password}@{hostname}:{port}/{db_number}\".format( password=os.environ.get(\"REDIS_PWD\"), hostname='127.0.0.1', port=6379, db_number=0", "-*- coding: utf-8 -*- import os class BaseConf(o...
[ ":param type Model: database collection model to query (should be a subclass of", "pk_or_query: either - a <basestring> representation of the record's primary key, e.g. 'abcdef'", "1) :param bool allow_deleted: allow deleleted records? :param basestring display_name: :raises: HTTPError(404) if", "isinstance(p...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "Image(object): \"\"\" Represents information about images sent to image channels. \"\"\" @validate(name=text_conv, description=text_conv,", "KIND,...
[ "usb_hid import time class HumanKeyboard(object): def __init__(self): self.keyboard = Keyboard(usb_hid.devices) self.keyboardLayout = KeyboardLayoutUS(self.keyboard)", "keypress. Keyword arguments: keyCode -- the real key to be pressed (example Keycode.SEVEN)", "HumanKeyboard(object): def __init__(self): self.k...
[ "return MaxBiTreeDepthTestCases() def run_test(self, input): return self.maxDepth(input) def maxDepth(self, root): \"\"\" :type root:", ":rtype: int \"\"\" if not root: return 0 return max(self.maxDepth(root.left), self.maxDepth(root.right)) + 1", "MaxBiTreeDepthTestCases class MaxBiTreeDepth(Solution): def gen...
[ "search_fields = ['supplier_name', 'contact', ] admin.site.register(models.Suppliers, SupplierAdmin) class InventoryUserAdmin(admin.ModelAdmin): list_display = ('employee_name', 'user_type')", "= ('supplier_name', 'contact', ) search_fields = ['supplier_name', 'contact', ] admin.site.register(models.Suppliers, Su...
[]
[ "requests class ByteSession(object): def __init__(self, token, providedSession=False): self._userToken = token if providedSession ==", "providedSession self._session.headers = { \"Authorization\": token, \"User-Agent\": \"byte/0.2 (co.byte.video; build:145; iOS 13.3.0) Alamofire/4.9.1\"", "self._session = reque...
[ "pyqtgraph.Qt import QtCore, QtGui, mkQApp import numpy as np app = mkQApp() #", "utf-8 -*- \"\"\" Description of example \"\"\" import pyqtgraph as pg from pyqtgraph.Qt", "coding: utf-8 -*- \"\"\" Description of example \"\"\" import pyqtgraph as pg from", "example \"\"\" import pyqtgraph as pg from pyqtgrap...
[ "= { 'hbase.rootdir': 'file:///grid/0/var/lib/ambari-metrics-collector/hbase', 'hbase.tmp.dir': '/var/lib/ambari-metrics-collector/hbase', 'hbase.cluster.distributed': 'false' } properties = { 'hbase.rootdir':", "test_getZKHostPortString(self): configurations = { \"zoo.cfg\": { \"properties\": { 'clientPort': \"2...
[ "-*- import multiprocessing as mp import time from pudb.remote import set_trace def worker(worker_id):", "Simple worker process\"\"\" i = 0 while i < 10: if worker_id ==", "== '__main__': processes = [] for p_id in range(2): # 2 worker processes", "# represents some work print('In Process {}, i:{}'.format(wor...
[ "print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test", "def setUp(self): TestBase.setUp(self) # Find the breakpoint self.line = line_number('main.cpp', '// lldb testsuite", "TestBase.setUp(self) # Find the breakpoint self.line = line_numbe...
[ "im_output.show() def SHARPEN(): img = input(\"Insert the name of an image found in", "folder (for example: Image.png): \") im = Image.open(r\"C:\\Users\\{}\\Downloads\\{}\".format(user_account_name, img)) enhancer = ImageEnhance.Contrast(im) factor", "example: Image.png): \") im = Image.open(r\"C:\\Users\\{}\\...
[ "ID 2 sm.spawnMob(CURBROCK2, 190, -208, False) sm.createClock(1800) sm.addEvent(sm.invokeAfterDelay(1800000, \"warp\", CURBROCKS_ESCAPE_ROUTE_VER3, 0)) sm.waitForMobDeath(CURBROCK2) sm.warp(CURBROCKS_ESCAPE_ROUTE_VER2)", "MAP ID CURBROCKS_ESCAPE_ROUTE_VER3 = 600050050 # MAP ID 2 sm.spawnMob(CURBROCK2, 190, -208, ...
[ "Cancelling jobs on the University cluster forces programs to instantly quit, which sometimes", "way to prevent this from happening. The experiment will be stopped if a", "is checked after each epoch. \"\"\" import os from trainloops.listeners.listener import Listener class", "\"\"\" import os from trainloops...
[ "database notifications = Notifications.objects.filter(notification_owner=user_data[1]).values( \"id\", \"article_id\", \"notification_title\", \"notification_body\", \"notification_owner\", \"read_status\" ) # create", "class method is used to update a users article \"\"\" serializer_class = NotificationsAPIView...
[ "members. \"\"\" return copy.deepcopy(self) def extend(self, **kwargs): \"\"\"Returns a copy of this object", "return '%s(%s)' % (type(self).__name__, str(self)) def __eq__(self, other): return self._data == other def", "be # found in the LICENSE file. \"\"\"Implements a frozen dictionary-like object\"\"\" impo...
[]
[]
[]
[ "for label data in the retrieve dictionary. # Returns A tuple `(data, labels)`.", "data = d['data'] labels = d[label_key] data = data.reshape(data.shape[0], 3, 32, 32) return", "label data in the retrieve dictionary. # Returns A tuple `(data, labels)`. \"\"\"", "\"\"\" with open(fpath, 'rb') as f: if sys.vers...
[ "other', '0 ').splitlines()]) for key in rules: rules[key]=[(d[2:].strip(), int(d[:2].strip())) for d in rules[key].split(',", "int(d[:2].strip())) for d in rules[key].split(', ')] print(getNumBags('shiny gold')-1) #-1 cause shiny bag not", "rules[key]=[(d[2:].strip(), int(d[:2].strip())) for d in rules[key].sp...
[ "seq=5 \"\"\" coab = ['Blade', 'Xander', 'Tiki'] if __name__ == '__main__': from core.simulate", "\"\"\" `dragon `s1 `s2, seq=5 and cancel `s3, seq=5 and cancel or fsc", "and cancel `s3, seq=5 and cancel or fsc `fs, seq=5 \"\"\" coab =", "* from slot.d import * def module(): return Luther class Luther(Adv): a...
[ "None, masks: Optional[Union[Dict[str, \"ImageMask\"], Dict[str, dict]]] = None, ) -> None: super(Image, self).__init__()", "None: if self._path is not None: pil_image = util.get_module( \"PIL.Image\", required='wandb.Image needs the", "no cover import matplotlib # type: ignore import numpy as np # type:", "6...
[ "(milli//(1000*60))%60 hours= (milli//(1000*60*60))%24 if hours == 0: if minutes == 0: return '%d.%03d'", "milliseconds = milli % 1000 seconds= (milli//1000)%60 minutes= (milli//(1000*60))%60 hours= (milli//(1000*60*60))%24 if hours", "datetime # Gets time from milliseconds # Returns string formatted as HH:MM:S...
[ "= digits[skip + linecount*perline:skip + (linecount + 1)*perline] for i in range(columns): print(line[i*colwidth:", "printed + colwidth*columns) def calculateit(func, base, n, tofile): \"\"\"Writes first n base-digits of", "\\n> \") if tofile: tofile = open(tofile, \"w\") calculateit(pi, base, digits, tofile) ...
[ "verbose_name='ID')), ('username', models.CharField(default=uuid.uuid4, max_length=64, verbose_name='Username')), ('password', <PASSWORD>.models.<PASSWORD>(max_length=128, verbose_name='Password')), ('description', models.CharField(blank=True, default='', max_length=255)), ('user',", "'0010_domain_redirect_to'), ...
[ "python clients \"\"\" if \"tempest/api\" in filename or \"tempest/scenario\" in filename: res =", "Unless required by applicable law or agreed to in writing, software # distributed", "mutable_default_args.match(logical_line): yield (0, msg) @core.flake8ext def no_testtools_skip_decorator(logical_line): \"\"\"C...
[ "import sys import logging from K8055Controller import K8055Controller logging.basicConfig() controller_log = logging.getLogger(\"Controller\") class", "def reset(self): self.k8055.reset() controller_log.debug(\"reset\") return 0 def turn_on(self, i): self.k8055.turn_on(i) controller_log.debug('turned on %i'", ...
[]
[ "of '.' or ? or !. for l in re.split(r\"\\.|\\?|\\!\",paragraph): # print(l) ss", "feel low or joyless much of the time. Some depressive symptoms, \" +", "\" + \"messengers like serotonin and melatonin function. The leading \" + \"treatment", "depressive symptoms, \" + \"such as appetite and sleep changes, lo...
[ "authenticating with Okta.\") # Collect and organize user specific information helpers.process_options(args) # Authenticate", "with Okta.\"\"\" # Set some required initial values args = helpers.setup(args) logging.debug(\"tokendito retrieves", "# Collect and organize user specific information helpers.process_op...
[]
[ "= gzip.GzipFile(fileobj=file) yield from self._parser(file) file_count += 1 if self._expected_file_count is not None:", "in self._qtype_map.items(): match = re.match(tag, line) if match: fields[target] = line[match.end():] reading =", "following: {self._path_globs} under {self._docs_dlc.path()}. Make sure that...
[ "data directory (default: data/). Args: output_dir: A string pointing to the location to", "data to. snippet_only: Downloads only the first 5 kB of the source, for", "def download(output_dir: str, snippet_only: bool, ignore_cache: bool = False) -> None: \"\"\"Downloads data", "source, for testing and file che...
[ "option invokes AutoSupport on all nodes in the cluster. type: str autosupport_message: description:", "HAS_NETAPP_LIB = netapp_utils.has_netapp_lib() class NetAppONTAPasupInvoke(object): ''' send ASUP message ''' def __init__(self): self.use_rest", "list() node_obj = netapp_utils.zapi.NaElement('system-node-ge...
[ "user = self.create_user() result = serialize(user) assert result[\"id\"] == str(user.id) assert result[\"name\"] ==", "serialize from freight.testutils import TestCase class UserSerializerTest(TestCase): def test_simple(self): user = self.create_user() result", "from freight.api.serializer import serialize fro...
[ "cz[b].std() fname = 'pozo_5m_dem_mean_cl%i.tif' % uc[j] WriteGTiff(fname, mean, x.min(), y.min()+500, step = 5)", "2], pts[:, 5] ix = (0.2 * (x - x.min())).astype('int') iy = (0.2", "x, y, z, c = pts[:, 0], pts[:, 1], pts[:, 2], pts[:, 5]", "10.24), sharex = True, sharey = True) uc = (2, 5) for j", "in ran...
[ "POINTER(...) type # for that class, with bases <coclass> and c_void_p. Also, the", "# POINTER(...) type gets a __ctypes_from_outparam__ method which # will QueryInterface for the", "mro() of a POINTER(App) type, where class App is a subclass of CoClass:", "# App # CoClass # c_void_p # _SimpleCData # _CData #...
[ "None if hasattr(self.opPanel, 'optionsForm'): self.opPanel.toggleMin.set(0) self.opPanel.min_entry.configure(state='disabled', fg='gray40') def setMax(self, max): if max is", "release self.canvas.itemconfigure(self.labelId2, text='') self.canvas.itemconfigure(self.labelId, text='') def mouseMove(self, event): dx...
[ "# GNU General Public License Usage # Alternatively, this file may be used", "# # Commercial License Usage # Licensees holding valid commercial Qt licenses may", "3 as published by the Free Software # Foundation with exceptions as appearing", "https://www.qt.io/terms-conditions. For further # information use ...
[ "i in range(num_vecs): lat_vecs.append(data[\"latent_codes\"][i].cuda()) return lat_vecs else: num_embeddings, embedding_dim = data[\"latent_codes\"][\"weight\"].shape lat_vecs =", "\"NormalizationParameters\" training_meshes_subdir = \"TrainingMeshes\" def load_experiment_specifications(experiment_directory): fi...
[ "Model -------------------') print('Loading data...') directory_path = resource_filename('EmoPy.examples','image_data/sample_image_directory') data_loader = DirectoryDataLoader(datapath=directory_path, validation_split=validation_split) dataset =", "= data_loader.load_data() if verbose: dataset.print_data_details...
[ "jinja2 import nodes from jinja2.ext import Extension class TestExtension(Extension): tags = {'test_ext'} def", "from jinja2.ext import Extension class TestExtension(Extension): tags = {'test_ext'} def parse(self, parser): return", "import nodes from jinja2.ext import Extension class TestExtension(Extension): t...
[ "elif metric.name == \"output/Device Input1\" or metric.alias == AliasMap.Device_Input1: # This is a", "isn't the DBIRTH payload = sparkplug.getDdataPayload() addMetric(payload, None, AliasMap.Device_Metric4, MetricDataType.String, newValue) # Publish", "msg.topic) tokens = msg.topic.split(\"/\") global newValu...
[ "\"AS IS\" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED,", "accompany this distribution. # THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY AND", "sys def get_package_dir(value): \"\"\"Get package directory\"\"\" package_dir = os.path.split(value)[0] if package_dir not in", "subject to the provis...
[ "= torch.randn(batch_size, hid_dim) output0 = expert0(batch) output1 = expert1(batch) loss = output0.sum() loss.backward()", "import pytest import torch from hivemind import RemoteExpert from hivemind.moe.server import background_server CUSTOM_EXPERTS_PATH", "for batch_size in (1, 4): batch = ( torch.randn(batc...
[ "ar < 150: print(\"价值动量超过110,小于150,做多\") target_pos.set_target_volume(100) # 如果ar大于50,小于90,开空仓 elif 50 < ar < 90:", "< 150: print(\"价值动量超过110,小于150,做多\") target_pos.set_target_volume(100) # 如果ar大于50,小于90,开空仓 elif 50 < ar < 90: print(\"价值动量大于50,小于90,做空\")", "该示例策略仅用于功能示范, 实盘时请根据自己的策略/经验进行修改 ''' from tqsdk import...
[ "1, 2], None, [8, 8, 8], [0, 256, 0, 256, 0, 256]) #", "array OpenCV image in BGR color space (the target image) Returns: ------- tuple:", "float('inf') for clip in bools: for preserve_paper in bools: # create candidate image", "75) top_true_loc = (5 + int(h / 2), 190) top_false_loc = (5, 190)", "if mn < ne...
[ "from Library.CreateATree import CreateATree tree = CreateATree.BinarySearchTree() nodesList = list((4, 5, 1, 3,", "tree = CreateATree.BinarySearchTree() nodesList = list((4, 5, 1, 3, 2)) for i in", "list((4, 5, 1, 3, 2)) for i in range(0, len(nodesList)): tree.insert(nodesList[i]) #tree.printInorder() tree.pri...
[ "path( 'search/page/<int:page>', views.Search.as_view(), name = 'search' ), path( 'sitemap.xml', views.Sitemap.as_view(), name = 'sitemap'", "urlpatterns = [ path( '', views.Home.as_view(), name = 'home' ), path( 'about-me', views.About_me.as_view(),", "VAZ Projects # # # Author: <NAME> <<EMAIL>> from django.ur...
[]
[ "be imune to task swiping on Android 9 self.Service.setAutoRestartService(True) self.confDict = {k: v", "stop. flow thus continues to next block of code #sys.exit() is to prevent", "continues to next block of code #sys.exit() is to prevent subsequent code from", "for k, v in confDict.items(): setattr(self, k,...
[ "def create_app(script_info=None): # instantiate the app app = Flask( __name__, template_folder=\"../client/templates\", static_folder=\"../client/static\", )", "the extensions bootstrap = Bootstrap() def create_app(script_info=None): # instantiate the app app =", "bootstrap = Bootstrap() def create_app(script_...
[ "def test_deserialize_corrupt(tmpdir): path = str(tmpdir / \"corrupt_cache.dat\") with open(path, \"w\", encoding=\"utf-8\") as f:", "engine.serialize() assert isinstance(serialization_result, bytes) engine2 = empty_engine() deserialization_result = engine2.deserialize(serialization_result) assert deserialization...
[ "<gh_stars>10-100 from rest_framework.routers import SimpleRouter from .views.upgrade_notice import UpgradeNoticeViewSet router = SimpleRouter(trailing_slash=False) router.register('upgrade_notice',", "rest_framework.routers import SimpleRouter from .views.upgrade_notice import UpgradeNoticeViewSet router = Simpl...
[ "in a given histogram where the largest rectangle can be made of a", "the largest rectangular area possible in a given histogram where the largest rectangle", "top_of_stack = stack.pop() area = (histogram[top_of_stack] * ((index - stack[-1] - 1) if", "= stack.pop() area = (histogram[top_of_stack] * ((index - ...
[ "import ctypes.util import hashlib import platform import os.path import binascii import sys __all__", "crypto_hashfunc.restype = ctypes.c_void_p return crypto_hashfunc() def _openssl_pbkdf2(data, salt, iterations, digest, keylen): \"\"\"OpenSSL compatibile", "c_saltlen = ctypes.c_size_t(len(salt)) c_iter = cty...
[ "(key,time) VALUES('\"+str(pem.decode(\"utf-8\"))+\"',\"+str(int(time.time()))+\")\") conn.commit() print(\"New key generated!\") elif sys.argv[1] == \"generate_if_needed\": #Load the key", "print(\"New key generated!\") elif sys.argv[1] == \"generate_if_needed\": #Load the key or generate a", "conn.cursor() as...
[ "accompanying # file LICENSE.txt or copy at https://www.bfgroup.xyz/b2/LICENSE.txt) from b2.build import type def", "the Boost # Software License, Version 1.0. (See accompanying # file LICENSE.txt or", "# Software License, Version 1.0. (See accompanying # file LICENSE.txt or copy at", "import type def registe...
[ "y - z R, x, y, z, t = ring(\"x,y,z,t\", ZZ) assert R.dmp_sqf_p(f_6)", "3)]) assert R.dup_sqf_list(2*x**2 + 4*x + 2) == (2, [(x + 1, 2)])", "assert R.dup_sqf_part(2*x + 2) == x + 1 assert R.dup_sqf_p(2*x + 2) is", "R, x, y, z = ring(\"x,y,z\", ZZ) assert R.dmp_sqf_p(f_0) is True assert R.dmp_sqf_p(f_0**2)", ...
[ "9 XML = 11 Document97 = 0 DocumentDefault = 16 PDF = 17", "10 FlatXML = 19 OpenDocumentText = 23 HTML = 8 RTF = 6", "7 Template = 5 TIF = 21 WMV = 37 XPS = 33", "TODO: Implement \"SaveAs\" methods, see: https://docs.microsoft.com/en-us/office/vba/api/excel.workbook.saveas PDF = 0 XPS = 1 app", "XPS = 1 app...
[ "Migration(migrations.Migration): dependencies = [ ('news', '0001_initial'), ] operations = [ migrations.AddField( model_name='movies', name='year',", "= [ ('news', '0001_initial'), ] operations = [ migrations.AddField( model_name='movies', name='year', field=models.CharField(max_length=4, null=True),", "4.0.1 ...
[ "some_text = param.String(default=\"This is some text\") view = param.Parameter() def __init__(self, **params): super().__init__(**params)", "__init__(self, **params): super().__init__(**params) self.view = pn.Param(self, parameters=[\"some_text\"], widgets=WIDGETS) parameterized_app = ParameterizedApp() paremete...
[ "None def connect_db(): global conn conn = pymysql.connect(host=\"172.16.16.15\",port=3306,user=\"root\",passwd=\"<PASSWORD>\",db=\"ixinnuo_sjcj\",charset=\"utf8\") return def get_req_from_db(): global conn", "my_queue.get_queue_length(settings.COMPANIES) print result #mq 里存在数据则,3秒后退出 if result: time.sleep(3) exi...
[ "json=params) data = json.loads(r.text) print('RESPONSE: %s\\n' % data) # Wait some seconds to", "% params) r = requests.post(cmd_url, headers=headers, json=params) data = json.loads(r.text) print('RESPONSE: %s\\n' %", "= json.loads(r.text) print('RESPONSE: %s\\n' % data) # Wait some seconds to be sure", "req...
[ "arr[start] >= 0: arr[start], arr[end] = arr[end], arr[start] end -= 1 else: #", "0: arr[start], arr[end] = arr[end], arr[start] end -= 1 else: # If arr[start]", ">= 0: arr[start], arr[end] = arr[end], arr[start] end -= 1 else: # If", "end by 1. if arr[start] >= 0: arr[start], arr[end] = arr[end], arr[start] ...
[ "encoding='utf-8') fout = open(output_file, 'w', encoding='utf-8', newline='\\n') for i, line in enumerate(f): sent", "part_pos_tag_files = [f'd:/data/res/wiki/anchor/enwiki-20190101-anchor-sents-tok-texts-pos-{i}.txt' for i in range(4)] pos_tag_file = 'd:/data/res/wiki/anchor/enwiki-20190101-anchor-sents-tok-tex...
[ "import sys import os sys.path.append('/Users/ptendick/open-source-workspace/cannr Image/source/cannr/lib') os.environ['PATH'] = '/Library/Frameworks/Python.framework/Versions/3.7/bin:' + os.environ['PATH'] import cannr", "# Test openProcess by opening a Flask process def test_openProcess1(): return smp.openProce...
[ "# raise ValueError(\"Unsupported resnet version\") # inception_scope = os.path.join('InceptionV1/InceptionV1', inception_out) # print(\"--- 2\")", "# print(\"--- 1\") arg_sc = inception_v1.inception_v1_arg_scope() # Pick the correct version of the", "layers_lib from tensorflow.contrib.framework.python.ops impo...
[ "better than rhs self.max_history = max_history self.unwrap_fn = unwrap_fn assert self.max_history >= 1", "operator.gt # True if lhs better than rhs self.max_history = max_history self.unwrap_fn =", "self.checkpoint_dir = checkpoint_dir self.recovery_dir = recovery_dir self.save_prefix = checkpoint_prefix self....
[ "% 2 == 0: print(0) exit(0) print(min(a*b, b*c, c*a)) if __name__ == '__main__':", "% 2 == 0 or b % 2 == 0 or c %", "== 0 or b % 2 == 0 or c % 2 ==", "input = sys.stdin.readline sys.setrecursionlimit(10**6) a, b, c = map(int, input().split()) if a %", "2 == 0: print(0) exit(0) print(min(a*b, b*c, c*a)) if _...
[ "header Verify version choices returned. Verify message in API log about unknown accept", "= 'http://127.0.0.1:%d/v%%s/' % self.api_port versions = _generate_v1_versions(url) # Verify version choices returned. path", "content_json = http.request(path, 'GET', headers=headers) self.assertEqual(http_client.OK, res...
[ "_dict_path_string(key_path), ) def assert_ne(expected, actual, message=None, tolerance=None, extra=None): \"\"\"Raises an AssertionError if expected", "Unless required by applicable law or agreed to in writing, software # distributed", ") assert isinstance(expected, _number_types) and isinstance( actual, _numb...
[ ".framework import url_for from .framework.base import httpexceptions from .framework.decorators import ( do_not_cache, error,", "import httpexceptions from .framework.decorators import ( do_not_cache, error, expose, expose_api, expose_api_anonymous, expose_api_anonymous_and_sessionless, expose_api_raw,", "'exp...
[ "typing import ClassVar, Iterable, List, Optional, Tuple, Type from pants.core.goals.check import Check, CheckRequest,", "@abstractmethod def exit_code(_: Iterable[Address]) -> int: pass @property def check_results(self) -> CheckResults: addresses", "MockCheckFieldSet checker_name: ClassVar[str] @staticmethod @...
[ "Dict[Any, Any] = {} intent_result = get_intent_acc(intent_preds, intent_labels) slot_result = get_slot_metrics(slot_preds, slot_labels) sementic_result", "2 * partial_precision * partial_recall / (partial_precision + partial_recall) ) exact_precision = count_exact_matches", "recall on these metrics and precisi...
[ "or None if N/A. error: The error represented by the action, or None", "is not None: path = self._filename if self._lineno is not None: path +=", "show_help self.show_trace = show_trace def GetResult(self): \"\"\"Returns the component from the last element", "KIND, either express or implied. # See the License...
[ "** self.part_power): for r in range(self.replicas): self._replica2part2dev_id[r][p] = next(dev_ids) class FakeMemcache(object): def __init__(self):", "which can be a problem in the particular case of a patched TestCase", "Unless required by applicable law or agreed to in writing, software # distributed", "de...
[ "x = self.activation_fn(x) x = self.dropout(x) x = self.out_proj(x) return x @register_model_architecture('bart', 'bart_large')", "x[ src_tokens.eq(self.encoder.dictionary.eos()), : ].view(x.size(0), -1, x.size(-1))[:, -1, :] x = self.classification_heads[classification_head_name]( sentence_representation )", "...
[ "NotFound from config import get_debug_flag from tracker import tracker from tracker.symbol import smileys_sad", "return {'message': e}, code return make_response(render_template('error.html', smiley=smileys_sad[randint(0, len(smileys_sad) - 1)], text=e, title='{}'.format(code)), code)", "= hexlify(urandom(4))....
[ "None: extern_id = self.args.get(\"External id\") return extern_id @property def callstack(self): return self.args.get(\"Call stack\",", "self.args.get(\"external id\") if extern_id is None: extern_id = self.args.get(\"External id\") return extern_id @property", "(c) Microsoft Corporation. All rights reserved. ...
[ "'test/test_shortcut_win.h', 'test/test_simple_task_runner.cc', 'test/test_simple_task_runner.h', 'test/test_suite.cc', 'test/test_suite.h', 'test/test_support_android.cc', 'test/test_support_android.h', 'test/test_support_ios.h', 'test/test_support_ios.mm', 'test/test_switches.cc', 'test/test_switches.h', 'test/te...
[ "max(pds) class Solution4(unittest.TestCase): def setUp(self): self.problem = Problem4(3) def test_solution(self): self.assertEqual(906609, self.problem.solve()) if", "the same both ways. The largest palindrome made from the product of two", "product(range(self.lower, self.upper), repeat=2): if self.is_palindro...
[ "\" \"records, prefer using the `add_alias_for_did` function, which \" \"interacts with the new", ") resource = \"http://{host}:{port}/alias/{name}\".format( host=host, port=port, name=name ) res = requests.get(resource) try: res.raise_for_status()", "import logging import argparse import warnings import reques...
[ "queued! Assunto: {} Mensage: {}'.format( assunto, mensagem ) if __name__ == '__main__': sender", "request class Sender(Bottle): def __init__(self): super().__init__() self.route('/', method='POST', callback=self.send) self.fila = redis.StrictRedis(host='queue', port=6379,", "def register_message(self, assunto,...
[ "ruamel_passthrough_tags(loader, tag, node): name = node.__class__.__name__ if \"Seq\" in name: result = []", "self._simplified(value) def tokens(self, source): return TestSettings.protected_call(self._tokenize, source) def represented_token(self, token): return str(token) def", "rep)) return print(message) pri...
[ "= abs(-(OWAS[i])+180) # made this an absolute value so that the tilt remains", "kras_indices[k][0] protein_x4 = str(kras_indices[k][1]) try: protein_type = [item[protein_x4] for item in protein_systems][0][0] #", "== 1: # # krases0_BB = u.select_atoms('resid '+str(start_of_g)+':'+str(len(u.residues))+' and nam...
[ "is on. \"\"\" return self._state == STATE_ON def turn_on(self, **kwargs): \"\"\" Turn the", "self._state @property def is_on(self): \"\"\" True if device is on. \"\"\" return self._state", "hikvision.api is None: _LOGGING.error(( \"Failed to import hikvision. Did you maybe not install", "Currently works usin...
[ "Use all the query fragments from the queries (the nesting parent is #", "aggregations for predefined choices.\"\"\" # pylint: disable=unused-argument def get_aggs_fragment(self, queries, *args, **kwargs): \"\"\"", "} This can only be built by calling the parent NestingWrapper with customized", "by calling th...
[ "each payment request uses a different Bitcoin SV payment destination.') receive_address_label = HelpLabel(_('Receiving", "AmountEdit, BTCAmountEdit from .constants import expiration_values if TYPE_CHECKING: from .main_window import ElectrumWindow from", "seen by the recipient if you send them ' 'a signed payme...