ngram
listlengths
0
67.8k
[ ". import testcase from . import testing class RecoverTestCase(testcase.RabbitTestCase, unittest.TestCase): @testing.coroutine def test_basic_recover_async(self):", "methods \"\"\" import unittest from . import testcase from . import testing class", "basic tests for recover methods \"\"\" import unittest from ....
[ "Label_Session(self,client,session_id,label): self.Validate_Session_Id(session_id) self.sessions[session_id][\"label\"]=label def Update_Status(self,client,session_id,key,value): self.Validate_Session_Id(session_id) self.sessions[session_id][\"user_status\"][key]=value self.sessions[session_id][\"last_update\"]=tim...
[ "69, 72, 76, 73], [1, 1, 4, 2, 1, 1, 0, 0])] for", "List class Solution: def dailyTemperatures(self, T: List[int]) -> List[int]: if not T: return", "<reponame>HearyShen/leetcode-cn import time from typing import List class Solution: def dailyTemperatures(self, T: List[int])", "time from typing import List cla...
[ "in obj.garbagetype_set.all()] class Meta: model = Location fields = ( 'id', 'address', 'open_time',", "TransactionSerializer(serializers.ModelSerializer): id = serializers.ReadOnlyField() datetime = serializers.SerializerMethodField() user_id = serializers.SerializerMethodField() collector_id = serializers.Seria...
[ "# def __init__(self, val=0, next=None): # self.val = val # self.next = next", "= cur.next cur.next = head m = n - k % n i", "k): \"\"\" :type head: ListNode :type k: int :rtype: ListNode \"\"\" if not", "1 cur = head while cur.next: n+=1 cur = cur.next cur.next = head", "head: return None n = 1 cur = head ...
[ "and Contributors # See license.txt # import frappe import unittest class TestStore(unittest.TestCase): pass", "(c) 2021, mds and Contributors # See license.txt # import frappe import unittest", "2021, mds and Contributors # See license.txt # import frappe import unittest class", "mds and Contributors # See l...
[ "validate_config(config) # initialize the DatabaseClient database = oci.database.DatabaseClient(config) db_system_ids = [\"dfsdfgsfdsdf\",\"fsdxfgsd\"] if not", "<filename>steps/oci-database-step-instances-terminate/step.py #!/usr/bin/env python import oci config = oci.config.from_file() from oci.config import va...
[ "* 50) print \"dir info: {}\".format(dir(obj)) for attr in dir(obj): try: if attr.startswith(\"__\")", "else: print \"--- attribute {}: {}\".format(attr, attr_value) except Exception, e: print \"*** read", "ms] {}\".format( _id[0], time.strftime(\"%Y-%m-%d %H:%M:%S\"), (end_time - start_time) * 1000, {\"func_na...
[ "use, modify and redistribute this software as you please, as long as you", "[] # Verify size if len(button_text_row) != len(callback_row): raise ValueError(\"Buttons and callbacks size", "e: self.logger.log(\"RuntimeError when sending message\") self.logger.log(e) except Exception as e: self.logger.log(\"Unhan...
[ "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "writing, software # distributed under the License is distributed on an \"AS IS\"", "@swagger.operation(nickname='post') def post(self): \"\"\" @description: 生成图片校验码 @rtype: L{ImageResp} @raise 400: Invalid Input @raise", "fro...
[]
[ "ind, movie in enumerate(ds['movieId'].unique())} processed = pd.DataFrame({'user': ds['userId'].apply(lambda x: u2i[x]), 'item': ds['movieId'].apply(lambda x:", "handle: pickle.dump(u2i, handle) with open(path.join(output_dir, 'x2i.pickle'), 'wb') as handle: pickle.dump(x2i, handle) if __name__", "path from sc...
[ "as f: f.write(\"Recommender class: {}\\n\".format(recommender_name)) f.write(\"Recommender fit parameters: {}\\n\".format(recommender_fit_parameters)) f.write(\"Number of folds: {}\\n\".format(num_folds))", "[6910, 1996, 2019, 153, 12, 5, 1010, 9999, 666, 467] def write_results_on_file(file_path, recommender_nam...
[ "self.timeNight.time().hour() self.settings['nightmin'] = self.timeNight.time().minute() else: self.settings['isCustomTimes'] = 0 functions.write_settings(self.settingsPath, self.settings) if self.isClosedFromTray: event.accept()", "self.mainTimer = QtCore.QTimer() self.mainTimer.timeout.connect(self.set_desktop)...
[ "return self._ip @ip.setter def ip(self, ip: str) -> None: self._ip = ip @property", "bytes) -> None: self._token = token @property def request_token(self) -> bytes: return self._request_token", "str: return self._ip @ip.setter def ip(self, ip: str) -> None: self._ip = ip", "@token.setter def token(self, toke...
[ "t.astype(np.float32) T = M.dot(T) # revert height # x[:,1]=height-x[:,1] H = np.diagflat([1., 1.,", "np.diagflat([1., 1., 1., 1.]) H[1, 1] = -1.0 H[1, 3] = height T", "Rx.dot(Ry).dot(Rz) R = R.astype(np.float32) T = np.zeros((4, 4)) T[0:3, 0:3] = R T[3,", "cos(x)]]) Ry = np.array([[cos(y), 0, -sin(y)], [0, 1...
[ "= response['page_num'] if 'page_size' in response: self.page_size = response['page_size'] if 'total_number' in response:", "utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.PaymentSuccessPagePlanInfo import PaymentSuccessPagePlanInfo class", "to...
[ "else: return self.__tabix_file.fetch( self.__contig_mapping.get( chrom_interval.chrom, chrom_interval.chrom), chrom_interval.interval.start, chrom_interval.interval.end) except ValueError: raise StopIteration def", "is None: return self.__tabix_file.fetch() else: return self.__tabix_file.fetch( self.__contig_map...
[ "import Category from simplestore.products.models.product import Product class CategoryAdmin(admin.ModelAdmin): prepopulated_fields = {\"slug\": ('name',)} class", "admin from simplestore.products.models.category import Category from simplestore.products.models.product import Product class CategoryAdmin(admin.Mod...
[ "Exception as exception: logging.debug('\"%s\" threw exception.', plugin.key, exc_info=exception) self._runtime_stats['errors'][plugin.key].append(exception) state['errors'].append((plugin.key, exception)) def _process_motors(self,", "self._termination is None: try: loop_start = datetime.now() state = self._build...
[ "13, 15, 22, 29] def __call__(self, xs): assert xs.dim() == 4 xs =", "from torchvision import models from torchvision.transforms import transforms import util class VGGFeatureExtractor(nn.Module): def", "xs = self.normalize(xs) feats = [xs] for i, layer in enumerate(self._vgg): xs =", "6, 8, 11, 13, 15, 22, 2...
[ "'log.txt') LOG_LEVEL = 'INFO' current_app = None @staticmethod def init_app(app): Log.current_app = app", "= app if not os.path.exists(Log.LOG_PATH): os.makedirs(Log.LOG_PATH) # 根据时间重命名log file_handler = logging.handlers.TimedRotatingFileHandler(Log.LOG_NAME, when='D', interval=1,", "Log.current_app = app if n...
[ "of requests within a certain timeframe requests = list(Session.execute(query.format(table=self.table, t1=current_time, t2=current_time + timestep)))", "{t2}; \"\"\" class DemandGenerator(object): def __init__(self, use_pattern=False): if use_pattern: self.table = \"request_pattern\" else:", "with each request ...
[ "trees = [] with open('data/' + inFile, 'rb') as fin: sentenceTokens = []", "10: if len(sentenceTokens) > 0: trees.append(tree) sents.append(sentenceTokens) tree = DependencyTree() sentenceTokens = []", "line[7] token = {} token['word'] = word token['POS'] = pos token['head'] = head", "DependencyTree def load...
[ "<filename>vimeo/auth/__init__.py #! /usr/bin/env python # encoding: utf-8 from __future__ import absolute_import class GrantFailed(Exception):", "#! /usr/bin/env python # encoding: utf-8 from __future__ import absolute_import class GrantFailed(Exception): pass" ]
[ "distributed in the hope that it will be useful, # but WITHOUT ANY", "either version 3 of the License, or # (at your option) any later", "print('var eh = {{{}}};'.format(','.join('\"{} {}\":{{bot:{},top:{},l:{}}}'.format(k[0], k[1], v[0], v[1], v[2]) for k, v in", "by # the Free Software Foundation, either ve...
[ "= stockInput + \" price update!\" if oldprice < targetprice: if newprice >=", "= price.replace(\",\", \"\") print(\"The price is: \" + price) newprice = float(price.replace(\",\", \"\"))", "from flask import Flask, render_template, request, url_for from threading import Thread app =", "message) time.sleep(30...
[ "subscribed_response_msg, ticket_challenge_msg, unsubscribed_response_msg, welcome_msg) NO_MORE_EVENTS = object() NO_IDENTITY = object() logger = logging.getLogger(__name__)", "self.realm = realm self.identity = NO_IDENTITY self._custom_state = {} self._said_goodbye = False self._subscriptions", "sub_id = self....
[ "freq='15T'), inplace=True) pv.drop(columns='Period Beginning (UTC -08:00)', inplace=True) pv.columns = ['gen'] #%% Save to", "pvdata = pd.read_csv('solar_PV_15min_kWh.csv') pv = pvdata[:8760*4] pv.set_index(pd.date_range(start='2021-01-01 00:00', periods=35040, freq='15T'), inplace=True) pv.drop(columns='Period ...
[ "confusion_matrix import numpy as np from keras.models import Sequential import tensorflow as tf", "Model from keras.layers.normalization import BatchNormalization import numpy as np from keras.models import load_model", "my_model = load_model('VO_2_classification_model.h5') test_datagen = ImageDataGenerator(re...
[ "patched_git: patched_git.Repo().head.object.hexsha = \"a1\" * 20 patched_git.Repo().head.object.author.email = \"<EMAIL>\" submission = SubmissionBuilder(\"t\", \"b\",", "== [\"anything\"], submission def test_version_details(converted_tests): \"\"\"Should contain version details from git head commit\"\"\"", "...
[ "COPYRIGHT file) \"\"\" def od(value): def spaced(value): even = None for v in", "3-clause BSD. (See the COPYRIGHT file) \"\"\" def od(value): def spaced(value): even =", "v in value: if even is False: yield ' ' yield '%02X' %", "2009-09-06. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: ...
[ "\\ .group_by(Membership.created_by) \\ .filter(Membership.account == account) \\ .filter(Membership.settled_by == None) \\ .filter(Membership.id <=", "= db.update(Membership) \\ .where(Membership.account == account) \\ .where(Membership.settled_by == None) \\ .where(Membership.id <=", "@app.route('/') def inde...
[ "engine, char_state): char_state.ap += 260 def timeout(self, rotation, engine, char_state): char_state.ap -= 260", "Buff, LastingBuff class DragonKiller(LastingBuff): def __init__(self): super().__init__('dragon_killer', 2 * 60, 20) def equip(self,engine,", "2 * 60, 20) def equip(self,engine, char_state): char_...
[ "put delete or patch' if not isinstance(parameters,dict): return False,'Parameters must be dict' headers", "appname=settings.WORKFLOW_APP, username='admin', workflowurl=settings.WORKFLOW_URL): self.token = token self.appname = appname self.username = username self.workflowurl", "getattr(requests,method)('{0}{1}...
[ "from .io import write_graph_to_filepath from .api import merge_filter_graphs_from_filepaths @click.group('strainotype') def strainotype_cli(): pass @strainotype_cli.command('merge')", "@click.group('strainotype') def strainotype_cli(): pass @strainotype_cli.command('merge') @click.option('-m', '--min-weight', de...
[ ".conanbuilder.configreader import ConfigReader from .conanbuilder.package import Package from .conanbuilder.runner import Runner from .conanbuilder.signature", "cli_ui as ui import deserialize from conans.client.conan_api import Conan from .conanbuilder.configreader import ConfigReader", "import deserialize fr...
[ "# Generated by Django 2.0.3 on 2018-04-05 07:55 from django.db import migrations, models", "dependencies = [ ('kyokigo', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='kyokigo_input', name='ownurl', ),", "operations = [ migrations.RemoveField( model_name='kyokigo_input', name='ownurl', )...
[ "from db.sql.migration_of_db.tweet_migration_big.psql_tweet_mig_queries import psql_connector_twitter_mig from db.sql.migration_of_db.tweet_migration_big.big_queries_sql import big_connector_twitter_mig import data_collection.altdata_service.twitter.object_function.tweet_cleaner as cleaner def", "migration') twee...
[ "secret_time = cover_time return cover_time, secret_time def recv(self, size, timeout=0): \"\"\"Reads the RstegTCP", "None self.rtcp.psh_event.wait(timeout) if len(self.rtcp.ingress_buffer) != 0: # check if empty if len(self.rtcp.ingress_buffer) <=", "receive ACK while not res: #print(rto) # Wait for ack event ...
[ "nano import solvers geop = nano.Params( R = 35., H = 70., )", "from pore \" import nanopores as nano import solvers geop = nano.Params( R", "= 35., H = 70., ) physp = nano.Params( bulkcon = 1000., bV", "1000., bV = -1., ) geo, pnp = solvers.solve1D(geop, physp) solvers.visualize1D(geo, pnp) nano.showplots()"...
[ "Library\" content = Content(\"text/plain\", \"some text here\") mail = Mail(from_email, subject, to_email, content)", "with the v3 SendGrid API. Usage example: def build_hello_email(): to_email = from_email =", "body builder Builder for assembling emails to be sent with the v3 SendGrid", "mail.personalizatio...
[ "be used to access variables and classes in the # module (loader.myClass()) #", "If a operation is not defined in the default device, let it execute", "loader that can be used to access variables and classes in the #", "as sys_config import logging import tensorflow as tf from collections import Counter from"...
[ "\"\"\" Run the migrations. \"\"\" with self.schema.create(\"thirdstorages\") as table: table.increments(\"id\") table.string(\"thirdstorage_name\") table.string(\"thirdstorage_brand\") table.string(\"thirdstorage_type\")", "class ThirdStorage(Migration): def up(self): \"\"\" Run the migrations. \"\"\" with self....
[]
[ "FacebookDataSetEntry: def __init__(self, followers_number, likes_number, comments_number, share_number, grammar_index, subject_relevance, label): self.followers_number = followers_number", "comments_number, share_number, grammar_index, subject_relevance, label): self.followers_number = followers_number self.like...
[ "rf.npvForEpoch(fyear); print \"mean: \", stats.nanmean(npv-npvRF) print \"median: \", stats.nanmedian(npv-npvRF) print \"Aligning epoch \",fyear", "print 'pout:',stats['pout']; print 'nout:',stats['nout']; print 'npts:',stats['npts']; print print ' RMS:',stats['RMS']/1e-3, '[mm]' print 'wRMS:',stats['wRMS']/1e-3...
[ "schema_editor): Modulo = apps.get_model('modulos', 'Modulo') for modulo in Modulo.objects.all(): modulo.slug = slugify(modulo.titulo) modulo.save()", "Generated by Django 3.1.3 on 2020-11-25 11:09 from django.db import migrations from django.utils.text", "= slugify(modulo.titulo) modulo.save() class Migration(...
[ "import path from .views import index, search, todo_list_view urlpatterns = [ path('', index,", "path from .views import index, search, todo_list_view urlpatterns = [ path('', index, name='index'),", "from .views import index, search, todo_list_view urlpatterns = [ path('', index, name='index'), path('list',", ...
[ "input_type=decoders.InputType(args.input_type), inspect_content=False, ) # Parse the input vt_client = None file_paths = []", "io import sys import tau_clients import vt from tau_clients import decoders from tau_clients", "e: raise ValueError(str(e)) from e def main(): \"\"\"Submit all samples or hashes by", ...
[ "[] allPositions = rf.getAllOptions(allPositions) frequentTickers = rf.getFrequentTickers(allPositions) rf.r.options.write_spinner() rf.r.options.spinning_cursor() optionNames, entryPrices, calls, puts", "rf email, password = rf.getCredentials() rf.loginToRH(email, password) allPositions = [] allPositions = rf.ge...
[ "class ModelC(ModelA): b = models.ForeignKey(ModelB, related_name=\"c\", on_delete=models.CASCADE) @grainy_model( namespace=\"dynamic.{value}\", namespace_instance=\"{namespace}.{other_value}\" ) class ModelD(ModelA):", "related_name=\"z\", on_delete=models.CASCADE) class APIKey(models.Model): key = models.CharFi...
[ "DispatcherHandlerStop, Dispatcher from telegram import Update, User, Message, ParseMode from telegram.error import BadRequest", "_ _ __ _ __ _ _ __ __ _ | | _", "CommandHandler, MessageHandler, Filters, Handler from telegram.ext.dispatcher import run_async, DispatcherHandlerStop, Dispatcher from telegram impor...
[ "flip(self, node): if not node: return None hold_node = node.left node.left = node.right", "self.right = right class Solution(object): def flip(self, node): if not node: return None", "class Solution(object): def flip(self, node): if not node: return None hold_node = node.left", "tree node. # class TreeNode(o...
[ "* from statistics.variance import variance, standard_deviation from statistics.correlation import covariance, correlation def main():", "outlier\") plt.xlabel(\"# of friends\") plt.ylabel(\"minutes\") def correlations(num_frieds: List[float], daily_minutes: List[float]): cov = covariance(num_frieds,", "9, 20, ...
[ "= ValueSchemaDescription(text=_load_from_file(Path(value))) if key is not None: self._keys[topic] = KeySchemaDescription(text=_load_from_file(Path(key))) class AvroModelRepo(AbstractDescriptionStore): def", "None: self._keys[topic] = KeySchemaDescription(text=_load_from_file(Path(key))) class AvroModelRepo(Abstr...
[ "<filename>bin/tests/test_design.py \"\"\"Tests for design.py \"\"\" import random import os import copy import tempfile", "as f: for i, line in enumerate(f): if i == 0: headers =", "== 0: headers = line.split('\\t') # Will raise an error if header is", "guide counts as a match if specific == 'fasta': argv.ex...
[ "list, k): cars.sort() to_cover = cars[:k] mx = max(to_cover) mi = min(to_cover) return", "to_cover = cars[:k] mx = max(to_cover) mi = min(to_cover) return mx - (mi", "= int(input().strip()) cars.append(cars_item) k = int(input().strip()) print(\"running code...\") result = carParkingRoof(cars, k) fptr.write(st...
[ "default = 'fix', type = str, help = 'Output pdf file path suffix", "when using saddle stitch option.' ) front_page.add_argument('-fs', '--front-second', action = 'store_true', default =", "page is located on first page when using saddle stitch option.' ) front_page.add_argument('-fs',", "help = 'Split pdf pa...
[ "= { \"name\": \"DexParser\", \"desc\": \"Parsing Dex file into bytecode\" } def __init__(self,", "<reponame>BiteFoo/androyara<filename>androyara/core/dex_parser.py # coding:utf8 ''' @File : dex_parser.py @Author : Loopher @Version : 1.0", "coding:utf8 ''' @File : dex_parser.py @Author : Loopher @Version : 1.0 ...
[ "The package provides a number of modules to be used in the clustering,", "be used in the clustering, extraction, and evaluation of white matter tractography. \"\"\"", "provides a number of modules to be used in the clustering, extraction, and", "number of modules to be used in the clustering, extraction, and...
[ "Address 1 Compressed: ' + caddr) f.write('\\nPublic Address 1 Uncompressed: ' + uaddr)", "', wif, '\\nPrivatekey compressed: ', wifc, '\\nPublic Address 1 Uncompressed: ', uaddr, '\\nPublic", "True: count+=1 total+=5 ran=random.randrange(a,b) HEX = \"%064x\" % ran wallet = Wallet(HEX) uaddr", "\"%064x\" % ra...
[ "debug) if debug: print(\"\\n------ Filtered Training Data ------\") print(\"filterdTraindata length should be 5", "simplicity of the decision surface. # A low C makes the decision surface", "baselineTest = json.load(f) with open(traindataFolder + 'test-volts.json') as f: voltsTest = json.load(f) #", "+ str(l...
[ "output=input(game.move_description) while output not in [str(game.map_move_to_input[i]) for i in game.get_move_effective()]: #intput verification output=input(game.move_description)", "while output not in [str(game.map_move_to_input[i]) for i in game.get_move_effective()]: #intput verification output=input(game....
[ "lookup of given query in CMS data-services. cmssh find command lookup given query", "fname = arg.replace('file=', '') if arg and os.path.isfile(fname): mtype = mimetypes.guess_type(arg) if mtype[0]:", "name.find('.') == -1: archs.append(name) if archs: print '\\nInstalled architectures:' for item in archs:", ...
[ "more, read - https://arxiv.org/pdf/1812.02091.pdf \"\"\" def __init__(self, histograms, use_gpu=True, cost_matrix=None): self.use_gpu = use_gpu", "the distance must be calculated self.histograms = histograms # this is the cost", "ACT_EMD: \"\"\" EMD stands for Earth Mover's Distance - Mallows distance or 1st",...
[ "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "writing, software # distributed under the License is distributed on an \"AS IS\"", "Unless required by applicable law or agreed to in writing, software # distributed", "collections.namedtuple('RouteRule', 'dest_cidr, next_hop...
[ "len(expected) line = bytearray() modi_timeout = self.Timeout(self._timeout) while True: c = self.read(1) if", "== 0x2FDE and port.pid == 0x0003) modi_ports = [port for port in stl.comports()", "ser = serial.Serial(port = self._port, baudrate=self._baudrate, timeout=self._timeout, write_timeout=self._write_time...
[ "List of molar fractions \"\"\" calc_settings = self.plotting_preferences[\"Pressure density\"][\"Calc\"] tpv_settings = self.plotting_preferences[\"Pressure density\"][\"TPV\"]", "= plot_settings[\"Title\"] self.axes.plot(x, y, color=line_color, label=\"Phase envelope\") self.axes.scatter([crit_x], [crit_y], col...
[ "pen.hideturtle() pen.goto(0, 260) pen.write(\"Christmas Tree\", align=\"center\",font=(\"Arial\", 24, \"normal\")) # Starting position t.up() t.rt(90)", "\"normal\")) # Starting position t.up() t.rt(90) t.fd(100) t.lt(90) t.down() # Stump t.color(\"brown\") t.begin_fill()", "t.lt(90) t.down() # Stump t.color(\...
[ "use this file except in # compliance with the Apache License and the", "it: # Section 6. Trademarks. is deleted and replaced with: # # 6.", "is deleted and replaced with: # # 6. Trademarks. This License does not", "is # distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF", "language gove...
[ "at # | http://www.boost.org/LICENSE_1_0.txt. # | # ---------------------------------------------------------------------- \"\"\"Contains the MatchValueExpression object\"\"\" import", "Interface from CommonEnvironmentEx.Package import InitRelativeImports # --------------------------------------------------------...
[ "= ','.join(list(self.actions)) raise UndefinedActionException(\"Undefined action {}. Possible values: {}\".format(action_name, possible)) events.append(event) def get_action(self,", "retornada nesta funcao. def add_action(self, action_name): action_name = action_name.lower() if self.actions.get(action_name) is n...
[ "TEMPLATE = \"event/enum.html\" LABEL = \"Christmas\" DAY = \"day\" EVE = \"eve\" TIME", "elif e == home.event.holiday.christmas.Event.Time: return self.TIME elif e == home.event.holiday.christmas.Event.Over: return self.OVER return", "home.event.holiday.christmas.Event.Day: return \"fas fa-gifts\" elif e == ho...
[ "1 if line[0] > line[-1] and line[-2] > line[-1]: local_extremas += 1 if", "line[-1] and line[0] < line[1]: local_extremas += 1 if line[0] > line[-1] and", "int(input()) if n == 0: break line = list(map(int, stdin.readline().strip().split())) local_extremas = 0", "if line[0] < line[-1] and line[0] < line[1]: ...
[ "time import time import os import shutil import numpy as np import torch", "masked_radar_img.save(os.path.join(out_folder, 'masked_radar_vis/masked_radar_vis_{}.png'.format(batchi+1))) detector_scores_img = draw_detector_scores(out, i=1) detector_scores_img.save(os.path.join(out_folder, 'detector_scores/detector...
[ "this measures not the tangential vector, but rotational vector. \"\"\" # Type check", "# The vector is tangent to a circle made by r, thus the", "angle. B_x = B_t * np.cos(B_angle) B_y = B_t * np.sin(B_angle) # Return", "is not phi. B_angle = phi_subaxis + np.pi/2 # Calculate the components of", "rotationa...
[ "django.contrib import admin from .models import * # Register your models here. admin.site.register(Vehicle)", "admin from .models import * # Register your models here. admin.site.register(Vehicle) admin.site.register(VehicleLogging) admin.site.register(RegisteredUserLogging)", "import admin from .models import...
[ "] operations = [ migrations.AddField( model_name='battery', name='status', field=model_utils.fields.StatusField(choices=[(0, 'dummy')], default='template', max_length=100, no_check_for_status=True), ),", "model_name='assignment', name='status', field=model_utils.fields.StatusField(choices=[(0, 'dummy')], default...
[ "python from distutils.core import setup setup(name='aifin', version='1.0.1', description='Python Distribution Utilities', author='<NAME>', author_email='<EMAIL>', url='aitroopers.com',", "from distutils.core import setup setup(name='aifin', version='1.0.1', description='Python Distribution Utilities', author='<N...
[ "if in_list[s_idx] <= base_val: final_idx = s_idx else: final_idx = s_idx - 1", "NoReturn def quick_sort(in_list: List[int], s_idx: int, e_idx: int) -> NoReturn: if e_idx >", "= e_idx base_idx = int((s_idx + e_idx)/2) base_val = in_list[base_idx] in_list[first_idx], in_list[base_idx] =", "s_idx += 1 while e_i...
[ "+ p.query else: request_uri = p.path environ['REQUEST_URI'] = request_uri return self.fallback(environ, start_response) elif", "query_string): cached_files = get_cached_files(path_and_query, server) for i in cached_files: try: os.remove(i) except OSError", "environ.get('RAW_URI', '')) if request_uri == '': uri...
[ "= int(partsB[ind]) listCoordinates.append(partsB) listCentroid = centroid(listCoordinates) listSmaller, listBigger = coordinatesDistance(listCoordinates, listCentroid) print(\"Centroid: \",", "yCentroid = 0 listCentroid=[] for i in range(0, len(listCoordinates)): xCentroid += listCoordinates[i][0] yCentroid", ...
[ "is governed by the Apache v2.0 license that can be # found in", "response.body.get('host_token') self.assertTrue(token) # Verify it is usable. response = self.app.client.json_request( '/_ah/api/testing_service/v1/who', headers={'X-Host-Token-V1': token})", "CloudEndpointsSmokeTest(unittest.TestCase): def setUp...
[ "#tipo do nó. Compound, Assign, ArithOp, etc self.value = None def __str__(self, level=0):", "if down.index(child) is len(down) - 1 else '' next_indent = '{0}{1}{2}'.format(indent, ' '", "self.children: if (child != None): ret += child.__str__(level+1) #level+1 return ret def __repr__(self):", "nb_children(no...
[ "name='no', field=models.IntegerField(primary_key=True, serialize=False, verbose_name='部门编号'), ), migrations.AlterField( model_name='emp', name='comm', field=models.DecimalField(blank=True, decimal_places=2, max_digits=7, null=True), ),", "django.db import migrations, models class Migration(migrations.Migration):...
[ "\"v\": self.ammo_package_v, \"w\": self.ammo_package_w, \"h\": self.ammo_package_h, \"colkey\": self.ammo_package_color_exclusion }) def drawAmmoBox(self): if self.ammo_package_list.__len__()", "1: self.ammo_package_list.append({ \"x\": self.APP_X_MAX_PLAYABLE_AREA + 10, \"y\": random.randint(self.APP_Y_MIN_PLAY...
[ "recover_to_addr User = get_user_model() DEFAULT_ADDRESS_FIELD = 'username' class Web3Backend(backends.ModelBackend): def authenticate( self, request,", "the address the user has provided matches the signature if address != recover_to_addr(token,", "'WEB3AUTH_USER_ADDRESS_FIELD', DEFAULT_ADDRESS_FIELD) kwargs =...
[ "LICENSE file. class TimelineEvent(object): \"\"\"Represents a timeline event.\"\"\" def __init__(self, category, name, start,", "duration self.args = args @property def end(self): return self.start + self.duration def __repr__(self):", "# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of",...
[ "generalized linear models (VGLMs). :param size_factors: size factors for X :return: tuple: (groupwise_means,", "linear models (VGLMs). :param size_factors: size factors for X :return: tuple: (groupwise_means, mean,", "vector generalized linear models (VGLMs). :param size_factors: size factors for X :return: tu...
[ "# -*- coding: utf-8 -*- # Copyright (c) 2019, 9T9IT and contributors #", "import unicode_literals import frappe def after_insert(doc, method): is_gift_card = frappe.db.get_value(\"Item\", doc.item_code, \"is_gift_card\") if", "\"Gift Card\", \"gift_card_no\": doc.serial_no, \"amount\": gift_card_value, } ).ins...
[ "decade: 5256000 # print(60*24*365*10) # #age in seconds:1135296000 # print(60*60*24*365*36) # #days 32-bit", "a person's first name, middle and last then greet with full name #", "soc-wk1-cert-Diana-Ilinca.py # # Day1 homework # #hours in a year:8760 # print(365*24) #", "print((2**63)/100/60/60/24) # Day3 ho...
[ "distributed in the hope that it will be useful, # but WITHOUT ANY", "the GNU General Public License # along with Diamond. If not, see <http://www.gnu.org/licenses/>.", "\"insert\", \"location\": path, \"index\": index, \"value\": tag + (\" \" + value if", "PURPOSE. See the # GNU General Public License for mo...
[ "= logging.getLogger('chatserver') app = Flask(__name__) messages = [] @app.route('/post/<who>/<message>') def post_message(who, message): messages.append((time(),", "%(threadName)s %(message)s') log = logging.getLogger('chatserver') app = Flask(__name__) messages = [] @app.route('/post/<who>/<message>') def", ...
[ "total -= node.val doCount(total) path.append(node.val) if node.left is not None: dfs(node.left) if node.right", ":type total: int :rtype: int \"\"\" if root is None: return 0 path", "Definition for a binary tree node. # class TreeNode: # def __init__(self, x):", "None: return 0 path = [] count = 0 def doCoun...
[ "print(\"Received event: \" + json.dumps(event, indent=4)) for record in event['Records']: # Kinesis data", "json.dumps(event, indent=4)) for record in event['Records']: # Kinesis data is base64 encoded so", "OUTBOUND_EVENT = 'FileFiltered' LETTERS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' def re...
[ "<gh_stars>1-10 file = input('Enter the file name: ') file_extsn= file.split(\".\") print(f\"The file extension", "= input('Enter the file name: ') file_extsn= file.split(\".\") print(f\"The file extension is {file_extsn[1]}\")", "file = input('Enter the file name: ') file_extsn= file.split(\".\") print(f\"The ...
[ "'slower': p[0] = p[1] < p[5] def p_error(p): print(f\"Synax error at {p.value!r}\") #set", "\".\" + 'osxc', \"r\") for line in f: file_str = '' file_str +=", "'''statement : IFA VAR IFB statement''' if p[4]: p[6] def p_statement_file_in(p): 'statement :", "VAR IFB statement''' if p[4]: p[6] def p_statement_f...
[ "( 'name', ) search_fields = ( 'name', ) @transaction.atomic def merge_ingredients(self, request, queryset):", "'At least two ingredients need to be selected!', messages.WARNING) return main = queryset.first()", "import Prefetch from recipe.models import Ingredient, Recipe, RecipeIngredient, RecipeInstance, \\ ...
[ "under slightly different names. try: LSIDPerson.objects.get( lsid=person_ls_id ) except(LSIDPerson.DoesNotExist): person_object, person_created = Person.objects.get_or_create(", "# under slightly different names. try: LSIDPerson.objects.get( lsid=person_ls_id ) except(LSIDPerson.DoesNotExist): person_object, per...