ngram
listlengths
0
67.8k
[ "parser = feedparser.parse(content) # Set the root parser = parser[\"entries\"] # Get the", "hashlib.sha256(bytes(description, \"utf-8\", errors=\"ignore\")).hexdigest() # Return the check of the query return not self.database.isNewsExists(root,", "to discord. @param => str: `root`: Name of the Website. @param ...
[ "such as changing avatar and low-level message handling. \"\"\" def __init__( self, player_configuration:", "None, server_configuration: ServerConfiguration, start_listening: bool = True, ) -> None: \"\"\" :param player_configuration:", "e: self.logger.critical(\"CancelledError intercepted. %s\", e) except Exce...
[ "'scheduling', 'september', 'special', 'student', 'programs', 'capacitated', 'balancing', 'assembly', 'aspect', 'model', 'inc', 'psychological', 'psychology',", "bin_ngrams(authors, n=15, max_bin_size=30): bins = defaultdict(set) for i, (id, a) in enumerate(authors.iteritems()): if", "(id, a) in enumerate(autho...
[ "signature unknown pass def currentFilePath(self, *args, **kwargs): # real signature unknown pass def", "# module PySide.QtCore # from C:\\Python27\\lib\\site-packages\\PySide\\QtCore.pyd # by generator 1.147 # no doc", "real signature unknown pass def currentFileName(self, *args, **kwargs): # real signature un...
[ "iss_tle): orb = iss_tle.orbit() if request.param == \"tle\": return orb elif request.param ==", "timedelta(minutes=1) return orb.ephem(start=start, stop=stop, step=step) @fixture def jplfiles(): config['env'] = { 'jpl': [", "of the library, but merely a convenience \"\"\" try: import matplotlib.pyplot as plt",...
[ "for arg in expr.args if arg.has(x) ]) else: return expr f = (x**7", "0.5*x*sqrt(0.25*x**2 + 1) + 1.0*asinh(0.5*x) # TODO: convert the rest of PMINT tests:", "assert heurisch(1/(x + sqrt(2)), x) == log(x + sqrt(2)) assert simplify(diff(heurisch(log(x + y", "C = 5*pi*I/12, Mathematica gives identical # result ...
[ "> pi)).any(): raise ValueError(f\"Hue-factor must be in the range [-PI, PI]. Got {hue_factor}\")", "super(AdjustHue, self).__init__() self.hue_factor: Union[float, torch.Tensor] = hue_factor def forward(self, input: torch.Tensor) -> torch.Tensor:", "saturation_factor (float): How much to adjust the saturation....
[ "{}\".format(config_id, REGISTRY) env = gym.make(config_id) for id_, agent in enumerate(agent_list): assert isinstance(agent, agents.BaseAgent)", "gym.make(config_id) for id_, agent in enumerate(agent_list): assert isinstance(agent, agents.BaseAgent) # NOTE: This is", "continue config = f() gym.envs.registratio...
[ "import path from .views import ProfileView urlpatterns = [ path('', ProfileView.as_view(), name='user-profile'), ]", "django.urls import path from .views import ProfileView urlpatterns = [ path('', ProfileView.as_view(), name='user-profile'),", "from django.urls import path from .views import ProfileView urlpa...
[ "BaseClassificationComponentTest class PassiveAggressiveComponentTest(BaseClassificationComponentTest): __test__ = True res = dict() res[\"default_iris\"] = 0.92 res[\"iris_n_calls\"]", "from autosklearn.pipeline.components.classification.passive_aggressive import \\ PassiveAggressive from .test_base import BaseC...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "# limitations under the License. \"\"\"Dart dataset tests.\"\"\" import json import mock import", "KIND, either express or implied. # See the Lice...
[ "# encoder - decoder outputs = self.model(batch_x, batch_x_mark, dec_inp, batch_y_mark) batch_y = batch_y[:,-self.args.pred_len:,:].to(self.device)", "= 'val') test_data, test_loader = self._get_data(flag = 'test') path = './checkpoints/'+setting if not", "print('\\tspeed: {:.4f}s/iter; left time: {:.4f}s'.form...
[ "the power sensor state.\"\"\" return load_nodes_state(\"mysensors/power_sensor_state.json\") @pytest.fixture def power_sensor(gateway_nodes: dict[int, Sensor], power_sensor_state: dict)", "\"\"\"Receive a message for the gateway.\"\"\" def receive_message_callback(message_string: str) -> None: \"\"\"Receive a", ...
[ "point in points: if point[0] != 'p' and point[0] != 'v' and point[0]", "import Edges import INTPoint eps = 1e-7 votes = {} Groups = []", "Centers = [] Cluster = [] voters = {} image = cv.imread(inputname) edges", "K = 3 ret = [] count = count / num * 0.1", "num * 0.1 if p1 > count: K -= 1 ret.append(ret1) ...
[ "== 200 data = response.get_json() assert 'annotations' in data assert 'tags' in data", "'02.png' def test_get_example_image(client): response = client.get(\"/api/files/image/x.jpg\") assert response.status_code == 404 response = client.get(\"/api/files/image/image.jpg\")", "response = client.get(\"/api/files/i...
[ "models.ManyToManyField(help_text='Who is in this group?', related_name='course_groups', to=settings.AUTH_USER_MODEL, db_index=True)), ], ), migrations.CreateModel( name='CourseUserGroupPartitionGroup', fields=[", "models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ('co...
[ "= { 'CustomerID': int(customer_id), 'AcquisitionSource': random.choices(ACQUISITION_SOURCES).pop() } writer.writerow(record) if __name__ == '__main__': main()", "'SocialMedia', 'Display', 'Affiliate' 'Referral' ] def main(): with open('customers.csv', 'w') as fout: writer", "fout: writer = csv.DictWriter(fout,...
[ "executors[label] break assert isinstance(executor, WorkQueueExecutor) if __name__ == '__main__': local_config = config parsl.load(local_config)", "2, 'memory': '1GiB'} fut = double(n, parsl_resource_specification=spec) try: fut.result() except Exception as e:", "executors = parsl.dfk().executors executor = Non...
[ "based on a pattern\"\"\" def __init__(self, match_string: str, include: bool): self.match_string = match_string", "When filename contains potentially spaces, were are only interested about absolute path #", "argument, not dividing it pieces yet for further analysis if a_name: self.command_args.append(a_name) c...
[ "'groups', 'login_method']: body['error'] = error.FORBIDDEN_MODIFICATION return body else: user[field] = value resource.db_update_item(user_id, user)", "'value?': 'str', }, 'output_format': { 'user_id?': 'str', }, 'description': 'Set my information' }", "'field': 'str', 'value?': 'str', }, 'output_format': { 'u...
[ "is so pervasive that it made it into the framework. \"\"\" from armi.reactor.tests", "= r.core.getBlocks(Flags.FUEL)[0] for ci, component in enumerate(bFuel, start=1): ndens = component.getNumberDensities() # convert", "import test_reactors from armi.reactor.flags import Flags from armi.utils.densityTools impo...
[ "\"+family_id + '\\n' db[wife_id]['string'] += \"1 FAMS \"+family_id + '\\n' generate_recursive_family(db, generations=8, max_children=4)", "font_size=22, pos=(15, 40), size=(100, 100), color=(160, 160, 160)): img = Image.new('RGB', size, color=color)", "int(random()*5), sex='M') else: print('reused {}'.format(...
[ "frame. # Position the start at the enemy's current location start_x = enemy.center_x", "title): super().__init__(width, height, title) # Set the working directory (where we expect to", "delta_x, delta_y): \"\"\"Called whenever the mouse moves. \"\"\" self.player.center_x = x self.player.center_y =", "bullet ...
[ "gather Infos and demonstrate the use of Variables. usrName = input(\"What is your", "will gather Infos and demonstrate the use of Variables. usrName = input(\"What is", "to improve your GPA by %f points to have a perfect score.\" %", "get a new line print (\"Hello, %s\" % (usrName)) print (\"Did you know", ...
[ "<reponame>AmitHasanShuvo/Programming a = input() a = a.replace('--', '2') a = a.replace('-.', '1') a", "= input() a = a.replace('--', '2') a = a.replace('-.', '1') a = a.replace('.',", "a = a.replace('--', '2') a = a.replace('-.', '1') a = a.replace('.', '0') print(a)", "a = input() a = a.replace('--', '2') ...
[ "class Message: def __init__(self, from_channel=None, **kwargs): self._channel = from_channel if kwargs is not", "from_channel=None, **kwargs): self._channel = from_channel if kwargs is not None: for key, value", "for key, value in kwargs.items(): setattr(self, key, value) @property def carrier(self): return se...
[ "stacks', extra={'stack': True}) self.assertEquals(len(self.client.events), 1) event = self.client.events.pop(0) self.assertTrue('stacktrace' in event) frames =", "event['exception'] self.assertEquals(exc['type'], 'ValueError') self.assertEquals(exc['value'], 'This is a test ValueError') self.assertTrue('param_me...
[ "@property def full(self): return '{0}/{1}'.format(self.major.name, self.name) @staticmethod def q_major_minor(dbsession, major, minor): cond =", "= name class Mime(Base): def __init__(self, name, template, major): super().__init__() self.name = name", "== major) if minor and minor != '*': cond.append(Mime.name...
[ "json_data = json.loads(json_data) from django.http import HttpResponse, JsonResponse # jsonResponse做的工作也就是加上了dumps和content_type # return HttpResponse(json.dumps(json_data),", "return HttpResponse(json.dumps(json_list),content_type=\"application/json\") from django.forms.models import model_to_dict for good in go...
[ "classpath] command += jvm_properties + system_properties command += [main_class] command += options.arguments if", "pathjoin(options.data_dir, 'etc')) if options.install_path != options.data_dir: create_symlink( pathjoin(options.install_path, 'plugin'), pathjoin(options.data_dir, 'plugin')) def build_java_execut...
[ "from direct.task import Task from direct.actor.Actor import Actor import numpy as np class", "__init__(self): ShowBase.__init__(self) # Load environment model self.scene = self.loader.loadModel(\"models/environment\") # Reparent model to", "self.pandaActor.reparentTo(self.render) # Loop animation self.pandaAct...
[]
[ "your data. - package: package details. \"\"\" if df is None: raise ValueError(\"Can", "variables: descriptions per series. - correlations: correlation matrices. - missing: missing value diagrams.", "not isinstance(df, pd.DataFrame): warnings.warn(\"df is not of type pandas.DataFrame\") disable_progress_bar = n...
[ "== \"__main__\": campers = ['PKUxk','THUsz_ai','THUsz_cs','THUsz_data','USTC_cs'] for camper in campers: filename = camper +", "= index index += 1 if camper not in stds[stdsDict[name]].offers: stds[stdsDict[name]].offers.append(camper) stds[stdsDict[name]].offerNum +=", "1 if camper not in stds[stdsDict[name]]...
[ "keywords=KEYWORDS, entry_points={ 'console_scripts': [ 'futurize = libfuturize.main:main', 'pasteurize = libpasteurize.main:main' ] }, package_dir={'':", "his/her Python 3 install, depending on the folder order in # sys.path. (Running", "try: # If the user happens to run: # python2 setup.py build #", "single...
[ "from flask import Flask from .extensions import db from .routes import short from", "import config def create_app(): \"\"\" Creates Flask App, connect to Database and register", "routes\"\"\" app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = config.DATABASE_CONNECTION_URI app.config['SQLALCHEMY_TRA...
[ "def html(url): user_agents = [ 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11)", ".NET CLR 2.0.50727)', 'Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.5 (like Gecko) (Kubuntu)', 'Mozilla/5.0 (X11;", "# title views answersnum asked_time tag_str active_time quest_content_ text answer_conten...
[ "angl = np.array([np.full(shape=(75, 75), fill_value=angel).astype(np.float32) for angel in angl]) X_band_1 = (X_band_1 -", "= np.array([np.array(band).astype(np.float32).reshape(75, 75) for band in df[\"band_1\"]]) X_band_2 = np.array([np.array(band).astype(np.float32).reshape(75, 75) for band", "train_test_sp...
[ "PolyaxonClient().experiment.resume( user, project_name, _experiment, config=config, update_code=update_code) Printer.print_success('Experiment was resumed with id {}'.format(response.id)) except", "help=\"The job id.\") @click.option('--past', '-p', is_flag=True, help=\"Show the past logs.\") @click.option('--fo...
[ "for which a + b + c = 1000. Find the product abc.", "range(1, 1000): for b in range(1, 1000): for c in range(1, 1000): if", "c in range(1, 1000): if a < b < c: if a +", "c == 1000: if a**2 + b**2 == c**2: solved = True break", "1000): for c in range(1, 1000): if a < b < c: if", "solved = False for a in r...
[ "import os from django.test import TestCase from unipath import Path from ....utils import", "django.test import TestCase from unipath import Path from ....utils import refresh from ...media", "os from django.test import TestCase from unipath import Path from ....utils import refresh", "= t.fragments.all() se...
[ "= entries[0].find(\"a\").next_sibling.text #We do next_sibling here because the source puts PFS links first,", "requests.get(link) res.raise_for_status() soup = BeautifulSoup(res.text, 'lxml') feat = soup.find_all(\"div\", {'class':'main'}) detailraw = soup.find(\"meta\",", "'Pathfinder 2.0 Ancestry feat list'...
[ "some kind of structure with numbers of question and space to answer. print", "# randomly selecting from strings within each question list for each_question in range", "don't understand. #printing some kind of structure with numbers of question and space", "def Randomise(questions_lists): import random import...
[ "TestScrapeFunctions(unittest.TestCase): def test_build_url(self): url = 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", "def test_fetch_page(self): fpl = scrape.fetch_page_listings...
[ "print(\"|q p| /}\") print(\"( 0 )\\\"\\\"\\\"\\\\\") print(\"|\\\"^\\\"` |\") print(\"||_/=\\\\\\\\__|\") if __name__ == \"__main__\":", "def main(): print(\"|\\_/|\") print(\"|q p| /}\") print(\"( 0 )\\\"\\\"\\\"\\\\\") print(\"|\\\"^\\\"` |\") print(\"||_/=\\\\\\\\__|\") if", "main(): print(\"|\\_/|\") print...
[ "tf-idf model and classifiers ClassificationUtils.save_classifier(\"ada_bag_cook.pickle\",adaboost) ClassificationUtils.save_classifier(\"rf_bag_cook.pickle\",randomforest) ClassificationUtils.save_classifier(\"extree_bag_cook.pickle\",extratrees) ClassificationUtils.save_classifier(\"bagging_bag_cook.pickle\",bagg...
[ "range(52)] # Create suits and ranks lists suits = [\"Spades\", \"Hearts\", \"Diamonds\", \"Clubs\"]", "\"8\", \"9\", \"10\", \"Jack\", \"Queen\", \"King\"] # Shuffle the cards random.shuffle(deck) # Display", "of cards deck = [x for x in range(52)] # Create suits and", "[\"Ace\", \"2\", \"3\", \"4\", \"5\", ...
[ "self.built = True def message_function(self, edge_source_states, edge_target_states, num_incoming_to_node_per_message, num_outing_to_node_per_message, edge_type_idx): \"\"\" :param edge_source_states:", "True def message_function(self, edge_source_states, edge_target_states, num_incoming_to_node_per_message, num...
[ "\"\"\" Deletes a model. If a model is already deployed, this only deletes", "Unless required by applicable law or agreed to in writing, software # distributed", "name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') >>> >>> response = client.get_model(name) Args: name (str):", "default_timeout=self....
[ "user_names)) def _compute_attachment_ids(self): for task in self: attachment_ids = self.env['ir.attachment'].search([('res_id', '=', task.id), ('res_model',", "= self.env.context.get('default_project_id', False) if project_id: name = self.env['project.project'].browse(project_id).label_tasks if name: tname = nam...
[ "import import_module class Config(object): \"\"\" Base class for all config variables \"\"\" DEBUG", "class Config(object): \"\"\" Base class for all config variables \"\"\" DEBUG = False", "Config File for enviroment variables \"\"\" import os from importlib import import_module class", "True KEY_ON_TEST = ...
[ "as MysqlSelectDao from postgres_dao.ddl_dao import DdlDao from postgres_dao.dml_dao import DmlDao as PsqlDmlDao psql_ddl_dao", "import SelectDao as MysqlSelectDao from postgres_dao.ddl_dao import DdlDao from postgres_dao.dml_dao import DmlDao as", "postgres_dao.ddl_dao import DdlDao from postgres_dao.dml_dao i...
[ "BlobGenerator class DocsTests(BaseTestCase): def setUp(self): super(DocsTests, self).setUp() def tearDown(self): super(DocsTests, self).tearDown() def test_docs_int_big_values(self):", "self.fail(\"Able to create documents with value: %s\" % str(number)) #docs.docs.DocsTests.test_load_memory,nodes_init=3,standar...
[ "URL!!!') excel_url = get_excel_url(url) excel_url = excel_url.replace(' ','%20') print('Download excel file!!!') save_at =", "str(td_tag.a['href']).replace('..', ROOT) def get_excel_url(url): r = requests.get(url) soup = BeautifulSoup(r.text,'lxml') list_span_tags = soup.find_all('span',class_='txt_l4')", "req...
[ "request. Returns: The list of items loaded from BigQuery. \"\"\" table_id = f'process_items_to_{operation.value}_{task.timestamp}'", "item_failures = [ failure.Failure(str(item_row.get('item_id', 'Missing ID')), error_reason) for item_row in item_rows ] api_result", "if not items: logging.error( 'Batch #%d, op...
[ "lifted = _loop_lift_modify_blocks(func_ir, loopinfo, blocks, typingctx, targetctx, flags, locals) loops.append(lifted) # Make main", "blocks[loopinfo.callfrom] scope = entry_block.scope loc = entry_block.loc # Lowering assumes the first block", "object and extra info. The extra contains the arguments if the co...
[ "mask = np.zeros((WIDTH // 2, HEIGHT // 2)) mask[100, 100] = 1 np.save(MASK1,", "[ [[243, 243], [243, 243]], [[243, 243], [243, 243]], [[243, 243], [243, 243]],", "@skipUnless(has_osl, \"Requires OpenSlide\") @skip_if_quick def test_read_patches_openslide(self, input_parameters, expected): dataset = MaskedInfer...
[ "[b''] def get_files(self): items = self.document_fromstring(self.content, self.img_selector) return [i.get('data-file').replace('&amp;', '&') for i in", "from .helpers.std import Std class DoujinsCom(Provider, Std): img_selector = '#image-container img.doujin' def get_archive_name(self)", "DoujinsCom(Provider,...
[ "import QItemDelegate, QWidget, QStyleOptionViewItem, QCheckBox class CheckBoxDelegate(QItemDelegate): def __init__(self, parent=None): super().__init__(parent) self.enabled =", "parent=None): super().__init__(parent) self.enabled = True def createEditor(self, parent: QWidget, option: QStyleOptionViewItem, index:...
[ "= tflearn.embedding(net, input_dim=10000, output_dim=128) net = tflearn.simple_rnn(net, neurons_num, dropout=keep_prob) net = tflearn.fully_connected(net, 2,", "to_categorical(Y, 2) #Build the network net = tflearn.input_data([None, 5]) net = tflearn.embedding(net, input_dim=10000,", "32 # Batch size n_epoch =...
[ "real data in logits, 0 where there's padding dim: int. dimension over which", "2 M = 3 BS = 10 def my_softmax(arr): max_elements = np.reshape(np.max(arr, axis", "but with 1e30 subtracted (i.e. very large negative number) in the padding locations.", "M = 3 BS = 10 def my_softmax(arr): max_elements = np.reshap...
[ "median_smooth(spec1, width) compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value, rtol=0.15) # Check the input and output units", "difficult as smoothing will make a difference for median filter, but less so", "(area under the kernel = 1). In this second case the rtol (relative", ...
[ "a mathematical function from a given set of points using either linear, polynomial", "method (string): name of the interpolation method to be used Returns: intfunc: interpolated", "name of the interpolation method to be used Returns: intfunc: interpolated function \"\"\"", "intfunc: interpolated function \"\...
[ "<filename>frappe/patches/v13_0/remove_web_view.py import frappe 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\",", "import frappe def execute(): frappe.delete_doc_if_exists(\"DocType\", ...
[ "= lambda x: x*slope + intercept fit_y = [f(min(X)), f(max(X))] plt.xlabel('Free Throw Attempts')", "X.append(ft_dif) y.append(pt_dif) c = 0 for f, p in zip(X, y): if f", "as f: df = json.load(f) X, y = [], [] for match, stats", "away['mp'] != '240': continue try: ft_dif = float(home['fta']) - float(away['fta...
[ "y_tr), (ID_val, X_num_val, X_img_val, y_val) def load_test_data(): ID, X_num_test = load_numeric_test() X_img_test =", "h1, h2, w1, w2 = 0, h, 0, w X[i][h1:h2, w1:w2][:] = x", "load_test_data(): ID, X_num_test = load_numeric_test() X_img_test = load_img_data(ID) return ID, X_num_test, X_img_test print('Loading...
[ "coding: utf-8 -*- n, w = map(int, input().split()) for _ in range(n): entrada", "n, w = map(int, input().split()) for _ in range(n): entrada = input() last_space", "_ in range(n): entrada = input() last_space = entrada.rfind(' ') if int(entrada[last_space:]) >", "-*- n, w = map(int, input().split()) for _ in...
[ "ast.CompExpr( ast.FeatureRef(0), ast.NumVal(1.5), ast.CompOpType.LTE), ast.NumVal(1.0), ast.NumVal(2.0)), ast.BinNumOpType.ADD), ast.NumVal(0.5), ast.BinNumOpType.MUL) assert utils.cmp_exprs(actual, expected) def", "from tests import utils def test_single_condition(): estimator = ensemble.RandomForestRegressor(n...
[ "import os from setuptools import setup, find_packages, Extension import pynumenc_meta # pylint: disable=redefined-builtin", "pylint: disable=invalid-name with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() # pylint:", "License', 'Programming Language :: Python :: 3.5...
[ "analysis and labelling were used Parameters: ----------- a_license_plate: 2D numpy binary image of", "else: roismall = resize(roi, (20,20)) samples = np.concatenate((samples[:,:,:], roismall[None,:,:]), axis=0) cord.append(regions.bbox) column_list.append(minimumCol) if", "where the license plate charcters are...
[ ":return: string \"\"\" try: payload = { 'exp': datetime.datetime.utcnow() + datetime.timedelta(days=0, seconds=5), 'iat':", "def check_blacklist(auth_token): # Check whether auth token has been blacklisted res = BlacklistToken.query.filter_by(token=str(auth_token)).first()", "unique=True, nullable=False) black...
[ "import setup from setuptools import find_packages def read_file(filename, encoding='utf8'): \"\"\"Read unicode from given", "= os.path.abspath(os.path.dirname(__file__)) readme = read_file(os.path.join(here, 'README.rst')) # This package is a simple shim", "Python :: 2', 'Programming Language :: Python :: 2.6'...
[ "jira_ part. Convert underscores to spaces normalized_jira_field = jira_field[5:].replace('_', ' ').lower() # All", "%s at %s:' % (self.rule['name'], match[qk], lookup_es_key(match, self.rule['timestamp_field'])) ) fullmessage['match'] = match[qk] else:", "a query_key, use that in the title if 'query_key' in se...
[ "in args assert 'OMF to PI north' in args assert 'North Readings to", "scheduler._schedule_executions[sch_id] # WHEN scheduler._schedule_first_task(sch, current_time) time_after_call = sch_execution.next_start_time # THEN assert time_after_call >", "log_info.assert_has_calls(calls, any_order=True) assert 1 == a...
[ "you solve based on the highest calorie to lowest calorie cupcake Args: calorie", "\"__main__\": assert marcs_cakewalk([5, 10, 7]) == 44 assert marcs_cakewalk([1, 3, 2]) == 11", "highest calorie to lowest calorie cupcake Args: calorie (list): List of integers denoting", "the highest calorie to lowest calorie ...
[ "context = { 'corona_info': info, 'data': sorted(corona_info, key=lambda i: int(''.join(i['confirm_case'].replace(',', ''))), reverse=True) }", "state.find_all('div', class_='tick-death')[0].find_all('small')[0].string } for state in state_wise_data ] context = { 'corona_info': info,", "info = { 'update_data': ...
[ "[] model_out = [] comp_out = [] for etype in ['EQS','EQP','SUS','SUP','THS','THP','SNS','SNP','PXS','PXP']: arrival =", "= open(comp_out, 'w') truth_arr = read_arrivals_to_arr(arrival) # read in the arrival times to", "= 'P' times = key_lookup(event, phase, model_dict) if len(times) == 0: phase =", "model_di...
[ "chunk_multiplier + frame_number def insert_images( img_raw_paths, img_types, img_metadatas, game_id, frame_numbers ): command =", "Pool from ultitrackerapi import get_backend, get_logger, get_s3Client, video backend_instance = get_backend() logger =", "os.remove(video_filename) os.remove(thumbnail_filename) sh...
[ "Predict the most probable class hard_predictions = voting.predict(x_test) # --- SECTION 6 ---", "# --- SECTION 1 --- # Import the required libraries import matplotlib as", "Import the required libraries import matplotlib as mpl import matplotlib.pyplot as plt mpl.style.use('seaborn-paper')", "2 --- # Get the...
[ "] operations = [ migrations.AlterField( model_name='news', name='date_time', field=models.DateTimeField(default=datetime.datetime(2022, 3, 23, 17, 31, 17,", "django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('API', '0004_alter_news_date_time_alter_news_headline'), ] ope...
[ "1)).fit(samples) sample_train = minmax_scale.transform(sample_train) sample_test = minmax_scale.transform(sample_test) # Pick training size number of", "from sklearn.preprocessing import StandardScaler, MinMaxScaler from sklearn.decomposition import PCA from qiskit.aqua import MissingOptionalLibraryError", "sa...
[ "controller.oauth.validate_authorization_request.assert_called_once_with( pyramid_request.url) @pytest.mark.parametrize('view_name', ['get', 'get_web_message']) def test_get_raises_for_invalid_request(self, controller, view_name): controller.oauth.validate_authorization_request.side_effect = InvalidRequestFatalErro...
[ "file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Test conditional properties. import BoostBuild", "Arrange a project which will build only if 'a.cpp' is compiled with \"STATIC\"", "if 'a.cpp' is compiled with \"STATIC\" # define. t.write(\"a.cpp\", \"\"\"\\ #ifdef STATIC int", "int m...
[ "<gh_stars>1-10 from setuptools_rust_starter import PythonClass, ExampleClass def test_python_class() -> None: py_class = PythonClass(value=10)", "= PythonClass(value=10) assert py_class.value == 10 def test_example_class() -> None: example = ExampleClass(value=11)", "PythonClass, ExampleClass def test_python_c...
[ "self._login_uid: Optional[str] = None self._login_client_id: Optional[str] = None self._response_data = None self._blogs_data: List", "login_params if \"uid\" in d][ 0 ].replace(\"uid=\", \"\") self._login_token = [d for d", "next_page_variable = personal_blog[\"verifyCreatedAt\"] if self._response_data[\"d\"]...
[ "36, 40, 44, 48, 52, 56, 60, 64]) # channel_optional.append([36, 40, 44, 48,", "52, 56, 60, 64]) # channel_optional.append([36, 40, 44, 48, 52, 56,60, 64]) else:", "ResNet20(100, channel_list) net2 = ResNet20(100, channel_list) net2.set_state_dict(paddle.load('./pretrained_model/resnet20.pdparams')) channel_opt...
[ "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,", "a Pastebin link. \"\"\" await self.create_slash_tag(ctx, tag_name, link, is_global=False) @commands.mod_or_permissions(manage_guild=True) @slashtag.group(\"edit\", aliases=[\"e\"], invoke_without_command=True)", "@classmethod ...
[ "str1 [::-1]: l1 = i+l1 print(l1) if str1 == l1: print(\"string is a", "== l1: print(\"string is a palindrome\") else : print(\"string is not a palindrome\")", "string :\") l1 =\"\" for i in str1 [::-1]: l1 = i+l1 print(l1)", "= i+l1 print(l1) if str1 == l1: print(\"string is a palindrome\") else :", "str1 ...
[ "div.xpath('.//a[@class=\"name\"]/@href').get() img_url = div.xpath('.//img/@src').get() d = { 'brand': brand.replace('-', '') or None, \"purity\":", "for package_obj in packages: catalog_price = package_obj.get(\"CatalogPrice\", {}) dd = { 'brand': d.get('brand'),", "rel_url), 'img_url': img_url and urljoin(re...
[ "todo check if rational def updateObservation(self): self.observation[0] = self.ego.lanePos self.observation[1] = self.ego.speed self.observation[2]", "if not self.is_success: if action_lateral == 1: # and abs(self.ego.pos_lat - (0.5+self.ego.targetLane)*self.rd.laneWidth) >", "self.ego = self.veh_dict[self.ego...
[ "True ) def handler(event, context): r = requests.get('https://endpoints.office.com/version?clientrequestid='+str(uuid.uuid4())) logger.info('Link Status Code: '+str(r.status_code)) if", "== 200: for cidr in cidrs: try: if len(cidr['ips']) != 0: for ip", "r.json() logger.info(versions) for version in versions: ...
[ "= Company(\"Example Inc\") c.add_flow(FixedCost(\"Initial Cash\", -500000)) c.add_flow(FixedCost(\"Incorporation\", 500)) c.add_flow(ConstantCost(\"Office\", 50000)) c.add_flow(PeriodicCost(\"Subscription\", 4000, \"2012-01-05\",", "ConstantCost(\"Office\", 50000))) c.add_flow(DelayedCost(\"2012-02-01\", FixedCo...
[ "ValidatorError(Exception): pass def ping(address): try: subprocess.check_call(('ping', '-c 1', '-W 1', address), stdout=subprocess.PIPE, stderr=subprocess.PIPE)", "= logging.getLogger(__name__) class ValidatorError(Exception): pass def ping(address): try: subprocess.check_call(('ping', '-c 1', '-W 1',", "addre...
[ "<reponame>Open-EO/openeo-geopyspark-driver from openeo.udf import XarrayDataCube def apply_datacube(cube: XarrayDataCube, context: dict) -> XarrayDataCube: return", "from openeo.udf import XarrayDataCube def apply_datacube(cube: XarrayDataCube, context: dict) -> XarrayDataCube: return cube" ]
[ "gave the resource home, look 4 resources again if(not self.player.hasResources()): self.player.state = StateLook4Resources(self.player)", "look 4 resources again if(not self.player.hasResources()): self.player.state = StateLook4Resources(self.player) return create_purchase_action(0) return create_move_action(mov...
[ "same velocity along +x for 3 steps. It will bounce back in y", "self.assertAlmostEqual(slit.H, 2.) self.assertAlmostEqual(slit.V, 0.) self.assertEqual(slit.boundary, \"no_slip\") self.assertAlmostEqual(slit._cpp.geometry.getH(), 2.) self.assertAlmostEqual(slit._cpp.geometry.getVelocity(), 0.) self.assertEqual(sl...
[ "models.QuestionGroupDTO( self.second_question_group_id, {'description': self.second_question_group_description, 'items': [{'question': str(self.used_twice_question_id)}]}) self.third_question_group_description = 'third_question_group' self.third_question_group_id = 6", "'user_id' student = models.Student(key_nam...
[ "signal to. Must be more than twice lowpass-cutoff. (default: 4000) delta_pitch( float, optional):", "of the phases inverse = torch.istft(specgram * angles, n_fft=n_fft, hop_length=hop_length, win_length=win_length, window=window, length=length).float()", "int = 100, center: bool = False, norm_vars: bool = Fals...
[ "mode = 'None' elif mode == 'Posctl': mode = 'Position' elif mode ==", "latitude = self.gps.latitude longitude = self.gps.longitude altitude = round(self.gps.altitude, 2) status_gps = f'{latitude:.7f}", "(XYZ) {roll} {pitch} {yaw} (RPY)') row += 1 # Setpoint v = self.setpoint.velocity", "ExtendedState, Positi...
[ "instance (nrows=ncols=index) bp = ax.boxplot(data, widths=0.6) set_box_format(bp, '000') # set and format litle,", "remove frame ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) # thicken frame ax.spines['left'].set_linewidth(2) ax.spines['bottom'].set_linewidth(2) # adjust min and", "...