ngram
listlengths
0
67.8k
[ "urgent = fields.Boolean('Urgent',) wizard_multiple_test_physician_id = fields.Many2one('medical.physician','Doctor', required = True) wizard_multiple_test_owner_partner_id = fields.Many2one('res.partner','Owner') tests_ids", "self.env['medical.test_type'] test_browse_record = lab_test_req_obj.browse(test_id.id) ...
[ "= models.IntegerField() class_code = models.CharField(max_length=20) author_id = models.CharField(max_length=20) title = models.CharField(max_length=255) content =", "blank=True, null=True) quota = models.CharField(max_length=10, blank=True, null=True) instructor = models.CharField(max_length=100, blank=True, nu...
[ "dir_okay=False, readable=True)) @click.argument('output_filename', default='citation_keys', type=click.Path(file_okay=True, dir_okay=False, writable=True)) @click.option('-v/-V', '--verbose/--no-verbose', default=False) def main(aux_filename, output_filename,", "<reponame>yoavram-lab/EffectiveNPI import click @c...
[ "import multiprocessing as mp sys.path.append(os.getcwd()+\"/source\") import ProGED as pg import warnings #warnings.filterwarnings(\"ignore\") np.random.seed(0)", "as pd import sys import os import pickle import multiprocessing as mp sys.path.append(os.getcwd()+\"/source\")", "numpy as np import pandas as pd i...
[ "from collections import namedtuple from edward.models import ( Beta, Dirichlet, DirichletProcess, Gamma, MultivariateNormalDiag,", "namedtuple('FakeRV', ['support']) x = FakeRV(support='rational') with self.assertRaises(ValueError): y = ed.transform(x) if __name__ ==", "1.0) y = ed.transform(x) self.assertIsIn...
[]
[ "systems.commands.index import Command class Start(Command('server.start')): def exec(self): def start_server(server): self.data(\"Starting server\", str(server)) server.start()", "from systems.commands.index import Command class Start(Command('server.start')): def exec(self): def start_server(server): self.data(...
[ "map sentence for all chapters, save results in beads files # book_mapper.beadMapBook(utils.Lang.FRA, utils.Lang.ENG,", "# aligner.alignChapter(utils.Lang.FRA, book_id, 1) # start at min, stop at max-1 # for", "chapter in range(7, 38): # aligner.alignChapter(utils.Lang.ENG, book_id, chapter) # for chapter in ra...
[ "mu) * t.pow(std + 1e-8, -1) * (z - mu)).sum(1)) / \\ t.sqrt(t.abs(2", "= mu.unsqueeze(1).repeat(1, 15, 1) std_repeated = std.unsqueeze(1).repeat(1, 15, 1) z = z *", "* p_second[1] - 2 * p_first[1] + t.exp(p_first[1]) / (t.exp(p_second[1]) + 1e-8) +", "= Encoder() self.decoder = Decoder() def forward(self, in...
[ "logger = logging.getLogger(__name__) @shared_task def listen_ethereum_ipfs_hash_storage(): redis_db = redis.get_redis() verification_storage = contract.contract('VerificationStorage') event", "def listen_ethereum_ipfs_hash_storage(): redis_db = redis.get_redis() verification_storage = contract.contract('Verifica...
[ "test_push_trace(self): pass def test_message(self): base_value = exception.Base(http_status=STATUS.OK, message=\"message\") self.assertEqual(base_value.message, \"message\") def test_str(self): base", "self.assertEqual(unimplemented_verb.stack_trace, [{\"verb\": \"GET\"}]) class ExceptionNoEndpointError(unittest...
[ "\"På lager\", time.strftime('%H:%M:%S', time.localtime())) in_stock.append({'store': store, 'name': name, 'url': product_url}) else: print(\"Item unavailable\",", "på lager\", time.strftime('%H:%M:%S', time.localtime())) else: print('Item available', name, store) update(product_url, \"På lager\", time.strftime('...
[ "i[s] + 1, i[sw] + 1, i[w], i[nw] - 1, ] j_adj =", "1, i[e], i[se] + 1, i[s] + 1, i[sw] + 1, i[w], i[nw]", "slow and could be improved is_adj = np.full(party.shape, False) for d in range(8):", "args = parser.parse_args() s = load_input(args.input_file) party = party_from_str(s) if args.sync: step =", "nw = ...
[]
[ "state: state -> (result, state') \"\"\" def __init__(self, fn: Callable[[TState], Tuple[TSource, TState]]) ->", "-> let (a, s') = runState m s in runState (k a) s'", "\"\"\" self._fn = fn @classmethod def unit(cls, value: TSource) -> \"State[TSource, TState]\": r\"\"\"Create", "@classmethod def get(cls) -> \...
[ "image, sound and hitmask dicts IMAGES, SOUNDS, HITMASKS = {}, {}, {} #", "playerIndex, basex if (loopIter + 1) % 5 == 0: playerIndex = next(playerIndexGen)", "False # True when player flaps # The counter to spawn new pipes", "uPipeRect, pHitMask, uHitmask) if uCollide: # for fury mode we want to break", "=...
[ "django.utils.translation import ugettext_lazy as _ from touchtechnology.news.models import Article, Category register = Library()", "@register.inclusion_tag('touchtechnology/news/_latest_articles.html', takes_context=True) def latest_articles(context, count=5, title=_(\"Latest News\")): articles = Article.object...
[ "= \"example\" class __Dimens: def __init__(self): self.test_int = 42 self.test_int_2 = 17 R", "Resources: def __init__(self): self.string = self.__Strings() self.id = self.__Ids() self.dimen = self.__Dimens() class", "\"O campo deve possuir no máximo %(max_length)d caracteres.\" self.field_length_range = \"O c...
[ "-*- coding: utf-8 -*- __author__ = \"\"\"<NAME>\"\"\" __email__ = '<EMAIL>' __version__ = '0.1.0'", "# -*- coding: utf-8 -*- __author__ = \"\"\"<NAME>\"\"\" __email__ = '<EMAIL>' __version__ =" ]
[ "Revision ID: <KEY> Revises: 8f176326a337 Create Date: 2020-08-09 23:00:56.671372 \"\"\" from alembic import", "= '<KEY>' down_revision = '8f176326a337' branch_labels = None depends_on = None ROLES =", "Create Date: 2020-08-09 23:00:56.671372 \"\"\" from alembic import op import sqlalchemy as sa", "used by Al...
[ "return fname + extension def write(self, fname, data, format=None): fname = self._sanitize_fname(fname) with", "fname = fname.replace(\"/\", \"-\") return fname + extension def write(self, fname, data, format=None):", "self._sanitize_fname(fname) output_data = self.normalize_data(data, format) with open(os.pat...
[ "class BaseGroup: def __init__(self, log_type): self.log_type = log_type def __call__(self, data): return data" ]
[ "= Tokenizer.uuid_re.sub(\"RNGU\", strip) # Remove heat short uuid but keep spacing # ObjectName-2kbhkd45kcs3-ServiceName", "random test r\"|zuul.*echo BECOME-SUCCESS-\" r\"|^[^ ]{64}$\" # useless debug statement r\"|ovs-ofctl .* (dump-ports|dump-flows|show)\\b\"", "= re.compile(r\"\\b\\w{7}\\.\\.\\w{7}\\b\") h...
[ "identifies a job. Returns ------- dict Dataflow plan \"\"\" return _execute_rest_request(url=f\"{self.prefix}/{job_id}/plan\")[\"plan\"] def get_vertex_ids(self,", "list List of metric names. \"\"\" return [ elem[\"id\"] for elem in _execute_rest_request(url=f\"{self.prefix}/metrics\")", "show_subtasks is true...
[ "in destinations] nume2d = int(len(sources)/2 - len(existingedges2desgin)) # print(nume2d) if nume2d>0: newedges =", "l in namelist for e in l] random.shuffle(federatenames) # print(\"shuffle:\", federatenames) # all_edges", "destin = elementDict[e2], capacity = linkcapacity, size = 0, owner = elementDict[e2].o...
[ "the last reward from every done task (also true for failed tasks) step_rew", "= False, verbose: bool = False): \"\"\" Constructor :param tasks: sequence of tasks", "True if verbose: print_cbt(f'Task {self._idx_curr} has failed (is done) at state {state}', 'r')", "\"\"\" if not isinstance(space_des, Space): r...
[ "as binary strings # sample long integer l = (2**32-2)*(2**32-3)*(2**32-7) # input long", "# create a list ls = [] while l: # extract each byte", "l >>= 8 ls.append(bot) # pad the list up to 32 items ls.extend([0]*(32-len(ls)))", "list bot = l&((1<<8)-1) l >>= 8 ls.append(bot) # pad the list up", "<gh_stars...
[ "start_num_points = len(self.summary_scores) xdata = np.array([x for x in range(1, start_num_points)]) self.lines =", "right number of times for breed_count in range(available[0][1], self.breeding_times): try: # try to", "# if the partner's bred the requisite number of times, remove them from", "= self.popula...
[ "\\x4b\\x6b\\x90\\x26\\xba\\x25\\xde\\x95\\xc5\\x59\\x89\\x72\\x69\\x46\\x0f\\xa9\\ \\x70\\x8c\\xe2\\x54\\x2a\\x4a\\x48\\x3a\\xb7\\x97\\xc4\\x1a\\x95\\x63\\x29\\x98\\ \\xfb\\xb0\\xe4\\x9a\\xa5\\x83\\x58\\x6a\\x64\\x9b\\xe4\\x2f\\x52\\x83\\xf7\\x2b\\ \\xad\\xa1\\x55\\xe3\\x86\\x48\\x1f\\x12\\x50\\xa5\\x7b\\xad\\xf4\...
[ "2: x = x.flatten(2) lin_output = T.dot(x, self.get_W()) + self.get_b().dimshuffle('x', 0) # noinspection", ": int or tuple[] Dimension of input. n_output : int or tuple[] Dimension", "\\\\times n_{input}}` and :math:`b \\\\in \\\\mathbb{R}^{n_{output}}`. Parameters ---------- n_input : int or tuple[]", "Retu...
[ "state] return max(minDists) + (len(state) // 12) def hUnOpt(state): minDists = [targetsD[s] for", "range(len(board[i])): tup = (i, j) if tup in state and tup in targets:", "if nextState in visited: continue visited.add(nextState) if nextState in targetsD: targetsD[nextState] = min(steps", "res = [] # for i i...
[ "PREV_MONTH = (Q(sessions__start__month=MONTH_NOW - 1 if MONTH_NOW > 1 else 12) & Q(sessions__start__year=YEAR_NOW", "YEAR_NOW - 1)) return query.annotate( curr_hours=Coalesce(Sum('sessions__duration', filter=CURR_MONTH), Cast(timedelta(), DurationField())), prev_hours=Coalesce(Sum('sessions__duration', filter=PR...
[ "listdir(folder_in) all_info = [] for f in files: if \"json\" not in f", "attributes = list(all_info[0].keys()) attributes.remove(\"room_types\") df_dict = {} for attr in attributes: df_dict[attr] =", "f, \"r\") as f: all_info += json.load(f) with open(folder_out + \"INFO.json\", \"w\") as", "pd.DataFrame(df_...
[ "-1.0], [0.0, 0.0])), (range(5), np.stack([range(5), range(5, 0, -1)], 1), ([1.0, -1.0], [0.0, 0.0])),", "p = stats.permtest_metric(x, y) assert np.allclose([r, p], [0.0345815411043023, 0.7192807192807192]) r, p = stats.permtest_metric(np.c_[x,", "np.stack([range(5), range(5, 0, -1)], 1), ([1.0, -1.0], [0.0, 0....
[ "= lasagne.updates.nesterov_momentum( loss.mean(), params, learning_rate=0.01, momentum=0.9) else: updates = updates_fn(loss.mean(), params) # EVALUATION", "performing a training step on a mini-batch (by giving # the updates dictionary)", "it smooths the resulting probabilities. \"\"\" def __init__(self, temper...
[ "as Root from mugimugi_client_api_entity.enum import ElementPrefix, ItemType from .abstract import SearchItem @dataclass class", "ClassVar from mugimugi_client_api_entity import Parody from mugimugi_client_api_entity import SearchParody as Root from mugimugi_client_api_entity.enum", "mugimugi_client_api_entity....
[ "AdaptiveSignalProcesser(AdaptiveSignalProcesserABC): def __init__(self, model, shape, mu, w_init, lambda_): self.method = Method.methods[model] self.mu =", "same length. But now, 'd' has {len_d} and 'x' has {len_x}.\" ) w_delta", "import AdaptiveSignalProcesserABC class AdaptiveSignalProcesser(AdaptiveSignalPr...
[ "sheet in wb.worksheets: for column_cells in sheet.columns: length = (max(len(self.as_text(cell.value)) for cell in", "current_readme_row += 1 data_sheet.cell(column=current_data_column, row=1, value=column_name) if isinstance(validator, OntologyValidator): if not ontology_sheet: ontology_sheet", "if data_valid...
[ "float(ws_kline['k']['t'])/1000).strftime(\"%m-%d-%Y %H:%M:%S\") self.klineCloseTime=datetime.datetime.fromtimestamp( float(ws_kline['k']['c'])/1000).strftime(\"%m-%d-%Y %H:%M:%S\") self.interval=ws_kline['k']['i'] self.openPrice=float(ws_kline['k']['o']) self.closePrice=float(ws_kline['k']['c']) self.highPrice=flo...
[ "open('images_rebuilt', 'w') as f: for environment in env.manager.get_rebuild_steps('common', changed_files, force=force): build_image(environment) f.write('{}\\n'.format(environment)) @task", "import cyan, green, red, yellow from fabric.contrib.console import confirm from fabric.contrib.files import exists", "...
[ "import migrations, models class Migration(migrations.Migration): dependencies = [ ('control_produccion', '0007_auto_20160623_1052'), ] operations =", "model_name='order_process', name='order_process_user_finished', ), migrations.RemoveField( model_name='order_process', name='order_process_user_started', ), migra...
[ "# Example script to use mlfb class #a = mlfb_test4.mlfb_test4(1) #a = mlfb.mlfb_test4(1)", "class #a = mlfb_test4.mlfb_test4(1) #a = mlfb.mlfb_test4(1) a = mlfb.mlfb(1) #input1=999 #input1=99.88 #input1=99,66", "import mlfb def main(): # Example script to use mlfb class #a =", "# (type_in, 'null', '20180226T...
[ "Community', author_email='<EMAIL>', url='https://github.com/RLBot/RLBotTraining', keywords=['rocket-league', 'training', 'train'], license='MIT License', classifiers=[ \"Programming Language :: Python", "native import statements as we don't want to depend on the package being", "long_description = readme_file....
[ "- 1. imgarr3 = (imgarr2*imgarr2).sum(2) mask = ~(imgarr3==3.0) imgarr3 *= mask imgarr3 =", "= 2.*imgarr - 1. imgarr3 = (imgarr2*imgarr2).sum(2) mask = ~(imgarr3==3.0) imgarr3 *= mask", "\"\"\" see if normals are plausible by looking at their norm. \"\"\" import", "~(imgarr3==3.0) imgarr3 *= mask imgarr3 = np...
[ "r'D:\\Data\\Class_data\\Alg_data\\FinalTask\\l_1.txt' path = r'D:\\Data\\Class_data\\Alg_data\\FinalTask\\F.txt' with open(path,'r',encoding='utf-8',errors='ignore') as f: string = '' # for", "f: # string += line.strip() # except: # continue string = f.read() print(len(string))", "path_save = r'D:\\Data\\Class...
[ "y, w, h) # print(bbox) # print('===========================') xmlbox.find('xmin').text = str(int(bbox[0])) xmlbox.find('ymin').text = str(int(bbox[2]))", "b) x, y, w, h = bb[0], bb[1], bb[2], bb[3] # print(x, y,", "xmlbox.find('xmax').text = str(int(bbox[1])) xmlbox.find('ymax').text = str(int(bbox[3])) if fla...
[ "gzip import shutil import logging logger = logging.getLogger(__name__) class Image: def __init__(self, client,", "is None and tag == 'latest': force = True logger.info(\"Tagging image {image} as", "if compress: open_func = gzip.open else: open_func = open with open_func(path, 'wb') as", "**kwargs) def get(se...
[ "that has been made on article \"\"\" body=models.TextField(max_length=500) createdAt=models.DateTimeField(auto_now_add=True) updatedAt=models.DateTimeField(auto_now=True) highlight_start = models.PositiveIntegerField(null=True,", "CommentReply(models.Model): \"\"\" Handles replying on a specific comment by made ...
[ "for epoch in range(MAX_EPOCH): for batch in range(data.batch_total): i, l = sess.run([ibatch, lbatch])", "'rb') as ff: for i,d in enumerate(ff): if only_path: path = d[:-1] label", "label_queue], batch_size=self.batch_size) return img_batch, label_batch if __name__ == '__main__': IMG_WIDTH = 1200 IMG_HEIGHT", ...
[ "# -*- coding: utf-8 -*- import deepnlpf.log as log class Execute (object): \"\"\"", "utf-8 -*- import deepnlpf.log as log class Execute (object): \"\"\" Execute Scripts External", "as ro r = ro.r r.source(script) return r.main(*args) def run_java(self, jar_file, *args): try:", "import rpy2.robjects as ro r =...
[]
[ "model: model.fit_ctr).sink(fit_ctr_list.append) n_fits = 10 for i in range(n_fits): X_stream.emit(X_example) y_stream.emit(y_example) predicate =", "pred_df = model.stream_predict(X, y_example=pd.DataFrame(data=example_data)) pred_series_list, pred_df_list = [], [] pred_series.stream.sink(pred_series_list.append...
[ "from selenium import webdriver import geckodriver_binary # Adds geckodriver binary to path def", "geckodriver binary to path def test_driver(): driver = webdriver.Firefox() driver.get(\"http://www.python.org\") assert \"Python\" in", "binary to path def test_driver(): driver = webdriver.Firefox() driver.get(\"...
[]
[ "# BaPSF group at UCLA. # # http://plasma.physics.ucla.edu/ # # Copyright 2017-2018 <NAME>", "class HDFReadDigiError(HDFReadError): \"\"\"Exception for failed HDF5 reading of digitizer.\"\"\" pass class HDFReadControlError(HDFReadError): \"\"\"Exception", "HDF5 reading of digitizer.\"\"\" pass class HDFReadCont...
[ "torchvision import transforms import torchvision.models as models from torch.utils.data import DataLoader from utils", "use_cuda = torch.cuda.is_available() np.random.seed(2019) torch.manual_seed(2019) device = torch.device(\"cuda\" if use_cuda else \"cpu\") print(\"Available", "network resnet_model = create_e...
[ "<reponame>VasseurLaurent/ansible-nwd import glob import os def get_list_files(path,list_files): for filename in glob.iglob(path + '**/*',", "glob import os def get_list_files(path,list_files): for filename in glob.iglob(path + '**/*', recursive=True): if", "import glob import os def get_list_files(path,list_fi...
[ "as plt from matplotlib.animation import FuncAnimation N = 100 world = np.zeros((N, N))", "0 pos_y = -8 player_score_text_handle = plt.text(pos_x, pos_y, \"blocks: 0\") perimeter_score_text_handle = plt.text(0,", "= 1 world[0,0] = amoebe_mark perimeters = get_neighs(*starting_point) ############################...
[ "from core.models import action, conduct, webui from core import helpers, logging, cache, settings", "continueFlow(self): if self.events: tempDataCopy = conduct.copyData(self.data) tempDataCopy[\"flowData\"][\"event\"] = self.events tempDataCopy[\"flowData\"][\"skip\"] = 1 self.events", "= { \"first\" : True, \...
[ "the License. ''' # USAGE # python face_headpose_dlib.py [--input 0] [--detthreshold 0.55] [--nmsthreshold", "np.array( [[focal_length, 0, center[0]], [0, focal_length, center[1]], [0, 0, 1]], dtype = \"double\"", "import cv2 import numpy as np import vart import pathlib import xir import", "= 0.35)\") args =...
[ "return self._percent @percent.setter def percent(self, value): self._percent = max(0.0, min(1.0, value)) def _draw(self):", "0.02, 1.0), 'FillColor2': (0.0, 0.42, 0.02, 1.0), 'FillColor3': (0.0, 0.42, 0.02, 1.0), 'FillColor4':", "the widget's parent :param name: the name of the widget :param percent: the", "...
[ "attrs) ''' 有了ListMetaclass,我们在定义类的时候还是指示要使用ListMetaclass来定制类,传入关键字参数metaclass: ''' class MyList(list, metaclass=ListMetaclass): pass ''' 当我们传入关键字参数metaclass时,魔术就生效了, 它指示Python解释器在创建MyList时, 要通过ListMetaclass.__new__()来创建。 在此,我们可以修改类的定义,比如,加上新的方法,然后,返回修改后的定义。", "__str__(self): return '<%s:%s>' % (self.__class__.__...
[ "np.zeros_like(state), \"constituency_matrix\": constituency_matrix, \"job_generator\": drjg.DeterministicDiscreteReviewJobGenerator( arrival_rate, buffer_processing_matrix, sim_time_interval=time_interval ), \"state_initialiser\": si.DeterministicCRWStateInitialiser(state), \"job_conservation_flag\": True,", "0,...
[ "torchvision import transforms def get_transforms(): normalize = Normalize(mean=[0.485, 0.456, 0.406],std=[0.229, 0.224, 0.225]) transform", "def get_transforms(): normalize = Normalize(mean=[0.485, 0.456, 0.406],std=[0.229, 0.224, 0.225]) transform = Compose([normalize]) return", "from torchvision.transforms i...
[ "Check that training and testing sets are disjoint # print(np.intersect1d(trainIndices, testIndices)) Xtrain =", "plt import pprint def missingIsNan(s): return np.nan if s == b'?' else float(s)", "column of 1s XtrainS1 = np.insert(XtrainS, 0, 1, 1) XtestS1 = np.insert(XtestS, 0,", "numbers rows = np.arange(nR...
[ "if m == 2: m = 12 elif m == 1: m =", "1: m = 11 else: m -= 2 c = year%100 print((day +", "11 else: m -= 2 c = year%100 print((day + ((13*m -1) //5)", "2: m = 12 elif m == 1: m = 11 else: m", "int(input(\": \")) year = int(input(\": \")) if m == 2: m = 12", "= int(input(\": \")) if m == 2: m = 12 elif m =...
[ "text not null primary key, date text, title text, content text, public integer", "key, date text, title text, content text, public integer db.close_connection() if __name__ ==", "# print(res) # (id text not null primary key, date text, title text,", "is a secret',3) # ) # res = db.select(\"SELECT * FROM blog...
[ "class ProvisioningContext: def __init__(self): self.runbook = None self.role = None context = ProvisioningContext()", "<gh_stars>0 class ProvisioningContext: def __init__(self): self.runbook = None self.role = None context =" ]
[ "'fcprobforward') and callable(layer.fcprobforward): x, _kl, = layer.fcprobforward(x) kl += _kl else: x =", "self.layers: if hasattr(layer, 'convprobforward') and callable(layer.convprobforward): x, _kl, = layer.convprobforward(x) kl += _kl", "BBBConv2d(256, 48, kernel_size=1) self.squeeze_activation5 = nn.Soft...
[ "class TestEmailValidator(unittest.TestCase): def test_validates_document(self): email_validator = EmailValidator() test_data = [ (\"<EMAIL>\", True), (\"<EMAIL>\",", "import EmailValidator class TestEmailValidator(unittest.TestCase): def test_validates_document(self): email_validator = EmailValidator() test_data...
[ "django.contrib import admin from .models import Balance class BalanceAdmin(admin.ModelAdmin): list_display = ('balance',) admin.site.register(Balance)", "from django.contrib import admin from .models import Balance class BalanceAdmin(admin.ModelAdmin): list_display = ('balance',)" ]
[ "\"\"\" self.set_error_rate(act_type_rate, slot_rate) def set_error_rate(self, act_type_rate, slot_rate): \"\"\" Set error rate parameter for", "self.set_error_rate(act_type_rate, slot_rate) def set_error_rate(self, act_type_rate, slot_rate): \"\"\" Set error rate parameter for error", "Apply the error model on...
[ "saberbot locations: json file containing the openweathermap location data \"\"\" def __init__(self, bot):", "location, country): print(location) for item in self.locations_json: if item[\"name\"] == location: if not", "l.append(country) l.append(location) print(l) location_id = self.get_location_id(location, c...
[]
[ "django.contrib import admin from .models import Article class ArticleAdmin(admin.ModelAdmin): model = Article admin.site.register(Article)", "from django.contrib import admin from .models import Article class ArticleAdmin(admin.ModelAdmin): model = Article" ]
[ "data_file_path: raise Exception(f\"invalid froot: {self.froot}\") self._path = self.froot.value+self._dir print(f\"updating path, will read data", "with these extensions std_image_size = { 'SAXS': (1043, 981), 'WAXS1': (619, 487), 'WAXS2':", "from {fn}: {data.shape}') #, return an empty frame instead.') except...
[ "PetPhotoSerializer(many=True, read_only=True) class Meta: model = Pet fields = (\"id\", \"name\", \"age\", \"type\",", "serializers.ImageField() class IdsSerializer(serializers.Serializer): \"\"\"Deserialization of pet IDs.\"\"\" ids = serializers.ListField( child=serializers.IntegerField(min_value=1), allow_emp...
[ "self.mean image_tag = prefix + '/' + 'image' self._writer.add_images(image_tag, images, step) reconstruction_tag =", "embeddings.detach().cpu().numpy() sim = cosine_distances(embeddings) self._writer.add_image('cos_sim_vq_embeddings', sim, step, dataformats='HW') def double_soft_orthogonality(weights: torch.Tens...
[ "'data/B/event.txt' # with open(source_file_name, \"r\") as source_file: data = source_file.read() key = 'b'", "= source_file.read() key = 'b' # context = {'b': 2} value = context[key]", "'data/A/event.txt' sink_file_name = 'data/B/event.txt' # with open(source_file_name, \"r\") as source_file: data = source_fi...
[ "Migration(migrations.Migration): dependencies = [ ('councilmatic_core', '0012_auto_20160707_1859'), ] operations = [ migrations.AlterField( model_name='bill', name='extras',", "1.9.7 on 2016-07-07 23:57 from __future__ import unicode_literals from django.db import migrations import", "max_length=255), ), migra...
[ "version, location, and installed files. Installed files requires a pip generated 'installed-files.txt' in", "package[key] = pkg_info_dict.get(key) # It looks like FeedParser can not deal with repeated", "for l in lines] paths = [os.path.join(dist.location, p) for p in paths] file_list", "Should pkg_resources...
[]
[]
[ "before the `EXTENSION` type of the Archived Source Package in the URI. #", "setting up `HTTPD` Dependency components.\", 'OS_SUPPORT' : { 'Unix': ['Solaris'], 'Linux': ['Ubuntu', 'RHEL']", ": \"Build Automation for setting up `HTTPD` Dependency components.\", 'OS_SUPPORT' : { 'Unix':", "store the Build Infor...
[ "parser = argparse.ArgumentParser(description='Update Positioner data') parser.add_argument('start', help='start date') parser.add_argument('end', help='end date') parser.add_argument('-o','--option', help='option:", "positioners') args = parser.parse_args() start_date = args.start end_date = args.end option = ar...
[ "layers to 512 * Adjusted flattening to match CIFAR-10 shapes * Replaced dropout", "v == 'M': layers += [nn.MaxPool2d(kernel_size=2, stride=2)] else: if isinstance(v, list): v, kernel_size,", "(epoch_id is not None) and (batch_id is not None): scio.savemat('../checkpoints/inter_features_epoch{}_batch{}.mat'.for...
[ "test_page_should_contain_string_custom_message( mocker: MockerFixture, under_test: x3270 ): mocker.patch(\"Mainframe3270.py3270.Emulator.string_get\", return_value=\"abc\") with pytest.raises(Exception, match=\"my error message\"):", "with pytest.raises(Exception, match='The string \"ghi\" was not found'): under...
[ "[2, 2]]).translate(1) self.assertEqual(sp[1.5], 0) self.assertEqual(sp[2.5], 1) def test_slice(self): series = DiscreteSeries([[0, 0], [1,", "'(-1;6)') self.assertIsInstance(sa, DiscreteSeries) self.assertEqual(sa.data, [(i, i ** 2) for i in PTS]) sa", "1, 2, 3, 1, 2, 3, 1]) def test_comp_discrete(self): ser1 ...
[ "Command from werkzeug.utils import send_from_directory api_routes_blueprint = Blueprint('api_routes', __name__) execute: Callable[[Union[Command, str], Optional[Dict[str,", "from src.utils.remote import Command from werkzeug.utils import send_from_directory api_routes_blueprint = Blueprint('api_routes', __name__...
[ "Unless required by applicable law or agreed to in writing, software # distributed", "% {\"wsdir\": self.wsdir, \"env_path\": os.environ[\"PATH\"]}) ) os.environ[\"ROS_PACKAGE_PATH\"] = os.pathsep.join([\"/before\"] + [\"%s/src/%s\" % (self.wsdir,", "helper.run_rosrepo(\"config\", \"-w\", self.wsdir, \"--offlin...
[ "{ \"folder\": folder, \"prefix\": Profiler.FILES_PREFIX, \"sufix\": Profiler.FILES_SUFFIX, \"full_path\": True, } self.actuator.cfg(cfg) def profile(self):", "logger.info(\"Could not load profiler output %s\", value) return self.profiles if __name__ == \"__main__\":", "formatter = logging.Formatter('%(asctime)...
[ "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES", "def __eq__(self, other): \"\"\" NullField is always not equal to any other value.", "this list of conditions and the following disclaimer. # 2. Redistributions in binary", "null field that does not exists. \"\"\" def __...
[ "Device) -> str: return device.app_current()['package'] + device.app_current()['activity'] def activity_window(device: Device, activity: str) ->", "\"\"\" from adbutils import adb import uiautomator2 as u2 from uiautomator2 import Device", "#\\\"\") return wins.output.strip().split('\\n') def stop_app(device: D...
[ "executable, '--www-port=' + str(port), '--rsession-which-r=' + _get_r_executable(), ] env = get_r_env() if env.get('LD_LIBRARY_PATH'):", "env def setup_shiny(): '''Manage a Shiny instance.''' def _get_shiny_cmd(port): # server.r_path ??? conf", "os import tempfile import subprocess import getpass import shutil...
[ "in s: if (i.islower()): res.append(chr(219 - ord(i))) else: res.append(i) return ''.join(res) text =", "- ord(i))) else: res.append(i) return ''.join(res) text = \"chika chika\" a = cipher(text)", "if (i.islower()): res.append(chr(219 - ord(i))) else: res.append(i) return ''.join(res) text = \"chika chika\"", ...
[ "os.path.join('/nfs/masi/leeh43/MULAN_universal_lesion_analysis/results') file_list= get_files_endswith(data_dir, '.txt') data_list = [] for i in file_list: with open(i)", "file_list file_list = [] dirs_list = [] data_dir = os.path.join('/nfs/masi/leeh43/MULAN_universal_lesion_analysis/results') file_list= get_fi...
[ "return \"metric\" @property def UnitModules(self): return [ self.Millimeter, self.Centimeter, self.Decimeter, self.Meter ] @property", "return Millimeter @property def Centimeter(self): from .centimeter import Centimeter return Centimeter @property def", "# May need to be \"id\" for combos \"abbreviation\": mo...
[ "= DateTimeCreatedField() modified_at = DateTimeModifiedField() class Meta: get_latest_by = \"modified_at\" ordering = (\"-modified_at\",", "from django.db import models from .fields import DateTimeCreatedField, DateTimeModifiedField class BaseModel(models.Model): created_at =", "DateTimeModifiedField class Bas...
[ "hib_sql_connection.queryToHibiscus(connection, \"select * from umsatz where betrag < 0;\") def getIncomingTransfers(): connection =", "0;\") def getIncomingTransfers(): connection = hib_sql_connection.connectToHibiscus() return hib_sql_connection.queryToHibiscus(connection, \"select * from umsatz where", "def ...
[ "config[\"label\"] = \"{}{}\".format(config[\"label\"],config[\"period\"]) BaseIndicator.__init__(self,csdata,config) self.chartcolors = [\"mediumslateblue\"] self.data = None self.analysis = None", "= None raise ex return self.data def get_analysis(self ): if self.data is None:", "get_ema(self): if self.csdata...