ngram
listlengths
0
67.8k
[ "class VersionInfo: \"\"\"Define the server's version info.\"\"\" driver_version: str server_version: str min_schema_version: int", "\"\"\"Define utilities related to eufy-websocket-ws versions.\"\"\" from dataclasses import dataclass @dataclass class VersionInfo:", "str min_schema_version: int max_schema_versi...
[ "( \"{0:.2f}\".format ( n [ i - 1 ] + div ) )", "para el graficado del algoritmo import matplotlib.pyplot as plt import numpy as np", "n ) = ( 5/3 )n. # Nombres de los ejes. plt.xlabel (", "graph ( size, time ): # Título de la ventana. plt.figure ( \"Complejidad", "Función propuesta: g ( n ) = ( 5/3 )n. # N...
[ "pandas as pd from collections import OrderedDict import rdkit.Chem as rdc from rdkit.Chem.MolStandardize", "== \"M END\\n\"): flag = 9 # could just use flag = 0(?)", "file_list_csv.append( os.path.join(subdir, os.path.splitext(file)[0] + \".csv\") ) zipped = zip(file_list_in, file_list_ok, file_list_csv) # not...
[ "= f.read() f.close() return text except OSError: print(\"Session File not found\") return \"00000\"", "machine.reset() def help1(): print(\"This is a WIP help menu\") print(\"Some description\") # Reads", "def reboot(): machine.reset() def help1(): print(\"This is a WIP help menu\") print(\"Some description\")...
[ "IMAGE = f\"ruterstop:python{PYVER}\" print(\"Building\", IMAGE) run( [ \"docker\", \"build\", \"--network=host\", \"--file=.deploy/Dockerfile\", f\"--build-arg=PYTHON_VERSION={PYVER}\", f\"--build-arg=POETRY_VERSION=1.1.5\",", "check=True, ) print(\"Running unit-tests\", IMAGE) run( [ \"docker\", \"run\", \"--ne...
[ "np.mean(posterior, axis=1) init_distribution = np.ones(num_states)/num_states #uniform distribution mdp_env = mdp.MachineReplacementMDP(num_states, r_sa, gamma, init_distribution)", "- np.min(cvar_rets_array[:,1]))/17 for i,pt in enumerate(unique_pts_lambdas): if i in [0,1,2,4]: plt.text(pt[0] - 6.2*offsetx,", ...
[ "# -*- coding: utf-8 -*- from pystocktwits_data_utils import PyStockTwitData from pystocktwits_data_utils.utils import return_json_file", "from pystocktwits_data_utils import PyStockTwitData from pystocktwits_data_utils.utils import return_json_file data = PyStockTwitData() recent_msg =", "PyStockTwitData from ...
[ "of the boilerplate code required to produce an object which implements AccumulatorBase. \"\"\"", "KIND, either express or implied. # See the License for the specific language", "result_name=None): \"\"\"Lazy accumulator decorator. Args: depends_on: list of accumulators on which this value", "Unless required ...
[ "range(3,sn+1,2): if all((attempt % prime != 0 and n%attempt==0) for prime in prime1):", "and n%attempt==0) for prime in prime1): prime1.append(attempt) end = time.time() print(end - start)", "def primes(n): start = time.time() prime1 = [2] sn=int(math.sqrt(n)) for attempt in range(3,sn+1,2):", "in range(3,sn...
[ "not supported yet') self.specials = self.tokenizer.all_special_tokens def _whole_word_cand_indexes_bert(self, input_tokens: List[str]): cand_indexes = []", "KIND, either express or implied. # See the License for the specific language", "self.tokenizer.all_special_tokens def _whole_word_cand_indexes_bert(self, ...
[ "rest_framework.exceptions import APIException from core.exceptions import common_exception_handler def test_common_exception_handler_if_error_without_detail(mocker): exp = APIException({'data': 'test'})", "def test_common_exception_handler_if_error_is_string(mocker): exp = APIException(['testing error']) respons...
[ "list.\"\"\" accounts = api.Account.list().all() assert list(accounts) def test_account(self, account): \"\"\"Test account list.\"\"\" assert", "account list.\"\"\" accounts = api.Account.list().all() assert list(accounts) def test_account(self, account): \"\"\"Test account list.\"\"\"", "from dynaconf import s...
[]
[ "'base', 'parent') def __init__(self, size: int, reverse: bool, base: int=0, parent: int=0, *args):", "self.base = base self.parent = parent class RepeaterPlaceholder(Token): __slots__ = ('value',) def __init__(self,", "index: int=None, *args): super(Field, self).__init__(*args) self.index = index self.name = n...
[ "import * from thermodynamics import * from dynamics import * from box import", "* from dynamics import * from box import * from stats import *", "thermodynamics import * from dynamics import * from box import * from stats", "* from box import * from stats import * from meta import *", "import * from box im...
[ "final = price - discount print(f'The final price is: {final} lv.\\nThe discount is:", "* 7.61 discount = price * 0.18 final = price - discount print(f'The", "= price * 0.18 final = price - discount print(f'The final price is:", "price = float(input()) * 7.61 discount = price * 0.18 final = price", "price *...
[ "= 'message', text_color: str = None) -> None: if text_color: self.statusBar().setStyleSheet(f'color : {text_color}')", "running_tasks = [executor.submit(self.process, torrent) for torrent in torrents] for running_task in running_tasks: running_task.result()", "files = QFileDialog.getOpenFileNames(self, 'Open a...
[ "add a user to a group.\"\"\" validator = Schema.get_validator(\"bulk_api/command/create_group_membership.json\") @classmethod def create(cls, user_ref,", "body for adding users to groups. :param user_ref: Custom user reference :param group_ref:", "= [\"authority\", \"authority_provided_id\"] class CreateGroupM...
[ "test_user_instance(self): pass def test_post_instance(self): pass def test_comment_instance(self): pass if __name__ == '__main__': unittest.main()", "email='<EMAIL>', password='<PASSWORD>') self.new_post = Post() self.new_comment = Comment() def test_user_instance(self): pass def test_post_instance(self):", "U...
[ "\"\"\"Construct.\"\"\" pass def transform(self, graphs_list): \"\"\"transform.\"\"\" try: for graphs in graphs_list: transformed_graph =", "nx.Graph() for graph in graphs: graph_global = nx.disjoint_union(graph_global, graph) return graph_global # -----------------------------------------------------------------...
[ "= body[\"result\"] results = body[\"results\"] results_df = join_results(results) file_name = storage.write_output( session_id, str(uuid.uuid4()),", "from typing import Dict from showwhy_inference.inference import join_results from shared_code.io.storage import get_storage_client storage", "from shared_code.io...
[ "AppKey=AppKey) # 获取sign r = requests.post(url=url, params=params) # 获取分析结果 result = json.loads(r.text) #", "json import time import random import hashlib from urllib import parse from collections", "i in range(10)]), 'sign': '', 'text': one_text} params['sign'] = cal_sign(params_raw=params, AppKey=AppKey) # 获取...
[ "not used 'data_format': 'channels_last', # 'channels_last' 'channels_first' 'batch_size': batch_size, 'coord_scale': 1, 'noobj_scale': 1,", "[373.,326.]]] } image_augmentor_config = { 'data_format': 'channels_last', 'output_shape': [448, 448], # 'zoom_size': [520,", "# 'rotate': [0.5, -10., 10.], 'pad_truth_to...
[ "#------------------------------------------------------------------------------- # Description: defines classes for processing tactile data to be used for", "for #each taxel of the tactile sensor featureVector = np.zeros(numberTaxels) #scan all the", "#for every sample, get the moving average response for z in...
[ "import argparse import matplotlib matplotlib.use('pdf') import matplotlib.pyplot as plt import os import json", "= os.path.join(args.dir, 'plots') if not os.path.exists(save_dir): os.makedirs(save_dir) plt.savefig(os.path.join(save_dir, f'property_{args.property}_{args.sub_dir}.pdf')) if __name__ == '__main__':"...
[ "= StringVar() self.MaxFeatures_Float.set('0.1') self.MaxFeatures_None = ttk.Radiobutton(frame, text='None', variable=self.MaxFeatures, value='none') self.MaxFeatures_Integer_Button = ttk.Radiobutton(frame, text='Number:',", "self.LearningRate = StringVar() self.LearningRate.set('0.1') self.LearningRate_Box = Spi...
[ "= size self.vocab_size = vocab_size self.output_dim = size self.zero_index = zero_index self._mask =", "if type(mask) == NeuralVariable else mask self._init = init self._load_values = load_values self.init(1)", "if self._load_values is not None: self.embed_matrix = theano.shared(self._load_values, name=\"embed...
[ "import pandas as pd # Data Preprocessing dataset = pd.read_csv('Market_Basket_Optimisation.csv', header = None)", "por lo que tiene sentido que sea la asociación más fuerte del dataset", "pruebas para obtener buenos valores para los parámetros # Visualising the results results", "última # El primer valor num...
[ "halls, etc), as well as to the user's location.\" 'Queries that are related", "as f: json_data = json.load(f) print(json_data.keys()) # ['domains', 'version'] domains = json_data['domains'] print('domain", "json_data['domains'][3]['name'] 'weather' (Pdb) json_data['domains'][2]['name'] 'transit' (Pdb) json_dat...
[ "curr_worker == len(worker_ids): curr_worker = 0 print('-----------------------------------------------------------------') worker_status_temp = run_dask_tools.get_dask_worker_status(curr_client, custom_index=custom_index_curr) get_worker_free_temp =", "results_dask['energyMM_mem'] out_file = open(out_name, 'w') ...
[ "cost(num_of_cities, distance_matrix, tour) for tour in population] sum_fitness = sum(fitness) return [f /", "if child2[i] == -1: child2[i] = parent1[i] return [child1, child2] def mutate(num_of_cities, child):", "/ cost(tour) \"\"\" fitness = [1 / cost(num_of_cities, distance_matrix, tour) for tour in", "ran...
[]
[ "necessary dialog.exec_() if __name__ == '__main__': app = QApplication(sys.argv) main = QDialogDemo() main.show()", "from PyQt5.QtWidgets import QDialog, QApplication, QMainWindow, QPushButton class QDialogDemo(QMainWindow): def __init__(self): super(QDialogDemo, self).__init__()", "@staticmethod def function(...
[ "hear a very British problem?' return question(welcome_message) @ASK.intent(\"GetNewBritishProblem\") def handle_get_problem_intent(): \"\"\"Handles the intent", "@ASK.intent(\"GetNewBritishProblem\") def handle_get_problem_intent(): \"\"\"Handles the intent for getting a new british problem and", "def handle_g...
[ "['-created'] get_latest_by = 'created' created = CreationDateTimeField(db_index=True) class CopyrightLicense(models.TextChoices): CC_0 = 'CC-0', 'CC-0'", "CreationDateTimeField from django_extensions.db.models import TimeStampedModel class CreationSortedTimeStampedModel(TimeStampedModel): class Meta(TimeStampedM...
[ "t = (self.mean - other.mean)/np.sqrt(s1 + s2) # calculate the probability using the", "def _rvs(self): return np.zeros(self._size) DeterministicDistribution = DeterministicDistribution_gen( name='DeterministicDistribution' ) class LogUniformDistribution_gen(stats.rv_continuous): \"\"\" Log-uniform", "- linalg....
[ "while posY < linec: if lines[posY][posX % linelen] == '#': trees += 1", "<gh_stars>0 lines = [] with open('input.txt') as f: lines = f.readlines() lines =", "f.readlines() lines = list(map(lambda x: x.strip(), lines)) linelen = len(lines[0]) linec = len(lines)", "f: lines = f.readlines() lines = list(map(lam...
[ "<filename>shoppingcart/shop/context_processors.py from .models import Category def menu_links(request): \"\"\"get menu links\"\"\" links = Category.objects.all()", ".models import Category def menu_links(request): \"\"\"get menu links\"\"\" links = Category.objects.all() return dict(links=links)", "from .model...
[ "coding: utf-8 -*- \"\"\" @author: nicolas.posocco \"\"\" from .classwise_ece import classwise_ece from .classwise_ece_c", "nicolas.posocco \"\"\" from .classwise_ece import classwise_ece from .classwise_ece_c import classwise_ece_c from .classwise_ece_a import", "\"\"\" from .classwise_ece import classwise_ece...
[ "self.placeholders['labels'], self.placeholders['labels_mask']) self.loss += self.pred_error def _accuracy(self): self.accuracy = masked_accuracy(self.outputs, self.placeholders['labels'], self.placeholders['labels_mask']) def", "output_dim=self.configs['hidden_dims'], num_heads = self.num_heads, average_heads=Fa...
[ "argparse import shutil import base64 import glob import sys import os import promote", "= verbose self.devnull = open(os.devnull, \"w\") self.image = image parser = configparser.ConfigParser() parser.read(\"authentication.ini\")", "= glob.glob(\"./*.pyc\") for aFile in files_to_remove: os.remove(aFile) shutil....
[ "= db.Column(db.String(80), index=True, unique=True) email = db.Column(db.String(120), index=True, unique=True) display_name = db.Column(db.String(80), index=True,", "class Profile(Base, db.Model): __tablename__ = 'profile' username = db.Column(db.String(80), index=True, unique=True) email =", "db.ForeignKey('u...
[ "# coding=utf-8 import json import os import sys import unittest from src.utils.payloadHelper import", "os import sys import unittest from src.utils.payloadHelper import PayloadHelper class MappedPayloadTests(unittest.TestCase): def setUp(self):", "import sys import unittest from src.utils.payloadHelper import ...
[ "','.join([str(x) for x in [self.word, self.scrambled, self.guesser, self.revealed_idx]]) def advance(self, state): if self.revealed_idx", ">= len(self.word) - 1: self.scrambled += random.choice(string.ascii_lowercase) self.revealed_idx += 1 state.update_history_log(f\"{self.guesser} advanced\") #", "word_for_g...
[ "from scripts.migration.migrate_mailing_lists_to_mailchimp_field import main, get_users_with_no_mailchimp_mailing_lists class TestMigrateMailingLists(OsfTestCase): def setUp(self): super(TestMigrateMailingLists, self).setUp() self.user1 =", "in users_with_mailing_list_ids) assert_true(self.user2._id in users_with...
[ "= (1+nu)/(8*R**2)*X*Y strain['yx'] = strain['xy'] strain['zz'] = nu/(4*R**2)*(X**2+Y**2-L**2/8) #missing zero strains from sbcalc", "(uzzaux2+uzzaux3*np.cos(2*phi+beta))*r_squared) #In sbcalc, there's incorrectly sin instead of cos for k in stress:", "+ 3*S[5,5]*a**4/20, (S[0,1]/3 + S[5,5]/12)*a**2*b**2, -3*S[...
[ "can re-load quickly. \"\"\" vec_file = join(self.dir, word_vec_name + self.WORD_VEC_SUFFIX + \".npy\") if", "return [] with open(file, \"rb\") as f: return pickle.load(f) def __getstate__(self): state =", "WARNING: this includes dev words This exists since loading word-vecs each time we", "dir = join(CORPUS_...
[]
[ "self.dp, self.img = match_finder.find_kp_dp(self.img) # def main(): # map_ = image_processing(filename = '26_12_2021_nn')", "= home+'/copa5/map' file_exists = os.path.exists(data_path+'/'+filename+'.tif') # print(\"start job\") try: if file_exists is True:", "= 0.0 time_start = time() if filename is not None: ...
[ "render_template, url_for from markupsafe import Markup from mass_flask_core.models import FileSample, IPSample, DomainSample, URISample,", "return Markup('<i class=\"fa fa-at\"></i>') else: return Markup('<i class=\"fa fa-question\"></i>') def is_file_sample(sample): return isinstance(sample,", "else: return M...
[ "JsonDifferently.load(Path(directory) / \"a.json\") b = JsonDifferently.load(Path(directory) / \"b.json\") actual_json = str(JsonDifferently(a, b, color=True))", "b, color=True)) with open(Path(directory) / \"actual-json.txt\", \"w\") as f: f.write(actual_json) with open(Path(directory) /", "from differently im...
[ "117, 116, 101, 32, 116, 101, 115, 116, 115, 32, 32, 32, 32,", "test_by_log_differ(): differ = ld.LogDiffer.from_json('misc/nestest_log.json') nes = nft.prepared_nes() mem = nc.Memory(None, None) mem.load_nes(nes) cpu", "114, 101, 99, 116, 44, 88, 41, 32, 116, 101, 115, 116, 115,", "0, 0, 0, 0, 0, 0, 0, ] res...
[]
[ "swapcount += 1 a[j], a[j+1] = a[j+1], a[j] print(f\"Array is sorted in {swapcount}", "> a[j+1]: swapcount += 1 a[j], a[j+1] = a[j+1], a[j] print(f\"Array is sorted", "math import os import random import re import sys a = [6, 4,", "in range(0, n-i-1): if a[j] > a[j+1]: swapcount += 1 a[j], a[j+1] =", "# Com...
[ "RB04, RB05, RB06, RB07, ] return rodentBreeds def get_other_breeds(): otherBreed = [DE01,] return", "DB21), (DB22, DB22), (DB23, DB23), (DB24, DB24), (DB25, DB25), (DB26, DB26), (DB27, DB27),", "'Jandaia' BB21 = 'Lóris' BB22 = 'Mainá' BB23 = 'Modesto' BB24 = 'Papagaio'", "= 'Tucano' # RODENT BREED RB00 = 'Ca...
[ "int(claim.split(' ')[3].split('x')[0]) b = int(claim.split(' ')[3].split('x')[1]) for i in range(x, x + a):", "int(claim.split(' ')[2].split(',')[1][:-1]) a = int(claim.split(' ')[3].split('x')[0]) b = int(claim.split(' ')[3].split('x')[1]) for i in", "in range(y, y + b): if canvas[i][j] > 1: return False # If...
[ "= ( (_('Navigation options'), { 'classes': ('collapse',), 'fields': ( 'grid_num_rows', 'theme_navigation_type', 'theme_bullets_margin_top', 'theme_bullets_color',", "'theme_navigation_type', 'theme_bullets_margin_top', 'theme_bullets_color', 'bullets_space_between', 'theme_arrows_margin_top', 'theme_space_betwee...
[ "# All rights are reserved to the authors ... I only used a", "if neighbor == node: inc[com] = inc.get(com, 0.) + float(edge_weight) else: inc[com] =", "which is decomposed weight : str, optional the key in graph to use", "= inc.get(com, 0.) + float(edge_weight) / 2. res = 0. for com in", "graph nodes Value...
[ "k, v in sorted(d.items()): if isinstance(v, dict): print('\\t'*level + k+':') print_dict(v, level+1, list_on_levels)", "'norm': normalize }, { 'data': stiffs, 'title': 'Stiffness', 'out_file': os.path.join(results_folder, 'stiffness', 'stiff_dist_sim_{}_{}.pdf'.format(seed, num_sim)),", "#') print_dict(config)...
[ "str(value) else: value = str(value) self.modifier = Text(value, \"rimouski sb.ttf\", white, 60) self.modifierBack", "About import About from Text import * from color import * class Card(pygame.sprite.Sprite):", "getCard(self) self.image.set_alpha() def addModifier(self, value): \"\"\"Add bonus or malus to the ...
[ "assert_is_not_none(props.get('descriptor')) class TestPagerDutyOutput(object): \"\"\"Test class for PagerDutyOutput\"\"\" @classmethod def setup_class(cls): \"\"\"Setup the class", "return get_alert() @patch('logging.Logger.info') @patch('urllib2.urlopen') def test_dispatch_existing_container(self, url_mock, log...
[ "def sigmoid(x): return 1/(1+np.exp(-x)) def softmax(x): return np.exp(x)/np.sum(np.exp(x)) Wi,Ri,bi = np.random.normal(mean,std,(len_of_vocab,len_of_vocab)),np.random.normal(mean,std,(len_of_vocab,len_of_vocab)),np.random.normal(mean,std,(len_of_vocab,1)) Wo,Ro,bo =", "{} z_g = {} os = {} cs[-1] = np.copy(c_p) y...
[ "A node with no children. Branch node Internal node A node with at", "proceeding from parent to child. Also known as subchild. Ancestor A node reachable", "child) return # Searching for an item # Adding a new item at", "[] return self class Tree(object): def __init__(self, data, num_children = 2, notation =",...
[ "dependencies = [ ('get_random_quote', '0016_auto_20200525_0146'), ] operations = [ migrations.RenameField( model_name='quote', old_name='photo', new_name='image_object',", "by Django 3.0.3 on 2020-05-24 21:05 from django.db import migrations class Migration(migrations.Migration): dependencies", "django.db impo...
[ "time import sleep from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium import webdriver sleep(5) def", "sleep from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium import webdriver sleep(5) def screenshot_main(): driver", "<reponame...
[ "import argparse import logging import os import secrets from typing import NamedTuple SSS_IP", "sockf): # Make sure the socket does not already exist try: os.unlink(sockf) except", "Random seed: 32bytes elif op == REG: self.devs[dev_id] = Device(dev_id, REG, csock) resp_op", "int), ('status', int), ('csock',...
[ "np.sqrt(np.pi) * r[i] g = (1 / 1000) * np.sqrt(np.pi) * r[i] w,", "g): freq_low = 0 freq_high = 5 num_freq = 300 w = np.arange(freq_low,", "datasets:' % sets) ftrTrain, ftrTest, lblTrain, lblTest = train_test_split(features, labels, test_size=0.2, random_state=1234) train_data", "torch.utils.data import Data...
[ "5) p.kernel_initializers() p.layers(12) p.neurons(10, 100, 5) p.lr() p.optimizers('multi_label') p.shapes() p.shapes_slope() p.automated('sloped') return \"Finished", "import talos as ta def test_params_object(): '''Tests the object from Params()''' print('Start testing", "p.shapes_slope() p.automated() p = ta...
[ "in range(0,self.FBGFileNum): FBGPathtemp=self.FBGPaths[i].replace(\"\\\\\",\"/\",99) FBGDataTemp=pd.read_csv(FBGPathtemp,sep=self.FBGSep,names=self.FBGColNames,skiprows=self.FBGSkipRows,parse_dates=[['Date', 'Time']],dayfirst=True) #Merge Date and Hour self.FBGData= pd.concat([self.FBGData,FBGDataTemp],ignore_inde...
[ "class Migration(migrations.Migration): dependencies = [ ('PiGPIO', '0006_program_logging'), ] operations = [ migrations.CreateModel( name='ProgramLog',", "= [ ('PiGPIO', '0006_program_logging'), ] operations = [ migrations.CreateModel( name='ProgramLog', fields=[ ('id', models.AutoField(auto_created=True,", "2...
[ "coding: utf-8 -*- import time def function1(seconds): time.sleep(seconds) if __name__ == \"__main__\": function1(100)", "<filename>tests/scripts/unicode💩.py<gh_stars>1000+ #!/env/bin/python # -*- coding: utf-8 -*- import time def function1(seconds): time.sleep(seconds) if", "# -*- coding: utf-8 -*- import tim...
[ "collect_handlers, handle fetcher = Fetcher(\"api/\") def create_display(name): disp = SseqDisplay(name) print(f\"Creating display at", "chart=None): self.name = name self.chart = None self.save_file_handle = FileHandle() self.autosave = False", "functions. \"\"\" # if not hasattr(self.chart, name): # raise Att...
[ "import Auth class Summary(Auth): _endpoint1 = \"zones\" _endpoint2 = \"spectrum/analytics/events/summary\" _endpoint3 = None", "aiocloudflare.commons.auth import Auth class Summary(Auth): _endpoint1 = \"zones\" _endpoint2 = \"spectrum/analytics/events/summary\" _endpoint3 =", "from aiocloudflare.commons.auth i...
[ "from typing import List, NamedTuple, Tuple, Set def extract(s): return [int(x) for x", "abs(x[2] - y[2]) @dataclass(frozen=True, order=True) class Box: bot: Pos top: Pos def split_at(self,", "check(fns, {m}) return fns, n def check(lhs, rhs): return for x in lhs:", "new_on = set() for x in on: splits, _ = sp...
[ "and told how many # attempts they have remaining. from random import randint", "random_num = randint(0, 10) turns = 5 # 5 turns for turn in", "in range(turns - 1, 0, -1): guess = int(input(\"Make a guess: \")) if", "problem below and then implement it in code. You do not need to", "implement it in code. Yo...
[ "for a dictionary. Keys are tree labels, all values must be dictionaries as", "node representing the tree root from the tree.\"\"\" return tree def get_text(self, node):", "node): \"\"\"Return the text associated with a node.\"\"\" return str(node) class DictTraversal(Traversal): \"\"\"Traversal", "all values...
[ "template_name = 'oauth2/applications/list.html' class ApplicationRegistration(mixins.ApplicationCreationMixin, mixins.TwoFactorMixin, views.ApplicationRegistration): template_name = 'oauth2/applications/register.html' def get_success_url(self): return", "def get_success_url(self): return reverse_lazy('applicatio...
[ "del(bot.dnd[key]) break if data[1] in [ID.HON_STATUS_ONLINE]: \"\"\" \"\"\" #nick = bot.id2nick[id] #bot.clan_roster[id]['upgrades'] =", "= u[0] if id in bot.clan_roster: if u[1] in [ID.HON_STATUS_ONLINE, ID.HON_STATUS_INGAME]: nick =", "[ID.HON_SC_CLAN_MEMBER_CHANGE] def add_member(bot,origin,data): id = data...
[ "frappe def execute(): a=frappe.new_doc(\"Task\") a.subject='axy' a.save() print(a.name) # #bench execute demo.doctype.task.execute # print('***************')", "import frappe def execute(): a=frappe.new_doc(\"Task\") a.subject='axy' a.save() print(a.name) # #bench execute demo.doctype.task.execute #" ]
[]
[ "the `App` class. Renders to terminal. \"\"\" def __init__(self, app, env_out, default_char, default_color:", "out=reduced_color_diffs) np.logical_or(char_diffs, reduced_color_diffs, out=char_diffs) write(\"\\x1b[?25l\") # Hide cursor ys, xs = np.nonzero(char_diffs) for", "np from ..colors import Color from .wi...
[ "page \") print (\"Page \" + url + \" may not exist\") browser.close()", "\"\\n\" \"\\\"headline\\\": \") + str(article_headline_list[j]) + \"\\n\\\"author\\\": \\\"\" + str(writer_list[j]) + \"\\\"\\n\\\"date\\\": \"", "List Variables outputList = [] article_headline_list = [] writer_list = [] time_posted_list...
[ "Linux and Windows discarded_variables = ['LC_CTYPE', 'PWD', 'COMSPEC', 'PATHEXT', 'PROMPT', 'SYSTEMROOT'] # Windows", "k not in discarded_variables ).lower()) app = Application('foo', 'tests.test_environ:foos') def test_environ(): with Given(app,", "os.environ.copy() # For Linux and Windows discarded_variables...
[ "['*'] # If DEBUG is False, send the errors to the email: ADMINS", "= 'django.core.mail.backends.smtp.EmailBackend' # REDIS related settings CELERY_BROKER_URL = config('REDIS_URL', default=\"redis://\") CELERY_RESULT_BACKEND = config('REDIS_URL',", "= config('REDIS_URL', default=\"redis://\") CELERY_RESULT_BACK...
[ "returns the solution. Parameters steal from transient reactive transport ---------- x0 : ndarray", "tspan : array_like Tuple (or array) containing the integration time span. saveat :", "is a combined array of solutions for each physics. The solution for each", "Get x from y, assume alg.Np is same for all alg...
[ ": 5, 'Brot' : 3, 'Wein' : 2, 'Eier' : 6, 'Nuss' :", "5, 'Brot' : 3, 'Wein' : 2, 'Eier' : 6, 'Nuss' : 12,", "dic={'Käse' : 5, 'Brot' : 3, 'Wein' : 2, 'Eier' : 6, 'Nuss'", "'#')).center(60)) for namen, anzahl in dic.items(): print((namen.ljust(13, '.') + str(anzahl).rjust(3, '.')).center(60)) print(('#'.center...
[ "Path def create_config(): \"\"\" Creates a merged dictionary between the `config.json` and the", "generic access token was made specific so that the request headers are easily", "env = sys.argv[1] else: env = \"dev\" if env not in {\"dev\", \"prod\",", "+ dict2[k] ) yield (k, dict1[\"headers\"][\"authorizati...
[ "torch.ceil(T * valid_ratio).long() - 1 valid_hf.append(holistic_feat[i, valid_step, :]) valid_hf = torch.stack(valid_hf, dim=0) else:", "valid_ratio in enumerate(valid_ratios): # use torch.ceil to replace original math.ceil and if else", "if else in mmocr valid_step = torch.ceil(T * valid_ratio).long() - 1 val...
[ "self.assertEqual(ctx.errors, []) self.assertEqual(ctx.warnings, []) t = ctx.node_to_text(root) self.assertEqual(t, expected) def test_basic1(self): self.backcvt(\"\", \"\")", "def test_basic4(self): self.backcvt(\"{{\", \"{{\") def test_title1(self): self.backcvt(\"== T1 ==\\nxyz\\n\", \"\\n== T1 ==\\n\\nxyz\\n\...
[ "len(nums2): if median[0] is not None and idx_1 + idx_2 == median[0]: median_sum", "None and idx_1 + idx_2 == median[0]: median_sum += nums1[idx_1] idx_1 += 1", "+= nums1[idx_1] idx_1 += 1 median[0] = None continue if median[1] is not", "median_sum += nums1[idx_1 + 1] break if median[1] is not None and idx_1"...
[ "limitations under the License. \"\"\" import discord import json import os import requests", "member off server', ignore_extra=True, hidden=True, enabled=False) async def kick(self, ctx, member: discord.member, *,", "ctx): await ctx.channel.send(f\"Pong... {round(self.bot.latency * 1000)} ms\") @commands.comma...
[ "x.dt.hour, delta), delta) def hours_chats(delta=0.0): \"\"\" Shows chart of average number of messages", "Monthly (not working) def monthly_conversation(conversation): # TODO not working charts for monthly \"\"\"", "from all conversations (default None) :return: None \"\"\" interval_plot(interval_count(convers...
[ "ev.z[0] == 0' ), LambdaStr( name='ev : ev.w[0] >= 300', lambda_str='ev : ev.w[0]", ") ), dict( factory='NotFactory', components=( dict( factory='AnyFactory', components=( dict( factory='LambdaStrFactory', components=(), lambda_str='ev :", "1', 'ev : ev.y[0] >= 100', )), dict(Not=dict( Any=( 'ev : ev.z[0] ==", ...
[ "== 23 : return 'twenty three' if n == 24 : return 'twenty", "try : n = int(input('Number ? ')) print (f'{n:,} = {terbilang(n)}') except :", "10) +'ty'+ (terbilang(n % 10) if n % 10 !=0 else '') else", "return 'thirty' if n == 50 : return 'fifty' return terbilang (n //", "else '') elif n >= 20 : if n == 21 ...
[ "if child.tag == \"nd\": way.add_node(int(child.attrib['ref'])) elif child.tag == \"tag\": key = child.attrib['k'] val", "nodes[node_id] = node def parse_osm_file(filename): tree = et.parse(filename) roads = [] nodes =", "None): way.name = val elif key == \"oneway\": way.is_one_way = val == \"yes\"", "nodes =...
[]
[ "- alpha * dz db = (1.0 / m) * np.sum(error_martrix) b =", "y def loss(forcast, real): return -(real * math.log(forcast) + (1-real)*log(1-forcast)) def sigmoidOnEle(matrix): m,n", "for i in range(maxCycles): # this is Z set() z = np.dot(dataSetMat, weights)+b", "* np.dot(dataSetMat.transpose(),error_martrix) ...
[ "is a list of strings for which the sum operation is skipped. Returns", "list skip_keys. Typically, the values of X are NumPy arrays (histograms) that are", "JSON text files if (len(py_keys) > 0): for key in py_keys: file_name =", "np_keys: np_keys.remove(rad) np_keys.insert(0, rad) # --- np_all_1d = True for...
[]
[ "i in range(0,24): if(i<10): i = '0'+str(i) else: i = str(i) print(day+i+' =", "<filename>grocercheck/scripts/lazy_coding_scripts/generateCodeForModel.py days = [\"mon\",'tue','wed','thu','fri','sat','sun'] for day in days: for i in range(0,24): if(i<10):", "= [\"mon\",'tue','wed','thu','fri','sat','sun'] for d...