ngram
listlengths
0
67.8k
[ "as_dict=True) def get_data(): rooms = get_rooms() now = datetime.date(datetime.now()) for room in rooms:", "'fieldname': 'actual_hk', 'label': 'Actual HK', 'fieldtype': 'Data', }, ] data = get_data() print(data)", "order by number\"\"\", as_dict=True) def get_data(): rooms = get_rooms() now = datetime.date(dat...
[ "speed and angle # Setting nod with block=False ensures the program continues to", "speed 10 degrees either side of current angle. Blocks program execution until finished.", "speed=50, block=True) # Shake and nod at the same time with default speed", "and angle # Setting nod with block=False ensures the progr...
[ "getData = GetData(5) features = getData.getAllFeatures('open', 'close') self.assertIsNotNone(features) self.assertEqual(len(features[0][0]), 2) if __name__ ==", "features = getData.getAllFeatures() self.assertIsNotNone(features) def test_getAllFeatures2(self): getData = GetData(101) features = getData.getAllFeat...
[ "mock import patch from gitflow_easyrelease import cli @patch('gitflow_easyrelease.cli_file.ColorOutput') @patch('gitflow_easyrelease.cli_file.Subcommand') @patch('gitflow_easyrelease.cli_file.Application') def test_execution(mock_app, mock_sub,", "gitflow_easyrelease import cli @patch('gitflow_easyrelease.cli_fi...
[ ".. | grimhacker.com .. | @_grimhacker .. | -------------------------------------------------------------------------------- Created on 22 Sep", "| -------------------------------------------------------------------------------- Created on 22 Sep 2013 @author: GrimHacker ''' import logging from", "| executes a ...
[ "f.write(json.dumps(request.get_json())) return '' @app.route('/load') def load(): result = '{ \"markers\": [] }' if", "def save(): with open('data.json', 'w+') as f: f.write(json.dumps(request.get_json())) return '' @app.route('/load') def load():", "with open('data.json', 'w+') as f: f.write(json.dumps(reques...
[ "from __future__ import print_function class Metrics(object): def scalar(self, name, y, x=None): raise NotImplementedError" ]
[ "for i in url: m = i.url data = { \"url\": m, \"agg\":", "DataInstruct() url = self.userSitesDay.filter(time=query['dailyTime__{}'.format(agg)]) m = \"\" for i in url: m =", "agg): time = DataInstruct() url = self.userSitesDay.filter(time=query['dailyTime__{}'.format(agg)]) m = \"\" for i in", "= Sites.object...
[ "**kwargs): loss, timestamps, grads = trace if abscissa == 'time': x = timestamps", "grads = tf.reduce_sum(tf.square(grads), axis=-1)/norm if log_scale is True: grads = tf.math.log(grads) loss =", "= array[:, 0] Y = array[:, 1] ax.scatter(X, Y, **kwargs) def plot_experiments(experiments, axes,", "y) concatena...
[ "url, include from keychain import keychain_client_urls from keychain import keychain_web_urls from keychain.views import", "keychain import keychain_web_urls from keychain.views import appview app_name = 'keychain' urlpatterns = [", "from keychain import keychain_web_urls from keychain.views import appview app...
[ "{} sub_message[\"sender_node_id\"] = arguments.node_id sub_message[\"sender_actor_type\"] = \"test_actor\" sub_message[\"sender_instance_id\"] = \"1\" sub_message[\"type\"] = \"subscription_update\"", "spawn_message[\"spawn_actor_type\"] = \"remotely_spawned_actor\" spawn_message[\"spawn_instance_id\"] = argumen...
[ "dummy.arg6 # Expected result for arg7 and arg8 basedict = {'arg1': 'prefix_arg1', 'arg2':", "'arg1', 'arg3_1', 'arg3_2', 'arg5_v', 'arg1', 'arg3_1', 'arg3_2', 'arg5_v', 'arg1', 'arg3_1', 'arg3_2', 'arg5_v', ]", "dummy.arg1 assert Transformer().visit(dummy.arg2) is dummy.arg2 assert Transformer().visit(dummy.ar...
[ "elem_wordvecs.append(self.word_to_ix_map[\"UNK\"]) elem_tags.append(self.tag_to_vector_map[t]) else: unk_words.append(w) w = \"UNK\" self.word_to_ix_map[w] = self.wordvecs.shape[0] - 1 elem_wordvecs.append(self.word_to_ix_map[w])", "1 self.tag_to_vector_map['NONE'] = tuple(one_hot_vec) self.vector_to_tag_map[tup...
[ "settings logFormatter = logging.Formatter('%(asctime)s [%(levelname)-5.5s] %(message)s') logger = logging.getLogger() fileHandler = logging.FileHandler('{0}'.format(settings.LOG_FILE_PATH)) fileHandler.setFormatter(logFormatter)", "logFormatter = logging.Formatter('%(asctime)s [%(levelname)-5.5s] %(message)s') l...
[ "'0005_auto_20170127_1841'), ] operations = [ migrations.RemoveField( model_name='ciudadano', name='uuid', ), migrations.AlterField( model_name='ciudadano', name='numero_documento', field=models.CharField(blank=True,", "by Django 1.10.1 on 2017-01-31 11:14 from __future__ import unicode_literals from django.db im...
[ "\"episode_reward_mean\": 0.99, \"training_iteration\":200, } # trainer=PPOTrainer(config=config_for_trainer) # print(trainer.get_policy().model) # # trainer=ImpalaTrainer(config=config_for_trainer) # print(trainer.get_policy().model)", "\"conv_filters\":[[32,[3,3],2],[32,[3,3],2],[32,[3,3],2],[32,[3,3],2],[1152,...
[ "([(\"A\", \"B\"), (\"A\", \"C\")], {\"A\": [\"B\", \"C\"], \"B\": [\"A\"], \"C\": [\"A\"]}), ([(\"A\", \"B\"),", "\"B\": 1, \"C\": 1}), ({\"A\": [\"B\"], \"B\": [\"A\"]}, {\"A\": 1, \"B\": 1}), ],", ") def test_inbound_degrees(adj_list, expected): assert inbound_degrees(adj_list) == expected @pytest.mark.param...
[ "def post(self, request, slug): contention = self.get_object() if check_content_deletion(contention): # remove notification Entry.objects.delete(contention.get_newsfeed_type(),", "contentions class AboutView(TemplateView): template_name = \"about.html\" def get_context_data(self, **kwargs): content = markdown(ren...
[ "and B. L2 norm is ``sqrt(sum(|x_i - y_i| ^ 2))`` Args: a (Tensor", "of points in a batch, D is the dimension of the Euclidian space.", "tf.expand_dims(a, 2) # N x K x 1 x D b_ext = tf.expand_dims(b,", "b_ext = tf.expand_dims(b, 1) # N x 1 x M x D a2", "a_ext, axis=3) # N x K x 1 b2 = tf.reduce_sum(b_ext * ...
[ "from typing import Dict, Any RawSchema = Dict[str, Any] Field = Dict[str, Any]" ]
[ "\"\"\"Password Change Confirmation\"\"\" FORGET_MY_PASSWORD_CONTENT = \"\"\"hello {user},\\n Please click the following link to", "the following link to change your password:\\n http://jinchispace.com:5001/newpass?token={token}\\n This link will be expired", "link to change your password:\\n http://jinchispace...
[ "a JSON-formatted push policy to serve\") @command.argument(\"--cert_path\", help=\"Location of the server certificate\") @command.argument(\"--key_path\",", "type=int, default=None ) @command.argument( \"--extract_critical_requests\", help=\"true or false to specify if server should", "help=\"Do not cache obje...
[ "RabbitMqEventTransport(\"192.168.1.71\", 5672, username=\"admin\", password=\"<PASSWORD>\") ] @gemstone.event_handler(\"test\") def broadcast_msg(self, message): print(message) if __name__ ==", "from gemstone.event.transport import RabbitMqEventTransport class ConsumerService(gemstone.MicroService): name = \"con...
[ "OSError as exc: raise Exception( f\"FileConverter: conversion directory error: `{exc!r}`.\" ) filepath =", "= ( \"__config\", ) def __init__( self, config: CallRecordsConfig, ) -> None: self.__config", "async with aiofiles.open(path, mode='rb') as f: content = await f.read() return content async", "return fi...
[ "requests inorder to capture paginated resources \"\"\" response,next_url = self.single_get_request(url,params) assert isinstance( response,", "immutable = False, ) proposed_entity = mutable_entity_class.create_from_data(data) msg_content = proposed_entity.toDict() msg_content.pop('Id',None) # No", "sending the...
[ "== False: num = int(input('''\\033[1;36mDigite um numero inteiro:\\033[m ''')) soma += num cont", "[ 1 ] SIM [ 2 ] NÃO''') opcao = int(input('Escolha sua opção:", "1: parar = False else: print('OPÇÃO INVALIDA.') media = soma/cont print(f'A média é", "== 2: parar = True elif opcao == 1: parar = False else:", ...
[ "train=True) print('Data Test: ') return self.model.test(test_loader, show, filename) def __build_model(self): # build Model", "epoch in range(1, self.num_epoch+1): print \"Epoch \" + str(epoch) + \"/\" + str(self.num_epoch)", "\" + str(epoch) + \"/\" + str(self.num_epoch) self.model.train(epoch, train_loader, ...
[ "input, the logic in the # strategy is slightly different in this case", "are closer to the initial value for x in range(0, 3): self.assertTrue(0.24 <", "are closer to the target one for x in range(out_stream_buffer.shape[0] - 3, out_stream_buffer.shape[0]):", "class StreamGainStrategyTest(unittest.TestCase):...
[ "def hello(request): return render(request, 'home/hello.html') @user_passes_test(not_logged_in, login_url='/user/dashboard', redirect_field_name=None) def login(request): return render(request, 'home/login.html')", "import user_passes_test # Create your views here. def not_logged_in(user): return not user.is_auth...
[ "tuple): ''' Inserts a new record in warehouse table Parameters ---------- data_tuple: tuple", "cursor cursor.close() def update(self, id: str, new_data: tuple): ''' Updates a record of", "FROM warehouse WHERE id = ? ''' # executing script cursor.execute(sql_script, (id,)) self.conn.commit()", "Deletes a reco...
[ "'True', 'true', 'yes', '1') false_values = (False, 'False', 'false', 'no', '0') if obj", "role_name=None, base_path=os.getcwd(), log_level='WARNING', subdir_template=os.path.join(resource_filename('ansibleroler', 'static'), 'templates', 'main.yml.j2'), root_template=os.path.join(resource_filename('ansibleroler',...
[]
[ "sitemap_file_error = None sitemap_received = False sitemap_lxml = None sitemap_plain_text = None sitemap_type", "result.text self.sitemap_headers = result.headers def set_local_file(self, file_contents): self.sitemap_source_type = 'local' self.sitemap_received = True", "'sitemap_type': self.sitemap_type} def g...
[ "PUT request or raise an exception.\"\"\" if json: r = requests.put( self._habitica_api+endpoint, headers={", "self._habitica_api+endpoint, headers={ 'x-api-user':self._uuid, 'x-api-key':self._apikey } ) r.raise_for_status() return attrdict_or_list(r.json()) def __str__(self): return \"HabiticaObject:", "refere...
[ "Local Variables c = 1 def foo(): c = 2 return c c", "# Exercise 33 - Local Variables c = 1 def foo(): c =", "Exercise 33 - Local Variables c = 1 def foo(): c = 2", "c = 1 def foo(): c = 2 return c c = 3", "- Local Variables c = 1 def foo(): c = 2 return c", "Variables c = 1 def foo(): c = 2 return c c ="...
[ "BOM to search. Typically the distributer BOM or a text schematic\") @click.command def", "second_parts = regx.findall(st) nfirst = [] nsecond = [] for part in first_parts:", "first_parts: if part not in nfirst: nfirst.append(part) for part in second_parts: if part", "to. Should have the part number somewhere...
[ "driver.close() def read_ini_settings(): setting_temp = [] setting = {} num_of_value = 1 seperate_symbol", "(item.startswith('#') or item.startswith('\\n')): setting_temp.append(item.split(seperate_symbol)) # Will result with a 2D list # Convert", "item in f: if not (item.startswith('#') or item.startswith('\\n...
[ "in (\"MHS File\", \"Device\", \"Package\", \"SpeedGrade\"): if field not in xmp.values: raise ParseError(f\"missing", "for line in lines)): if match is not None: xmp.values[match.group(1)] = match.group(2) else:", "that required fields are present for field in (\"MHS File\", \"Device\", \"Package\", \"SpeedGra...
[ "GaussSqrtInitializer: def params(self, shape): mat = np.random.standard_normal(shape) if len(shape) > 1: mat /=", "as np ''' Initializer params(shape): Create initalized tensor @param shape tuple of dimensions", "tensor @param shape tuple of dimensions of the expected tensor @return initialized tensor", "num...
[ "bool = False, fill_value: Any = None ) -> \"TensorArray\": \"\"\" See docstring", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "int: return len(self._tensor) def __getitem__(self, item) -> ...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "= datafiles, scripts=[ 'bin/pack_maps.py', 'bin/pack_raw.py', ], entry_points = { 'console_scripts': [ 'datastore-add-laser =", "datafiles = [(os....
[ "from datetime import datetime from ... import db class Story(db.Model): \"\"\" This model", "\"\"\" Returns the object reprensentation \"\"\" return '<Task %r>' % self.content def to_json(self):", "= db.Column(db.Text, nullable=False) featured_img_url = db.Column(db.Text, nullable=False) approved_count = db.Co...
[ "serializers.SerializerMethodField() allegation_count = serializers.IntegerField() percentile_allegation = serializers.DecimalField( source='complaint_percentile', max_digits=6, decimal_places=4, allow_null=True ) percentile_trr", "= serializers.SerializerMethodField() def get_kind(self, obj): raise NotImplemente...
[ "\"/home/jason/nn/osm-changeset-classification/osm-planet\" historyDbFileName = \"osm-planet/history.sqlite\" #historyPBF = \"../osm-data/vermont.osh.pbf\" #historyPBF = 'osm-planet/history-180319.osm.pbf' historyPBF = \"/media/jason/E46AC1AC6AC17BB4/Remillard/maps/osm2017/history-180319.osm.pbf\"", "= \"/home/ja...
[ "mcmc_sampler(data, prior_pdf, likelihood, propose_pdf, propose_func, xx, param, adaptive_func=None, min_run=1000, max_rum=3000, gap=100): # initialization", "is not None and accept_num >= 10 and m % gap == 0):", "0.0, 0.0 Q_now, Q_try = 0.0, 0.0 # step 1: propose a value", "np.sqrt(np.var(A) + np.var(B)) ret...
[]
[ "utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.db import", "model\"\"\" Site = apps.get_model('sites', 'Site') Site.objects.all().delete() # Register SITE_ID = 1 try: domain", "__future__ import unicode_literals from django.conf import settings from django.db imp...
[ "'daemon' attribute always return False def _get_daemon(self): return False def _set_daemon(self, value): pass", "multiprocessing class GmapsProcess(multiprocessing.Process): # make 'daemon' attribute always return False def _get_daemon(self): return", "pass daemon = property(_get_daemon, _set_daemon) # We sub-...
[ "ITEM = typing.TypeVar('ITEM') FIELD = str VALUE = typing.TypeVar('VALUE') GETTER = typing.Callable[[ITEM, FIELD],", "import typing ITEM = typing.TypeVar('ITEM') FIELD = str VALUE = typing.TypeVar('VALUE') GETTER =", "typing ITEM = typing.TypeVar('ITEM') FIELD = str VALUE = typing.TypeVar('VALUE') GETTER = typi...
[ "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,", "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", "self, sreader, sreader.s.fileno(), sreader.e['peername']) try: request = b'' res = b'' while True:", "class aMicroPyServer(objec...
[ "없으면 탐색 종료 break else: # 항상 오른쪽 노드가 큰 값임 no =", "prev_no != 0xffffffff and next_no != 0xffffffff: # 양쪽 모두 노트가 존재함 #", "엔진 ID, 압축된 파일 이름]] # --------------------------------------------------------------------- def arclist(self, filename, fileformat): file_scan_list =", "buf[t_off + 4:] if pps_next is not None...
[ "canny cv2.namedWindow(\"image_canny\",cv2.WINDOW_NORMAL) cv2.imshow(\"image_canny\", image_canny) cv2.resizeWindow(\"image_canny\",(windowwidth,windowheight)) cv2.moveWindow(\"image_canny\",screensize[0][0]+(windowwidth+headerside*2),0) # contours cv2.namedWindow(\"contours\",cv2.WINDOW_NORMAL) cv2.imshow(\"contou...
[ "as sock: sock.bind((\"127.0.0.1\", 10001)) sock.listen(socket.SOMAXCONN) PROCESS_COUNT = 6 process_list = [multiprocessing.Process(target=worker, args=(sock,)) for", "import socket import threading import multiprocessing import os def worker(sock): while True: conn,", "while True: data = conn.recv(1024) if not...
[ "0.1, 0.1) fig = plt.figure(figsize=(8, 6)) map = Basemap(llcrnrlon=lon0, llcrnrlat=lat0, urcrnrlon=lon1, urcrnrlat=lat1, \\", "= plt.figure(figsize=(8, 6)) map = Basemap(llcrnrlon=lon0, llcrnrlat=lat0, urcrnrlon=lon1, urcrnrlat=lat1, \\ resolution='f') map.drawcoastlines() map.drawparallels(parallels,", "urcrn...
[ "+ '_'.join(['%s:%s' % (k, v) for k, v in Counter(labels).most_common()]) new_subgraphs_list.append(subgraph) new_signatures_list.append(new_signature) gc", "new_signatures_list = [] for subgraph, signature in zip(graph_component.subgraphs, graph_component.signatures): node_size_label = '%d' %", "= [v for v in ...
[ "kwargs.items()) def ackley(x_1=None, x_2=None, a=20, b=0.2, c=2*math.pi): d = 2 return -a *", "_, x_i in kwargs.items()) def ackley(x_1=None, x_2=None, a=20, b=0.2, c=2*math.pi): d = 2", "x_1) + np.cos(c * x_2)) + a + np.exp(1) def flower(**kwargs): a =", "d)) - np.exp(np.cos(c * x_1) + np.cos(c * x_2)) + a ...
[ "filename = secure_filename(file.filename) file.save(os.path.join(app.config['PATH'], filename)) print(filename) img=cv2.imread(os.path.join(app.config['PATH'], filename)) id_class_detector(img, model, filename, debug=False) #time.sleep(2)", "pathToModel+'/frcnn.pbtxt') @app.route('/hello', methods=['POST', 'GET'...
[ "distributed on an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY", "= config_location self.logger = logger def read_config(self): config = ConfigParser() config.read(self.config_location) enable_insert_overwrite =", "{2}\".format(file_type, source_location, destination_location)) s3_bucket, prefix ...
[ "{item_code} and disabled = 0 and (expiry_date is null or expiry_date > '{cur_date}')\"\"\"", "txt, searchfield, start, page_len, filters): return frappe.db.sql(\"\"\"select batch_id, expiry_date from `tabBatch` where item", "get_batch_nos(doctype, txt, searchfield, start, page_len, filters): return frappe.db.s...
[ "return queryset.filter(draft=True).order_by('-modified') @register(category=TransactionCategory) class ClosedTrancations(ViewMixin): model = Transaction name = _(\"Closed transactions\") slug", "class TransactionModule(Module): model = Transaction default = True create = TransactionCreateView update =", "from ...
[ "%(name)-30s %(levelname)-8s %(message)s' ) def create_log(name): '''Create a log and elevate it to", "to the INFO level. format='%(asctime)-10s %(name)-30s %(levelname)-8s %(message)s' ) def create_log(name): '''Create a", "the INFO level. format='%(asctime)-10s %(name)-30s %(levelname)-8s %(message)s' ) def c...
[ "c) assert isinstance(d1, np.ndarray) and not isinstance(d1, quaternionic.array) f2 = quaternionic.utilities.type_self_return(f1) d2 =", "numpy as np import quaternionic import pytest def test_self_return(): def f1(a, b, c):", "numba.ushort, numba.uintc, numba.uint, numba.ulonglong, numba.uintp, numba.float32, ...
[ "[] for x in A: B.append(f1(x)) ''' B = list(map(f1, A)) print(B) C", "__future__ import unicode_literals def f1(x): return x + 3 a = 1 b", "utf-8 -*- from __future__ import unicode_literals def f1(x): return x + 3 a", "A: B.append(f1(x)) ''' B = list(map(f1, A)) print(B) C = list(map(lambda x: x", "2, 3] '...
[ "is None: d[nums[i]] = i else: return [d[find], i] class Solution1: # @return", "(index1, index2) def twoSum(self, num, target): tmp = {} for i in range(len(num)):", "# @return a tuple, (index1, index2) def twoSum(self, num, target): tmp = {}", "- num[i] in tmp: return([tmp[target - num[i]], i]) else: tmp[num...
[ "depth2 = aim2 = 0 # Process each line of text for l", "* depth1}') print(f'Problem 2: Ending pos = {horiz2}, depth = {depth2}, aim =", "depth1}') print(f'Problem 2: Ending pos = {horiz2}, depth = {depth2}, aim = {aim2},", "= {horiz2}, depth = {depth2}, aim = {aim2}, product = {horiz2 * depth2}')", "in open...
[ "import configparser import ctypes import io import mmap import msvcrt import multiprocessing as", "+ game_name, save_data, server_manager)) process.start() print(\"Successfully configured bots. Setting flag for injected dll.\")", "gameInputPacket.sPlayerConfiguration[i].wName = get_sanitized_bot_name(name_dict...
[ "import PATH_DATA_PROCESSED class FER(torchvision.datasets.ImageFolder): def __init__(self, num_classes: int, **kwargs): kwargs['root'] = PATH_DATA_PROCESSED.joinpath(f'FER{num_classes}').as_posix() super().__init__(**kwargs)", "import torchvision from ..paths import PATH_DATA_PROCESSED class FER(torchvision.data...
[ "while p < q: tmp = nums[i] + nums[p] +nums[q] if abs(tmp -", "= 0x7fffffff sz = len(nums) nums.sort() for i in range(sz-2): if i >", "- 1 b = True while p < q: tmp = nums[i] +", "p += 1 if ans == target: break return ans # @lc code=end", "i + 1 q = sz - 1 b = True while p", "continue p = i + 1 q = sz - 1...
[ "DataSet from ._datastore import DataStore from ._environment import Environment from ._project import Project", "from ._datastore import DataStore from ._environment import Environment from ._project import Project from", "* __all__ = [ \"DataSet\", \"DataStore\", \"Environment\", \"Project\", \"SecretStore\",...
[ "logging import asyncio from discord.ext import commands, tasks from dotenv import load_dotenv from", "discord.Client() class Onload(commands.Cog): def __init__(self, client): self.client = client @commands.Cog.listener() async def on_ready(self):", "client): self.client = client @commands.Cog.listener() async ...
[ "pertb_dets = np.array([[[1, 2, 6, 6, 0.3, 1, 0.995]], [[0, 1, 2, 2,", "metric type. \"\"\" impl = DetectorRISE('hamming') assert impl.proximity_metric == 'hamming' def test_shape_sanity(self) ->", "unittest import TestCase import numpy as np import os from xaitk_saliency.impls.gen_detector_prop_sal.drise_scori...
[ "= pd.read_csv(r'./data/cmb_list.csv',index_col=None) AllocateList['胜'] = (AllocateList['胜']*bet_amt)/100 AllocateList['平'] = (AllocateList['平']*bet_amt)/100 AllocateList['负'] = (AllocateList['负']*bet_amt)/100 AllocateList['胜入'] =", "as os def GetLverage(v_win,v_tie,v_los,bet_amt,keep_side): AllocateList = pd.rea...
[ "+ 1] = dp[i][j] and (p[i] == s[j] or p[i] == '.') return", "1] == '.': dp[i + 1][j + 1] |= dp[i + 1][j] else:", "for i in range(len(p)): for j in range(len(s)): if p[i] == '*': dp[i", "case ?? @ Time | Space \"\"\" def isMatch(self, s, p): # 长为S+1", "+ 1) for _ in range(len(p) + 1)] dp[0][0] = True for i",...
[ "not os.path.isdir(directLong): sys.exit(directLong + \" does not exist\") # make vis directory within", "(str): base directory of logged model shrink_factor (int): factor by which to downsample", "print(\"creating training evolution gif\") # clean up directory input direct = re.sub(r\"(\\/)?$\", \"\",", "dat...
[ "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,", "Team' __version__ = '0.0.5' from django import forms from django.utils.safestring import mark_safe from", "_ from djangoerp.core.forms.auth import UserForm class UserRegistrationForm(UserForm): \"\"\"Form for user registration...
[ "[5, 2, 3, 4, 5, 6, 2] assert sort_with_reverse(l) == [2, 2, 3,", "4] l = [5, 2, 3, 4, 5, 6, 2] assert sort_with_reverse(l) ==", "j][::-1] def sort_with_reverse(lst:list): iterator = 0 while iterator < len(lst)-1: smallest_value = min(lst[iterator:])", "l = [3, 2, 4, 1] assert sort_with_reverse(l) == [1, 2, 3...
[ "db.Column(db.String(120), nullable=False) date = db.Column(db.String(12), nullable=True) class Checkout(db.Model): sno = db.Column(db.Integer, primary_key=True) name", "class Specification(db.Model): sno = db.Column(db.Integer, primary_key=True) size = db.Column(db.Integer, nullable=False) color = db.Column(db.S...
[ "max_length=120) keywords = models.CharField('Keywords', max_length=250) sort = models.PositiveIntegerField('Порядок', default=0, unique=True) banner = models.ImageField('Баннер',", "kwargs={'slug': self.slug}) class Meta: verbose_name = 'Категория' verbose_name_plural = 'Категории' class Model(models.Model): \"\...
[ "for ticket in data: print(ticket_validator(ticket)) tickets_info = input() data = [x.strip() for x", "else: current_max_num += 1 return [current_max_num, special_char] def ticket_validator(ticket): ticket_condition = '' if", "in '@#$^': ticket_condition = f'ticket \"{ticket}\" - 10{ticket[0]} Jackpot!' else: d...
[ "### commands auto generated by Alembic - please adjust! ### op.drop_constraint('client_referral_id_fkey', 'client', type_='foreignkey')", "message Revision ID: bbedc353f90c Revises: d67eab226ecd Create Date: 2021-10-26 12:05:38.840492 \"\"\" import sqlalchemy_utils", "Alembic. revision = 'bbedc353f90c' down_re...
[ "def is_composite_coder(coder): \"\"\"Check if a coder is composite. Args: coder (coder): Coder. Returns:", "\"\"\" return all([i > 0 for i in B.shape(x)]) def batch(x, other_dims): \"\"\"Get", "compress_batch_dimensions(x, other_dims): \"\"\"Compress multiple batch dimensions of a tensor into a single batch", ...
[ "similar words and its similarity as a list of tuples Example ------- >>>", "This method is **a lot** slower than `self.cosine` and results are the almost", "else: return temp[0] def get_vector(self, word): ''' Returns the (l2norm) vector for `word`", "---------- word : string word in the vocabulary to calcul...
[ "<reponame>TomPretty/calculator from calculator import evaluate def test_evaluating_a_constant_expression(): source = \"3\" assert evaluate(source) ==", "from calculator import evaluate def test_evaluating_a_constant_expression(): source = \"3\" assert evaluate(source) == 3" ]
[ "jdbot.delete_messages(chat_id, msg) cmdtext = res conv.cancel() if cmdtext: await cmd(cmdtext.replace('nohup ', '')) except", "jdbot.edit_message(msg, '请做出您的选择:', buttons=markup) convdata = await conv.wait_event(press_event(SENDER)) res = bytes.decode(convdata.data) if res ==", "with open(SHORTCUT_FILE, 'r', e...
[ "__name__ == \"__main__\": while True: try: # Get the current unix epoch time", "errin, errout, dropin, dropout) = nics[nic] if nic not in filternics: # Ignore", "nic + \"_out,\" + str(bytes_sent) + \",metric=bps;function=derivative;inversion=-1;title=\" + nic + \"_out\") print(now +", "try: # Get the current...
[ "MIMEMultipart # from email.mime.text import MIMEText # from email.mime.application import MIMEApplication region =", "sent! Message ID: \" + response['MessageId'] return output def lambda_handler(event, context): # print(event)", "print(event) # print(event['reply_address']) print(send_mail(event)) return { 's...
[ "class AlexNet(nn.Module): def __init__(self): super(AlexNet, self).__init__() self.conv_layers = nn.Sequential( nn.Conv2d(in_channels=1, out_channels=96, kernel_size=3, stride=2,", "7, out_features=10) def forward(self, x): x = self.conv1(x) x = self.conv2(x) x =", "stride=1, padding=1), nn.ReLU(inplace=True),...
[ "jslexer importlib.reload(babel.messages.jslexer) # babel.messages.extract is not changed, so we can use directly from", "# babel.messages.extract is not changed, so we can use directly from babel.messages.extract import", "is not changed, so we can use directly from babel.messages.extract import extract_javasc...
[ "result record = cursor.fetchone() print(\"You are connected to - \", record, \"\\n\") print(\"Retrieving", "soil_profile limit 10\") # Fetch result records = cursor.fetchall() print(f\"soil records = {records}\")", "try: # Connect to an existing database connection = psycopg2.connect(user=\"sa\", password=\"<P...
[ "class=\"toolForm\">\\n <div class=\"toolFormTitle\">Accessible Galaxy tool sheds</div>\\n <div class=\"toolFormBody\">\\n <div class=\"form-row\">\\n <table class=\"grid\">\\n ')", "SOURCE LINE 22 __M_writer(u' <tr class=\"libraryTitle\">\\n <td>\\n <div style=\"float: left; margin-left: 1px;\" class=\"menubutto...
[ "feed=feed, machine=cnc) cnc.cmd(\"G91\") prog.run() cnc.reset() def test_04_row3(cnc): prog = gcode.GCode(machine=cnc) prog.G90() prog.G0(X=0, Y=20)", "prog.run() cnc.reset() def test_04_row3(cnc): prog = gcode.GCode(machine=cnc) prog.G90() prog.G0(X=0, Y=20) prog.run() cnc.reset() @pytest.mark.parametrize(\"dyn...
[ "import numpy as np import autoeap from numpy.testing import assert_array_almost_equal import os PACKAGEDIR", "as np import autoeap from numpy.testing import assert_array_almost_equal import os PACKAGEDIR = os.path.abspath(os.path.dirname(__file__))", "autoeap from numpy.testing import assert_array_almost_equal...
[ "= resp.get('balance') try: weth_contract_address = supported_tokens.get('WETH') if supported_tokens and supported_tokens.get('WETH') else None if", "baseurl = self.get_baseurl(network) if baseurl is None: raise Exception( 'UnchainedClient is not supported", "network self.baseurl = baseurl @staticmethod def get...
[ "print(x) print(\"-\" * 10) x.append('d') print(x) print(\"-\" * 10) x.__setitem__(4, 'e') print(x) print(\"-\"", "if index > 0: index -= 1 return list.__getitem__(self, index) def __setitem__(self, index,", "raise IndexError if index > 0: index -= 1 return list.__getitem__(self, index) def", "index) def __se...
[ "and *PERMANENTLY* DELETES THE TOKENS FOR ALL USERS', ) def handle(self, *args, **options):", "out and *PERMANENTLY* DELETES THE TOKENS FOR ALL USERS', ) def handle(self, *args,", "THE TOKENS FOR ALL USERS', ) def handle(self, *args, **options): if not options[\"force\"]:", "parser.add_argument( '--force', ac...
[ "Config.COLOUR_WHITE assert return_tile_colour(False) == Config.COLOUR_BLACK def test_coordinates_to_notation(): assert coordinates_to_notation(0, 0) == \"A8\" assert", "from main import determine_colour, return_tile_colour, coordinates_to_notation def test_determine_colour(): assert determine_colour(0, 0) assert...
[ "then subscriptions will be renewed. for topic in SUBSCRIPTIONS: self.subscribe(topic) def on_message(self, client,", "self.obj: _obj.receivedMQTT(topic, message, json=json_check) # receiveMQTT() function to receive MQTT pubs except Exception", "%s]\" % (key, value) message = j json_check = True except: log_mes...
[ "iface in netifaces.interfaces(): try: ip[iface] = netifaces.ifaddresses(iface)[netifaces.AF_INET][0]['addr'] except KeyError: pass except ValueError: pass", "ValueError: pass d = jinja.get_template(\"vmfw.sh\").render(port=data, ip=ip, vmip=_config.get(\"iface\", \"vmIP\")) open(\"sysconf/vmfw.sh\", \"w\").write...
[]
[ "elements of A. # # You may return any answer array that satisfies", "\"\"\" output = [] for i in A: if i % 2 ==", "# # # Example 1: # # Input: [3,1,2,4] # Output: [2,4,3,1] #", "# # # # Example 1: # # Input: [3,1,2,4] # Output: [2,4,3,1]", "[4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be accepted. # # # ...