ngram
listlengths
0
67.8k
[]
[ "from models import User class RegistrationForm(FlaskForm): email = StringField('Your Email Address', validators=[InputRequired(), Email()])", "import User class RegistrationForm(FlaskForm): email = StringField('Your Email Address', validators=[InputRequired(), Email()]) username =", "Email()]) username = Strin...
[ "new policy\", \"order\": 1 } }, \"required\": [ \"id\" ] } \"\"\") def", "json.loads(\"\"\" { \"type\": \"object\", \"title\": \"Variables\", \"properties\": { \"name\": { \"type\": \"string\", \"title\":", "schema = json.loads(\"\"\" { \"type\": \"object\", \"title\": \"Variables\", \"properties\": { \"name\"...
[ "r1 = result[0][\"scores\"][0] r2 = result[1][\"scores\"][0] print(\"Rule salary<2100 and title=\\\"Sales Representative\\\": {},\" \"", "= rule(conditions, df)[0] print(\"Rule salary>2100: {}\".format(r1)) condition1 = {\"column\": \"salary\", \"operator\": \"lt\", \"value\":", "[condition1, condition2] task2 ...
[ "documentation notes that these elements aren't guaranteed to be provided so we're not", "messages: business_ids.add(message['business_id']) business_details = party.get_business_details(business_ids) for message in messages: message['@business_details'] = next((business for", "= party.get_business_details(busi...
[ "*args): return print(*args, file=self.stream) class BaseAsciiRenderer(StreamRenderer): \"\"\" Renders a board as a simple", "notetool.tool.log import logger from six import integer_types, itervalues, text_type from ..utils.iter import max_safe,", "BOX, SPACE, UNKNOWN, BlottedBlock, is_list_like class Cell(obje...
[ "DotProduct allows any shape order, but numpy.dot does matrix # multiplication, so we", ":'not_equal', '<' :'less', '<=' :'less_equal', '>' :'greater', '>=' :'greater_equal', } if expr.rel_op in", "_print_MatrixBase def _print_Piecewise(self, expr): result = [] i = 0 for arg in", "to override LambdaPrinter be...
[ "'business_id': 0, 'user_id': 0, 'postal_code': 0}: df_col = df[col].values na = sum(pd.isna(df_col)) if", "statistics import median from tqdm import tqdm def find_most_common_value(element_list): for element in element_list:", "from collections import Counter from statistics import median from tqdm import tqdm...
[ "from tkinter import StringVar t=Tk() t.title(\"<NAME>\") t.geometry(\"425x300\") t.resizable(0,0) t.configure(background=\"black\")#back ground color a=StringVar() def", "<filename>GUI Applications/calc.py from tkinter import Tk from tkinter import Entry from tkinter import", "b8.configure(command=lambda:show(...
[ "models.CharField(max_length=255) body = models.CharField(max_length=255) position = models.CharField(max_length=255) selector = models.CharField(max_length=255) tour = ParentalKey(Tour,", "ClusterTaggableManager( through='core.CountryTaggedCaseStudy', blank=True, verbose_name='Country tags' ) region_code_tags = ...
[ "[height, width, channels]. Args: transforms (list): A list contains data pre-processing or augmentation.", "If converting image to RGB color space. Default: True. Raises: TypeError: When 'transforms'", "KIND, either express or implied. # See the License for the specific language", "w), output size will be ma...
[ "def test_serialize_terms_for_edit_ui_no_terms(create_record): deposit = create_record(published=False) serialized_deposit = serialize_terms_for_edit_ui(deposit) assert 'terms' not in serialized_deposit", "'data': {'source': 'FAST', 'value': 'Border terrier'} } ] def test_serialize_terms_for_edit_ui_no_terms(crea...
[ "yt_search(search: str): webbrowser.open_new_tab(f\"https://www.youtube.com/results?search_query={search}\") def google_search(search: str): webbrowser.open_new_tab(f\"https://www.google.com/search?q={search}\") def bing_search(search: str): webbrowser.open_new_tab(f\"https://www.bing.com/search?q={search}\") def d...
[ "< n - (r - i): indices[i] = indices[i] + 1 for j", "= max(combinations, key=lambda x: len(x)) max_len = 0 for i1, i2, c in", "lambda : key_by_space(8, 41), lambda : key_by_space(5, 42), lambda : key_by_guess(3, 43, 'n'),", "encrypt(key, msg): c = strxor(key, msg) print print c #.encode('hex') return c MSGS",...
[ "on how to compute the expected upper confidence bound payoff (expected UCB payoff)", "arms_sampled: raise ValueError('sample_arms are empty!') return get_equal_arm_allocations(arms_sampled, self.get_winning_arm_names(arms_sampled)) def get_winning_arm_names(self, arms_sampled): r\"\"\"Compute the", "arm, this ...
[ "result, error = Hedge.run('<stdin>', text) if (error): print(error.asString()) elif result: if len(result.elements) ==", "= Hedge.run('<stdin>', text) if (error): print(error.asString()) elif result: if len(result.elements) == 1: print(repr(result.elements[0]))", "True: text = input('Hedge > ') if text.strip()...
[ "_read_particle_fields(self, chunks, ptf, selector): chunks = list(chunks) for chunk in chunks: # These", "= size rv[field] = np.empty(fsize, dtype=\"float64\") ng = sum(len(c.objs) for c in chunks)", "chunk.objs: # We want a *hard error* here. # if g.id not in", "sorted(ptf): x, y, z = ( self.grids_in_memory...
[ "metavar='file', type=str, nargs='*', help='List of files to retrieve CIDR ranges to enumerate') parser.add_argument('-s',", "python3 \"\"\" cidr_enum.py is a very simple tool to help enumerate IP ranges", "do_sort): cidrs=[] for r in ranges: try: cidrs.append(netaddr.IPNetwork(r)) except Exception as e: print(...
[ "2, 2, 2), temporal_strides=(1, 2, 2, 2), zero_init_residual=False), cls_head=dict( type='I3DHead', num_classes=400, in_channels=512, spatial_type='avg',", "pipeline_weak=train_pipeline_weak, pipeline_strong=train_pipeline_strong, pipeline_format=train_pipeline_format, contrast_clip_num=1 ), val=dict( type=datase...
[ "check it yourself. # This will not work unless you have installed py-spidev", "print \" connect red probe to DA%d on D/A header\" % channel else:", "decimal number and it converts it to 8 bit binary # each argument", "by user input channel = int(which_channel()) # continue asking until answer 0 or", "% cha...
[ "a list of variables used by this template variables = frozenset([ 'repo', 'branch',", "and line_author_age: parts.append(u'⟢ {line_author} ({line_author_age})') # join template and fill with locals return", "inserted (int): The amount of inserted lines deleted (int): The amount of deleted", "git integration ...
[ "__future__ import unicode_literals from django.test import TestCase class RandomTestCase(TestCase): def test_one_plus_one1(self): self.assertEqual(1+1, 2)", "coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase class RandomTestCase(TestCase):", "from __future__ import unic...
[ "sso import opencv2 as cv2 import urllib import numpy as np # log", "want if cv2.waitKey(22) & 0xFF == ord('q'): break else: print(\"Frame is None\") break", "# print \"File Cannot be Opened\" while(True): # Capture frame-by-frame ret, frame =", "Press q to close the video windows before it ends if you want",...
[ "import status class GraphAPIError(APIException): \"\"\"Base class for exceptions in this module.\"\"\" pass class", "self.id = id super(NodeNotFoundError, self).__init__(\"Node with id '{}' does not exist.\".format(id)) class NodeTypeNotFoundError(GraphAPIError):", "self).__init__(\"Node type '{}' does not exi...
[ "import * import candles as can # Globals: client = None # Main", "= Client(api_key, api_secret) if check_connectivity(client): output.print_ok('Successfully connected to binance.') if check_account_status(client): output.print_ok('Successfully connected", "output.print_ok('Starting kobe trading bot...') connec...
[ "return_counts=True) merger_bins_gal, c_t_gal = np.unique(t_merger_gal, return_counts=True) fig, ax = plt.subplots(1,1,figsize=(7,6)) # plot the", "package loaded @redshift_limit :: upper limit in redshift --> end point for interpolation", "r'$\\Delta t_{merger} = t(z_{merger})-t(z_{current})$ [Gyr]', r'Redshif...
[ "this work for additional information regarding # copyright ownership. The Modin Development Team", "shape in self.shapes: df = generate_dataframe(\"pandas\", \"int\", *shape, RAND_LOW, RAND_HIGH) file_id = get_shape_id(shape)", "You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE...
[ "range(30, 180, granularity * 4): angles = angle_adder + np.arange(0, granularity * 4,", "acorn is not None: np.random.seed(acorn) errors = np.zeros(2) for rep in range(reps): print(\"Starting", "= y[indx[0:250]] train_y2 = y[indx[250:500]] test_x = x[indx[500:600],:] test_y = y[indx[500:600]] else: train_x1", ...
[ "MonitorMixin(object): def print_message(self, message): if self.logfile: with open(self.logfile, \"a\") as fout: fout.write(message) else:", "MonitorMixin): def __init__(self, logfile=None, to_screen=True, max_nunique=20): self.logfile = logfile self.to_screen = to_screen self.max_nunique", "if len(unique_valu...
[ "[]), ({'event_sources': \"No such source, Proofpoint TAP\", 'abuse_disposition': \"No such value\"}, []), ({'event_sources':", "'message_delivery_time': 1544640072000, 'body': \"test\", 'body_type': \"test\", 'headers': \"test\", 'urls': \"test\" } ] EMAILS_CONTEXT_INPUT", "\"value\"}, \"cnc_host\": {\"key\": ...
[ "raise(\"Can't find LC_SYMTAB\") def replace_methname(macho_file, methname_json, output_dir): \"\"\" Map method names in Mach-O", "None: raise(\"Can't find __objc_methname section\") sect.section_data = replace_in_bytes( sect.section_data, name_dict, ReplaceType.objc_methname) header.mod_dict[lc] =", "output_di...
[ "math import numpy as np def sd1(rr): sdnn = np.std(rr) return math.sqrt(0.5 *", "import math import numpy as np def sd1(rr): sdnn = np.std(rr) return math.sqrt(0.5", "python import math import numpy as np def sd1(rr): sdnn = np.std(rr) return", "<gh_stars>0 #!/usr/bin/env python import math import numpy as n...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "import print_function from apiclient import discovery from httplib2 import Http from oauth2client import", "KIND, either express or implied. # See...
[ "= x else: x.parent = y if x.rank == y.rank: y.rank += 1", "Node def make_set(x: Node) -> None: \"\"\" Make x as a set. \"\"\"", "x.parent def find_python_set(node: Node) -> set: \"\"\" Return a Python Standard Library set", "not in {sets}\") def test_disjoint_set() -> None: \"\"\" >>> test_disjoint_set() \"\...
[ "spin 1/2 nuclei import numpy as np from scipy.linalg import expm from matplotlib.pylab", "2*np.pi * 50.e6 # Isotropic Hyperfine coupling rad / s B0 = 0.35#", "+ np.dot(Sz,Iz)) print('Hamiltonian:') print(H) out = np.linalg.eig(H) E = out[0] print(E) E12 =", "/ 1e6)) print('%0.05f MHz'%(E34 / 1e6)) print('Ele...
[ "in enumerate(reversed(vm_q)): if value[-1] == '0' and value[-2] == class_: vm = value[1]", "reader = csv.reader(f) vm_list = [i for i in reader] # ['2020-08-06 04:27:59',", "'w', encoding='utf-8', newline='') as f: writer = csv.writer(f) writer.writerows(dataFlow) try: with open(path_, 'r',", "encoding='utf-...
[ "with a period of silence. Note that this is an in-place transformation. :param", "audio segment class.\"\"\" import copy import io import random import re import struct", "Unless required by applicable law or agreed to in writing, software # distributed", "= np.frombuffer(audio_bytes, dtype='int16') return c...
[ "import re import sys import traceback from pprint import pformat import tornado from", "from tornado import template SENSITIVE_SETTINGS_RE = re.compile( 'api|key|pass|salt|secret|signature|token', flags=re.IGNORECASE ) class ExceptionReporter: def", "exceptions.pop() except IndexError: break tb = exc_value.__t...
[ "callable = ___id(\"%callable\") if args.__len__() == 1: if callable(l): stopwhen = args[0] return", "self def __next__(self): has_length = True found = False try: self.l.__len__() except AttributeError:", "== 0: return it.__next__() else: return it.__next__(arg[0]) ___assign(\"%next\", next) class FuncIter: de...
[ "open_general_transhipment_licence = OpenGeneralLicence( \"00000000-0000-0000-0000-000000000014\", \"Open General Transhipment Licence\", OGTL_DESCRIPTION, \"OGTL\", ) @classmethod def", "= id self.name = name self.description = description self.acronym = acronym open_general_export_licence =", "OpenGeneralLice...
[ "#Function to rotate matrix by 90 degree def rotate(mat): # `N × N`", "for i in range(N): for j in range(i): temp = mat[i][j] mat[i][j] =", "`N × N` matrix N = len(mat) # Transpose the matrix for i", "N` matrix N = len(mat) # Transpose the matrix for i in range(N):", "# `N × N` matrix N = len(mat) # Transpo...
[ "+= quicksort(right) return res xs = [1, 3, 2, 4, 5, 2] sorted_xs", "0: return [] pivot = xs[0] xs = xs[1:] left = [x for", "x in xs if x <= pivot] right = [x for x in", "if x <= pivot] right = [x for x in xs if x", "return [] pivot = xs[0] xs = xs[1:] left = [x for x", "res = quicksort(left) res.append(p...
[ "# import os import re import subprocess import devops_pb2 import fabric_pb2 import chaincode_pb2", "KIND, either express or implied. # See the License for the specific language", "which calls the system python, not the virtual env python we # setup", "Unless required by applicable law or agreed to in writing...
[ "value_by_ksearch(k, d_big, logger=logger, *search_args) if not v is None: d[k] = v continue", "there is no builtin method to add to the head of an ordered", "except: logger.debug('unable to find \\'%s\\' in the dict with method \\'%s\\''%(k, method)) if", "= 'sub', search = 'search', # logger = mod_logger): ...
[ "\"3\" + green + \"]\" + white + \" Gmail\" + green +", "white + \" Playstation\" + green + \" [\" + white + \"22\"", "white + \"15\" + green + \"]\" + white + \" Blockchain\") print(green", "\"5\" + green + \"]\" + white + \" Twitter\" + green +", "\"17\" + green + \"]\" + white + \" Rockstar\") print(gree...
[ "sys def create_order(acme, domains, method, order_file): order = acme.new_order(domains, method) update_order(order, order_file) return", "Querying ACME server for current \" \"status.\") order = Order.deserialize(fs.read(order_file)) try: server_order =", "'http': print(files) clean_http_challenges(files) sys...
[ "= F.one_hot(train_batch[SampleBatch.ACTIONS].long(), policy.action_space.n) q_t_selected = torch.sum(q_t * one_hot_selection, 1) # compute estimate of", "q_tp1_best_masked) # Compute the error (Square/Huber). td_error = q_t_selected - q_t_selected_target.detach() loss =", "# q scores for actions which we know ...
[ "u'yệ' : u'iɛ', u'uơ' : u'uə', u'uở' : u'uə', u'uờ': u'uə', u'uở' :", ": u'et' } N_onoffglides = { u'oe' : u'ej', u'oé' : u'ej', u'oè'", "fix #oe <-> uê -> fix oe from e to ɛ #âm cuối:", "for l in listParse: if len(l) <= len(text[ic:]) and l == text[ic:ic+len(l)]: output+=delimit+l", "u'ườu' : u'ɯəw', u'ưởu...
[ "'<NAME>' from django.contrib.sessions.base_session import AbstractBaseSession from django.contrib.sessions.backends.db import SessionStore as DBStore class CustomSession(AbstractBaseSession):", "class CustomSession(AbstractBaseSession): @classmethod def get_session_store_class(cls): return SessionStore class Met...
[ "a test for the sum_list_values function with list elements: # bill 23 16", "for assignment7 sum_list_values from src.assignments.assignment7 import sum_list_values class Test_Assign7(unittest.TestCase): def sample_test(self): self.assertEqual(1,1) #create", "16 19 22 def test_sum_w_23_16_19_22(self): test_list...
[ "Data to verify. Returns: bytes: The orignal message, sans signature. \"\"\" return self._verify_key.verify(message)", "KIND, either express or implied. # See the License for the specific language", "based on PyNaCl's SecretBox (Salsa20/Poly1305). Warning per the SecretBox docs: Once you’ve decrypted", "Unles...
[ "web browsers).\"\"\" bl_idname = 'LNDetectMobileBrowserNode' bl_label = 'Detect Mobile Browser' arm_version = 1", "bl_idname = 'LNDetectMobileBrowserNode' bl_label = 'Detect Mobile Browser' arm_version = 1 def init(self,", "\"\"\"Determines the mobile browser or not (works only for web browsers).\"\"\" bl_idna...
[ "self.domain_name, location_type_names, [], location_structure, ) self._dump_and_load(expected_object_counts) names = ['Cape Winelands', 'Paarl', 'Cape Town']", "permissions=Permissions(edit_web_users=True), assignable_by=[role1.id] ) self.addCleanup(role1.delete) self.addCleanup(role2.delete) self._dump_and_load...
[ "assert_allclose(result, true_result) def test_tanh(): test_values = get_standard_values() x = K.placeholder(ndim=2) exp = activations.tanh(x)", "used for testing the activation functions, and are useful in multiple tests. '''", "assert_allclose(result, expected, rtol=1e-05) def test_sigmoid(): ''' Test using a...
[ "# Open XMF files for step in range(start,finaltime+1,stride): XMFfile = open(basename+\".\"+str(step)+\".xmf\",\"w\") XMFfile.write(r\"\"\"<?xml version=\"1.0\"", "XMFfile.write (r' <DataItem DataType=\"Float\" Dimensions=\"' +str(len(tmp[:]))+ '\" Format=\"HDF\" Precision=\"8\">' + filename + ':/phid</DataItem>...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "@mock.patch(\"builtins.open\", mock.mock_open()) @mock.patch(\"aea.cli.generate.ConfigLoader\") @mock.patch(\"aea.cli.generate.os.path.join\", retur...
[ "docs, False if it should be included in the docs. \"\"\" has_doc =", "to Sphinx's default behavior. **If True**:: def __str__(self): \\\"\\\"\\\" This will be included", "\"sphinx.ext.napoleon\" is enabled in `conf.py`:: # conf.py # Add any Sphinx extension module", "which the docstring belongs. Valid values...
[ "import plugin_api __license__ = \"X11\" class LbvsEntry(plugin_api.PluginInterface): \"\"\" Compute Tanimoto similarity. \"\"\" def", "from rdkit import DataStructs import plugin_api __license__ = \"X11\" class LbvsEntry(plugin_api.PluginInterface): \"\"\" Compute", "= False def execute(self, files): query = L...
[ "proxy['port'] return { 'https': url } def get_origin_s_proxy(self, username): return global_config.s_proxy_dict[username] def get_static_proxy(self,", "proxy['port'] else: url = 'https://' + proxy['ip'] + ':' + proxy['port'] return {", "for i in range(0, int(self.LOW_WATER_MARK * 1) - len(self.proxies_list)): ...
[ "with no entries.\"\"\" rv = self.app.get('/') assert 'Nothing logged yet.' in rv.data def", "import unittest import tempfile class WeatherTestCase(unittest.TestCase): def setUp(self): self.db_fd, weather.app.config['DATABASE'] = tempfile.mkstemp() weather.app.config['TESTING']", "rv.data def test_full_db(self)...
[ "self.check_activator) def on_recv(self, pkt): if self.state == 'check_chinch' and self.future and pkt[0] ==", "print('checking act') if self.data: self.future.set_result(1) else: self.state = 'check_chinch' print('checking for chinch') def", "if self.state == 'chinch_ready' and self.future and pkt[0] == 0: sel...
[ "identical to qrels) # results = json.loads(requests.post(docker_beir_pyserini + \"/lexical/rm3/batch_search/\", json=payload).text)[\"results\"] #### Evaluate your", "(https://github.com/AdeDZY/DeepCT) as it only runs with TF 1.15. # We reformatted the code", "Image + FastAPI #### docker_beir_pyserini = \"http...
[ "False, False, False, False, True, True) truss.DefineReleases('BD', False, False, False, False, True, True,", "Truss - Nodal Load.py # Engineering Mechanics: Statics, 4th Edition # <NAME> #", "'Combo 1' since we didn't specify any. We'll display 'Case 1'. Visualization.RenderModel(truss, text_height=0.05,", "...
[ "= \"<EMAIL>\" #Receiver's gmail address body = \"Hello there from Yagmail\" filename =", "import yagmail receiver = \"<EMAIL>\" #Receiver's gmail address body = \"Hello there from", "\"Hello there from Yagmail\" filename = \"document.pdf\" yag = yagmail.SMTP(\"<EMAIL>\")#Your gmail address yag.send(", "there...
[ "Development until 2012 by Earth Systems Science Computational Center (ESSCC) # Development 2012-2013", "define an affine transformation *x->Ax+b*. \"\"\" def __init__(self): \"\"\" Creates a linear transformation.", "product of ``x`` and ``y``. \"\"\" return numpy.array([x[1] * y[2] - x[2] *", "Systems Scien...
[ "verbose = 2 eps = 1e-10 # Small epsilon to avoid r \\neq", "= Complex_Boson_Star(e_pow_minus_delta_guess, phi0, D, Lambda, verbose) pewpew.print_parameters() alpha0 = pewpew.radial_walker(Rstart, Rend, deltaR, N,", "pewpew.print_parameters() alpha0 = pewpew.radial_walker(Rstart, Rend, deltaR, N, eps) # =======...
[ "as f: license = f.read() with open('requirements.txt', encoding='utf-8') as f: reqs = f.read()", "reqs = f.read() pkgs = [p for p in find_packages() if p.startswith('fastNLP')] print(pkgs)", "python # coding=utf-8 from setuptools import setup, find_packages with open('README.md', encoding='utf-8') as f:", "f...
[ "be accessed with a valid Personal Access Token. Public APIs are mostly used", "import OpenApiException from ory_client.exceptions import ApiAttributeError from ory_client.exceptions import ApiTypeError from ory_client.exceptions import", "https://openapi-generator.tech \"\"\" __version__ = \"v0.0.1-alpha.187\"...
[ "`send_mock_outcome_request`. \"\"\" @abstractmethod def send_mock_outcome_request( self, url_outcome_endpoint: str, prediction_response: Response, info_from_prediction: dict, )", "-> Tuple[Response, dict]: \"\"\" Send a mock request to the provided url and", "__init__(self, is_for_mocker: bool = False): self.i...
[ "'192.168.1.1' #check it with boolean:(True) ip_addr == '192.168.1.1' #(false) ip_addr == '10.1.1.1' #is", "also get the last using negative notation. The follow gets the last: ip_addr[-1]", "ip_addr[-2] #show length of string: len(ip_addr) #Example string concatenation my_str = 'Hello' my_str", "in this vari...
[ "== '<Key>' and char != '' and self.bind_printing =='yes': # print 'printable key,", "self.bind_printing =='yes': # print 'printable key, bind-printing is yes',char,match # printable character without", "# for input the match mode any-char,char,any-line,line TEMPLATE=['','','',''] # CLASS VARIABLES (pp_kbddrive...
[ "3.2.6 on 2021-09-03 15:48 from django.db import migrations, models class Migration(migrations.Migration): dependencies =", "# Generated by Django 3.2.6 on 2021-09-03 15:48 from django.db import migrations, models", "'0002_alter_item_comments'), ] operations = [ migrations.AlterField( model_name='item', name='c...
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "the templates diffuse = Image.open(template[0]) mask = Image.open(template[1]) assert diffuse.size == mask.size width,", "2.0 - 1.0) * effectFac...
[ "env \"\"\" import os for k, v in os.environ.iteritems(): print k, '=', v", "\"\"\" test local env \"\"\" import os for k, v in os.environ.iteritems(): print", "test local env \"\"\" import os for k, v in os.environ.iteritems(): print k,", "local env \"\"\" import os for k, v in os.environ.iteritems(): print ...
[ "# evaluate each sf at all times ss_seq = [sf.Probs(ts) for sf in", "= resp.loc[resp.complete, 'complete_var'].dropna() ongoing = resp.loc[~resp.complete, 'ongoing_var'].dropna() hf = survival.EstimateHazardFunction(complete, ongoing) if cutoff:", "C1 #marital status: C5 #Respondent every married: CC227 pass de...
[ "continue else: yield reflections[i_begin:i] i_begin = i hkl_ref = hkl yield reflections[i_begin:i+1] @staticmethod", "reflection table keys: either inclusive or exclusive''' if len(reflections) != 0: all_keys =", "all_keys: #if not key in ['intensity.sum.value', 'intensity.sum.variance', 'miller_index', 'mille...
[ "rpython.translator.translator import TranslationContext t = TranslationContext() # XXX XXX XXX mess t.config.translation.gc =", "NB. Remember that the number above does not count # the number of", "run = self.runner(\"interior_ptrs\") res = run([]) assert res == 111111 def define_id(cls): class", "cls.ensure...
[ "from . import display from . import save from . import FFTW from", "import display from . import save from . import FFTW from . import", "display from . import save from . import FFTW from . import stackregistration", "from . import save from . import FFTW from . import stackregistration __version__=\"0.2.1\...
[ "KIND, either express or implied. # See the License for the specific language", "Choose from: - ``'neg'``: those queries count as ``0.0`` (default) - ``'pos'``: those", "Unless required by applicable law or agreed to in writing, software # distributed", "== \"neg\": res.append(tensor(0.0)) else: # ensure list...
[ "self.kf0.forwardFilter(dlm.model, None) self.assertAlmostEqual(dlm.model.obs[0, 0], 1.0) self.assertAlmostEqual(dlm.model.obsVar[0, 0]/1e10, 0.5) self.kf0.forwardFilter(dlm.model, 0) self.assertAlmostEqual(dlm.model.obs[0, 0], 0.0)", "builder from pydlm.base.kalmanFilter import kalmanFilter class testKalmanFilte...
[ "arcapix.fs.gpfs.rule import MigrateRule # load placement policy for mmfs1 policy = PlacementPolicy('mmfs1') #", "migrate rule for 'sata1' r = MigrateRule(source='sata1', threshold=(90, 50)) # add rule to", "r = MigrateRule(source='sata1', threshold=(90, 50)) # add rule to start of the policy", "new migrate r...
[ "python3 import sys depths = list(map(int, sys.stdin)) increased = [a > b for", "import sys depths = list(map(int, sys.stdin)) increased = [a > b for (a,", "depths = list(map(int, sys.stdin)) increased = [a > b for (a, b) in", "<reponame>tjol/advent-of-code-2021<gh_stars>1-10 #!/usr/bin/env python3 import sys...
[ "+ 1 db.session.add(paste) db.session.commit() # jsonify(success=True, paste=paste.to_dict()) return jsonify({'url': url}), 200 except: return", "# paste_to_delete.report_count = paste_to_delete.report_count + 1 # db.session.commit() # curr_id = session['user_id'] #", "user_id).first() x = user.paste_count user...
[ "dz=0.5, dradians=0) if COMMANDS[command_id] == \"take_off\": anafi.safe_takeoff(5) if COMMANDS[command_id] == \"land\": anafi.safe_land(5) return", "homemade_framework import framework as NN model = NN.Sequential([NN.Linear(input_size, hidden_size), NN.LeakyReLU(), NN.BatchNorm(), NN.Linear(hidden_size, hidden_s...
[ "#classifier = ImageSVC() #classifier.fit(train_data, train_labels) files = os.listdir(test_dir) for f in files: image", "8 June 2017 \"\"\" import numpy as np import matplotlib.pyplot as plt import", "from sklearn.utils import shuffle import os, fnmatch def classify_directory(classifier, test_dir, train_dir='t...
[ "from allennlp.common import JsonDict from allennlp.data import DatasetReader, Instance from allennlp.models import Model", "import overrides @Predictor.register(\"sentence_classifier\") class SentenceClassifierPredictor(Predictor): def predict(self, sentence: str) -> JsonDict: return self.predict_json({\"sentenc...
[ "(cipher_name, R) eqs += 'connection relations\\n' for r in range(R): xin = ['x_%d_%d'", "2, 3, 4, 5, 6, 7] tk1 = ['tk1_%d' % i for i", "else: eqs += '%s, %s\\n' % (xin[j + 4*i], y[j + 4*i]) #", "recommended_mg = 22 # recommended_ms = 35 # 6 rounds # recommended_mg =", "12, 11, 0, 1, 2, 3, 4, 5, 6, 7] tk1 =...
[ "get_end_time(self): pass def get_current_time(self): pass def get_time_step(self): pass def get_time_units(self): pass def get_grid_edge_count(self,", "pass def initialize(self, config_file): pass def update(self): pass def update_until(self, then): pass def", "pass def get_grid_size(self, grid_id): pass def g...
[ "import realize from .field import FuncField as BaseField class StringField( BaseField ): process_timing", "selector, key = None, value = None, **kwargs ): return { realize( selector,", "[ \"post_pack\" ] def __init__( self, key = None, value = None, selector", "StringField, self ).__init__( key = key, value ...
[ "import urllib.request import json from .models import News # Getting api key api_key", "news_details_response.get('original_author') title = news_details_response.get('title') description = news_details_response.get('description') url = news_details_response.get('url') urlToImage = news_details_response.get('url...
[ "# Enthalpy/Energy def he_(self): # [J/kg] he = [spTh.specie.Y * spTh.thermo.he for spTh", "= sp.X * n def rhoi_(self, rho=None, n=None, var='Y'): for spTh_ in self.spTh.values():", "for spTh in self.spTh.values() ] return np.sum(np.concatenate(dcpvdT)) def dhedY_(self, dY): # [J/kg] dhedY", "self.spTh.values...
[ "models from django.urls import reverse from datetime import date from django.contrib.auth.models import User", "ForeignKey (URL mapping, we use this to point to our class based views)", "len(MEALS) class Feeding(models.Model): date = models.DateField('feeding date') meal = models.CharField( max_length=1, choic...
[ "\"\"\" Kedro plugin for running a project with Airflow \"\"\" __version__ = \"0.5.0\"", "<gh_stars>1-10 \"\"\" Kedro plugin for running a project with Airflow \"\"\" __version__ =" ]
[ "import behavior import main import robocup import constants import time import math ##", "play, but it's pretty useful # Turn it on and we'll draw the", "__init__(self): super().__init__(continuous=True) self.add_transition(behavior.Behavior.State.start, behavior.Behavior.State.running, lambda: True, 'immediat...
[ ": float [Fe/H]-style metallicity (= 0.0 for solar) \"\"\" if Z <= 0:", "string. Parameters ---------- Z : float [Fe/H]-style metallicity (= 0.0 for solar) \"\"\"", "\"\"\" Convert a metallicity into a PHOENIX-style string. Parameters ---------- Z : float", "metallicity into a PHOENIX-style string. Parameters...
[ "def type(self, value): self._type = value @property def symbol(self): return self._symbol @symbol.setter def", "def completed_at(self): return self._completed_at @completed_at.setter def completed_at(self, value): self._completed_at = value @property def", "def __eq__(self, other): if self.completed_at != othe...
[ "np.array([[0.1] * event_size] * batch_size, dtype=np.float32) b_loc = np.array([[0.4] * event_size] * batch_size,", "# 10 x 1 laplace = tfd.Laplace(loc=loc_v, scale=scale_v, validate_args=True) n = 10000 samples", "KIND, either express or implied. # See the License for the specific language", "grad_scale] = ...
[ "import layout as layout_1 from app.dashapp1.callbacks import register_callbacks as register_callbacks_1 #from app.dashapp2.layout import", "import get_root_path from flask_login import login_required from flask_wtf.csrf import CSRFProtect from flask_admin import", "register_dashapp(server, 'dashapp1', 'dashboa...
[ "depends on the score, not how the mean depends on score, hence the", "self.observed_score_state = -opt_linearNoU.dot(_beta_unpenalized) self.observed_score_state[~overall] += self.loglike.smooth_objective(beta_bar, 'grad')[~overall] active_signs = np.sign(self.initial_soln) active = np.flatnonzero(active_signs)"...
[ "\\ stateseq_norep[np.where(stateseq_norep == SAMPLING)[0]+1] == k: temp -= 1 return temp ### label", "element is ((data,otherdata), (dur,otherdurs)) ''' # temporarily modifies members, like self.stateseq and maybe", "k == stateseq[t+1] else 0) + model._counts_fromto(k,stateseq[t+1]) + another_fromto) / (alpha+...