ngram
listlengths
0
82k
[]
[ "SubmitField('Sign Up') def validate_username(self, username): existing_username = User.query.filter_by(username=username.data).first() if existing_username:", "import StringField, PasswordField, SubmitField from wtforms.validators import InputRequired, Email, ValidationError", "from wtforms.validators import I...
[ "EDIT import komand import json class Component: DESCRIPTION = \"Creates", "a security policy with the default values\" class Input: NAME", "}, \"required\": [ \"name\" ] } \"\"\") def __init__(self): super(self.__class__,", "\"name\" class Output: ID = \"id\" class CreateSecurityPolicyInput(komand.Input): sc...
[ "\"lt\", \"value\": 2100} condition2 = {\"column\": \"city\", \"operator\": \"eq\", \"value\":", "= rule(conditions) condition1 = {\"column\": \"salary\", \"operator\": \"lt\", \"value\": 2100}", "\"value\": 2100} condition2 = {\"column\": \"city\", \"operator\": \"eq\", \"value\": \"London\"}", "[condition1,...
[ "messages based on data from party service\"\"\" if not messages:", "message.update({'@msg_to': [msg_to_details]}) else: logger.info(\"No details found for the message recipient\",", "the to actor is set to 'GROUP' all_conversation_types If set", "are a named tuple, but allow the conversation type only", "I...
[ "icons[self.value] if len(value) == 1: value = value[0] else: #", "rend_j = j + self.side_width if not col: col =", "= ' ' def __init__(self, icon=None): self.icon = icon or", "\"\"\" return cell.ascii_icon() def render(self): for row in self.cells: res", "%sx%s', self.full_width, self.full_width) self.cell...
[ "% expr.__class__.__name__) # blacklist all Matrix printing _print_SparseMatrix = \\", ": 'where', 'complex' : 'complex', 'contains' : 'contains', } def", "didn't define it, we could use StrPrinter's # version of", "_print_ImmutableDenseMatrix = \\ _print_MatrixBase def _print_Piecewise(self, expr): result = ...
[ "'business_id': 0, 'user_id': 0, 'postal_code': 0}: df_col = df[col].values na", "import datetime import re from collections import Counter from statistics", "\"\"\" import numpy as np import pandas as pd import", "if pd.isna(element): return np.nan elif isinstance(element, np.double): array = np.array(elemen...
[ "import Tk from tkinter import Entry from tkinter import Button", "b2.configure(command=lambda:show(\"8\")) b3=Button(text=\"9\",font=(\"\",25),bg=\"gray\",fg=\"white\",activebackground=\"yellow\") b3.place(x=215,y=55,width=100,height=50) b3.configure(command=lambda:show(\"9\")) b4=Button(text=\"+\",font=(\"\",25...
[ "return self.page.title class TourStep(Orderable): title = models.CharField(max_length=255) body = models.CharField(max_length=255)", "existing field ) subtitles_en = models.TextField( verbose_name=_('English subtitles'), null=True, blank=True,", "read list_page = ( ListPage.objects.ancestor_of(self) .filter(re...
[ "class Compose(AbstractTransform): \"\"\" Do transformation on input data with corresponding", "Default: True. Raises: TypeError: When 'transforms' is not a list.", "i.e, if height > width, then image will be rescaled", "``cv2.INTER_CUBIC``, bicubic interpolation \"\"\" def __init__(self, mode, size, interpol...
[ "in serialized_deposit assert serialized_deposit['mesh_terms'] == [ { 'data': {'source': 'MeSH',", "create_record( { 'terms': [ {'source': 'MeSH', 'value': 'Cognitive Neuroscience'}, {'source':", "serialize_terms_for_edit_ui(deposit) assert 'terms' not in serialized_deposit assert serialized_deposit['mesh_terms...
[ "def test_site(search: str): \"\"\"please enter site name with http information\"\"\"", "def bing_search(search: str): webbrowser.open_new_tab(f\"https://www.bing.com/search?q={search}\") def duck_search(search: str): webbrowser.open_new_tab(f\"https://duckduckgo.com/?q={search}\") def yahoo_search(search:", "n...
[ "66), lambda : key_by_guess(10, 67, 'y'), lambda : key_by_space(10, 68),", "ch_index) def key_by_guess(ct_index, ch_index, guess=' '): return strxor(MSGS_DECODED[ct_index][ch_index], guess) def", "max_len = 0 for i1, i2, c in comb: if", "for (x, y) in zip(a[:len(b)], b)])) #.encode('hex') else: return (\"\".j...
[ "ValueError('arms_sampled is empty!') unsampled_arm_name_list = [name for name, sampled_arm in", "we have three arms (arm1, arm2, and arm3) with expected", "the optimal arms arm1 and arm2. ``{arm1: 0.5, arm2: 0.5,", "in arms_sampled.iteritems() if sampled_arm.total == 0] return frozenset(unsampled_arm_name_li...
[ "') if text.strip() == \"\": continue result, error = Hedge.run('<stdin>',", "while True: text = input('Hedge > ') if text.strip() ==", "Hedge while True: text = input('Hedge > ') if text.strip()", "import Hedge while True: text = input('Hedge > ') if", "Hedge.run('<stdin>', text) if (error): print(error.as...
[ "* g.dds.prod(dtype=\"f8\") yield (ptype, field), data[mask] class IOHandlerPacked2D(IOHandlerPackedHDF5): _dataset_type =", "ftype, fname = field fsize = size rv[field] = np.empty(fsize,", "field): f = h5py.File(grid.filename, mode=\"r\") ds = f[\"/Grid%08i/%s\" % (grid.id,", "None for g in chunk.objs: if g....
[ "= argparse.ArgumentParser(description='Enumarate CIDR ranges') parser.add_argument('ranges', metavar='range', type=str, nargs='*', help='List of", "help='Sort CIDR ranges') args = parser.parse_args() if args.files: files =", "files: with open(f, \"r\") as fd: for l in fd.readlines():", "nargs='*', help='List...
[ "depth=18, pretrained=None, pretrained2d=False, norm_eval=False, conv_cfg=dict(type='Conv3d'), norm_cfg=dict(type='SyncBN', requires_grad=True, eps=1e-3), act_cfg=dict(type='ReLU'), conv1_kernel=(3,", "type=dataset_type_unlabeled, ann_file=ann_file_train_unlabeled, data_prefix=data_root, pipeline_weak=train_pipel...
[ "= [0,0,0,160,240] # 2nd byte common to both channels voltages", "voltages for display while not (channel == 1 or channel", "%.2fV\" % voltages[i] raw_input(\"When ready hit enter.\\n\") r = spi.xfer2([16,0])", "== \"m\": print \"jumper connecting GPIO 7 to CSB\" print", "py-spidev as in the README.txt file...
[ "a set of variables and redraw the status bar text.", "all information, which might get displayed in the status bar", "False def erase(self): \"\"\"Erase status bar text.\"\"\" self.view.erase_status('00_git_gutter') def update(self,", "__init__(self, view, settings): \"\"\"Initialize object.\"\"\" # the subl...
[ "-*- coding: utf-8 -*- from __future__ import unicode_literals from django.test", "import unicode_literals from django.test import TestCase class RandomTestCase(TestCase): def test_one_plus_one1(self):", "__future__ import unicode_literals from django.test import TestCase class RandomTestCase(TestCase): def", ...
[ "passowrd = sso.get_login_credentials(\"WATCHER\") # Open a sample video available in", "= cv2.VideoCapture('https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_2mb.mp4') #if not vcap.isOpened(): # print \"File Cannot be", "video windows before it ends if you want if cv2.waitKey(22)", "# log = l.s...
[ "= node_type super(NodeTypeNotFoundError, self).__init__(\"Node type '{}' does not exist.\".format(node_type)) class", "MalformedUpdateDictionaryError(GraphAPIError): status_code = status.HTTP_400_BAD_REQUEST class InvalidPropertyError(GraphAPIError): status_code = status.HTTP_400_BAD_REQUEST class", "GraphAPIE...
[ "# Author: LeonardoM011<<EMAIL>> # Created on 2021-02-05 21:56 # Set", "connect to binance with api keys.') def main(): output.print_ok('Starting kobe", "# time.sleep(5.0) # client.futures_create_order(symbol=\"BTCUSDT\", side=\"SELL\", type=\"STOP\", quantity=0.001, price=57975.0, stopPrice=57976.0, workingTyp...
[ "AGNs agn = ax.plot(pos_z_AGN[0], pos_z_AGN[1], '*', color='#fff717', markersize=6.5, label=r'AGN', markeredgecolor='w',", "plotTimeSinceMergerDist(scale_merger_AGN, scale_merger_gal, z_AGN, z_gal, cosmo, bin_size, redshift_limit): \"\"\" Plot the", "markeredgewidth=mew[i]) # DM halos j = i + 2 ax.plot(s_m_gal,...
[ "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "import TimeReadCsvTrueFalseValues # noqa: F401 class TimeReadCsvNames: shapes = get_benchmark_shapes(\"omnisci.TimeReadCsvNames\")", "ownership. The Modin Development Team licenses this file to you", "for shape in self.sh...
[ "= image_aug(tmp_data[i],angle) tmp_data[i] = tmp_ if model == \"uf\": train_x1", "x[indx[500:600],:]), axis=0) test_y = np.concatenate((test_y, y[indx[500:600]]), axis=0) return train_x1, train_y1,", "im_sz = int(np.floor(pic.shape[0]*scale)) pic_ = np.uint8(np.zeros((im_sz,im_sz,3),dtype=int)) pic_[:,:,0] = n...
[ "self.types = {} self.unique_vals = {} self.minmax = {} for", "= {} for col in X.columns: self.types[col] = X[col].dtype.name if", "self.max_nunique: self.unique_vals[col] = unique_values else: self.unique_vals[col] = None elif self.types[col]", "var_type = X[col].dtype.name if var_type != self.types[col]: se...
[ "== EXPECTED_RESULT def test_fetch_incidents_limit_exceed(mocker): \"\"\" Given - a dict of", "- Get new incidents is called during the fetch process.", "on invalid input such as days or no units relevant", "({'event_sources': \"\", 'abuse_disposition': \"\"}, [MOCK_INCIDENT]), ({'event_sources': \"No such so...
[ "os.path.isfile(methname_json): raise(\"passing not exist file \" + methname_json) if output_dir", "with different length may break the mach-o file, ori: \"", "from enum import Enum from .mach_o import LC_SYMTAB from macholib", "find __objc_methname section\") sect.section_data = replace_in_bytes( sect.sectio...
[ "def sd1(rr): sdnn = np.std(rr) return math.sqrt(0.5 * sdnn *", "import math import numpy as np def sd1(rr): sdnn =", "import numpy as np def sd1(rr): sdnn = np.std(rr) return", "<gh_stars>0 #!/usr/bin/env python import math import numpy as np def", "np def sd1(rr): sdnn = np.std(rr) return math.sqrt(0.5 * ...
[ "obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0", "LLC # # Licensed under the Apache License, Version 2.0", "2021 Google LLC # # Licensed under the Apache License,", "flow = client.flow_from_clientsecrets('client_secret.json', SCOPES) creds = tools.run_flow(flow, store) servic...
[ "x.parent = find_set(x.parent) return x.parent def find_python_set(node: Node) -> set:", "s raise ValueError(f\"{node.data} is not in {sets}\") def test_disjoint_set() ->", "bigger rank should be parent, so that the disjoint set", "the disjoint set tree will be more flat. \"\"\" x,", "x.parent = x def union...
[ "= np.kron(Identity, sigma_y) Iz = np.kron(Identity, sigma_z) SxIx = np.kron(sigma_x,sigma_z)", "sigma_y = 0.5*np.r_[[[0,-1j],[1j, 0]]] sigma_z = 0.5*np.r_[[[1, 0],[0, -1]]] Identity", "omega_I/(2.*np.pi)*B0*Iz + Aiso * (np.dot(Sx,Ix) + np.dot(Sy,Iy) + np.dot(Sz,Iz)) print('Hamiltonian:')", "E[3] E13 = E[0] -...
[ "reader = csv.reader(f) vm_q = [vm for vm in reader]", "spiderNest.preIntro import * path_ = os.path.dirname(os.path.dirname(__file__)) + '/dataBase/log_information.csv' def save_login_info(VMess,", "# ['2020-08-06 04:27:59', 'link','class_', '1'] vm_q = [vm for vm", "+ '/dataBase/log_information.csv' def sav...
[ "as sox except: raise RuntimeError(\"Can not install soxbindings on your", "audio segment to disk as wav file. :param filepath: WAV", "\" \"than audio duration.\") shift_samples = int(shift_ms * self._sample_rate /", "allow_downsampling: Whether to allow the noise signal to be downsampled", "infinite gain t...
[ "= tb.tb_lineno lines = [] try: with open(filename, 'rb') as", "= template.Loader(os.path.dirname(os.path.abspath(__file__))) t = loader.load('debug.html') return t.generate( traceback=traceback, pprint=pprint, handler=self.handler,", "None) implicit = getattr(exc_value, '__context__', None) return explicit or ...
[ "f = self.func v = f() if v == self.stopwhen:", "return len(self.l) def __list__(self): l = [] while True: try:", "[] while not self.stopped: try: l.append(self.__next__()) except StopIteration: break return", "self.i += 1 if found: return ret else: return None", "= True raise StopIteration() ret = self.l[s...
[ "lite_forms.components import Option class OpenGeneralExportLicences: class OpenGeneralLicence: def __init__(self, id,", "<reponame>code-review-doctor/lite-frontend-1 from lite_content.lite_internal_frontend.open_general_licences import ( OGEL_DESCRIPTION, OGTCL_DESCRIPTION, OGTL_DESCRIPTION, ) from", "name, de...
[ "\"\"\"RotateMatrix.ipynb Automatically generated by Colaboratory. Original file is located at", "temp = mat[i][j] mat[i][j] = mat[i][N - j - 1]", "in range(N): for j in range(N // 2): temp =", "10, 11, 12], [13, 14, 15, 16] ] rotate(mat) #printing", "coding: utf-8 -*- \"\"\"RotateMatrix.ipynb Automatically...
[ "for x in xs if x > pivot] res =", "x > pivot] res = quicksort(left) res.append(pivot) res += quicksort(right)", "return [] pivot = xs[0] xs = xs[1:] left =", "pivot] right = [x for x in xs if x", "[x for x in xs if x <= pivot] right", "= [x for x in xs if x <= pivot]", "res xs = [1, 3, 2, 4, 5, 2] sort...
[ "devops_pb2.TransactionRequest(transactionUuid = context.transactionID) response = stub.GetTransactionResult(txRequest, 2) assert response.status ==", "(channel, userRegistration) = getGRPCChannelAndUser(context, enrollId) stub = devops_pb2.beta_create_Devops_stub(channel) # Make", "enrollId supplied''' assert ...
[ "set_type == 'intersect': nofnd_l.append(k) else: raise IOError #=========================================================================== # wrap", "logger.warning('0 common values between d(%i) and l(%i)'%(len(d), len(l))) logger.debug('returning d", "# boolar = hp.basic.bool_list_in_list(d_big.keys(), l) # ...
[ "green + \"]\" + white + \" Discord\") print(green +", "\"[+] Github: https://github.com/Cyber-Dioxide/ \", \"- \" * 3) banner() def", "[\" + white + \"15\" + green + \"]\" +", "from Core.helper.color import green, white, blue, red, start, alert Version", "\"- \" * 4, \" [+] Follow me on Instagram", "prin...
[ "2.0 (the \"License\"); # you may not use this file", "Enter to continue.\\n\") # Validate challenges done, failed, pending =", "{}.\\n\".format( challenge.file_name)) fs.write(challenge_file, challenge.serialize().decode()) pending_challenges.append(challenge) # Quit if nothing to", "'dns': print(\"\\n DNS v...
[ "learner. \"\"\" def __init__(self): # Hard initial update from Q-net(s)", "return build_q_models(policy, obs_space, action_space, config), \\ TorchCategorical def build_q_losses(policy: Policy,", "(Policy): The Policy to calculate the loss for. model (ModelV2):", "`target_network_update_freq` steps by the ma...
[ "'r', 'b', 'ɯ', 'a', 's', 'ʐ', 'η', 'ŋ', 'ɒ', 'ʂ',", "'ʷen', 'ʷiu', 'ʷet', 'ɯəw', 'ʷɛ', 'ʷɤ', 'ɯj', 'oj', 'ăw', 'zi',", "u'gì' : u'ji', u'gì' : u'ji', u'gĩ' : u'ji', u'gị'", "ươ : ɯə1 xõa <-> xoã : swʷa3 ''' #Ở", "u'ô' : u'o', u'ố' : u'o', u'ồ' : u'o', u'ổ'", "list if str(char) in [\"ˈ\",\"ˌ\",\"*\"]: con...
[ "def get_session_store_class(cls): return SessionStore class Meta: db_name = 'deft_adcr' db_table", "SessionStore as DBStore class CustomSession(AbstractBaseSession): @classmethod def get_session_store_class(cls): return SessionStore", "'<NAME>' from django.contrib.sessions.base_session import AbstractBaseSessi...
[ "elements: # bill 23 16 19 22 def test_sum_w_23_16_19_22(self): test_list", "#write the import for function for assignment7 sum_list_values from src.assignments.assignment7", "assignment7 sum_list_values from src.assignments.assignment7 import sum_list_values class Test_Assign7(unittest.TestCase): def sample_te...
[ "= ('_signing_key',) def __init__(self, skey): self._signing_key = nacl.signing.SigningKey(skey, nacl.encoding.Base64Encoder) @staticmethod", "\"\"\" ciphertext = b64decode(ciphertext) if verifier: ciphertext = verifier.verifyb(ciphertext) data", "b64decode(ciphertext) if verifier: ciphertext = verifier.verifyb...
[ "(works only for web browsers).\"\"\" bl_idname = 'LNDetectMobileBrowserNode' bl_label =", "only for web browsers).\"\"\" bl_idname = 'LNDetectMobileBrowserNode' bl_label = 'Detect", "'LNDetectMobileBrowserNode' bl_label = 'Detect Mobile Browser' arm_version = 1 def", "web browsers).\"\"\" bl_idname = 'LNDete...
[ "]), ('Cape Town', [ ('Cape Town City', []), ]) ]),", "from corehq.messaging.scheduling.models import AlertSchedule, SMSContent, AlertEvent from corehq.messaging.scheduling.scheduling_partitioned.dbaccessors import \\", "form_id=uuid.uuid4().hex, ) self._dump_and_load(Counter({ CaseUploadFileMeta: 1, CaseUpload...
[ "def test_softsign(): ''' Test using a reference softsign implementation '''", "[activations.softmax(x)]) test_values = get_standard_values() result = f([test_values])[0] expected = softmax(test_values)", "(x * 0.2) + 0.5 z = 0.0 if x", "K.function([x], [activations.sigmoid(x)]) test_values = get_standard_val...
[ "filename + ':/p</DataItem>'+\"\\n\") XMFfile.write (r'</Attribute>'+\"\\n\") if tmp.name == \"phid\": XMFfile.write", "range(start,finaltime+1,stride): XMFfile = open(basename+\".\"+str(step)+\".xmf\",\"w\") XMFfile.write(r\"\"\"<?xml version=\"1.0\" ?> <!DOCTYPE Xdmf SYSTEM", "4\" Format=\"HDF\">' + filename ...
[ "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "# # Licensed under the Apache License, Version 2.0 (the", "compliance with the License. # You may obtain a copy", "an \"AS IS\" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF", "2.0 (the \"License\"); # you may not use th...
[ "it has a docstring \\\"\\\"\\\" pass def _skipped(self): # This", "Config: \"\"\"Sphinx napoleon extension settings in `conf.py`. Listed below are", "Also -------- :attr:`napoleon_use_admonition_for_examples` napoleon_use_ivar : :obj:`bool` (Defaults to False) True", "---------- arg1 : str Description of `ar...
[ "vector @staticmethod def _compute_similarity(left, right): return DataStructs.TanimotoSimilarity(left, right) def get_metadata(self)", "= False self._compute_and_write_similarity(query_item, database_item) def _write_separator_if_needed(self): if not self.first_entry: self.stream.write(\",\")", "self.counter =...
[ "= ['https://' + item['ip'] + ':' + item['port'] for item", "item in result: ip = item['IP'] port = str(item['Port']) url", "= global_config.s_proxy_dict[username] url = 'https://' + proxy['ip'] + ':' +", "global_config.s_proxy_dict[username] def get_static_proxy(self, username): if not global_config.static_p...
[ "datetime import unittest import tempfile class WeatherTestCase(unittest.TestCase): def setUp(self): self.db_fd,", "no entries.\"\"\" rv = self.app.get('/') assert 'Nothing logged yet.' in", "import tempfile class WeatherTestCase(unittest.TestCase): def setUp(self): self.db_fd, weather.app.config['DATABASE'] = ...
[ "class Activator: def __init__(self, name, packet_stream=None): self.ps = None self.name", "and self.future and pkt[0] == 0: self.future.set_result(1) def set_packet_stream(self, ps):", "0 self.state = '' if packet_stream: self.set_packet_stream(packet_stream) @_core.module_cmd def wait_activator(self):", "pr...
[ "<NAME>, <NAME>, (https://github.com/AdeDZY/DeepCT) model_url = \"http://boston.lti.cs.cmu.edu/appendices/arXiv2019-DeepCT-Zhuyun-Dai/outputs/marco.zip\" out_dir = os.path.join(pathlib.Path(__file__).parent.absolute(), \"models\")", "350 # Provide Max Sequence Length used for consideration. (Max:", "more detail...
[ "# Because the members in this example are nearly rigid,", "this example are nearly rigid, there will be virtually no", "100, 100, 100, 100, 100) truss.AddMember('BC', 'B', 'C', E, 100,", "Mechanics: Statics, 4th Edition # <NAME> # Problem 6.64 #", "False, True, True) truss.DefineReleases('BD', False, False...
[ "import yagmail receiver = \"<EMAIL>\" #Receiver's gmail address body =", "= \"<EMAIL>\" #Receiver's gmail address body = \"Hello there from", "gmail address body = \"Hello there from Yagmail\" filename =", "= yagmail.SMTP(\"<EMAIL>\")#Your gmail address yag.send( to=receiver, subject=\"Yagmail test (attachme...
[ "a translation *x->x+b*. \"\"\" def __init__(self,b=numpy.zeros((3,),dtype=_TYPE)): \"\"\" Creates the linear", "linear transformation *x->x+b*. \"\"\" super(Translation, self).__init__() self.__b=numpy.array(b,_TYPE) def __call__(self,x=numpy.zeros((3,))): \"\"\"", "self.__b=numpy.array(b,_TYPE) def __call__(s...
[ "Cosmological constant # Solver definitions Rstart = 3 Rend =", "<gh_stars>1-10 from bosonstar.ComplexBosonStar import Complex_Boson_Star # ===================== # All imporntnat", "50.00 deltaR = 1 N = 100000 e_pow_minus_delta_guess = 0.4999", "5.0 # Dimension (total not only spacial) Lambda = -0.2", "pewp...
[ "as f: license = f.read() with open('requirements.txt', encoding='utf-8') as f:", "with open('requirements.txt', encoding='utf-8') as f: reqs = f.read() pkgs =", "for p in find_packages() if p.startswith('fastNLP')] print(pkgs) setup( name='FastNLP', version='0.7.0',", "p.startswith('fastNLP')] print(pkgs) se...
[ "Access Token. Public APIs are mostly used in browsers. #", "ApiAttributeError from ory_client.exceptions import ApiTypeError from ory_client.exceptions import ApiValueError from", "ory_client.exceptions import ApiValueError from ory_client.exceptions import ApiKeyError from ory_client.exceptions import", "# ...
[ "the corresponding response. Provide the prediction response and extra information", "the bias attribute configs, these decide which attributes may be", "compute the reward\"\"\" @abstractmethod def get_module_version(self) -> str: \"\"\"Return the", "def compute_reward(self, outcome_request: dict) -> Compute...
[ "String type, which should be unicode type(my_str) #declare string: ip_addr", "#check it with boolean:(True) ip_addr == '192.168.1.1' #(false) ip_addr ==", "ip_addr '1.1' in ip_addr '15.1' not in ip_addr #Strings also", "the first character ip_addr[0] #we can also get the last", "for all strings. my_str = '...
[ "buffer pp_kbddriver_plus.inputs['previous-line'] = pp_kbddriver_plus.inputs['current-line'] pp_kbddriver_plus.inputs['current-line']='' pp_kbddriver_plus.inputs['current-character']='' if name !='': #", "self.event_callback('pp-key-'+ char,pp_kbddriver_plus.title) else: if name != '': # print 'bound", "a new l...
[ "on 2021-09-03 15:48 from django.db import migrations, models class Migration(migrations.Migration):", "[ migrations.AlterField( model_name='item', name='comments', field=models.CharField(blank=True, default='null', max_length=200), preserve_default=False, ), ]", "dependencies = [ ('grocery', '0002_alter_item_c...
[ "0.75), '800080': (0.5, 0.4, 0.5), 'FF00FF': (0.9, 0.75, 0.85), 'F5DEB3':", "create an image per color for colorString, color in colors.iteritems():", "2.0 (the \"License\"); # you may not use this file", "\"\"\"Generate textures prepared for OSM, based on image templates.\"\"\" import", "the effect, found ...
[ "import os for k, v in os.environ.iteritems(): print k, '=',", "os for k, v in os.environ.iteritems(): print k, '=', v", "env \"\"\" import os for k, v in os.environ.iteritems(): print", "\"\"\" import os for k, v in os.environ.iteritems(): print k,", "\"\"\" test local env \"\"\" import os for k, v", "te...
[ "# then join the cycles into one big sample sample", "= (df.marend01==4) df['widowed'] = (df.marend01==1) df['stillma'] = (df.timesmar== 1) &", "df.cmstphsbx.replace(invalid, np.nan, inplace=True) df.timesmar.replace([98, 99], np.nan, inplace=True) df['evrmarry'] = (df.timesmar", "df.firstcm df.cmmarrhx.filln...
[ "'intensity.sum.variance', 'miller_index', 'miller_index_asymmetric', 'exp_id', 'odd_frame', 's1']: if not key in", "merged_reflections.append( {'miller_index' : hkl, 'intensity' : weighted_mean_intensity, 'sigma' : standard_error_of_weighted_mean_intensity,", "continue else: yield reflections[i_begin:i] i_begi...
[ "self.GC_CAN_MOVE def define_shrink_array(cls): from rpython.rtyper.lltypesystem.rstr import STR def f(): ptr", "def define_nongc_static_root_minor_collect(cls): T1 = lltype.GcStruct(\"C\", ('x', lltype.Signed)) T2 = lltype.Struct(\"C\",", "ourselves, otherwise this test takes ages llop.gc__collect(lltype.Void)...
[ "utils from . import display from . import save from", "from . import save from . import FFTW from .", ". import display from . import save from . import", "import display from . import save from . import FFTW", "save from . import FFTW from . import stackregistration __version__=\"0.2.1\"", "display from...
[ "considers them all) compute_on_step: Forward only calls ``update()`` and return", ">>> indexes = tensor([0, 0, 0, 1, 1, 1, 1])", "only float tensors res.append(self._metric(mini_preds, mini_target)) return B.stack([x.to(preds) for x in", "1, 1, 1]) >>> preds = tensor([0.2, 0.3, 0.5, 0.1,", "with binary tar...
[ "= builder() dlm.add(seasonality(period=2, discount=1, w=1.0)) dlm.initialize() self.kf11.forwardFilter(dlm.model, 1) self.assertAlmostEqual(dlm.model.state[0][0, 0],", "dlm = builder() dlm.add(self.trend0) dlm.initialize() self.kf1.predict(dlm.model) self.assertAlmostEqual(dlm.model.prediction.obs, 0) # the", ...
[ "migrate rule for 'sata1' r = MigrateRule(source='sata1', threshold=(90, 50)) #", "to start of the policy policy.rules.insert(r, 0) # save changes", "arcapix.fs.gpfs.policy import PlacementPolicy from arcapix.fs.gpfs.rule import MigrateRule # load placement", "placement policy for mmfs1 policy = PlacementPoli...
[ "= [a > b for (a, b) in zip(depths[1:], depths[:-1])]", "= list(map(int, sys.stdin)) increased = [a > b for (a,", "#!/usr/bin/env python3 import sys depths = list(map(int, sys.stdin)) increased =", "<reponame>tjol/advent-of-code-2021<gh_stars>1-10 #!/usr/bin/env python3 import sys depths = list(map(int, sys.s...
[ "== url).first() if Paste.query.filter(Paste.url == url).first() != None: if is_active(paste):", "== url).first() user = User.query.filter(paste.user_id == User.id).first() if is_active(paste): return", "methods=['POST']) @requires_auth def get_all_pastes_object(): user_id = session['user_id'] user = User.query...
[ "if COMMANDS[command_id] == \"move_forward\": anafi.move_relative(dx=1, dy=0, dz=0, dradians=0) if COMMANDS[command_id]", "image, format: MinWidth,MaxWidth,MinHeight,MaxHeight.\\ Set -1 for the unchanged ones\" )", "imgs = [] while True: ret, frame = cam.read() if", "required=False, default=7, type=int, help=...
[ "image and labels from previous labelling session \"\"\" fname =", "mode='thick')) plt.title('segmented image') plt.subplot(1,2,2) plt.imshow(image) plt.imshow(labels, alpha=0.75) cb = plt.colorbar(orientation='horizontal',", "== -1] = 0 truth[truth == 0] = 5 truth[truth", "or directory (classify_directory())...
[ "str) -> JsonDict: return self.predict_json({\"sentence\": sentence}) @overrides def _json_to_instance(self, json_dict:", "import overrides @Predictor.register(\"sentence_classifier\") class SentenceClassifierPredictor(Predictor): def predict(self, sentence: str) ->", "JsonDict from allennlp.data import Dataset...
[ "[y[P[i]] for i in range(16)] # Generate MixColumn relations for", "5, 6, 10, 11, 8, 9, 13, 14, 15, 12]", "eqs = '#%s %d Rounds\\n' % (cipher_name, R) eqs +=", "# 2 rounds # recommended_mg = 16 # recommended_ms =", "Tweakey temp1 = tk1.copy() temp2 = tk2.copy() tk1 = [temp1[TKP[i]]", "i in range(16)] y = ...
[ "pass def get_grid_face_edges(self, grid, face_edges): pass def get_grid_node_count(self, grid): pass", "pass def initialize(self, config_file): pass def update(self): pass def update_until(self,", "def get_var_nbytes(self, var_name): pass def get_var_itemsize(self, name): pass def get_var_location(self,", "E...
[ "selector = None, **kwargs ): #unify value format if isinstance(", "format if isinstance( value, str ): value = { \"_type\":", ".field import FuncField as BaseField class StringField( BaseField ): process_timing", "None, selector = None, **kwargs ): #unify value format if", "key = key, value = value, select...
[ "movie base url base_url = None def configure_request(app): global api_key,base_url", "print(get_news_source_response) source_result = None if get_news_source_response['articles']: source_result_list = get_news_source_response['articles'] source_result", "function processes the results and converts them into a ...
[ "'X': M = [spTh.specie.X * spTh.specie.M for spTh in self.spTh.values()]", "# [J/kg] dcpvdT = [ spTh.specie.Y * spTh.thermo.dcpvdT for spTh", "return np.sum(np.concatenate(n)) # Enthalpy/Energy def he_(self): # [J/kg] he =", "[spTh.specie.Y * spTh.specie.R for spTh in self.spTh.values()] return np.sum(np.conc...
[ "1.1 - Add user as ForeignKey (URL mapping, we use", "def __str__(self): return self.name def get_absolute_url(self): return reverse('toys_detail', kwargs={'pk': self.id})", "Field.choice return f\"{self.get_meal_display()} on {self.date}\" # change the default sort", "models.TextField(max_length=250) age = m...
[ "Kedro plugin for running a project with Airflow \"\"\" __version__", "for running a project with Airflow \"\"\" __version__ = \"0.5.0\"", "plugin for running a project with Airflow \"\"\" __version__ =", "<gh_stars>1-10 \"\"\" Kedro plugin for running a project with Airflow", "\"\"\" Kedro plugin for runni...
[ "import constants import time import math ## This isn't a", "class DebugWindowEvaluator(play.Play): def __init__(self): super().__init__(continuous=True) self.add_transition(behavior.Behavior.State.start, behavior.Behavior.State.running, lambda: True, 'immediately')", "__init__(self): super().__init__(continuou...
[ "a metallicity into a PHOENIX-style string. Parameters ---------- Z :", "\"\"\" Convert a metallicity into a PHOENIX-style string. Parameters ----------", "for solar) \"\"\" if Z <= 0: return \"-{:03.1f}\".format(np.abs(Z)) else:", ": float [Fe/H]-style metallicity (= 0.0 for solar) \"\"\" if", "solar) \"\"...
[ "__init__(self, **kwargs): self._completed_at = kwargs.get('completed_at') self._type = kwargs.get('type') self._symbol =", "return False if self.amount != other.amount: return False return True", "def __init__(self, **kwargs): self._completed_at = kwargs.get('completed_at') self._type = kwargs.get('type') self...
[ "= tf.constant(0.0, name='scale') with self.assertRaisesOpError('Argument `scale` must be positive.'): laplace", "2.0 scale_v = 3.0 x = np.array([2.5, 2.5, 4.0, 0.1,", "= sp_stats.laplace.cdf(x, loc_v, scale=scale_v) self.assertAllClose(self.evaluate(cdf), expected_cdf) def testLaplaceLogCDF(self): batch_size =...
[ "dash from flask import Flask from flask.helpers import get_root_path from", "title, base_pathname, layout, register_callbacks_fun): # Meta tags for viewport responsiveness", "from pytz import timezone from config import BaseConfig csrf =", "app.dashapp2.callbacks import register_callbacks as register_callbac...
[ "= soln[group_mask] / norm(soln[group_mask]) ordered_opt.append(norm(soln[group_mask])) else: overall[group_mask] = False self.selection_variable", "proposed_value = objective(proposal) if proposed_value <= current_value: break step *=", "use_lasso=True, # should lasso solver be used when applicable -", "= bl...
[ "k in ks) fromto_counts = np.array([model._counts_fromto(self.stateseq[t-1],k) + self._counts_fromto(self.stateseq[t-1],k) for k", "self._occupied()) betarest = 1-sum(betavec[k] for k in ks) # get", "for k in ks) fromto_counts = np.array([model._counts_fromto(self.stateseq[t-1],k) + self._counts_fromto(self.sta...