ngram
listlengths
0
67.8k
[ "= (rato * 100) / contador porcsapo = (sapo * 100) / contador", "{contador} cobaias') print(f'Total de coelhos: {coelho}') print(f'Total de ratos: {rato}') print(f'Total de sapos:", "') t = t.upper() q = int(q) if 1 <= q <= 15:", "input().split(' ') t = t.upper() q = int(q) if 1 <= q <=", "n): q, t = input(...
[ "<NAME> <<EMAIL>> # License: MIT (see LICENSE file) from kivy.uix.boxlayout import BoxLayout from", "gravur.common.labelbox import LabelBox # NOQA from gravur.utils import load_widget @load_widget class AmountInput(BoxLayout): pass", "License: MIT (see LICENSE file) from kivy.uix.boxlayout import BoxLayout from...
[ "def as_datetime(cls, timestamp): return datetime.datetime.strptime(timestamp, cls.timestamp_format) @staticmethod def wrap_in_double_quotes(string): \"\"\"wrap a given string", "alphabetical|cpu|mem The commands are by default sorted alphabetically, but optionally can be sorted", "no top records will be filled...
[ "= 250 group = 'mygroup' dish.join(group) received_count = 0 received = set() sent", "str(i).encode('ascii') sent.add(msg) radio.send(msg, group=group) try: recvd = dish.recv() except zmq.Again: time.sleep(0.1) else: received.add(recvd)", "# Copyright (C) PyZMQ Developers # Distributed under the terms of the Mo...
[ "def __init__(self, error_code, error, request): self.error_code = error_code self.error = error self.request =", "error_code self.error = error self.request = request Exception.__init__(self, error) def __str__(self): return \"APIError:", "= request Exception.__init__(self, error) def __str__(self): return \"A...
[ "= 3 # 室外机 PropCallApp = 4 # 物业值守 PropSentryApp = 5 #", "主屏分离的室内主机 InnerScreen = 2 # 主屏分离的室内屏 OuterBox = 3 # 室外机 PropCallApp =", "= 5 # 物业岗亭机 Others = 10 ValidatedList = (1,2,3,4,5) class Constants(object): SUPER_ACCESS_TOKEN", "class SystemDeviceType(object): InnerBox = 1 # 主屏分离的室内主机 InnerScreen = 2 # 主屏分离的室...
[ "import patterns, url from django_qbe.exports import formats urlpatterns = patterns('django_qbe.views', url(r'^$', 'qbe_form', name=\"qbe_form\"),", "= patterns('django_qbe.views', url(r'^$', 'qbe_form', name=\"qbe_form\"), url(r'^js/$', 'qbe_js', name=\"qbe_js\"), url(r'^results/bookmark/$', 'qbe_bookmark', name...
[ "- half_thresh, img_h + np.random.randint(thresh) - half_thresh]) trans = WarpMLS(src, src_pts, dst_pts, img_w,", "for cut_idx in np.arange(1, segment, 1): move = np.random.randint(thresh) - half_thresh src_pts.append([cut *", "WarpMLS(src, src_pts, dst_pts, img_w, img_h) dst = trans.generate() return dst # def...
[ "return self.resultPaths def dfsUtil(self, current_vertex, visitedVertices, target_vertex, output_string): visitedVertices[current_vertex] = True if output_string", "+ current_vertex if current_vertex == target_vertex: self.resultPaths.append(output_string) return for vertex in self.graph[current_vertex]: if", ...
[ "making blocks with list testlist=bl.read('csvs/blocks_example.csv') blocks2=bl.make_line(testlist,list=True) # testing each bloocks geojson against each", "# making blocks with csv file location blocks1=bl.make_line('csvs/blocks_example.csv') # making blocks with list", "each other ind=0 for a,b in itertools.i...
[ "import partial main_dir = '/Volumes/behavgenom_archive$/Celine/raw/' fnames = glob.glob(os.path.join(main_dir, '**', '*.avi')) fnames = [x", "= [] for ii, video_file in enumerate(fnames): print(ii, video_file) vid = cv2.VideoCapture(video_file) vid.release()", "in enumerate(fnames): print(ii, video_file) vid =...
[ "devito.passes.iet.definitions import DataManager from devito.passes.iet.langbase import LangBB __all__ = ['CBB', 'CDataManager'] class CBB(LangBB):", "'__attribute__((aligned(%d)))' % i, 'host-alloc': lambda i, j, k: Call('posix_memalign', (i, j, k)), 'host-free':", "Call('posix_memalign', (i, j, k)), 'host-fr...
[ "= h1.tensor(h2) return im.reduce(f).expand(f) im1 = im.reduce(_filter) rec1 = _f(im1, _filter) + _f(im1,", "_f(im, _filter) rec1 = _f(im1, _filter) + _f(im1, _filter.H) + _f(im1, _filter, _filter.H)", "* import numpy as np _filter = Filter.from_name('db4') def test_resize(): chennal=0 c =", "_filter = Filter...
[ "= transform else: self.transform = get_default_transform() self.sequence = TubSequence(records) self.pipeline = self._create_pipeline() self.len", "[0.229, 0.224, 0.225] input_size = (224, 224) if for_video: mean = [0.43216, 0.394666,", "to the data \"\"\" self.config = config # Handle the transforms if transf...
[ "os from tornado.template import Template __SNIPPET__ = os.path.join(os.path.dirname(os.path.abspath(__file__)), '_snippet') def T(name, **kw): t", "tornado.template import Template __SNIPPET__ = os.path.join(os.path.dirname(os.path.abspath(__file__)), '_snippet') def T(name, **kw): t = Template(open(os.path.join...
[ "import homeassistant.helpers.config_validation as cv from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_NAME,", "= 'device' ATTR_MODEL = 'model' DEFAULT_HOST = 'localhost' DEFAULT_PORT = 7634 DEFAULT_NAME =", "vol.Optional(CONF_HOST, default=DEFAULT_HOST): cv.str...
[ "sent_array = sentence.split() if seed in (1, 2, 3): return sentence elif seed", "sentence = prefix[random.randint(0, len(prefix) - 1)] + sentence else: sentence += suffix[random.randint(0, len(suffix)", "if random.randint(1,10) <= 7: words[i] += \"...\" return \" \".join(words) def boomer_caps(sentence): seed"...
[ "**kwargs): context = request.data bot = TelegramBot(context) user, _ = User.objects.get_or_create( id=bot.sender['id'], defaults={", "= User.objects.get_or_create( id=bot.sender['id'], defaults={ 'first_name': bot.sender['first_name'], 'last_name': bot.sender.get('last_name', ''), 'username': bot.sender.get('use...
[ "- mask) * background # save_images path = join(sample_path, f'{y}_1_premask_' + ep_str +", "mask) * background # save_images path = join(sample_path, f'{y}_1_premask_' + ep_str + '.png')", "tqdm import tqdm import argparse import torch from torch import nn, optim from", "save_samples = save_sample_single if ...
[ "name='index'), path('about', views.about, name='about'), path('projects', views.projects, name='projects'), path('photos', views.photos, name='photos'), re_path(r'^api/projects/$', views.ProjectList.as_view()), re_path(r'^api-token-auth/',", "rest_framework.authtoken.views import obtain_auth_token urlpatterns = ...
[ "from six.moves import urllib from kiwi.store.tracking.file_store import FileStore class PluginFileStore(FileStore): \"\"\"FileStore provided through", "PluginFileStore(FileStore): \"\"\"FileStore provided through entrypoints system\"\"\" def __init__(self, store_uri=None, artifact_uri=None): path = urllib.parse....
[ "0, 0), 2.0: (255, 255, 255, 20), 3: '#ffffff', 4: 'abcabc'} rv =", "assert rv.status_code == 400 explicit_cmap = [(255, 255, 255)] rv = client.get(f'/singleband/val11/x/val12/{z}/{x}/{y}.png?colormap=explicit' f'&explicit_color_map={urlsafe_json(explicit_cmap)}')", "= Image.open(BytesIO(rv.data)) assert np.asa...
[ "that n^m < x max_power = 0 while output_base ** (max_power + 1)", "represent numbers: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ n can be an int if input_base <= 10, and", "be an int if input_base <= 10, and a string otherwise. The result", "input_base to base output_base. The following s...
[ "(DAGCircuit): the DAG to be optimized. Returns: DAGCircuit: the optimized DAG. \"\"\" diagonal_1q_gates", "decomposed. \"\"\" # Walk through the DAG and expand each node if required", "DAG and expand each node if required for node in dag.op_nodes(): if isinstance(node.op,", "qubits. \"\"\" def __init__(self,...
[ "#final mu value, smaller leads to higher accuracy delta, #l2 error bound. This", "function is less than TolVar stopTest == 2 : stop with the l_infinity", "identity(x): return x def IAFNNESTA(b,sig_size=0,A=identity,At=identity,muf=0.0001,delta=0,L1w=1,L2w=0,verbose=0,MaxIntIter=5,maxit=1000,x0=[],U=identity,Ut...
[ "exc.NoResults(self) def _resolve_all(self, resolver): for id_ in self.ids: yield resolver(id_) def all(self, resolve=True):", "\"\"\"See IIndexedDocuments\"\"\" not_indexed = self.not_indexed() indexed = self.indexed() if len(not_indexed) == 0: return", "a default resolver. NB: although the default implementat...
[ "max_length=50)), ('sqft', models.IntegerField()), ('open_house', models.BooleanField(default=False)), ('photo_main', models.ImageField(upload_to='photos/%Y/%m/%d')), ('photo_1', models.ImageField(blank=True, upload_to='photos/%Y/%m/%d')), ('photo_2', models.ImageField(blank=True, upload_to='photos/%Y/%m/%d')),", ...
[ "import asyncio import discord # Just with a function to add to the", "def on_message(message): if not message.author.bot: await message.channel.send(f\"{message.author.mention} a envoyé un message!\") # A", "message.channel.send(f\"{message.author.mention} a envoyé un message!\") # A Listener already created w...
[ "Expected query string is 'midi_file_name', such as 1234.midi \"\"\" performance_midi_file_name = request.args.get('midi_file_name') performance_midi_file_name", "get_performance_path(performance_midi_file_name) if not os.path.exists(midi_file_path): return { \"http_code\": 404, \"code\": \"Not Found\", \"message...
[ "as dbc import dash_core_components as dcc import dash_html_components as html import plotly.graph_objects as", "cases per day\", secondary_y=True, range=[0, 1000]) # fig = go.Figure( # data=[ #", "dash.Dash(__name__, external_stylesheets=external_stylesheets) app.layout = serve_layout if __name__ == '__main__'...
[ "schema = SystemAPISchema data_layer = {\"class\": APIData, \"type\": \"system\", \"model\": System, \"db\": db,", "APIData, # \"type\": \"system\", # \"model\": System, # \"db\": db, # \"model_info\": model_info", "\"class\": APIData, # \"type\": \"system\", # \"model\": System, # \"db\": db, # \"model_info\":...
[ "The Test S1Test 06 1 The Somewhat Long Name Of The Test S1Test", "Quarter Should Be Equal ${SCALAR} Hello, globe! Second And Half Should Be Equal", "sit amet, consectetur adipiscing elit. Mauris eu velit nunc. Duis eget purus eget", "S1Test 05 1 The Somewhat Long Name Of The Test S1Test 06 1", "], cwd=self...
[ "latin-1 -*- \"\"\"Setup script.\"\"\" try: from setuptools import setup except ImportError: from distutils.core", "setup except ImportError: from distutils.core import setup try: import pageviewapi version = pageviewapi.__version__", "[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Intended Audi...
[ "print(\"Farenheit of \" + str(f) + \" is \" + str(fa) + \"", "c_to_k(c): k = c + 273.15 #Formula to convert Celsius to Kelvin return", "fa = f_to_c(f) print(\"Celsius of \" + str(c) + \" is \" +", "return fa c = 25.0 f = 100.0 k = c_to_k(c) fa =", "program is to convert Celsius to Kelvin def c_to_k(c): k =...
[ "form_class = ContactUsForm success_url = reverse_lazy('contact') def get_initial(self): initial = super(ContactUsView, self).get_initial() #", "user is a wikipedia editor. try: assert self.request.user.editor email = form.cleaned_data['email'] message =", "initial = super(ContactUsView, self).get_initial() # @...
[ "\"frontend.config.Production\", \"default\": \"frontend.config.Development\", } def configure_app(app): \"\"\"Configures the Flask app according to the", "False TESTING = False LOGGING_FORMAT = \"[%(asctime)s] %(levelname)s in %(message)s\" LOGGING_LOCATION = \"frontend.log\"", "class Production(Base): \"\"\"C...
[ "parse_arg(arg): if isinstance(arg, list): return [parse_arg(a) for a in arg] else: return (", "JsonTest jsontest_files = path.join('tests', 'aggregates') jsontest_function = lambda self, test_name, test_data: ( _test_query(self,", "self.assertRaises(NoAggregateError): Aggregate.doesnotexist() def test_no_sugge...
[ "'./checkpoints/fashion_PATN/latest_net_netG.pth' save_path = './checkpoints/fashion_PATN_v1.0/latest_net_netG.pth' states_dict = torch.load(ckp_path) states_dict_new = states_dict.copy() for key in", "ckp_path = './checkpoints/fashion_PATN/latest_net_netG.pth' save_path = './checkpoints/fashion_PATN_v1.0/latest_...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "\\ actionlib.SimpleActionServer('move_to_bin_right', BinToteMoveAction, execute_cb=self.cb_move_to_bin_right, auto_start=False) self.srv_lowlevel_le...
[ "format_time(member.created_at) embed.set_footer(text=f\"{member.name} Created on {created}\") ch = self.bot.get_channel(int(chrow[0])) await ch.send(embed=embed) await cursor.close() @commands.Cog.listener()", "= await cursor.fetchone() if chrow is None: return else: msgrow = await self.bot.db.execute(f\"SELECT"...
[ "i == 0: return i return n def prime_factors(n, lowest): pf = []", "in numbers)) number, all_factors = prime_factors_of_number_with_lowest_prime_factor(numbers) print(' The one with the largest minimum", "2 search_max = int(floor(sqrt(n))) + 1 for i in range(_start, search_max, 2): if", "//= lowest lowest = l...
[ "import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='Project: Nowcasting the air pollution using", "find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='Project: Nowcasting the air pollution using online", "name='src',...
[ "the last ten digits of the series, 1^1 + 2^2 + 3^3 +", "+ ... + 1000^1000. \"\"\" def main(): max_digits = 1000 sum = 0", "2^2 + 3^3 + ... + 1000^1000. \"\"\" def main(): max_digits = 1000", "+ 3^3 + ... + 1000^1000. \"\"\" def main(): max_digits = 1000 sum", "ten digits of the series, 1^1 + 2^2 + 3^3 + .....
[ "import os from pyspark.sql import SparkSession os.environ['JAVA_HOME'] = '/root/jdk' os.environ['SPARK_HOME'] = '/root/spark' os.environ['PYTHON_HOME']", "sc logFile = \"/root/spark/README.md\" spark = create_spark_context() logData = spark.read.text(logFile).cache() numAs = logData.filter(logData.value.contains...
[ "xIntervalli.append(xIntervallo) yIntervalli.append(effe(xIntervallo)) i += 1 areaSottesa = 0.0 for altezza in yIntervalli: areaSottesa", "input('inserire il numero di intervalli in [0.0, 1.0] ') deltaIntervallo = 1.0 /", "1.0] ') deltaIntervallo = 1.0 / float(numIntervalli) print \"larghezza intervallo\", delt...
[ "ast.arguments( args=[ ast.arg(arg=\"json\", annotation=ast.Name(id=\"str\")), ast.arg(arg=\"only\", annotation=None), ], vararg=None, kwonlyargs=[], kw_defaults=[], kwarg=None, defaults=[ast.NameConstant(value=None)], )", "parent_dict.get(\"prop\") Primative nested list -> self.prop = parent_dict.get(\"prop\") N...
[ "declared. POSTCONDITIONS: A 3x3 ESMP_Mesh has been created. 3x3 Mesh 3.0 2.0 13", "exUB_center[1]): for i0 in range(exLB_center[0], exUB_center[0]): #print '[{0},{1}]'.format(gridXCenter[p], gridYCenter[p]) p = p +", "9 | | | | | 2.5 1.5 9 ------- 10 --------11--------12 |", "23:00:14 rokuingh Exp $ #=======...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "import sklearn.neighbors # class that follows scikit-learn conventions but lacks schemas, # for", "KIND, either express or implied. # See the Lice...
[ "make for interesting tweets. s = re.sub(r'http[\\S]*', '', s) # Replace some common", "s: String ''' # Return None if given tweet is a retweet if", "by ensuring false ascii encoding for _, value in enumerate(document): output.write(json.dumps(value, ensure_ascii=False) +", "r\"\", s) # Collapse multiples of ...
[ "f.write(str(polydets[i][1][j][k][0])+\" \"+ str(polydets[i][1][j][k][1])+\" \"+ str(polydets[i][1][j][k][2])+\" \"+ str(polydets[i][1][j][k][3])+\" \"+ str(polydets[i][1][j][k][4])+\" \"+ str(polydets[i][1][j][k][5])+\" \"+ str(polydets[i][1][j][k][6])+\"", "= bt.obb2poly(data[k][0:5]) poly=np.append(poly,data[k...
[ "tmp initializer def __init__(self, res, x0, y0, z0, x1, y1, z1): self.res =", "x1) self.y1 = int(res * y1) self.z1 = int(res * z1) @ti.kernel def", "res, x0, y0, z0, x1, y1, z1): self.res = res self.x0 = int(res", "\\ j >= self.y0 and j <= self.y1 and \\ k >= self.z0", "self.x1 = int(res * x1) self.y1 = in...
[ "from bifrost.pipeline import TransformBlock from bifrost.ndarray import copy_array class CopyBlock(TransformBlock):# $\\tikzmark{block-start}$ \"\"\"Copy the", "bf.BlockChainer() bc.blocks.read_wav(['hey_jude.wav'], gulp_nframe=4096) bc.custom(copy_block)(space='cuda')# $\\tikzmark{gpu-start}$ bc.views.split_axi...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "or # implied. # See the License for the specific language governing permissions", "OR CONDITIONS OF ANY KIND, either express or # implied. # See t...
[ "json your_json = '[\"foo\", {\"bar\":[\"baz\", null, 1.0, 2]}]' parsed = json.loads(your_json) print(type(your_json)) print(type(parsed))", "'[\"foo\", {\"bar\":[\"baz\", null, 1.0, 2]}]' parsed = json.loads(your_json) print(type(your_json)) print(type(parsed)) #print(json.dumps(parsed, indent=4, sort_keys=True)...
[ "in all_services.results: row += 1 sheet.write(row, 0, service.name) sheet.write(row, 1, service.email) sheet.write(row, 2,", "invalidate_cache from mcfw.consts import REST_TYPE_TO from mcfw.exceptions import HttpBadRequestException, HttpForbiddenException, HttpNotFoundException from mcfw.restapi", "', '-')) co...
[ "16)) f = FITSFigure(data) f.add_grid() f.grid.hide() f.grid.show() f.close() def test_grid_spacing(): data = np.zeros((16,", "= np.zeros((16, 16)) f = FITSFigure(data) f.add_grid() f.grid.hide() f.grid.show() f.close() def test_grid_spacing(): data", "f.close() def test_grid_linestyle(): data = np.zeros((16, 1...
[ "// 'git checkout $@' // 'git checkout $(SHADOW) -- $(MERGE)' ) self.mk.merge \\", "self.editor) def tasks(self): self.tasks = jsonFile('tasks'); self.vscode // self.tasks def task(clazz, cmd): return", "all') )) # self.files = (Sec() // f'\"{self}/**\":true,' ) self.exclude = \\ (Sec()", "wc -l)' # self.mk.d...
[ "f'{model_file_name}.pkl') classes = model.data.classes return model, classes loop = asyncio.get_event_loop() tasks = [asyncio.ensure_future(setup_learner())]", "exists will reuse md5sum: %s\", model_file, hashsum(model_file)) # Loading the saved model using", "logging.info(\"File %s already exists will reuse m...
[ "receive\") while True: connectionSocket,addr = serverSocket.accept() sentence = connectionSocket.recv(1024).decode() sentence = sentence.upper() connectionSocket.send(sentence.encode())", "serverSocket.listen(1) print(\"the server is ready to receive\") while True: connectionSocket,addr = serverSocket.accept() s...
[ "\"\"\" Instantiate LocalWorkflow class. \"\"\" self._job = job self._config = config self._parsed_job_work_uri =", "= parsed_job_work_uri def initialize(self): \"\"\" Initialize the LocalWorkflow class. This workflow class has", "that represents the Local Workflow objects. \"\"\" def __init__( self, job, confi...
[ "pct_start=0.5, div_factor=10.0, final_div_factor=10000 ): \"\"\"Create One Cycle Policy for Learning Rate. Args: optimizer", "Number of epoch with no improvement after which learning rate will be will", "last_epoch=-1): \"\"\"Create LR step scheduler. Args: optimizer (torch.optim): Model optimizer. step_size (...
[ "zonez = zones.buildZones(r.core, cs) self.assertEqual(len(list(zonez)), 3) zone = zonez[\"ring-3\"] self.assertEqual(len(zone), 30) # rings", "to ensure that our assem does not have a zone anymore self.assertEqual(daZones.findZoneAssemblyIsIn(a), None)", "KIND, either express or implied. # See the License for ...
[ "<filename>islam_fitz/survey/migrations/0005_auto_20210712_2132.py<gh_stars>0 # Generated by Django 3.1.12 on 2021-07-12 19:32 from django.db import migrations,", "from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('survey', '0004_lastpage_whatsapp_button'), ]", "b...
[ "<filename>Examples/WorkingWithOutlookMSGs/CreateAndSaveOutlookNote.py<gh_stars>1-10 import aspose.email.mapi.msg as msg from aspose.email.mapi import MapiNote, NoteSaveFormat, NoteColor def run():", "note3.width = 500 note3.save(dataDir + \"CreateAndSaveOutlookNote_out.msg\", NoteSaveFormat.MSG) #ExEnd: CreateAn...
[ "Union, Generic, Mapping, TypeVar, Callable, Optional, Sequence, cast, overload, ) if TYPE_CHECKING: from", "@overload def __init__( self: \"MessageTemplate[TM]\", template: Union[str, TM], factory: Type[TM] ) -> None:", "template, factory=str) -> None: self.template: TF = template self.factory: Type[TF] = fact...
[ "<gh_stars>1-10 # -*- coding: utf-8 -*- def main(): s, t, u = map(str,", "== 5 and len(t) == 7 and len(u) == 5: print('valid') else: print('invalid')", "main(): s, t, u = map(str, input().split()) if len(s) == 5 and len(t)", "s, t, u = map(str, input().split()) if len(s) == 5 and len(t) ==", "u = map(str, i...
[ "courses = ['语文', '数学', '英语'] # 录入五个学生三门课程的成绩 scores = [[None] * len(courses) for", "scores = [[None] * len(courses) for _ in range(len(names))] for row, name in", "嵌套的列表的坑 \"\"\" names = ['关羽', '张飞', '赵云', '马超', '黄忠'] courses = ['语文', '数学',", "\"\"\" 嵌套的列表的坑 \"\"\" names = ['关羽', '张飞', '赵云', '马超', '黄忠'] cour...
[ "phones_length.append(len(phone_feature)) if self.streaming: reduce = self.speech_config['reduction_factor'] * (self.speech_featurizer.sample_rate / 1000) * \\ self.speech_config['stride_ms']", "1 in_len *= chunk_times py = self.text_to_vocab(txt) if self.check_valid(py, self.phone_featurizer.vocab_array) is not ...
[ "nullable=True)) op.add_column('page', sa.Column('secondary_source_2_disclosure_control', sa.TEXT(), autoincrement=False, nullable=True)) op.add_column('page', sa.Column('secondary_source_2_publisher_text', sa.TEXT(), autoincrement=False, nullable=True)) op.add_column('page', sa.Column('secondary_source_2_contact_1...
[ "from lib.core import installer def options(): argv = sys.argv[1:] try: opts, args =", "parameter is missing please check!\") time.sleep(2) banner.usage() sys.exit() except getopt.GetoptError as err: print(err)", "= sys.argv[1:] try: opts, args = getopt.getopt(argv, 'm:t:c:o:n:whi', ['mode','task','country','ou...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "from mistral.tests.unit import base from mistral.utils import ssh_utils from mistral_lib import utils class", "C(A): pass class D(C): pass self.as...
[ "session = _init_session(session) url = tunein_url.format(base=base, id=station_id) response = session.get(url) if response.status_code ==", "session=None): session = _init_session(session) url = tunein_url.format(base=base, id=station_id) response = session.get(url) if response.status_code", "= session.get(req...
[ "settings import sys class Command(BaseCommand): def handle(self, *args, **options): sys.stdout.write(\"\\nResolving app groups\") app_list", "def handle(self, *args, **options): sys.stdout.write(\"\\nResolving app groups\") app_list = [app_name.lower() for app_name in", "BaseCommand, no_translations from djang...
[ "curs.fetchone() #在数据库中添加一条记录 def put_record(self, record): if self.db_file == ':memory:': self.merge_items([record]) return if not", "of object rows to delete :param sync_timestamp: max update_at timestamp of sync rows", "Unless required by applicable law or agreed to in writing, software # distributed", "ob...
[ "else: self.regex = regex if not hint: self.hint = self.generate_enum_hint() else: self.hint =", "value against prop limit regex. Args: value (str): Value to validate against prop", "Used if no explicit property is given and prop type is ``int``. POSITIVE_INT_PROP_LIMIT:", "props. PRESSURE_PROP_LIMIT: PropLim...
[ ">>> def override_c(*args, **kwargs): ... sig = inspect.signature(override) ... ba = sig.bind(*args, **kwargs)", "for unspecified kwonlyargs only. # Since keyword only arguements aren't allowed in python2,", "varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations) def bindcallargs_leq32(_fUnCtIoN_, *...
[ "os.path.abspath(os.path.join(__file__, os.path.pardir, 'atoms', \"gaia_apps.js\")) self.marionette.import_script(js) result = self.marionette.execute_async_script(\"GaiaApps.kill('%s');\" % app.origin) assert result, \"Failed", "WiFi' def connect_to_wifi(self, network=None): network = network or self.testvars.ge...
[ "// Firefox 3 expects getBoundingClientRect if ( typeof elem.getBoundingClientRect == 'function' ) {", "= null; } } else if (elem.isSameNode($wnd.__captureElem)) { $wnd.__captureElem = null; } \"\"\")", "// border. # try { # return $doc.getBoxObjectFor(elem).screenX # - $doc.getBoxObjectFor($doc.documentElement...
[ "1.9.6 on 2016-06-10 21:25 from __future__ import unicode_literals from django.db import migrations, models", "django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('vendors', '0089_auto_20160602_2123'), ] operations", "21:25 from __future__ import unicode_literals from dj...
[ "x in dfs.preorder[::-1]: for y in graph[x]: if y == dfs.parent[x]: continue lower[x]", "i, x in enumerate(dfs.preorder): order[x] = i lower = order[:] for x in", "= i lower = order[:] for x in dfs.preorder[::-1]: for y in graph[x]:", "in enumerate(dfs.preorder): order[x] = i lower = order[:] for x in dfs.pre...
[ "Exception(\"Nao foi possivel se conectar ao B.D.\") print(\"Conectado a\", string_conexao) def grava_filmes(self, lista_filmes):", "class Mongo_Database: \"\"\" Singleton com a conexao com o MongoDB \"\"\" _instancia =", "if not(cls._instancia): cls._instancia = super(Mongo_Database, cls).__new__(cls, *args, *...
[ "if (pycom.nvs_get(key) == None): pycom.nvs_set(key, value) def addWakeUpPin(self, pin): # P2, P3, P4,", "utime from exceptions import Exceptions class Sleep: @property def wakeReason(self): return machine.wake_reason()[0] @property", "return self.__inactiveTime ACTIVE_TIME_KEY = 'activeTime' INACTIVE_TIME_KEY ...
[ "prediction['id'] q_p_id = prediction['question_id'] # score = prediction['pos_score'] score = prediction['pos_score'] - prediction['neg_score']", "question_scores or q_p_id not in question_scores[doc_pass_id]: p_count += 1 u_count += 1 question_scores[doc_pass_id][q_p_id]", "predictions') print(f'{u_count} tot...
[ "prazo = int(input('Quantos meses deseja pagar ? ')) parcela = casa/prazo margem =", "seu salario? ')) prazo = int(input('Quantos meses deseja pagar ? ')) parcela =", "margem = sal* (30/100) if parcela > margem: print('Este negocio não foi aprovado,", "print('Este negocio não foi aprovado, aumente o prazo .')...
[ "('photo3', models.ImageField(blank=True, upload_to='photos/company/roadmap')), ], options={ 'verbose_name': 'roadmap', 'verbose_name_plural': 'roadmaps', 'ordering': ('company_name',), }, ),", "serialize=False, verbose_name='ID')), ('company_name', models.CharField(db_index=True, max_length=200, unique=True)), (...
[ "axis = 1) norm_square_2 = np.reshape(norm_square_2, (-1,1)) d1=matrix_1.shape d2=matrix_2.shape if d1[1]!=d2[1]: matrix_1=np.transpose(matrix_1) inner_matrix", "operations # Returns the norm of the pairwise difference def norm_matrix(matrix_1, matrix_2): norm_square_1", "1) norm_square_1 = np.reshape(norm_squa...
[ "b'origin2' in request.GET: response.headers.append(b\"Access-Control-Allow-Origin\", request.GET.first(b'origin2')) #Preflight if b'headers' in request.GET: response.headers.set(b\"Access-Control-Allow-Headers\", request.GET.first(b'headers')) if", "[(b\"Content-Type\", b\"text/plain\")], body if origin != b'non...
[ "__init__(self, name, width, height, ip, port, bri=1): DeviceObj.__init__(self, name, \"osc_grid\", width, height) self.buffer", "pythonosc import udp_client from .device import DeviceObj # OSC Grid Object class OSCGrid(DeviceObj):", "osc_message_builder.OscMessageBuilder(address=\"/light/{0}/{1}/color\".format...
[ "mydict def __repr__(self): return '<Project %r>' % self.__name__ class Item(db.Model): __tablename__ = 'Items'", "value = db.Column(db.String(64),nullable=False) def to_dict(self): mydict = { 'id': self.id, 'project_id': self.project_id, 'key':", "project_name = db.Column(db.String(64),unique=True,index=True) ...
[ "requests class TestIronCache(unittest.TestCase): def setUp(self): self.cache = IronCache(\"test_cache\") def test_get(self): self.cache.put(\"test_item\", \"testing\") item", "self.cache.increment(\"test_item\") item = self.cache.get(\"test_item\") self.assertEqual(item.value, 3) self.cache.increment(\"test_item...
[ "+ ' ' + outputPath + ' -b 1 -b 2 -b 3", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "# Quit if we did not find it # Now parse out the", "bandMinStart = textOutput.find('STATISTICS_MINIMU...
[ "merged: # Integrity check: do the files have same columns? genotypes_header = genotypes.readline().rstrip().split(DELIMITER)", "in the same order; \" f\"expected the following lines to match.\\n{x[0:4]}\\n{y[0:4]}\") h =", "x = genotypes_line.rstrip().split(DELIMITER) y = gq_line.rstrip().split(DELIMITER) # Ch...
[]
[ "import tweepy import traceback import time import pymongo from tweepy import OAuthHandler from", "in range(0, len(snsList)): if k == 15: break x = mycol.insert_one( { \"tag\":", "\"time\": snsTime[k], \"text\": snsList[k], \"img\": pic[k], \"url\": url[k] } ) conn_str = \"\"", "\"\" auth = OAuthHandler(twitt...
[ "your service account in Privacy Enhanced # Email format (.pem suffix). To convert", "format # (.p12 suffix) to .pem, run the openssl command like this: #", "private key associated with your service account in Privacy Enhanced # Email format", "a private key from the RSA format # (.p12 suffix) to .pem, run", ...
[ "print(5.5 * 6 // 2 + 8) print(-3 ** 2) print(\"\") # Use", "print(+7.86) print(-3348.63) print(\"\") # Simple arithmetic print(\"Addition and Subtraction\") print(1 + 2) print(48", "use of variables and how to assign values to them. \"\"\" # The", "can be used as values and in expressions print(temperature, ...
[ "this doesnt considers the support reaction check #if self.structure_model is not None: #", "dynamic analysis # TODO: only calculate reaction when user wants it # moved", "self.scheme.get_velocity() self.acceleration[:, i] = self.scheme.get_acceleration() # TODO: only calculate reaction when user wants", "ini...
[ "operations = [ migrations.AlterField( model_name='history_order', name='dead_date', field=models.DateTimeField(default=datetime.datetime(2017, 11, 24, 16, 22, 1, 719840,", "import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc", "migrations, mode...
[ "\"\"\"Single whitespace expected after USING in JOIN clause. | **Anti-pattern** .. code-block:: sql", "zoo USING(a) | **Best practice** | The • character represents a space. |", "| **Anti-pattern** .. code-block:: sql SELECT b FROM foo LEFT JOIN zoo USING(a)", "| **Best practice** | The • character represent...
[ "comps0 except: tab0 = Table.read(data_filename) Gmag = tab0['phot_g_mean_mag'] - 5 * np.log10(1.0 /", "yms = y[m] xms = x[m] def plot_MS_parametrisation_and_spectral_types(ax, xlim, ylim): ax.plot(xms, yms, c='brown',", "# fitpar for pmag, rpmag fitpar = [0.17954163, -2.48748376, 12.9279348, -31.35434182, 38.3...