ngram
listlengths
0
82k
[ "extension classes.\"\"\" from typing import Dict, List, Optional from lxml", "Parameters ---------- atom_feed : Element The feed's root element. Returns", "\"syn\": \"http://purl.org/rss/1.0/modules/syndication/\", \"admin\": \"http://webns.net/mvcb/\", \"media\": \"http://search.yahoo.com/mrss\", } class Arxi...
[ "int = None master_cpu_mode: str = None master_disk: int =", "# number of disks to create worker_memory: int = None", "= None private_ssh_key_path: Path = None working_dir: str = consts.WORKING_DIR", "from .base_config import _BaseConfig global_variables = GlobalVariables() @dataclass class BaseNodeConfig(_Ba...
[ "self.pool: return False del self.pool[hash] return True def size(self): return", "remove(self, hash): if hash not in self.pool: return False del", "in self.pool: self.log.write(\"MemPool.add(%s): already known\" % (hashstr,)) return False if", "tx.is_valid(): self.log.write(\"MemPool.add(%s): invalid TX\" % ...
[ "%s %s'%(self.leftexpr, self.combination, self.rightexpr) elif self.combination: return '%s %s'%(self.combination, self.rightexpr)", "= '()' return getattr(p, 'compound_commands', None) @_('pipe_command %prec LIST_COMMANDS', 'pipe_command", "def __init__(self, test, rightvalue, leftvalue=None): self.test = test...
[ "- target_date return dt.days def print_due_date_information(min_due_date, max_due_date, expected_due_date): print('Your expected", "= input('Format: [dd/mm/yyyy}') #'05/06/2018' parts = date_str.split('/') if len(parts)!= 3:", "3: print('Bad date found', date_str) return get_lmp_from_patient() year = int(parts...
[ "MpgForm(forms.Form): mpg = forms.FloatField(validators=[MinValueValidator(0.01)], widget=forms.TextInput(attrs={'class': 'form-control', 'id': 'inlineFormInputGroup', 'placeholder': '12'}))", "Silicon Valley, CA 00000'})) class DestinationForm(forms.Form): destination_address = forms.CharField(validators=[MinLen...
[ "= (-2, (1, 3), room_id, raffle_id) next_step_settings.append(next_step_setting) next_step_setting = (-2,", "raffle_id) next_step_settings.append(next_step_setting) next_step_setting = (-2, (2, 4), room_id, raffle_id) next_step_settings.append(next_step_setting)", "work(user, room_id, raffle_id): # await UtilsT...
[ "for the early gate will cause # no updates to", "bn.SimpleBatchNormalizationNode(name + \"_bn\"), \"late\": tn.IdentityNode(name + \"_identity\")}) GradualBNNode = GradualSimpleBatchNormalizationNode", "= tn.UpdateScaleNode(name + \"_late_update_scale\", subtree) late_node = late(name + \"_late\",", "as argu...
[ "self.handle = gzip.open(filename,'rt') elif filename.endswith('bz2'): self.handle = bz2.open(filename,'rt') elif filename.endswith('xz'):", "RawFile(object):#pragma: no cover def __init__(self,filename): self.filename = filename if filename.endswith('.gz'):", "= filename if filename.endswith('.gz'): self.handl...
[ "10_11_6) \" \"AppleWebKit/537.36 (KHTML, like Gecko) \" \"Chrome/55.0.2883.95 \" \"Safari/537.36\",", "(KHTML, like Gecko) \" \"Chrome/55.0.2883.95 \" \"Safari/537.36\", \"Accept\": \"text/html,application/xhtml+xml,application/xml;\" \"q=0.9,image/webp,*/*;\"", "Gecko) \" \"Chrome/55.0.2883.95 \" \"Safari/537...
[ "@autoload_node def get_node(node): ... \"\"\" @functools.wraps(func) def wrapper(*args, **kwargs): primary_key", "display_name = display_name or '' # FIXME: Not everything that", "message_long='The query must match exactly one {name} record'.format(name=safe_name) )) else:", "the function Example usage: :: d...
[ "Creates a new Image. :param name: Name of the image,", "2.0 (the \"License\"); # you may not use this file", "name, description, data): \"\"\" Creates a new Image. :param name:", "dashboard. :param data: Image data. :type name: unicode :type description:", "tab on job's dashboard. :param description: Descr...
[ "usb_hid import time class HumanKeyboard(object): def __init__(self): self.keyboard = Keyboard(usb_hid.devices)", "adafruit_hid.keyboard_layout_us import KeyboardLayoutUS from adafruit_hid.keycode import Keycode import usb_hid import", "from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS from adafruit_...
[ ":type root: TreeNode :rtype: int \"\"\" if not root: return", "root: TreeNode :rtype: int \"\"\" if not root: return 0", "import MaxBiTreeDepthTestCases class MaxBiTreeDepth(Solution): def gen_test_cases(self): return MaxBiTreeDepthTestCases() def run_test(self,", "from src.tests.part2.q104_test_max_bi_tree_...
[ "['supplier_name', 'contact', ] admin.site.register(models.Suppliers, SupplierAdmin) class InventoryUserAdmin(admin.ModelAdmin): list_display = ('employee_name',", "admin.site.register(models.InventoryUser, InventoryUserAdmin) class ProductsAdmin(admin.ModelAdmin): list_display = ('name', 'quantity', 'cost_price'...
[ "<gh_stars>1-10 try: name = \"\" except: pass else: print na<ref>me" ]
[ "token, \"User-Agent\": \"byte/0.2 (co.byte.video; build:145; iOS 13.3.0) Alamofire/4.9.1\" } def", "self._session.headers = { \"Authorization\": token, \"User-Agent\": \"byte/0.2 (co.byte.video; build:145; iOS", "{ \"Authorization\": token, \"User-Agent\": \"byte/0.2 (co.byte.video; build:145; iOS 13.3.0) Alam...
[ "= mkQApp() # win.setWindowTitle('pyqtgraph example: ____') if __name__ == '__main__':", "mkQApp import numpy as np app = mkQApp() # win.setWindowTitle('pyqtgraph", "Description of example \"\"\" import pyqtgraph as pg from pyqtgraph.Qt", "-*- \"\"\" Description of example \"\"\" import pyqtgraph as pg", "p...
[ "{ \"cpu_count\" : 1, \"host_name\" : \"host1\", \"os_arch\" : \"x86_64\",", "configurations[\"hdfs-site\"][\"properties\"]['dfs.internal.nameservices'] = \"mycluster\" configurations[\"hdfs-site\"][\"properties\"]['dfs.ha.namenodes.mycluster'] = \"nn1,nn2\" services['configurations'] = configurations expected[\"...
[ "time from pudb.remote import set_trace def worker(worker_id): \"\"\" Simple worker", "0 while i < 10: if worker_id == 1: #", "process\"\"\" i = 0 while i < 10: if worker_id", "10: if worker_id == 1: # debug process with id", "range(2): # 2 worker processes p = mp.Process(target=worker, args=(p_id,)) p.star...
[ "the breakpoint self.line = line_number('main.cpp', '// lldb testsuite break') @expectedFailureAll(oslist=[\"windows\"])", "testsuite break') @expectedFailureAll(oslist=[\"windows\"]) @expectedFailureAll( oslist=['linux'], archs=['arm'], bugnumber=\"llvm.org/pr27868\") def test(self): \"\"\"Test", "__future__ i...
[ "amount (0-100): \")) im_output = enhancer.enhance(factor) im_output.save('more-contrast-image.png') im_output.show() def STRETCH():", "int(input(\"Specify height: \")) im_output = im.resize((factor,factor2)) im_output.save('more-contrast-image.png') im_output.show() def INVERT():", "factor = float(input(\"Spec...
[ "Curbrock Summon 2 CURBROCK2 = 9400930 # MOD ID CURBROCKS_ESCAPE_ROUTE_VER2", "Summon 2 CURBROCK2 = 9400930 # MOD ID CURBROCKS_ESCAPE_ROUTE_VER2 =", "2 sm.spawnMob(CURBROCK2, 190, -208, False) sm.createClock(1800) sm.addEvent(sm.invokeAfterDelay(1800000, \"warp\", CURBROCKS_ESCAPE_ROUTE_VER3, 0))", "ID CURBRO...
[ "<reponame>Gerryflap/master_thesis \"\"\" Cancelling jobs on the University cluster forces programs", "As a remedy, this killswitch listener will stop the experiment", "will be stopped if a file named \"stop\" is encountered", "which sometimes crashes cluster nodes. As a remedy, this killswitch", "The exist...
[ "a user \"\"\" # decode users authentication token user_data =", "\"\"\" This class method is used to update a users", "notifications # the action below is done by use of", "notification = request.data.get('notification', {}) user_data = JWTAuthentication().authenticate(request) # append user_id", "serializ...
[ "its behavior on all of the dictionary's subtypes before using", "the LICENSE file. \"\"\"Implements a frozen dictionary-like object\"\"\" import collections", "frozen dictionary-like object\"\"\" import collections import copy import common.memo as", "license that can be # found in the LICENSE file.", "sel...
[]
[]
[]
[ "common to CIFAR10 and CIFAR100 datasets. \"\"\" from __future__ import", "= cPickle.load(f, encoding='bytes') # decode utf8 d_decoded = {} for", "if sys.version_info < (3,): d = cPickle.load(f) else: d =", "import print_function import sys from six.moves import cPickle def load_batch(fpath,", "labels)`. \"...
[ "').splitlines()]) for key in rules: rules[key]=[(d[2:].strip(), int(d[:2].strip())) for d in", "bag', '').replace('.', '').replace(' no other', '0 ').splitlines()]) for key in", "no other', '0 ').splitlines()]) for key in rules: rules[key]=[(d[2:].strip(), int(d[:2].strip()))", "int(d[:2].strip())) for d in ...
[ "core.advbase import * from slot.d import * def module(): return", "Leviathan() conf['acl'] = \"\"\" `dragon `s1 `s2, seq=5 and cancel", "import * def module(): return Luther class Luther(Adv): a1 =", "fsc `fs, seq=5 \"\"\" coab = ['Blade', 'Xander', 'Tiki'] if", "or fsc `fs, seq=5 \"\"\" coab = ['Blade', '...
[ "limit MAX_DIMENSION = 65500 _log_type = \"image-file\" format: Optional[str] _grouping:", "mode=\"RGB\") image = wandb.Image(pil_image, caption=f\"random field {i}\") examples.append(image) wandb.log({\"examples\": examples})", "for (k, mask) in self._masks.items() } return json_dict def guess_mode(self,", "...
[ "return '%02d:%02d:%02d.%03d' % (hours, minutes, seconds, milliseconds) # Returns a", "minutes= (milli//(1000*60))%60 hours= (milli//(1000*60*60))%24 if hours == 0: if minutes", "return '%d.%03d' % (seconds, milliseconds) return '%02d:%02d.%03d' % (minutes, seconds,", "hours == 0: if minutes == 0: return '%d....
[ "step2_time)) def interactive(): \"\"\"Simple function to interact with user\"\"\" print(\"Compute", "for i in range(columns): print(line[i*colwidth: (i + 1)*colwidth],) print(\":\", (linecount", "0: print printed += colwidth*columns rem = (len(digits) - skip)", "0: skip = 0 else: skip = len(intpart) print(\"...
[ "= [ migrations.CreateModel( name='MNServiceUser', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),", "-*- coding: utf-8 -*- # Generated by Django 1.11.11 on", "options={ 'verbose_name': 'Service User', 'verbose_name_plural': 'Service Users', }, bases=(...
[ "CLASS.match(line): # the end of a method return if 'self.get('", "logical_line or 'import tempest.lib' in logical_line): return msg = (\"T112:", "in line and 'self.list_resources(' not in line): continue if METHOD_GET_RESOURCE.match(logical_line):", "'glance', 'keystone', 'nova', 'swift', 'neutron', 'ironic'...
[ "return 0 controller = Controller() server = SimpleXMLRPCServer.SimpleXMLRPCServer((\"d6349.mysql.zone.ee\", 7000)) server.register_instance(controller)", "return 0 def turn_on(self, i): self.k8055.turn_on(i) controller_log.debug('turned on %i' %", "turn_off(self, i): self.k8055.turn_off(i) controller_log.debug...
[]
[ "trouble sleeping, changes in appetite or weight, loss of energy,", "ajay = SentimentIntensityAnalyzer() completeScore = 0 questionWeights = [0.05, 0.20,", "of this type of depression \" + \"include trouble sleeping,", "such as psychotherapy and medication, may also be \" +", "\" + \"for depression, such as...
[ "Okta.\"\"\" from __future__ import absolute_import, division, print_function, unicode_literals import logging", "also use assumerole to assign the role logging.debug(\"Authenticate user with", "# vim: set filetype=python ts=4 sw=4 # -*- coding: utf-8", "from tokendito import settings standard_library.install...
[]
[ "return TrecPrel class TrecScoredDocs(BaseScoredDocs): def __init__(self, scoreddocs_dlc): self._scoreddocs_dlc = scoreddocs_dlc", "self._qtype_map[field_el.tag] item[self._qtype._fields.index(field)] = text if field_el.tag == 'subtopic': text =", "f = codecs.getreader(self._encoding or 'utf8')(f) for line in f...
[ "files from list of URLs (default: download.yaml) into data directory", "to. snippet_only: Downloads only the first 5 kB of the", "-*- coding: utf-8 -*- from .utils import download_from_yaml def download(output_dir:", "they exist [false] Returns: None. \"\"\" download_from_yaml(yaml_file=\"download.yaml\", ou...
[ "self.module.fail_json(msg=\"Error on sending autosupport message to node %s: %s.\" %", "message from a node options: name: description: - The name", "%s: %s.\" % (node_name, to_native(error)), exception=traceback.format_exc()) def send_message(self): params =", "not HAS_NETAPP_LIB: self.module.fail_json(msg=...
[ "def test_simple(self): user = self.create_user() result = serialize(user) assert result[\"id\"]", "serialize from freight.testutils import TestCase class UserSerializerTest(TestCase): def test_simple(self): user", "class UserSerializerTest(TestCase): def test_simple(self): user = self.create_user() result = se...
[ "'../pozo-steep-vegetated-pcl.npy' pts = np.load(fn) x, y, z, c = pts[:,", "x, y, z, c = pts[:, 0], pts[:, 1], pts[:,", "(100, 100) xb = np.arange(shape[1]+1) yb = np.arange(shape[0]+1) fg, ax", "== i) * (cx == k) mean[i, k] = cz[b].mean()", "step = 5) np.save('pozo_5m_dem_mean_cl%i.npy' % uc[j], mean) np.s...
[ "def __new__(cls, name, bases, namespace): klass = type.__new__(cls, name, bases,", "We are an IUnknown pointer, represented as a c_void_p instance,", "App # CoClass # c_void_p # _SimpleCData # _CData #", "XXX We should insist that a _reg_clsid_ is present. if", "for CoClass (in comtypes/__init__.py) def _w...
[ "callbacks if not in continuous mode if not self.continuous: self.callbacks.CallCallbacks(self.opPanel.valInput.get())", "self.opPanel.lockUnlockDisplay() if __name__ == '__main__': def foo(val): print val d", "return d={} for k, w in self.labCfg.items(): if k ==", "x1, y1 ] pts2 = [ x1, y1, xb-n[0]*self.arro...
[ "'darwin': filename = 'makeinstall.darwin' else: print \"Unsupported platform: \", sys.platform", "https://www.qt.io/terms-conditions. For further # information use the contact form at", "subFolders, files in os.walk(rootdir): for file in (subFolders + files):", "0: print \"'%s' is empty!\" % f fileDict[f[len...
[ "experiment_dir, reconstructions_subdir, str(epoch), reconstruction_codes_subdir, dataset, class_name, instance_name + \".pth\", )", "does not include specifications file \" + '\"specs.json\"'.format(experiment_directory) ) return", "data[\"epoch\"] def build_decoder(experiment_directory, experiment_specs): arc...
[ "import DataGenerator from EmoPy.src.neuralnets import ConvolutionalNNDropout from sklearn.model_selection import train_test_split", "EmoPy.src.csv_data_loader import CSVDataLoader from EmoPy.src.data_generator import DataGenerator from EmoPy.src.neuralnets import", "verbose=True) model.fit_generator(train_gen....
[ "jinja2.ext import Extension class TestExtension(Extension): tags = {'test_ext'} def parse(self,", "Extension class TestExtension(Extension): tags = {'test_ext'} def parse(self, parser): return", "import nodes from jinja2.ext import Extension class TestExtension(Extension): tags =", "<filename>ENV/lib/python3...
[ "declated it in the DBIRTH newValue4 = metric.int_value print (\"CMD", "deathByteArray = bytearray(deathPayload.SerializeToString()) client.will_set(\"spBv1.0/\" + myGroupId + \"/NDEATH/\" + myNodeName,", "LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A", "# Publish a message Input 2 #publishBir...
[ "AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. #", "DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES", "(ZPL). A copy of the ZPL should accompany this distribution.", "A copy of the ZPL should accompany this distribution. #", "provisions of the Zope Public License, # Versi...
[ "custom_module_path=CUSTOM_EXPERTS_PATH, ) as (server_endpoint, _): expert0 = RemoteExpert(\"expert.0\", server_endpoint) expert1", "num_experts=2, device=\"cpu\", hidden_dim=hid_dim, num_handlers=2, no_dht=True, custom_module_path=CUSTOM_EXPERTS_PATH, ) as (server_endpoint, _):", "expert_cls=\"multihead\", num...
[ "ar = (spread_ho/spread_oc)*100 return ar ar = AR(klines) print(\"策略开始启动\") while", "klines = api.get_kline_serial(SYMBOL, 60*60*24, N) quote = api.get_quote(SYMBOL) target_pos =", "< 150: print(\"价值动量超过110,小于150,做多\") target_pos.set_target_volume(100) # 如果ar大于50,小于90,开空仓 elif 50 < ar", "SYMBOL = \"SHFE.au191...
[ "comparison) best_result: NumPy array result that minimizes mean absolute error", "= cv2.cvtColor(left, cv2.COLOR_GRAY2BGR) bordered_comparison_image = np.vstack((top, comparison_image)) bordered_comparison_image = np.hstack((left,", "& preserve_paper arguments. Mean absolute error (MAE) is computed for", "re...
[ "import CreateATree tree = CreateATree.BinarySearchTree() nodesList = list((4, 5, 1,", "CreateATree tree = CreateATree.BinarySearchTree() nodesList = list((4, 5, 1, 3,", "from Library.CreateATree import CreateATree tree = CreateATree.BinarySearchTree() nodesList = list((4,", "tree = CreateATree.BinarySearchTr...
[ "= 'home' ), path( 'about-me', views.About_me.as_view(), name = 'about_me' ),", "# # Author: <NAME> <<EMAIL>> from django.urls import path from", "= 'about_me' ), path( 'search', views.Search.as_view(), name = 'search' ),", "path( 'about-me', views.About_me.as_view(), name = 'about_me' ), path( 'search', view...
[]
[ "thus continues to next block of code #sys.exit() is to", "v) def killGeneric(self, error): print(repr(error)) PythonService.setAutoRestartService(False) print(\"Autorestart of the service", "\"Scheduling restart of crashed service process\" #in case we called", "__init__(self): PythonServiceClass = autoclass...
[ "bootstrap = Bootstrap() def create_app(script_info=None): # instantiate the app app", "__name__, template_folder=\"../client/templates\", static_folder=\"../client/static\", ) # set config app_settings = os.getenv(\"APP_SETTINGS\")", "# api/queue/__init__.py import os from flask import Flask from flask_bootstr...
[ "empty_engine() serialization_result = engine.serialize() assert isinstance(serialization_result, bytes) engine2 = empty_engine()", "engine0 = empty_engine() with pytest.raises(FileNotFoundError): # We haven't created the", "None def test_deserialize_corrupt(tmpdir): path = str(tmpdir / \"corrupt_cache.dat\") w...
[ "from rest_framework.routers import SimpleRouter from .views.upgrade_notice import UpgradeNoticeViewSet router =", "<gh_stars>10-100 from rest_framework.routers import SimpleRouter from .views.upgrade_notice import UpgradeNoticeViewSet router", "from .views.upgrade_notice import UpgradeNoticeViewSet router = Si...
[ "area) while stack: top_of_stack = stack.pop() area = (histogram[top_of_stack] *", "<gh_stars>1000+ ''' Largest rectangle area in a histogram:: Find the", "the largest rectangle can be made of a number of", "def max_area_histogram(histogram): stack = list() max_area = 0 # Initialize", "1) if stack else inde...
[ "c_keylen = ctypes.c_int(keylen) c_buff = ctypes.create_string_buffer(keylen) # PKCS5_PBKDF2_HMAC(const char *pass,", "== '__main__': try: crypto.SSLeay_version.restype = ctypes.c_char_p print(crypto.SSLeay_version(0)) except: pass import", "= platform.system() if system == 'Windows': if platform.architecture()...
[ "= cursor.fetchall() if len(res) == 0: privkey = rsa.generate_private_key(public_exponent=65537, key_size=2048,", "psycopg2 import base64 from cryptography.hazmat.primitives import serialization, hashes from cryptography.hazmat.primitives.asymmetric", "cursor.execute(\"DROP TABLE key\") conn.commit() print(\"Dr...
[ "Copyright <NAME> 2004. Distributed under the Boost # Software License,", "# file LICENSE.txt or copy at https://www.bfgroup.xyz/b2/LICENSE.txt) from b2.build import", "Boost # Software License, Version 1.0. (See accompanying # file", "https://www.bfgroup.xyz/b2/LICENSE.txt) from b2.build import type def regi...
[ "== \\ ( 1, [(x, 2), (x**2 + 2, 3)])", "[(x, 2)]) assert R.dup_sqf_list(3*x**3) == (3, [(x, 3)]) assert R.dup_sqf_list(-x**5", "[(h, 3)]) R, x = ring(\"x\", ZZ[\"t\"]) assert R.dup_sqf_list_include(DMP([1, 0,", "assert R.dmp_sqf_p(f_5**2) is False assert R.dmp_sqf_p(f_4) is True assert R.dmp_sqf_part(f_4)", ...
[ "2 TextLineBreaks = 3 UnicodeText = 7 WebArchive = 9", "= 15 MP4 = 39 OpenPresentation = 35 PDF =", "= 10 FlatXML = 19 OpenDocumentText = 23 HTML =", "@enum.unique class PPT(enum.Enum): # Source: https://docs.microsoft.com/en-us/office/vba/api/powerpoint.ppsaveasfiletype AnimatedGIF = 40 BMP", "'.pptx') @en...
[ "by Django 4.0.1 on 2022-01-19 23:58 from django.db import migrations,", "on 2022-01-19 23:58 from django.db import migrations, models class Migration(migrations.Migration):", "'0001_initial'), ] operations = [ migrations.AddField( model_name='movies', name='year', field=models.CharField(max_length=4, null=True...
[ "param.Parameter() def __init__(self, **params): super().__init__(**params) self.view = pn.Param(self, parameters=[\"some_text\"], widgets=WIDGETS)", "param.String(default=\"This is some text\") view = param.Parameter() def __init__(self, **params):", "400} } class ParameterizedApp(param.Parameterized): some_te...
[ "in source: message = json.dumps(id_name) my_queue.send_to_queue(settings.COMPANIES, message) conn.close() print '成功添加队列%s条数据!!!'", "import QueueRedis conn = None def connect_db(): global conn conn", "= res[0] company['name'] = res[1] companies.append(company) return companies def main():", "from gjqyxyxxcxxt...
[ "% check_tx_url) r = requests.get(check_tx_url) data = json.loads(r.text) print('RESPONSE: %s\\n'", "import time from http import HTTPStatus # Main if __name__", "'http://localhost:9119/%s' % set_cmd headers = {'Content-Type': 'application/json', 'Accept': 'application/json'} print('COMMAND:", "= json.loads(r...
[ "end: # Swap all positive value with last index end", "\"__main__\": arr = [-1, 2, -3, 4, 5, 6, -7,", "def sort(arr): # Start index 0. start = 0 #", "index 0. start = 0 # End index end =", "while start <= end: # Swap all positive value with", "if __name__ == \"__main__\": arr = [-1, 2, -3, 4,", "start b...
[ "in enumerate(f): sent = json.loads(line) fout.write('{}\\n'.format(sent['tokens'])) # if i >", "json def __text_from_anchor_sents_file(anchor_sents_file, output_file): f = open(anchor_sents_file, encoding='utf-8') fout =", "encoding='utf-8') for line in f: fout.write(line) f.close() fout.close() wiki19_anchor_...
[ "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", "'1']) # Test openProcess by opening a Plumber process def", "return smp.openProcess( {\"processInfo\": \"p...
[ "# current_resnet = resnet_v1.resnet_v1_152 # else: # raise ValueError(\"Unsupported resnet", "image_input: placeholder with image :param is_training: are you using the", "or test_time :param scope: tensorflow scope :param resnet_version: 50/101/152 :param", "as resnet_v1 import tensorflow.contrib.slim.python...
[ "metric)) self.checkpoint_files = sorted( self.checkpoint_files, key=lambda x: x[1], reverse=not self.decreasing)", "operator import os import logging import torch from .model import", "self.args.model save_state['args'] = self.args if self.amp_scaler is not None: save_state[self.amp_scaler.state_dict_key]", ...
[ "AGC004a def main(): import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) a,", "import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) a, b, c =", "0 or b % 2 == 0 or c %", "b, c = map(int, input().split()) if a % 2 ==", "b % 2 == 0 or c % 2 ==", "map(int, input().split()) if a %...
[ "self.api_port) http = httplib2.Http() response, content_json = http.request(path, 'GET') self.assertEqual(http_client.OK,", "{'Accept': 'unknown'} response, content_json = http.request(path, 'GET', headers=headers) self.assertEqual(http_client.MULTIPLE_CHOICES, response.status)", "def setUp(self): super(TestAp...
[ "wrote the code. \"\"\" __all__ = [ \"assert_is\", \"assert_is_not\", \"assert_is_instance\",", "2.0 (the \"License\"); # you may not use this file", "# Return True to suppress the Exception if the type", "# Copyright 2016 Quora, Inc. # # Licensed under the", "not start with prefix.\"\"\" assert ( (type(sub...
[ "expose_api_anonymous, expose_api_anonymous_and_sessionless, expose_api_raw, expose_api_raw_anonymous, expose_api_raw_anonymous_and_sessionless, format_return_as_json, json, json_pretty, legacy_expose_api, legacy_expose_api_anonymous,", "'expose_api_raw_anonymous', 'expose_api_raw_anonymous_and_sessionless', 'for...
[ "None) -> Target: if address is None: address = Address(\"\",", "= Address(\"\", target_name=\"good\") bad_address = Address(\"\", target_name=\"bad\") exit_code, stderr =", "address = Address(\"\", target_name=\"tests\") return MockTarget({}, address) def run_typecheck_rule( *,", "run_typecheck_rule( request...
[ "scores conflate other things like recall on these metrics and", "} def get_slot_simple_metrics( preds: List[List[str]], labels: List[List[str]] ) -> Dict[Any,", "= simplify_tokens(labels_flattened) assert len(simple_preds) == len(simple_labels) label_names = [\"O\", \"TERM\",", "{\"intent_acc\": acc} def rea...
[ "the command. Returns: A string representing a Fire CLI command", "during a single Fire execution. A FireTrace consists of a", "= FireTraceElement( component=initial_component, action=INITIAL_COMPONENT, ) self.name = name self.separator =", "Here's an example to demonstrate the separator. Let's say you", "i...
[ "# it's a thing, we return the wrapped thing instead", "] default_ring_args = [{'replicas': 14}, {}] else: default_policies = [", "instead of 100 # Continue, even if the client sent", "pass class DebugLogger(FakeLogger): \"\"\"A simple stdout logging version of FakeLogger\"\"\"", "expect_sleep=None, respons...
[ "weights. if hasattr(self, 'classification_heads'): cur_state = self.classification_heads.state_dict() for k, v", "def forward( self, src_tokens, src_lengths, prev_output_tokens, features_only=False, classification_head_name=None, **kwargs ):", "under the MIT license found in the # LICENSE file", "def __init_...
[ "import wraps from logging import error from os import urandom", "json=False): return handle_error(e, BadRequest.code, json) @errorhandler(Exception) @errorhandler(InternalServerError.code) def internal_error(e): if", "from functools import wraps from logging import error from os", "from werkzeug.exceptions i...
[ "BaseEvent(object): def __init__(self, type, data): self.type = type self.name =", "super().__init__(type, data) self.category = data.get(\"cat\", \"\") self.duration = data.get(\"dur\") @property", "id\") if extern_id is None: extern_id = self.args.get(\"External id\") return", "return extern_id @property de...
[ "or chromeos == 1', { 'conditions': [ ['chromeos==1', { 'sources/':", "'mac/mac_util_unittest.mm', 'mac/objc_property_releaser_unittest.mm', 'mac/scoped_nsobject_unittest.mm', 'mac/scoped_objc_class_swizzler_unittest.mm', 'mac/scoped_sending_event_unittest.mm', 'md5_unittest.cc', 'memory/aligned_memory_unittest.c...
[ "3-digit numbers. ANSWER: 906609 Solve time ~ 0.760 seconds \"\"\"", "from the product of two 2-digit numbers is 9009 =", "self.problem = Problem4(3) def test_solution(self): self.assertEqual(906609, self.problem.solve()) if __name__ ==", "def solve(self): pds = [] for i, j in product(range(self.lower,", "m...
[ "port=port, name=name ) res = requests.get(resource) try: res.raise_for_status() except Exception", "-- interacts with old `/alias/` endpoint. # For creating aliases", "name. \"\"\" warnings.warn( ( \"This function is deprecated. For creating", "Configure the info command. \"\"\" parser.set_defaults(func=info...
[ "assunto, mensagem): SQL = 'INSERT INTO emails (assunto, mensagem) VALUES", "INTO emails (assunto, mensagem) VALUES (%s, %s)' cur = self.conn.cursor()", "mensagem): SQL = 'INSERT INTO emails (assunto, mensagem) VALUES (%s,", "psycopg2.connect(DSN) def register_message(self, assunto, mensagem): SQL = 'INSERT I...
[ "yaml as pyyaml from zyaml import load_path, load_string, tokens_from_path, tokens_from_string", "result.append(ruamel_passthrough_tags(loader, tag, v)) return result if \"Map\" in name: result", "= \" \".join(str(s) for s in runez.flattened(value)) elif token.id ==", "s in runez.flattened(value)) else: asser...
[ "[] r152_165 = krases0_BB.select_atoms('resid '+str(start_of_g+150)+':'+str(start_of_g+163)+' and (name CA or name", "to run make_whole() # krases0_BB.guess_bonds() # TODO: CS, turn off", "in range(len(OROT)): OUTPUT[i] = str(protein_type), timeframes[i], OWAS[i], OROT[i], 'n/a', int(states[i])", "TODO: CS, f...
[ "to your config/configuration.yaml switch: platform: hikvisioncam name: Hikvision Cam 1", "switch you will need to add something like the following", "self._hikvision_cam.disable_motion_detection() def update(self): \"\"\" Update Motion Detection state \"\"\" enabled", "def should_poll(self): \"\"\" Poll for ...
[ "\"01-01-2019\"}}}, {\"terms\": {\"course_runs.languages\": [\"fr\"]}}, ] } }, } } }", "that need to apply term queries.\"\"\" def get_query_fragment(self, data): \"\"\"Build", "FilterDefinition classes.\"\"\" class TermsQueryMixin: \"\"\"A mixin for filter definitions that", "[]) ] class ChoicesAggsMixin: \"...
[ "else self._receive_amount_e) edit.textEdited.emit(edit.text()) # Bound to text fields in `_create_receive_form_layout`.", "message) self._receive_qr.setData(uri) if self._qr_window and self._qr_window.isVisible(): self._qr_window.set_content(self._receive_destination_e.text(), amount, message, uri)", "amount')...