ngram
listlengths
0
67.8k
[ "import torch import torch.optim as optim import torch.nn as nn import ccobra import", "network for a prediction prediction_idx = net(profile_tensor)[start:end].argmax() prediction = ccobra.syllogistic.RESPONSES[prediction_idx] subj_hits.append(prediction == truth)", "in range(n_epochs): start_time = time.time(...
[ "the License. \"\"\" __author__ = 'minhuaxu <EMAIL>' import time import os import logging", "本地,初始化UiAutomator \"\"\" _init_uiautomator() return int(_uiautomator_port) def get_uiautomator(): if get_uiautomator.instance: return get_uiautomator.instance else: port=_init()", "an \"AS IS\" basis, WITHOUT WARRANTIES...
[ "# renWin.Render() # prevent the tk window from showing up then start the", "= vtk.vtkContourFilter() stemp.SetInputConnection(reader.GetOutputPort()) stemp.SetValue(0,1150) stemp.GenerateTrianglesOff() stemp.Update() self.failUnlessEqual(stemp.GetOutputDataObject(0).GetNumberOfPoints(),39315) self.failUnlessEqua...
[ "disable=function-redefined def deserialize(class_reference, data, *, throw_on_unhandled: bool = False, raw_storage_mode: RawStorageMode = RawStorageMode.none):", "The other option is # to take the data, and try and determine", "got here. Optionals # are handled by unions above, so if we are", "to Python obje...
[ "test_get_set_months(): mn = ssf.get_month_names() assert isinstance(mn, tuple) assert mn == (None, ('J', 'Jan',", "assert mn == (None, ('J', 'Jan', 'January'), ('F', 'Feb', 'February'), ('M', 'Mar', 'March'),", "'MON'], ('TU', 'TUE'), ['WE', 'WED'], ('TH', 'THU'), ['FR', 'FRI'], ('SA', 'SAT'), ['SU', 'SUN']])"...
[ "the video here - {}\".format(download_location)) except Exception as e: print(\"Some Error occured. Exception", "= yt_obj.streams.filter(progressive=True, file_extension='mp4') print(\"\\nAvailable Resolutions -\") for num, res in enumerate(filters, start=1): print(\"\\t{}.", ": \", e) # Playlist Single Video ...
[ "self.get_a_cdr() with self.assertRaises(RuntimeError): d.getInteger(4) def test_to_string(self): d = Cdr() d.setInteger(field1, 123) self.assertEqual(d.toString(), \"1=123\")", "test_nested(self): d = Cdr() e = Cdr() e.setString(1, \"hello\") e.setString(2, \"world\") d.appendArray(1, e)", "e[12] = [f] d[1] = ...
[ "and isgmt[i] != 0) self._ttinfo_list.append(tti) # Replace ttinfo indexes for ttinfo objects. trans_idx", "dt): return ZERO @tzname_in_python2 def tzname(self, dt): return self._name def __eq__(self, other): return", "= [] # Next come tzh_timecnt one-byte values of type unsigned # char;", "raise ValueError(\...
[ "InputWindowView(View): uiFilePath = os.path.join(BASE_PATH, \"src\\\\window\\\\inputWindow\\\\inputWindow.ui\") if __name__ == '__main__': print(\"unit test from {filename}\".format(filename=__file__))", "# @ProjectName : PySide2MVCFramework # @FileName : view.py # @Author : 胡守杰 #", "# -*- coding: utf-8 -*- \"...
[ "and the following disclaimer in the documentation # and/or other materials provided with", "# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #", "cmd.append( \"create_bd_intf_pin -mode Master \" \"-vlnv xilinx.com:interface:axis_rtl:1.0 /%s/%s\" % (node_name, dout_name) ) cmd.append...
[ ".groupby('api_level') .agg('sum') .reset_index()) sf2['delta'] = sf2['supported'] - sf2['supported'].shift(1) sf2.fillna(0, inplace=True) return sf, sf2", "codepoints, supported]. Includes every sequence we could find of any type. Requires prior", "df = pd.DataFrame(records) df.columns = ['api_level', 'font_fi...
[ "status.HTTP_200_OK) self.assertEqual(len(response.data), 2) self.assertEqual(response.data[0]['content'], 'foo') self.assertEqual(response.data[1]['content'], 'bar') def test_get_private(self): \"\"\"Snippet list GET must", "2] def check(i): response = self.get() self.assertEqual(len(response.data), expected[i])...
[ "all(0 <= f <= 10 ** 5 for f in first_sequence) assert all(0", "input().split())) clicks = list(map(int, input().split())) assert len(prices) == len(clicks) == n print(max_dot_product(prices, clicks))", "<gh_stars>1-10 # python3 from itertools import permutations def max_dot_product_naive(first_sequence, second...
[ "deposit = 0 if hasGoodCredit: deposit = price/10 else: deposit = price/5 print(f\"Deposit", "= 1000000 deposit = 0 if hasGoodCredit: deposit = price/10 else: deposit =", "= True price = 1000000 deposit = 0 if hasGoodCredit: deposit = price/10", "price = 1000000 deposit = 0 if hasGoodCredit: deposit = price/1...
[ "sys.exit(2) for opt, arg in opts: if opt == '-h': showHelp() sys.exit() elif", "from ErrorFile import ErrorFile # Github Token TOKEN = props.token OWNER = \"\"", "props.token OWNER = \"\" REPOSITORY = \"\" OUTPUTFILE = \"\" def showHelp(): print('-r", "REPOSITORY = \"\" OUTPUTFILE = \"\" def showHelp(): prin...
[ "same extension as inputs') args = parser.parse_args() # determine models according to model", "'--tile', type=int, default=0, help='Tile size, 0 for no tile during testing') parser.add_argument('--tile_pad', type=int,", "has_aligned=False, only_center_face=False, paste_back=True) else: output, _ = upsampler.en...
[ "removed.\".format(filename) except FileNotFoundError as e: msg = \"{} does not exist.\".format(filename) except: raise", "'WAVECAR', 'XDATCAR' ] for filename in filenames_delete: try: os.remove(filename) msg = \"{} removed.\".format(filename)", "try: os.remove(filename) msg = \"{} removed.\".format(filename) e...
[ "else: current_max = max(node.value, current_max) # add the left and right children of", "current_max = node.value current_depth = depth # otherwise, we update `current_max` if we", "= deque() # add the root node to the queue at a depth", "depth # otherwise, we update `current_max` if we need to else: current...
[ "import numpy as np import pandas as pd from src.infer.ExtractDeformableTTA import MAPPINGS_PATH, test_image_set,", "384, 416, 448, 480, 512] fold0_nom = \"fold{}_{}\".format(0, imsizes[0]) fold1_nom = \"fold{}_{}\".format(1, imsizes[1])", "box is: newTopLeft = (1024. - topRight[0], topRight[1]) return [newTopL...
[ "* 60 * 60 ) token_instance = w3.eth.contract(abi=erc20ABI, address=w3.toChecksumAddress(YFII)) totalStakedAmount = token_instance.functions.balanceOf(POOL4).call() /", "* 60480 def _totalStakedAmount(): token_instance = w3.eth.contract(abi=erc20ABI, address=w3.toChecksumAddress(YFII)) return token_instance.funct...
[ "the list of scene items from. Defaults to the current scene if not", "not active or already paused. \"\"\" def __init__(self): Baserequests.__init__(self) self.name = 'PauseRecording' class", "type: String Name of the scene to switch to. *transitionName* type: String Name", "settings of a transition :Argumen...
[ "from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import CustomUser admin.site.register(CustomUser,", "django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import CustomUser admin.site.register(CustomUser, UserAdmin)" ]
[ "under the License. \"\"\" from collections import OrderedDict import cv2 import numpy as", "<= i: box_outs[layer_name] = data else: box_outs[layer_name] = np.expand_dims(data[i], axis=0) output_per_box.append(box_outs) return output_per_box", "np from ...adapters import MTCNNPAdapter def calibrate_predictions(...
[ "import SDKClient from com.couchbase.client.java.json import JsonObject \"\"\" Basic test cases with commit,rollback scenarios", "timeout_secs=self.sdk_timeout, retries=self.sdk_retries, update_count=self.update_count, transaction_timeout=self.transaction_timeout, commit=self.transaction_commit, durability=self.d...
[ "return ' '.join(list1) ''' 注意 在2.x版本可以用len()得到list的长度 3.x版本就不行了 优化版本 def spin_words(sentence): # Your code", "list1=sentence.split() l=len(list1) for i in range(l): relen = len(sentence.split()[i:][0]) if relen > 5:", "优化版本 def spin_words(sentence): # Your code goes here return \" \".join([x[::-1] if len(x)", ...
[ "= (host, port) self.__socket = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM) self.__conn = None # ---------------------------------------------------------------------------------------------------------------- def", "self.__conn = None # ----------------------------------------------------------...
[ "try: if self._settings.PREFER_LANGUAGE_DATE_ORDER: self._settings.DATE_ORDER = self.language.info.get('dateorder', _order) date_obj, period = date_parser.parse( self._get_translated_date(), settings=self._settings)", "u'\\N{FULLWIDTH APOSTROPHE}', # u'\\uff07' ] RE_NBSP = re.compile(u'\\xa0', flags=re.UNICODE) R...
[ "xp) g_mu_x1 = clip_grad(g_mu_x1, th_min, th_max, xp) g_mu_x2 = clip_grad(g_mu_x2, th_min, th_max, xp)", "\"type(x): {0}, type(eos_input): {1}, type(pi_input): {2}\" \"type(mu_x1_input): {3}, type(mu_x2_input): {4}, type(s_x1_input): {5}\" \"type(s_x2_input):", "* self.mask g_s_x2 = - self.gamma * ((C*d_norm_x2...
[ "free port # app.run(port=0) app.run( port=5000, # :param threaded: should the process handle", "== '__main__': app.debug = True # Localhost # port=0 -- random free port", "<reponame>DazEB2/SimplePyScripts #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' # SOURCE:", "process # up to this...
[ "import pypospack.io.phonts as phonts # <---- additional classes and functions in which to", "# <---- additional classes and functions in which to add top # <----", "and functions in which to add top # <---- pypospack.io.phonts if __name__ ==", "phonts # <---- additional classes and functions in which to add ...
[ "omegaconf.omegaconf import _maybe_wrap is_type = isinstance(obj, type) obj_type = obj if is_type else", "klass def _is_union(type_: Any) -> bool: return getattr(type_, \"__origin__\", None) is Union def", "if not is_type: value = getattr(obj, name) else: value = attrib.default if value", "a choice between tw...
[ "if cb key is not present pass else: # source known, CB valid:", "# Load LOFAR trigger server settings LOFARTriggerQueueServer.register('get_queue') with open(self.config_file, 'r') as f: server_config", "running to false self.observation_running = False # clear triggers self.amber_triggers = [] #", "allowed_...
[ "status(\"Launching web app & executing API calls\"): try: response_status, data = api(\"GET\", \"sysinfo\",", "token\", ) def assert_post(endpoint, data): response_status, data = api(\"POST\", endpoint, data, token) if", "\"ref\", \"sub\"]: fname = f'{source_info[\"id\"]}_{ttype}.png' fpath = basedir / f\"skyp...
[ "can be found in the LICENSE.TXT file. import sys import os import time", "selenium.common.exceptions import NoAlertPresentException import framework class Exploit (framework.Exploit): attributes = {'Name' : \"CUTEFLOW_0024\",", "self.verified = False return def exploit(self): driver = self.create_selenium_driv...
[ "@staticmethod def inline(text, data=None): \"\"\" Creates a new inline button with some payload", "a button press and the user typing and sending exactly the same text", "a different input peer. .. note:: For now, you cannot use ID or", "Creates a new keyboard button to request the user's phone on click. ``r...
[ "= readJson(jsonPathTemp + arr[0]) dict_1 = readJson(jsonPathTemp + arr[1]) dict_2 = readJson(jsonPathTemp +", "= jsonPath+\"temp/\" arr = os.listdir(jsonPathTemp) arr.sort() print(arr) dict_to_json = {} dict_0 = readJson(jsonPathTemp", "+ arr[0]) dict_1 = readJson(jsonPathTemp + arr[1]) dict_2 = readJson(jsonP...
[ "used in url, specific css, files etc. No spaces allowed\", max_length=50, unique=True, validators=[", "validators=[ grandchallenge.challenges.models.validate_nounderscores, django.core.validators.RegexValidator( re.compile(\"^[-a-zA-Z0-9_]+\\\\Z\"), \"Enter a valid “slug” consisting of letters, numbers, undersco...
[ "EqualsCondition(beta1, solver, \"adam\") beta2_depends_on_solver = EqualsCondition(beta2, solver, \"adam\") gamma_depends_on_policy = InCondition(child=gamma, parent=lr_policy, values=['inv',", "epoch_step=self.epoch_step, is_sparse=self.m_issparse, is_binary=self.m_isbinary, is_multilabel=self.m_ismultilabel, i...
[ "Creating a elif chain alien_color = 'red' if alien_color == 'green': print('Congratulations! You", "chain alien_color = 'red' if alien_color == 'green': print('Congratulations! You won 5 points!')", "'green': print('Congratulations! You won 5 points!') elif alien_color == 'yellow': print('Congratulations! You ...
[ "np.mean(test_scores, axis=1) test_std = np.std(test_scores, axis=1) plt.plot(param_range, train_mean, color='r', marker='o', markersize=5, label='Training score')", "train_mean = np.mean(train_scores, axis=1) train_std = np.std(train_scores, axis=1) test_mean = np.mean(test_scores, axis=1) test_std", "cv=None,...
[]
[ "= ToolError.FORMAT_INVALID if LineInfo is None: LineInfo = ['', -1, ''] Logger.Error(\"InfParser\", ErrorCode,", "objects of INF file miscellaneous. # Include BootMode/HOB/Event and others. It will consumed", "self.SupportedBootModes = '' self.HelpString = '' self.Usage = '' def SetSupportedBootModes(self, Sup...
[ "https://www.codechef.com/START8C/problems/PENALTY for T in range(int(input())): n=list(map(int,input().split())) a=b=0 for i in range(len(n)): if(n[i]==1): if(i%2==0):", "for i in range(len(n)): if(n[i]==1): if(i%2==0): a+=1 else: b+=1 if(a>b): print(1) elif(b>a): print(2)", "in range(int(input())): n=list(map...
[ "pred, out_file, norm=None): label_names = list(set(truth) | set(pred)) label_names.sort() truth_compact = [label_names.index(x) for", "pred_compact = [label_names.index(x) for x in pred] cm = confusion_matrix( truth_compact, pred_compact, labels=list(range(len(label_names))),", "disp.plot(ax=ax, xticks_rotatio...
[ "1.215 # [3, 20000] loss: 1.235 # [3, 25000] loss: 1.199 # [3,", "= self.fc3(x) # print(x.shape) return x # torch.Size([1, 3, 32, 32]) # torch.Size([1,", "1.124 # [4, 40000] loss: 1.094 # [4, 45000] loss: 1.105 # [4,", "loss: 1.235 # [3, 25000] loss: 1.199 # [3, 30000] loss: 1.187 #", "# [4, 5000] loss: 1.1...
[ "orbital_element_type=\"eq\", epoch_near_present=1) assert len(res_kep_0['Keplerian State Vector']) == 6 assert len(res_kep_0['Covariance Matrix']) == 21", "epoch_near_present=0) res_kep_1 = neodys.core.NEODyS.query_object( test_object, orbital_element_type=\"ke\", epoch_near_present=1) res_eq_0 = neodys.core.NEO...
[ "WireBillingRecord = apps.get_model('accounting', 'WireBillingRecord') for wirerecord in WireBillingRecord.objects.all(): if wirerecord.emailed_to != '': wirerecord.emailed_to_list", "wirerecord.emailed_to_list = wirerecord.emailed_to.split(',') wirerecord.save() class Migration(migrations.Migration): dependencie...
[ "of an \" \"out-of-graph one. Works only with --agent=policy.\" ) flags.DEFINE_string( \"planner_hparams_set\", \"planner_small\",", "from __future__ import print_function import datetime import os from tensor2tensor.data_generators import gym_env from", "KIND, either express or implied. # See the License for t...
[ "from selenium.webdriver.common.by import By from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support import expected_conditions from", "from selenium.webdriver.common.desired_capabilities import DesiredCapabilities class TestTest1(): def setup_method(self, method): self.dr...
[ "from django.contrib import admin from grandchallenge.components.models import ( ComponentInterface, ComponentInterfaceValue, ) class ComponentInterfaceAdmin(admin.ModelAdmin):", "import admin from grandchallenge.components.models import ( ComponentInterface, ComponentInterfaceValue, ) class ComponentInterfaceAdm...
[ "-*- \"\"\" Created on Mon Mar 28 15:28:24 2016 @author: <NAME>, <EMAIL> \"\"\"", "utf-8 -*- \"\"\" Created on Mon Mar 28 15:28:24 2016 @author: <NAME>, <EMAIL>", "coding: utf-8 -*- \"\"\" Created on Mon Mar 28 15:28:24 2016 @author: <NAME>,", "Created on Mon Mar 28 15:28:24 2016 @author: <NAME>, <EMAIL> \"\"...
[ "import MDNSDiscoverable class Discoverable(MDNSDiscoverable): \"\"\"Add support for discovering Nanoleaf Aurora devices.\"\"\" def __init__(self,", "\"\"\"Discover Nanoleaf Aurora devices.\"\"\" from . import MDNSDiscoverable class Discoverable(MDNSDiscoverable): \"\"\"Add support for", "Aurora devices.\"\"\" ...
[ "fb, :, :]).transform(covs[:, fb, :, :]) return covs_ts file_covs = op.join(cfg.path_outputs, 'covs_allch_oas.float32.h5') covs_allch", "proj_mat = V[:, :rank].T covs_proj = np.zeros((n_sub, n_fb, rank, rank)) for sub in", "fb] = proj_mat @ covs[sub, fb] @ proj_mat.T covs_proj[sub, fb] += reg *", "= [d['covs'...
[ "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "writing, software # distributed under the License is distributed on an \"AS IS\"", "# under the License. import daiquiri from six.moves.urllib import parse as urlparse from", "# Copyright 2017~ mengalong <<EMAIL>> # # License...
[ "\"constant\": False, \"inputs\": [], \"name\": \"return13\", \"outputs\": [ {\"name\": \"result\", \"type\": \"int256\"}, ],", "{\"name\": \"a\", \"type\": \"int256\"}, {\"name\": \"b\", \"type\": \"int256\"}, ], \"name\": \"add\", \"outputs\": [", "\"int256\"}, ], \"name\": \"add\", \"outputs\": [ {\"name\": ...
[ "print 'conf_dir: ', conf_dir if \"--\" in sys.argv: args = sys.argv[sys.argv.index(\"--\") + 1:]", "], 'log') CONF.register_opts([ cfg.StrOpt('connection'), cfg.StrOpt('data'), ], 'DB') CONF.register_opts([ cfg.StrOpt('server'), cfg.StrOpt('port'), cfg.StrOpt('from_addr'), cfg.StrOpt('info_list'), cfg.StrOpt('al...
[ "import Connections class Rover(Robot, Connections): def __init__( self, config, bt_flag = 0, xbox_flag", "elif bt_flag: self.connection_type = \"b\" elif xbox_flag: self.connection_type = \"x\" self.connectController() def drive(self):", "try: v,r = self.getDriveVals() if v,r != self.prev_cmd: self.sendCommand...
[ "{ }, macro_func = macro_fn, # custom_markup = (), interwiki_links_base_urls = { 'wikicreole'", "topics: TOPIC_LIST.extra_references.append(topic) ul.append(builder.tag.li(builder.tag.a(topic.name, href = topic.get_absolute_url()))) return ul #################################################################### # ...
[ "According to the rfc6749, client authentication is required in the following cases: -", "def save_authorization_code(self, client_id, code, request, *args, **kwargs): \"\"\" Persist the authorization_code. \"\"\" expires", "Basic. \"\"\" if self._get_application(client_id, request) is not None: return request....
[ "x = [1, 2, 3] y = modify(x) print(\"x == y\", x ==", "# returns same reference. No new object is created x = [1, 2,", "same reference. No new object is created x = [1, 2, 3] y", "created x = [1, 2, 3] y = modify(x) print(\"x == y\", x", "2, 3] y = modify(x) print(\"x == y\", x == y) print(\"x ==", "No ne...
[ "the markdown file is blank') # get the type for this component comp_type", "list(tree_snippet.iter('h1')) if len(h1_tags) == 0: print(WARNING, 'The snippet does not start with any", "print(WARNING, 'There seem to be no settings for this \"problem-checkboxes\" component:', md_filepath) return", "settings = _r...
[ "101): score = input(\"Please input valid numbers only.(Number from zero to 100.)\\n\") students_score[name]", "check_name(name): # 2.1.1 Remove period and blank and check it if the name", "2. Input student's name and check if input is correct. (Alphabet, period, and", "if input is correct. (digits only and b...
[ "= 'Recipe00000000000000000000000000000000000000000000' self.assertTrue(utils.valid_project_slug(project_slug)) project_slug = \"\" self.assertFalse(utils.valid_project_slug(project_slug)) project_slug = \"Recipe000000000000000000000000000000000000000000001\" self.assertFalse(utils.valid_project_slug(project_slug))...
[ "3, 3).detach().cpu().numpy() pose_body = np.zeros((pose_body_mats.shape[0], 63)) for i in range(0, pose_body_mats.shape[0]): for j", "rot_vecs / angle cos = torch.unsqueeze(torch.cos(angle), dim=1) sin = torch.unsqueeze(torch.sin(angle), dim=1) # Bx1", "Exception() if fn_no_ext == 'poses': #load the vposer mod...
[ "docker.from_env() print(f\"Pushing image: {tag}\") with tqdm(total=100, ascii=False) as progress_bar: last_percent = 0.0 for", "last_percent = 0.0 for line in client.images.push(tag, stream=True): percent = get_completion_percentage(line) if percent:", "client.images.build(path=f\"{path}\", labels=labels, tag=...
[ "the fullpath) of the VCF file that will be analysed. It assumes that", "the Bcftools binary' ) parser.add_argument('--filename', type=str, required=True, help='Name (without the fullpath) of the", "type=str, required=False, help='Type of variant to select. i.e. snps/indels etc' ) args =", "variant to select....
[ "b\"\") eq(base64.b64encode(b\"abcdefghijklmnopqrstuvwxyz\" b\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" b\"0123456789!@#0^&*();:<>,. []{}\"), b\"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE\" b\"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NT\" b\"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\") # Test with arbitrary alternative", "b'b\\xdd\\xad\\x...
[ "-*- # Generated by Django 1.11.29 on 2021-02-25 20:32 from __future__ import unicode_literals", "Django 1.11.29 on 2021-02-25 20:32 from __future__ import unicode_literals from django.db import migrations,", "('appliance_catalog', '0014_auto_20180625_1104'), ] operations = [ migrations.AlterField( model_name='...
[ "user for our db db_user = (User.query.get(user_id)) or User(id=user_id, name=username) # This adds", "= spacy.load(\"my_model\") def vectorize_tweet(tweet_text): return nlp(tweet_text).vector # Add and updates tweets def add_or_update_user(username):", "# db_user.newest_tweet_id = tweets[0].id for tweet in twe...
[ "range(len(l)): grid[(y,x)] = l[x] y += 1 y = y // 2 x", "x in range(len(l)): grid[(y,x)] = l[x] y += 1 y = y //", "1 y = y // 2 x = x // 2 dx =", "-dy) grid[(y,x)] = 'F' elif grid[(y,x)] == 'F': (dy, dx) = (-dy, -dx)", "'F': (dy, dx) = (-dy, -dx) grid[(y,x)] = '.' y += dy x", "dy) grid[(y,x)] = 'W' elif ...
[ "using an invalid location.\"\"\" def __init__(self, msg=\"Invalid location\"): ValueError.__init__(self, msg) class ComplexPlottingError(ValueError): \"\"\"Error", "raised when the Ansys verion is invalid.\"\"\" def __init__(self, msg=\"\"): RuntimeError.__init__(self, msg) class", "features are not supported ...
[ "deep_disfluency.utils.accuracy import wer final_file = open('wer_test.text', \"w\") ranges1 = [line.strip() for line in", "results: # print l if l == \"\\n\": print no_ho no_ho = 0", "continue if float(l.strip('\\n').split(\" \")[ 2]) < 0.4: # both speakers are under 40%", "0 file.close() file = open( \"../....
[ "class NewUser: \"\"\"Deals with the commands the user is currently sending\"\"\" user_id: int", "\"\"\"For FunctionStagingArea\"\"\" fn: Callable[..., Any] args: Optional[Tuple[Any, ...]] = None kwargs: Optional[Dict[str, Any]]", "__repr__(self) -> str: return f\"{self.user_id=} {self.command=}\" @dataclass cl...
[ "vcard:hasAddress ?obj . \"\"\", \"definition\": { \"where\": \"?subj a vcard:Address .\", \"fields\": {", "\"list\": True }, \"overview\": { \"where\": \"?subj vivo:overview ?obj .\", \"optional\": True, },", ".\", \"definition\": { \"where\": \"?subj a vivo:Position .\", \"fields\": { \"title\": { \"where\":"...
[ "items = Apart.objects.filter(user = user.id).filter(lookups) for item in items: result.add(app_name, 'apart', item.id, None,", "= Price.objects.filter(apart__user = user.id).filter(lookups) for item in items: result.add(app_name, 'price', item.id, item.start, item.name(),", "import Q from hier.search import Se...
[ "os.path.join(self.data_folder, 'descriptors', f'behavior_desc_{_id}.txt') with open(filename, \"w\") as f: if measures is None: f.write(str(None))", "= False return last_snapshot, has_offspring, last_id+1 def plot_path(self, data_source: str, filename: str, file_extension=\".png\"):", "ids of robots in the nam...
[ "response_write_time): \"\"\"Set response write time. Args: response_write_time(str): Response write time. \"\"\" self.response_write_time =", "time. Args: page_context_write_time(str): Page context write time. \"\"\" self.page_context_write_time = page_context_write_time def get_page_context_write_time(self):", ...
[ "setup( name=\"dpr\", version=\"0.1.0\", description=\"Facebook AI Research Open Domain Q&A Toolkit\", url=\"https://github.com/facebookresearch/DPR/\", classifiers=[ \"Intended", "Inc. and its affiliates. # # This source code is licensed under the", "(c) Facebook, Inc. and its affiliates. # # This source code ...
[ "20:37 \"\"\" from pprint import pprint as pp from operator import itemgetter import", "= Solution() nums = [[4, 10, 15, 24, 26], [0, 9, 12, 20],", "= k_tagged_merged_list[i][0] tags = od.keys() # print('len_k_dque-->', len(k_dque)) # print('len_k_dque_tags-->', len(k_dque_tags)) if len(tags)", "输出: [20,24] \...
[ "= Storage.UNIQUE_KEYS def get_status(self): \"\"\" Determines if the bucket exists Returns: status (dict)", "self.resource.Blob(blob_name, bucket).download_file(file_obj, **kwargs) def delete_object(self, blob_name): \"\"\" Deletes an object in the storage", "keys from state definition that are used to uniquel...
[ "% 2 == 0: WSZ = WSZ - 1 out0 = np.convolve(a, np.ones(WSZ,", "implementation if WSZ % 2 == 0: WSZ = WSZ - 1 out0", "1 out0 = np.convolve(a, np.ones(WSZ, dtype=int), 'valid') / WSZ r = np.arange(1, WSZ", "as in the original MATLAB implementation if WSZ % 2 == 0: WSZ", "1-D array containing the data to be sm...
[ "integers; the most recent are taken to be those with the largest values.", "categorical_column=categorial_feature_a, ...) ... # other feature columns estimator = tf.estimator.DNNClassifier( config=tf.estimator.RunConfig( model_dir='/my_model', save_summary_steps=100),", "\"\"\" if not event_files: return None ...
[ "node_type \"\"\" sf = object.__setattr__ sf(self, \"type\", new_type) sf(self, \"_restrict\", restrict) def match(self,", "of a certain type. This uses :obj:`partial` to pass a node_type to the", "*a, **kw): return self._restrict.match(*a, **kw) def __str__(self): return \"Faked type(%s): %s\" % (self.type,", ...
[ "Date: 2021-01-14 10:50:56.275257 \"\"\" import sqlalchemy as sa from alembic import op #", "globals()[f\"upgrade_{engine_name}\"]() def downgrade(engine_name): globals()[f\"downgrade_{engine_name}\"]() def upgrade_registrar(): pass def downgrade_registrar(): pass def upgrade_cloud_verifier(): with", "None depe...
[ "mundo import sys for line in sys.stdin: lexer.input(line) for tok in lexer: print(tok)", "import ply.lex as lex tokens =[\"NUM\",\"OPERADORES\"] t_NUM = '\\d+' t_OPERADORES = '[+|*|-]' t_ignore='\\n\\t", "1+2 1-2 1*2 # ola mundo import sys for line in sys.stdin: lexer.input(line)", "t_NUM = '\\d+' t_OPERADOR...
[ "field=models.BooleanField(default=False), ), migrations.AddField( model_name='treatmentscenario', name='landform_type_checkboxes', field=models.TextField(blank=True, default=None, null=True), ), migrations.AddField( model_name='treatmentscenario', name='landform_type_checkboxes_include_east_west', field=models.Boo...
[ "None = None, provider: spec.ProviderSpec = None, ) -> analytics_spec.AnalyticsPayload: \"\"\"create data payload", "'window_size': time_data['window_size'], 'interval_size': time_data['interval_size'], 'timestamps': time_data['timestamps'], 'block_numbers': time_data['block_numbers'], 'created_at_timestamp': tim...
[ "cdna: cdna_input = tf.reshape(hidden5, [int(batch_size), -1]) transformed += cdna_transformation(prev_image, cdna_input, num_masks, int(color_channels)) elif", "Unless required by applicable law or agreed to in writing, software # distributed", "hidden2, hidden2.get_shape()[3], [3, 3], stride=2, scope='conv2')...
[ "main_class = \"org.junit.platform.console.ConsoleLauncher\", args = junit_console_args, deps = deps + [ artifact(\"org.junit.jupiter:junit-jupiter-api\"), artifact(\"org.junit.jupiter:junit-jupiter-params\"),", "information see # - https://github.com/bmuschko/bazel-examples/blob/master/java/junit5-test/BUILD # -...
[ "Vector3D(object): \"\"\" A mock class for carla.Vector3D. \"\"\" def __init__(self, x, y, z):", "mocked versions of classes and functions provided # by Carla in our runtime", "and functions provided # by Carla in our runtime environment. class Location(object): \"\"\"", "mock class for carla.Rotation. \"\"\"...
[ "= 1-max(R,G,B) C,M,Y = [round(float((1-X-K)/(1-K) * 0x64),1) for X in [R,G,B]] K =", "ee = '\\033[1m' green = '\\033[32m' yellow = '\\033[33m' cyan = '\\033[36m' line", "# -*- coding: utf-8 -*- ee = '\\033[1m' green = '\\033[32m' yellow =", "python3 # -*- coding: utf-8 -*- ee = '\\033[1m' green = '\\033[32m'...
[ "for odir in args.output: prepare_dir(odir, not args.nodelete) print '\\nRunning gendoc' print '='*80 for", "documentaion. First it runs gendoc to create rst files\\ for the source code.", "gendoc' print '='*80 for i, idir in enumerate(args.input): if i >= len(args.output): odir", "less dirs than for source, ...
[ "min = i for j in range(i+1, n): # encontra o menor elemento", "1 + 3*(n-1) + (n^2 + n - 2)/2 # = (1 -", "+ X*(n-1) = 1 + 3*(n-1) + (n^2 + n - 2)/2 #", "# encontra o menor elemento da lista a partir de i + 1", "= j A[i], A[min] = A[min], A[i] # insere o elemento na posicao", "range(n-1): # percorre a list...
[ "# create the load step load_step: LoadStep = None for load_step in LoadStep.instances:", "1\") tcl_commands.append( f\"*attributeupdateint loadsteps {load_step_id} 4709 1 1 0 1\") tcl_commands.append( f\"*setvalue loadsteps", "tcl_commands.append( f\"*createentity loadcols includeid=0 name=\\\"{load_collector....
[ "while tajniBroj != broj: broj = int(input(\"Pogodite tajni broj: \")) if tajniBroj ==", "= int(input(\"Pogodite tajni broj: \")) if tajniBroj == broj: print(\"Pogodak!\") elif tajniBroj <", "broj = 2 while tajniBroj != broj: broj = int(input(\"Pogodite tajni broj: \"))", "print(\"Pogodak!\") elif tajniBroj <...
[ "1)) X_train_before = X_train.copy() X_test = np.reshape(np.linspace(np.pi, 2 * np.pi, 50), (50, 1))", "BaseTestCase class CMACTestCase(BaseTestCase): def test_cmac(self): X_train = np.reshape(np.linspace(0, 2 * np.pi, 100), (100,", "data = np.array([[1, 2, 3]]).T target = np.array([[1, 2, 3]]).T cmac.train(dat...
[ "joinstr = 'and_(foreign(TaskGroupObject.object_id) == {type}.id, '\\ 'foreign(TaskGroupObject.object_type) == \"{type}\")' joinstr = joinstr.format(type=cls.__name__) return", "target class TaskGroupable(object): @classmethod def late_init_task_groupable(cls): def make_task_group_objects(cls): cls.task_groups = ...
[ "the DFFRAM Memory Compiler. # See https://github.com/Cloud-V/DFFRAM for further info. # # Licensed", "RAM_DATA_RW; reg [(SIZE*8-1):0] RAM_DATA_R; genvar c; generate for (c=0; c < SIZE; c", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or ag...
[ "bid): self.bid = float(bid) def get_bid(self): return self.bid def set_ask(self, ask): self.ask =", "def set_bid(self, bid): self.bid = float(bid) def get_bid(self): return self.bid def set_ask(self, ask):", "class CoinbaseResponse: bid = 0 ask = 0 product_id = None def set_bid(self,", "def set_ask(self, ask...
[ "of wettest/driest quarter. The wettest (or driest) quarter of the year is determined,", ") out = select_resample_op(pr_qrt, oper, freq) out.attrs[\"units\"] = pr_qrt.units return out @declare_units(pr=\"[precipitation]\", tas=\"[temperature]\")", "of temperature values for a given year expressed as a percentag...