ngram
listlengths
0
82k
[ "__init__(self, bot, cwd): \"\"\" Initialize class @param => DiscordBot: `bot`:", "class @param => DiscordBot: `bot`: Discord Bot Instance. @param =>", "=> str: `description`: Description of the news. @param => str:", "= key # For each sections for index_section, section in", "in the section for link in sec...
[ "= self._create_player_logger(log_level) # pyre-ignore if start_listening: self._listening_coroutine = ensure_future(self.listen()) async", "@property def logger(self) -> Logger: # pyre-ignore \"\"\"Logger associated with", "\"\"\" return self._logger @property def username(self) -> str: \"\"\"The player's", ...
[ "import defaultdict import cPickle as pickle import re stopwords_custom =", "a) in enumerate(authors.iteritems()): if ':' not in a['fullname']: lname =", "if len(a['fullname_joined']) > 1: bins[a['fullname_joined'][:-1]].add(id) if (i+1) % 10000 ==", "import csv import argparse from unidecode import unidecode...
[ "def filters(self, *args, **kwargs): # real signature unknown pass def", "of __new__ def __new__(S, *more): # real signature unknown; restored", "*args, **kwargs): # real signature unknown pass def path(self, *args,", "signature unknown pass def currentFileName(self, *args, **kwargs): # real signature", "de...
[ ".00001524 00000-0 30197-4 0 9997 2 25544 51.6421 236.2139 0003381", "\"\"\"Declare the skip_if_no_mpl marker in pytest's '--markers' helper option This", "called for each test case. It looks if the test", "skip from unittest.mock import patch from pathlib import Path from", "return True else: return False ...
[ "x) == log(x + sin(y)) # Up to a constant,", "is this still correct? assert heurisch(5*x**5/( 2*x**6 - 5), x)", "== log(x + sqrt(2)) assert simplify(diff(heurisch(log(x + y + z),", "the rest of PMINT tests: # Airy functions # f", "/ 7 assert heurisch(1/pi/4 * x**2*cos(x), x) == 1/pi/4*(x**2*sin(x) -", "x)...
[ "a torch.Tensor. Got {type(input)}\") if not isinstance(contrast_factor, (float, torch.Tensor,)): raise", "torch.Tensor: Adjusted image. \"\"\" def __init__(self, contrast_factor: Union[float, torch.Tensor]) ->", "= torch.unsqueeze(hue_factor, dim=-1) # unpack the hsv values h, s,", "Union[float, torch.Tensor...
[ "env and registers it with gym''' assert config_id in REGISTRY,", "global REGISTRY REGISTRY = [] for name, f in inspect.getmembers(configs,", "REGISTRY.append(config['env_id']) # Register environments with gym _register() def make(config_id, agent_list,", "agent.init_agent(id_, env.spec._kwargs['game_type']) ...
[ "django.urls import path from .views import ProfileView urlpatterns = [", "import path from .views import ProfileView urlpatterns = [ path('',", "from django.urls import path from .views import ProfileView urlpatterns =", "path from .views import ProfileView urlpatterns = [ path('', ProfileView.as_view(),", ...
[ "= dict() res[\"default_iris\"] = 0.92 res[\"iris_n_calls\"] = 5 res[\"default_iris_iterative\"] =", "res[\"digits_iterative_n_iter\"] = 64 res[\"default_digits_binary\"] = 0.9927140255009107 res[\"default_digits_multilabel\"] = 0.90997912489192 res[\"default_digits_multilabel_proba\"]", "= 32 res[\"default_iri...
[ "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "# coding=utf-8 # Copyright 2020 The TensorFlow Datasets Authors. #", "as tfds from tensorflow_datasets.structured.dart import dart class DartTest(tfds.testing.DatasetBuilderTestCase): DATASET_CLASS =", "# # Licensed under...
[ "trues = [] labels = [] with torch.no_grad(): for i,", "model_optim.zero_grad() batch_x = batch_x.double().to(self.device) batch_y = batch_y.double() batch_x_mark = batch_x_mark.double().to(self.device)", "labels.shape[-1]) print('test shape:', preds.shape, trues.shape) # result save folder_path =", "enumerat...
[ "transport. The message_string parameter is a string in the MySensors", "load_nodes_state(\"mysensors/distance_sensor_state.json\") @pytest.fixture def distance_sensor( gateway_nodes: dict[int, Sensor], distance_sensor_state: dict )", "message_string parameter is a string in the MySensors message format.", "g...
[ "return INTPoint.getIntersectPoint(linea,lineb) def sortLines(lines): #moved to Edges.py return Edges.sortLines(lines) def", "point[0] sumy += w * point[1] return (sumx/count,sumy/count) def devideIntoPoints(Points):", "in range(0,lens,1): Cluster[i] = [] for point in Points: if", "count == K: break for i in ...
[ "assert response.status_code == 200 file_list = response.get_json() assert len(file_list) ==", "def test_put_example_image_data(client): response = client.get(\"/api/files/image_data/image.jpg\") assert response.status_code == 404 response", "'x': 0, 'y': 0}], 'tags': ['a', 'b'] }) assert response.status_code",...
[ "a cohorted partition in this course')), ('group_id', models.IntegerField(help_text='contains the id", "of a specific group within the cohorted partition')), ('created_at', models.DateTimeField(auto_now_add=True)),", "with?', max_length=255, db_index=True)), ('group_type', models.CharField(max_length=20, choice...
[ "import csv import random from config import MIN_CUSTOMER_ID, MAX_CUSTOMER_ID ACQUISITION_SOURCES", "fieldnames=['CustomerID', 'AcquisitionSource']) writer.writeheader() for customer_id in range(MIN_CUSTOMER_ID, MAX_CUSTOMER_ID + 1):", "main(): with open('customers.csv', 'w') as fout: writer = csv.DictWriter(fo...
[ "parsl.executors.errors import UnsupportedFeatureError from parsl.executors import WorkQueueExecutor @python_app def double(x,", "import python_app from parsl.tests.configs.local_threads import config from parsl.executors.errors import UnsupportedFeatureError", "import config from parsl.executors.errors import ...
[ "__include_sub_dirs(self, files: Iterable[pathlib.Path], file_set: Set[pathlib.Path]): \"\"\"Include files from sub directories\"\"\"", "If there is local match for file/directory, it is marked", "is changed to be relative of working directory of container,", "-> List['FileMatcher']: \"\"\"Parse pattens from ...
[ "This information is used when creating the *SDK*. info =", "info = { 'input_format': { 'session_id': 'str', 'field': 'str', 'value?':", "= { 'input_format': { 'session_id': 'str', 'field': 'str', 'value?': 'str',", "def do(data, resource): body = {} params = data['params'] user", "input output format of th...
[ "Normally, code-specific utility code would belong in a code-specific ARMI", "code-specific ARMI plugin. But in this case, the need for", "nuclideBases as nb from armi import configure configure(permissive=True) _o, r", "code-specific utility code would belong in a code-specific ARMI plugin.", "in enumerate...
[ "JUN {}'.format(birth_year) if not db['yougest']: db['yougest'] = individual_id elif db[db['yougest']]['birth']", "if not last_name: last_name = names.get_last_name() birth_place = 'Paris' if", "individual_id elif db[db['yougest']]['birth'] < birth_year: db['yougest'] = individual_id db[individual_id]['string']...
[ "the destination. # Calculation the angle in radians between the", "could do this # only when the bullet fires, but", "the mouse moves. \"\"\" self.player.center_x = x self.player.center_y = y", "You can leave this out of your own # code,", "BULLET_SPEED self.bullet_list.append(bullet) # Get rid of the bull...
[ "you know that in two years you will be %d", "usrAge = int(input(\"What is your Age?\")) usrGPA = float(input(\"What is", "is your Name?\") usrAge = int(input(\"What is your Age?\")) usrGPA", "(\"Hello, %s\" % (usrName)) print (\"Did you know that in", "use of Variables. usrName = input(\"What is your Name?...
[ "a = input() a = a.replace('--', '2') a = a.replace('-.',", "a = a.replace('--', '2') a = a.replace('-.', '1') a =", "= a.replace('--', '2') a = a.replace('-.', '1') a = a.replace('.',", "= input() a = a.replace('--', '2') a = a.replace('-.', '1')", "'2') a = a.replace('-.', '1') a = a.replace('.', '0') pri...
[ "class Message: def __init__(self, from_channel=None, **kwargs): self._channel = from_channel if", "msg = Message(sender=\"A\", receiver=\"B\") assert msg.sender is \"A\" assert msg.receiver", "return self._channel.sender def receiver(self): return self._channel.receiver class CallbackMessage(Message): def __in...
[ "self.assertEquals(msg['params'], ()) def test_logger_warning(self): self.logger.warning('This is a test warning') self.assertEquals(len(self.client.events),", "TestCase class LoggingIntegrationTest(TestCase): def setUp(self): self.client = get_tempstoreclient(include_paths=['tests', 'opbeat']) self.handler", "...
[ "major): super().__init__() self.name = name self.template = template self.major =", "q_major_minor(dbsession, major, minor): cond = sql.and_( MimeMajor.name == major, Mime.name", "if minor and minor != '*': cond.append(Mime.name == minor) return", "dbsession.execute( sql.select(Mime).join(Mime.major).options...
[ "= Goods.objects.all()[:10] # for good in goods: # json_dict =", "goods: # json_dict = {} # json_dict[\"name\"] = good.name #", "good.add_time # json_list.append(json_dict) # from django.http import HttpResponse # import", "from django.http import HttpResponse, JsonResponse # jsonResponse做的工作也就是加上了dumps和conte...
[ "len(args) == 0: parser.error('command name not specified') else: parser.error('too many", "if len(process_name) > 0: system = platform.system() + '-' +", "process.write_pid(os.getpid()) redirect_stdin_to_devnull() os.execvpe(args[0], args, env) def start(process, options): if process.alive():", "= realpath(o...
[ "__init__(self): ShowBase.__init__(self) # Load environment model self.scene = self.loader.loadModel(\"models/environment\") #", "execute self.taskMgr.add(self.spinCameraTask, \"SpinCameraTask\") # Load and transform panda actor self.pandaActor", "model to render self.scene.reparentTo(self.render) # Scale and p...
[]
[ "value in correlations.items() if value is not None } #", "custom sample Returns: This function returns a dictionary containing: -", "description \"table\": table_stats, # Per variable descriptions \"variables\": series_description, #", "if config.correlations[correlation_name].calculate ] number_of_tasks = 8...
[ "campers = ['PKUxk','THUsz_ai','THUsz_cs','THUsz_data','USTC_cs'] for camper in campers: filename = camper", "if __name__ == \"__main__\": campers = ['PKUxk','THUsz_ai','THUsz_cs','THUsz_data','USTC_cs'] for camper in", "global index if name not in stdsDict: newStd = Std()", "index if name not in stdsDict: ne...
[ "'copyreg', 'html', 'http', 'queue', 'reprlib', 'socketserver', 'tkinter', 'winreg', 'xmlrpc' ])", "Do any of the above folders exist in build/lib? files", "2\" LONG_DESC = src.future.__doc__ AUTHOR = \"<NAME>\" AUTHOR_EMAIL = \"<EMAIL>\"", "If the user happens to run: # python2 setup.py build", "\"future.t...
[ "connect to Database and register Blueprint of routes\"\"\" app =", "import Flask from .extensions import db from .routes import short", "app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = config.DATABASE_CONNECTION_URI app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.app_context().push()", ...
[ "updatesql = \"UPDATE `t_stackoverflow_question` \" \\ \"SET `tags`='%s', `views`='%s', `answers_num`='%s',", "it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11', 'Opera/9.25 (Windows NT 5.1; U; en)',", "tag in tags: tags_str += tag.get_text() + \",\" answer_contetnts =", "`question_content`='%s', `answers_con...
[ "X_train, y_train = (preprocess(train), to_categorical(train['is_iceberg'].as_matrix().reshape(-1, 1))) X_train_cv, X_valid, y_train_cv, y_valid", ":, :, np.newaxis], angl[:, :, :, np.newaxis]], axis=-1) return images", "/ stds[1] angl = (angl - means[2]) / stds[2] images", "stds=(5.33146, 4.5463958, 4.081539...
[ "polyaxon experiment -xp 19 resources --gpu ``` Examples for getting", "Printer.print_success(\"Experiment updated.\") get_experiment_details(response) @experiment.command() @click.option('--yes', '-y', is_flag=True, default=False, help=\"Automatic yes", "get_resources(experiment.resources.to_dict(), header=\"E...
[ "9 + 16 = 25 = 52. There exists exactly", "b < c: if a + b + c ==", "a < b < c, for which, a2 + b2", "= True break if solved: break if solved: break product", "is a set of three natural numbers, a < b", "for which a + b + c = 1000. Find", "a + b + c == 1000: if a**2 +", "if solved: break product = a*b...
[ "= t.stitches.all() self.assertEqual(s0.left, f0) self.assertEqual(s0.right, f1) self.assertEqual(s0.state, 'notready') self.assertEqual(s1.left, f1)", "t.fragments.all() self.assertEqual(f0.start, Decimal('0.00')) self.assertEqual(f0.end, Decimal('3.33')) self.assertEqual(t.stitches.count(), 0) t = Transcript.ob...
[ "any links detail = ''.join(detailsplit[::2]) #Finally, we join every other", "(passing over the link groups) into one string #print(detail) return", "list' featHolder['date'] = datetime.date.today().strftime(\"%B %d, %Y\") def get_details(link): res =", "#if t > 5: #break return feats listOfPages = codecs.op...
[ "I think this is where i need to add in", "random import secrets secure_random = secrets.SystemRandom()# creates a secure random", "list for each_question in range (0, num_qustion_t_select): # I think", "object. group_of_items = questions_lists num_qustion_t_select = num_question_to_display list_of_random_ite...
[ "job_data = fpl(\"indeed\", next_page=\"/jobs?q=Data+Scientist\" \"&l=Texas&start=10\") if __name__ == '__main__': unittest.main()", "scrape.build_url(\"indeed\", \"/jobs?q=Data+Scientist&l=Texas&start=10\", join_next=True) expected = (\"https://www.indeed.com/\" \"jobs?q=Data+Scientist&l=Texas&start=10\") url2 =...
[ "p| /}\") print(\"( 0 )\\\"\\\"\\\"\\\\\") print(\"|\\\"^\\\"` |\") print(\"||_/=\\\\\\\\__|\") if __name__", "def main(): print(\"|\\_/|\") print(\"|q p| /}\") print(\"( 0 )\\\"\\\"\\\"\\\\\") print(\"|\\\"^\\\"`", "main(): print(\"|\\_/|\") print(\"|q p| /}\") print(\"( 0 )\\\"\\\"\\\"\\\\\") print(\"|\\\"^\\...
[ "= train_labels[1:30000] test_data_tfidf = tfidf.transform(ingredient_list[1:30000]) test_data_hash = hashvec.transform(ingredient_list[1:30000]) test_data_bag =", "from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction.text import HashingVectorizer from sklearn.ensemble", "...
[ "13] rank = ranks[deck[i] % 13] print(\"Card number\", deck[i], \"is", "Display the first four cards for i in range(4): suit", "= [\"Spades\", \"Hearts\", \"Diamonds\", \"Clubs\"] ranks = [\"Ace\", \"2\", \"3\",", "in range(4): suit = suits[deck[i] // 13] rank = ranks[deck[i]", "first four cards for i in ra...
[ "use_bias self.normalize = normalize self.out_features = out_features self.epsion = epsion", "self.normalize = normalize self.out_features = out_features self.epsion = epsion def", "nlpgnn.gnn.messagepassing import MessagePassing class RGraphConvolution(MessagePassing): def __init__(self, out_features, epsion=1...
[ "call options for each method. If not specified, the default", "(str): The resource name of the dataset to retrieve. retry", "like. self._inner_api_calls = {} # Service calls def create_dataset( self,", "same form as the protobuf message :class:`~google.cloud.automl_v1beta1.types.Dataset` retry (Optional[goog...
[ "task.working_hours_open = 0.0 task.working_days_open = 0.0 if task.date_end: dt_date_end =", "self.env.user.has_group('project.group_project_recurring_tasks')) # rating fields rating_request_deadline = fields.Datetime(compute='_compute_rating_request_deadline', store=True) rating_active =", "_compute_partner_p...
[ "APP_SETTINGS environment variable :return The config class instance :rtype: Config", "Staging Config is for... staging things \"\"\" DEBUG = True", "config_imports[-1] config_module = import_module('.'.join(config_imports[:-1])) config_class = getattr(config_module, config_class_name, None) if", "class. \"\"...
[ "from postgres_dao.ddl_dao import DdlDao from postgres_dao.dml_dao import DmlDao as PsqlDmlDao", "DdlDao from postgres_dao.dml_dao import DmlDao as PsqlDmlDao psql_ddl_dao = DdlDao()", "zipcode_data = mysql_select_dao.select_all_zipcodes() psql_dml_dao.insert_zipcode(zipcode_data) data = mysql_select_dao.select...
[ "bucket in rest.get_buckets(): self.log.info(\"*****************************\\ bucket %s: memUsed %s\\ ****************************\" %", "Memory\" error (UI) \"\"\" def test_load_memory(self): num_items = self.quota *", "False) number = 2**degree first = ['james', 'sharon'] template =", "template, [number,],...
[ "ca :('.format(sub, id_)) return else: print('get excel URL!!!') excel_url =", "BeautifulSoup(r.text, 'lxml') list_td_tag = soup.find_all('td', attrs={'style': 'padding-top:10px'}) all_td_tag = all_td_tag", "input('Nhap ten mon: ') id_ = input('Nhap id mon: ')", "r = requests.get(url) soup = BeautifulSoup(r.t...
[ "for Shopping. - Sending items to Content API for Shopping", "'Error loading items from BigQuery', http.HTTPStatus.INTERNAL_SERVER_ERROR result = process_result.ProcessResult([], [],", "timestamp %s successfully processed %s items, failed to process %s", "__name__ == '__main__': # This is used when running lo...
[ "ranges for the with-regions. \"\"\" def find_ranges(blocks): for blk in", "variables are actually used in the blocks, else remove, #", "return True _logger.info('finding looplift candidates') # the check for cfg.entry_point", "support with-context that contain branches \" \"(i.e. break/return/raise) that can...
[ "], ] TEST_CASE_2 = [ { \"data\": [{\"image\": FILE_PATH, \"mask\":", "from unittest import skipUnless import numpy as np from numpy.testing", "\"CMU-1\", \"mask_location\": [101, 100], }, ], ] TEST_CASE_OPENSLIDE_0 = [", "\"CMU-1\", \"mask_location\": [101, 100], }, { \"image\": np.array([[[243]], [[243]], [...
[ "for i in items] def get_cover(self) -> str: return self._cover_from_content(self.img_selector)", "'archive' def get_chapter_index(self) -> str: return '0' def get_main_content(self): return", "def get_chapters(self): return [b''] def get_files(self): items = self.document_fromstring(self.content, self.img_sele...
[ "QModelIndex): editor.blockSignals(True) editor.setChecked(index.model().data(index)) self.enabled = editor.isChecked() editor.blockSignals(False) def setModelData(self, editor:", "editor: QCheckBox, model: QAbstractItemModel, index: QModelIndex): model.setData(index, editor.isChecked(), Qt.EditRole) @pyqtSlot()"...
[ "input_dim=10000, output_dim=128) net = tflearn.simple_rnn(net, neurons_num, dropout=keep_prob) net = tflearn.fully_connected(net,", "= 100 # Number of epoch #Data preprocessing/ Converting data", "Validation samples: 400 RNN with 128 units Optimizer: Adam Epoch:", "keep_prob = 0.8 Accuracy of Validation set:...
[ "x M x 2H q_tile = tf.transpose(q_tile, (1, 0, 3,", "as tf H = 2 N = 2 M =", "np.array([True, True, False]) # BS x M context_mask = np.tile(context_mask,", "test_concatenation(c2q, q2c) init = tf.global_variables_initializer() with tf.Session() as sess: sess.run(init)", "x M contexts = tf.expand_dims(contex...
[ "@pytest.mark.parametrize(\"stddev\", [-1, 0, 'a']) def test_smooth_gaussian_bad(simulated_spectra, stddev): \"\"\" Test MexicanHat1DKernel", "np import pytest from astropy import convolution from scipy.signal import", "pytest.raises(ValueError): box_smooth(spec1, width) @pytest.mark.parametrize(\"stddev\", [1,...
[ "set of points using either linear, polynomial or cubic spline", "function \"\"\" if method == \"linear\": intfunc = interp1d(x_sup, y_sup,", "x-coordinates of the function y_sup (list): y-coordinates of the function", "points using either linear, polynomial or cubic spline for the", "lagrange(x_sup, y_sup)...
[ "def execute(): frappe.delete_doc_if_exists(\"DocType\", \"Web View\") frappe.delete_doc_if_exists(\"DocType\", \"Web View Component\") frappe.delete_doc_if_exists(\"DocType\",", "<filename>frappe/patches/v13_0/remove_web_view.py import frappe def execute(): frappe.delete_doc_if_exists(\"DocType\", \"Web View\") ...
[ "= float(home['fta']) - float(away['fta']) pt_dif = float(home['pts']) - float(away['pts']) if", "lambda x: x*slope + intercept fit_y = [f(min(X)), f(max(X))] plt.xlabel('Free", "10: continue except: continue X.append(ft_dif) y.append(pt_dif) c = 0 for", "Throw Attempts') plt.ylabel('Point Differential') plt....
[ "horizontal_flip=True, vertical_flip=True, fill_mode='nearest') imgen_train = imgen.flow(X_img_tr, ID_train, batch_size=32, seed=7) print('Generating", "= y_tr[i] ID_num_dic[ID_train[i]] = X_num_tr[i, :] print('Loading test data ...')", "label to categorical/one-hot ID_train, y_tr, y_val = to_categorical(ID_tra...
[ "w = map(int, input().split()) for _ in range(n): entrada =", "coding: utf-8 -*- n, w = map(int, input().split()) for _", "_ in range(n): entrada = input() last_space = entrada.rfind(' ')", "map(int, input().split()) for _ in range(n): entrada = input() last_space", "= input() last_space = entrada.rfind(' '...
[ "ensemble.RandomForestRegressor(n_estimators=2, random_state=1) estimator.fit([[1], [2]], [1, 2]) assembler = assemblers.RandomForestModelAssembler(estimator) actual", "ast.NumVal(2.5), ast.CompOpType.LTE), ast.VectorVal([ ast.NumVal(1.0), ast.NumVal(0.0)]), ast.VectorVal([ ast.NumVal(0.0), ast.NumVal(1.0)])), as...
[ "See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject \"\"\" import os from setuptools import setup,", "Extension import pynumenc_meta # pylint: disable=redefined-builtin here = os.path.abspath(os.path.dirname(__file__)) #", "f.read() # pylint: disable=invalid-name...
[ "the index fullscale: 3D array containig 2D array of each", "counter == 1: roismall = resize(roi, (20,20)) samples = np.concatenate((samples[None,:,:],", "numpy as np from skimage.transform import resize from skimage import", "self.identify_boundary_objects(license_plate) self.get_regions(character_objects, l...
[ "encode_auth_token(self, user_id): \"\"\" Generates the Auth Token :return: string \"\"\"", "app.config.get('SECRET_KEY')) is_blacklisted_token = BlacklistToken.check_blacklist(auth_token) if is_blacklisted_token: return 'Token blacklisted. Please", ") except Exception as e: return e @staticmethod def decode_au...
[ "install_requires=install_requires, entry_points={ 'console_scripts': [ 'letsencrypt = certbot.main:main', ], }, )", "Linux', 'Programming Language :: Python', 'Programming Language :: Python ::", "'Programming Language :: Python :: 2', 'Programming Language :: Python", "codecs import os import sys from setup...
[ "body += '\\nJIRA ticket: %s' % (url) to_addr = self.rule['email']", "'jira_component', 'jira_components', 'jira_description', 'jira_ignore_in_title', 'jira_issuetype', 'jira_label', 'jira_labels', 'jira_max_age', 'jira_priority', 'jira_project',", "don't have on our radar # 2. A custom field", "'&amp;') body...
[ "log_info.assert_has_calls(calls) assert 1 == audit_logger.call_count calls = [call('SCHCH', {'schedule': {'name':", "assert scheduler._check_processes_pending is True @pytest.mark.asyncio async def test__wait_for_task_completion(self, mocker): #", "is_enabled_modified=True) # THEN assert len(scheduler._storage...
[ "on the highest calorie to lowest calorie cupcake Args: calorie", "fit. Each cupcake has a calorie count, and Marc can", "his weight \"\"\" calories = 0 for i, c in", "c in enumerate(sorted(calorie, reverse=True)): calories += (2 ** i *", "= 0 for i, c in enumerate(sorted(calorie, reverse=True)): calories +...
[ "class_='tick-death')[0].find_all('small')[0].string } for state in state_wise_data ] context = {", "class_='tick-confirmed')[0].find_all('small')[0].string, \"active_case\": state.find_all('div', class_='tick-active')[0].find_all('small')[0].string, \"discharge\": state.find_all('div', class_='tick-discharged')[...
[ "= [] model_out = [] comp_out = [] for etype", "time_diff (might need to add this) time = datetime.strftime(time, \"%Y-%m-%dT%H:%M:%S\")", "in model .in file as a list truth_arr = filter_times(truth_dict,", "+ etype + \".out\" parsed_arrivals.append(arrival) model_in.append(infile) model_out.append(outfile) c...
[ "import get_backend, get_logger, get_s3Client, video backend_instance = get_backend() logger =", "chunking video\") logger.debug(\"extract_and_upload_video: Uploading video chunks\") with futures.ThreadPoolExecutor(8) as ex:", "lambda responses\") logger.debug(\"extract_and_upload_video: Finished inserting imag...
[ "predictions_3 = learner_3.predict(x_test) # --- SECTION 7 --- # Accuracies", "= breast_cancer.data, breast_cancer.target # Split the train and test samples", "mpl.style.use('seaborn-paper') # --- SECTION 2 --- # Get the wrongly", "y_3, 1, label='50NN') plt.scatter(x, y_avg, marker='x', c='k', s=150, label='A...
[ "by Django 4.0.3 on 2022-03-23 14:31 import datetime from django.db", "migrations, models class Migration(migrations.Migration): dependencies = [ ('API', '0004_alter_news_date_time_alter_news_headline'), ]", "23, 17, 31, 17, 27766)), ), migrations.AlterField( model_name='news', name='headline', field=models.Cha...
[ "# Scale to the range (-1,+1) samples = np.append(sample_train, sample_test,", "features to number of qubits pca = PCA(n_components=n).fit(sample_train) sample_train =", "pca = PCA(n_components=n).fit(sample_train) sample_train = pca.transform(sample_train) sample_test = pca.transform(sample_test) #", "Pick t...
[ "@pytest.mark.parametrize('view_name', ['get', 'get_web_message']) def test_get_creates_authorization_response_for_trusted_clients(self, controller, auth_client, authenticated_user, pyramid_request, view_name):", "test_it_creates_revocation_response(self, pyramid_request, controller, oauth_provider): controller.p...
[ "requirements. t.write(\"jamroot.jam\", \"\"\" project : requirements <link>static:<define>STATIC ; exe a", ";\") t.run_build_system([\"link=static\"]) t.expect_addition(\"bin/$toolset/debug/link-static/a.exe\") t.rm(\"bin\") # Test conditionals in project requirements.", "compiled with \"STATIC\" # define. t.w...
[ "-> None: py_class = PythonClass(value=10) assert py_class.value == 10 def", "py_class.value == 10 def test_example_class() -> None: example = ExampleClass(value=11)", "import PythonClass, ExampleClass def test_python_class() -> None: py_class = PythonClass(value=10)", "assert py_class.value == 10 def test_ex...
[ "response = self.make_request( url=login_url, headers=self._common_headers, method=\"POST\", json=login_data, ) if response.content.decode()", "\"web\", \"X-Juejin-Token\": self._login_token, \"X-Juejin-Uid\": self._login_uid, } ) response = self.make_request(url=like_blogs_url,", "= None entry_list = self._res...
[ "[0.5071, 0.4865, 0.4409] CIFAR_STD = [0.1942, 0.1918, 0.1958] DATA_FILE =", "range(0, 23): if i <= 7: channel_optional.append([4, 8, 12, 16])", "0.4409] CIFAR_STD = [0.1942, 0.1918, 0.1958] DATA_FILE = './data/data76994/cifar-100-python.tar.gz' model.prepare(", "callbacks.VisualDL('vis_logs/ofa_resnet20')] m...
[ "TagScriptConverter ): \"\"\"Edit a slash tag's TagScript.\"\"\" await self.slashtag_edit(ctx, tag,", "embed = e.copy() embed.description = page embed.set_footer(text=f\"{index}/{len(pages)} | {len(tags)} {slash_tags}\")", "commands from redbot.core.utils.chat_formatting import box, humanize_list, inline, pagif...
[ "[::-1]: l1 = i+l1 print(l1) if str1 == l1: print(\"string", "str1 == l1: print(\"string is a palindrome\") else : print(\"string", "string :\") l1 =\"\" for i in str1 [::-1]: l1", "for i in str1 [::-1]: l1 = i+l1 print(l1) if", "if str1 == l1: print(\"string is a palindrome\") else :", "== l1: print(\"st...
[ "in response.xpath(\"//div[@class='yy toa']//a/@href\"): tmp_url = self.base_url + xp_url.extract() yield Request(tmp_url.replace(\"EN\",", "response.meta.get('prd_data', {}) package = first(packages, {}) if package: d['brand'] =", "and catalog_price.get('Value'), 'currency': catalog_price and strip(catalog_pri...
[ "if veh is not None: self.observation[name * 4 + 0]", "in preStpe self.preStep() if self.timestep > 5000: raise Exception('cannot find", "self.rd) for veh_id in list(self.veh_dict.keys()): if veh_id not in veh_id_tuple:", "if self.lateral_action != 1 and 0 < TTC < 2:", "on: successfully lane change, dis2tar...
[ "= requests.get(link) cidrs = r.json() if r.status_code == 200: for", "link = 'https://endpoints.office.com/endpoints/China?clientrequestid='+str(uuid.uuid4()) downloader(version['instance'], version['latest'], os.environ['CHINA_PARAMETER'], link) elif version['instance'] ==", "200: versions = r.json() logger.i...
[ "from money import * c = Company(\"Example Inc\") c.add_flow(FixedCost(\"Initial Cash\",", "* c = Company(\"Example Inc\") c.add_flow(FixedCost(\"Initial Cash\", -500000)) c.add_flow(FixedCost(\"Incorporation\", 500))", "c.add_flow(DelayedCost(\"2012-02-01\", ConstantCost(\"Office\", 50000))) c.add_flow(Delayed...
[ "1', '-W 1', address), stdout=subprocess.PIPE, stderr=subprocess.PIPE) LOGGER.info('Ping server %s -", "port) except socket.error as e: LOGGER.error('Checking port %s:%d - Failed',", "raise ValidatorError(e) ping.short_name = 'PING' def port(address, port): s =", "stderr=subprocess.PIPE) LOGGER.info('Ping ser...
[ "openeo.udf import XarrayDataCube def apply_datacube(cube: XarrayDataCube, context: dict) -> XarrayDataCube:", "from openeo.udf import XarrayDataCube def apply_datacube(cube: XarrayDataCube, context: dict) ->", "import XarrayDataCube def apply_datacube(cube: XarrayDataCube, context: dict) -> XarrayDataCube: ret...
[ "\"\"\" State Implementation: has a resource and go back home", "= player self.player.setTarget(self.player.playerData.HouseLocation) def doAction(self): origin = self.player.playerData.Position target =", "resource home, look 4 resources again if(not self.player.hasResources()): self.player.state =", "self.p...
[ "not None) hoomd.run(1) # assert an error is raised if", "slit = mpcd.stream.slit(H=4.) slit.set_params(boundary=\"no_slip\") slit.set_params(boundary=\"slip\") with self.assertRaises(ValueError): slit.set_params(boundary=\"invalid\") # test", "relative to original position. np.testing.assert_array_almost_equal...
[ "models.QuestionGroupDTO( self.third_question_group_id, {'description': self.third_question_group_description, 'items': [{'question': str(self.used_twice_question_id)}]}) models.QuestionGroupDAO.save_all([ self.first_question_group_dto, self.second_question_group_dto,", "self.assertEqual( 'transformed_' + user_id...
[ "the waveform (Hz) frame_time (float, optional): Duration of a frame", "can be detected (Hz) (Default: ``85``). freq_high (int, optional): Highest", "on both sides so that the :math:`t`-th frame is centered", "factor of the second, elementwise. \"\"\" mask = (a[0] >", "# Centered windowed pad_length = (win_...
[ "def image_callback(self, image_msg, camera): self.images[camera].append(image_msg) def statustext_callback(self, statustext_msg): screen =", "= curses.COLOR_RED status_armed = 'Yes' else: color = curses.COLOR_GREEN status_armed", "color = curses.COLOR_GREEN status_armed = 'No' screen.addstr(row, x_tab, 'Armed:...
[ "it is the same here) # todo: adapt to your", "\"\"\"Initializes a new instance of the Result Parameter Args: path", "# load the CSVs. We usually want to compare different", "for metric, (min_, max_) in zip(metrics, metrics_yaxis_limits): boxplot(os.path.join(plot_dir, '{}_{}.png'.format(label, metric)),", ...