query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
The function makes currying.
def carry(function): def dec_1(first_arg): def dec_2(second_arg): def dec_3(third_arg): def dec_4(fourth_arg): print(first_arg + second_arg + third_arg + fourth_arg) return function return dec_4 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def curry(func):\n def curried(*args, **kwargs):\n return func(args, **kwargs)\n return curried", "def _(func, *args, **kwargs):\r\n return CurryingWrapper(func, *args, **kwargs)", "def _compat_curry(fun, *args, **kwargs):\n\n def _curried(*addargs, **addkwargs):\n return fun(*(args+a...
[ "0.8128945", "0.75029737", "0.7459536", "0.7189017", "0.70955986", "0.7085532", "0.70025253", "0.6770132", "0.6730792", "0.6678913", "0.6391263", "0.6336106", "0.6202939", "0.6059338", "0.5997176", "0.59315217", "0.5907922", "0.58864945", "0.58152425", "0.5729332", "0.5727609...
0.5496153
41
The function to curry.
def given_func(arg_1, arg_2, arg_3, arg_4): return arg_1 + arg_2 + arg_3 + arg_4
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def curry(func):\n def curried(*args, **kwargs):\n return func(args, **kwargs)\n return curried", "def curry2(f):\n return lambda x: lambda y: f(x, y)", "def curry(f: Callable) -> Callable:\n @functools.wraps(f)\n def decorator(*args: object, **kwargs: object) -> Any:\n return Curr...
[ "0.7753282", "0.7037408", "0.7028376", "0.7009016", "0.6910099", "0.68881893", "0.680502", "0.6618646", "0.6539153", "0.6523903", "0.649776", "0.62962383", "0.62244517", "0.6130228", "0.59942424", "0.5978484", "0.5952794", "0.5945213", "0.59353554", "0.586335", "0.5792939", ...
0.0
-1
Main loop of the game
def gameloop(self): # What you see above (""" some text """) is called a docstring. # It explains the purpose of the method/function. # There should generally be one for every function. # Below is the main loop while True: # One cycle in the loop is equiv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Gameloop():", "def main():\n g = Game(800, 600)\n g.start()", "def main():\r\n gameclass = data.game.GameClass()\r\n gameclass.main_loop()", "def GAME_LOOP():\n pass", "def main():\n g = DemoGame(800, 600)\n g.start()", "def game_loop(self):\n self.interface.game_loop(...
[ "0.8618443", "0.8491576", "0.8377245", "0.8225048", "0.8171834", "0.8108598", "0.80508864", "0.80445045", "0.80276704", "0.79887885", "0.79750353", "0.79735273", "0.7931562", "0.78987134", "0.7891214", "0.7877787", "0.78247064", "0.7808233", "0.77779156", "0.7738986", "0.7738...
0.7991744
9
Refreshes the screen, and keeps the framerate stable
def update_display(self): # The display.update() Updates the screen, making the new frame replace the old one. pg.display.update() # clock.tick sets a framerate for the game. # This is to make the game run at a stable fps self.clock.tick(cng.FRAMERATE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh(self) -> None:\n self.screen.refresh()", "def refresh_screen(self):", "def _update_screen(self):\n self.screen.fill((250,250,250))\n self.rocket.blitme()\n pygame.display.flip()", "def update(self):\r\n pygame.display.update()\r\n return", "def _refresh...
[ "0.83246535", "0.7862803", "0.76323617", "0.752276", "0.7522323", "0.74499613", "0.73839813", "0.7364671", "0.7351016", "0.72493345", "0.7239161", "0.70169955", "0.70018166", "0.6962198", "0.69360656", "0.6918648", "0.6893443", "0.68931735", "0.687911", "0.6869362", "0.684624...
0.75532764
3
Widget to reclassify raster/feature_class into local classes
def __init__(self, *args, **kwargs): self.dense = True # Create table super().__init__(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reclassify(self):\n if not self.checkConditions():\n return\n \n somethingMade = False\n reclassifiedFeatures = 0\n \n #button that sent the signal\n self.buttonName = self.sender().text()\n (reclassificationLayer, self.category, self.edgvClass...
[ "0.6807139", "0.56661713", "0.558603", "0.5570115", "0.5464505", "0.52979136", "0.5291363", "0.52849865", "0.5284896", "0.52798796", "0.5200945", "0.51445824", "0.5142979", "0.51421237", "0.51225793", "0.51190907", "0.51189446", "0.5117211", "0.51104474", "0.5097539", "0.5094...
0.0
-1
Init table reading local classes file and code/categories fields
def _get_matrix(self, code_fields, classes_file=''): self.matrix = {} # Set empty items if there is not a file selected self.items = [] if classes_file: self.items = self.read_classes_from_file(classes_file) headers = ['From: user code...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n TableLoader.__init__(self, **kwargs)\n \n self._top_level_categories_ = ['Mathematics',\n 'People',\n 'Science',\n 'Law',\n 'History',\n 'Culture',\n 'Politics',\n 'Technology',\n 'Education',\n ...
[ "0.68784857", "0.67007977", "0.67007977", "0.67007977", "0.67007977", "0.67007977", "0.67007977", "0.67007977", "0.67007977", "0.67007977", "0.67007977", "0.67007977", "0.6250758", "0.6238833", "0.6183437", "0.61654633", "0.61508626", "0.6150765", "0.6121898", "0.6098673", "0...
0.0
-1
Read classes from .csv file
def read_classes_from_file(self, class_file): items = [] with open(class_file) as f: for cl in f.readlines(): # c:code, d:description item = [{'value': c, 'text': f'{c}: ' + d.replace('\n','')} for c, d in [cl.split(',')]] items+=item ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_csv():", "def load_class_list():\r\n try:\r\n firstLine = True #keeping track of the first line in the csv file (the header)\r\n index = 0\r\n if os.access(\"mySchedule.csv\", os.F_OK): #If the file exists\r\n f = open(\"mySchedule.csv\")\r\n for row in csv....
[ "0.73640335", "0.7316954", "0.7263384", "0.7037231", "0.7030433", "0.69492215", "0.6938637", "0.68829817", "0.6876325", "0.67768806", "0.677276", "0.670412", "0.6661229", "0.6641916", "0.6617991", "0.65395534", "0.64838445", "0.64634323", "0.64495176", "0.6403338", "0.6369451...
0.57443583
73
Store user row code and new select value (file class)
def store(self, code, change): self.matrix[code] = change['new']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_row_to_insert(self, data_row, option_file):\n data_dict = {}\n\n if(option_file == 'distelec'):\n data_dict = {\n \"codigo_electoral\": data_row[0],\n \"provincia\": data_row[1].strip(),\n \"canton\": data_row[2].strip(),\n ...
[ "0.593672", "0.5832076", "0.5602219", "0.55295897", "0.5498477", "0.5468663", "0.53920156", "0.53917986", "0.5379102", "0.535196", "0.53162205", "0.5312261", "0.5241234", "0.5227456", "0.51944655", "0.5179577", "0.51707476", "0.5152179", "0.5152179", "0.5084932", "0.5078263",...
0.0
-1
Get class selector on the fly and store code to matrix
def get_classes(self, code): select = v.Combobox( _metadata={'name':code}, items=self.items, v_model=None, dense=True, hide_details=True ) select.observe(partial(self.store, code), 'v_model') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_class(numlist,classlist=string.ascii_lowercase):\n\n return np.vectorize(lambda t: classlist[t])(numlist)", "def to_class(numlist,classlist=string.ascii_lowercase):\n\n return np.vectorize(lambda t: classlist[t])(numlist)", "def identify_class(self, cls):", "def _classifier(self, classes):\n ...
[ "0.5367522", "0.5367522", "0.5352208", "0.5264769", "0.52475744", "0.52023804", "0.5068794", "0.5063609", "0.50205195", "0.5015453", "0.50087535", "0.49962926", "0.49717507", "0.49532643", "0.49110916", "0.49093753", "0.48867622", "0.48821568", "0.4837388", "0.48327234", "0.4...
0.0
-1
Clone or pull repo using Git depending on if it exists or not.
def update_git_repo(webhook): # TODO: Fail fast if a repo doesn't exist project_path = os.path.join(Global.PROJECTS_PATH, Global.repo_full_name(webhook)) if os.path.exists(project_path): output = Git.pull_repo(project_path, webhook) else: output = Git.clone_repo(p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _clone_gitrepo():\n # Puts git repo in ~/.ssh/config to avoid interaction due to missing known_hosts\n git_server = urllib.splituser(urllib.splittype(env.project['git_repo'])[0])[1]\n if not files.exists('~/.ssh/config') or not files.contains('~/.ssh/config', git_server):\n files.append('~/.ssh...
[ "0.73447335", "0.73035216", "0.72421116", "0.7090096", "0.6912739", "0.6888623", "0.6865049", "0.68422073", "0.6772946", "0.67509604", "0.6737348", "0.6725153", "0.66586995", "0.66022795", "0.6589142", "0.6562682", "0.64966714", "0.6482546", "0.64669746", "0.6456992", "0.6408...
0.5928002
64
Pull updates for a repo in the Harvey projects folder.
def pull_repo(project_path, webhook): try: final_output = subprocess.check_output( # TODO: Rebase without the need to specify the branch f'git -C {project_path} pull --rebase origin main', stdin=None, stderr=None, shell=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_from_repo():\n\treturn", "def pull(args):\n do_all_projects(args + [\"pull\"])", "def update():\n call('git -C ~/norminette+ pull', shell=True)", "def run(self):\n self.update_repos()", "def git_pull(where=None):\n config = get_config(where)\n with settings(host_string=config['h...
[ "0.73854375", "0.72276235", "0.7226156", "0.69447446", "0.6878521", "0.68385345", "0.66932493", "0.6640741", "0.66180634", "0.6557121", "0.64469326", "0.63802475", "0.63315153", "0.6311704", "0.62625736", "0.62582576", "0.62278783", "0.6208341", "0.61823314", "0.6167809", "0....
0.67034894
6
Clone a repo into the Harvey projects folder.
def clone_repo(project_path, webhook): try: final_output = subprocess.check_output( f'git clone --depth=10 {Global.repo_url(webhook)} {project_path}', stdin=None, stderr=None, shell=True, timeout=Global.GIT_TIMEOUT, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clone():\n with cd(os.path.dirname(env.proj_root.rstrip('/'))):\n run('git clone --recursive %s' % (git_repo,))", "def clone_repo():\n with settings(warn_only=True):\n run('git clone %(repository_url)s %(repo_path)s' % env)", "def clone(self):\n out, err, code = self.command( [\"...
[ "0.77692336", "0.7594056", "0.73292404", "0.73037136", "0.7276886", "0.72755396", "0.72170615", "0.7151643", "0.6946478", "0.69039273", "0.68761927", "0.683624", "0.6801833", "0.67621565", "0.66591036", "0.66388273", "0.659276", "0.65672845", "0.6550663", "0.65505", "0.653900...
0.70394915
8
Generate a file that represents locations in Calliope.
def construct_locations(path_to_shapes, path_to_land_eligibility_km2, path_to_hydro_capacities_mw, path_to_biofuel_potential_mwh, flat_roof_share, maximum_installable_power_density, scaling_factors, biofuel_efficiency, path_to_output_yaml, path_to_output_csv): locatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeLocationPtShapefile(config,locationData):\n\n\n # set up the shapefile driver\n driver = ogr.GetDriverByName(\"ESRI Shapefile\")\n\n num_years = config.EndYear\n \n for iteration in range(config.MinimumIteration, config.MaximumIteration + 1):\n for year in range(1, num_years + 1):\n\n...
[ "0.63554776", "0.62833744", "0.62250984", "0.6023786", "0.5978605", "0.5890049", "0.58753896", "0.5832321", "0.5797035", "0.5796448", "0.5791602", "0.57861376", "0.5766778", "0.57144153", "0.5708117", "0.57072043", "0.56742126", "0.5648806", "0.5602178", "0.55888146", "0.5572...
0.5993339
4
Compute weighted UniFrac with or without branch length normalization
def weighted_unifrac(u_counts, v_counts, otu_ids, tree, normalized=False, validate=True, **kwargs): if validate: _validate(u_counts=u_counts, v_counts=v_counts, otu_ids=otu_ids, tree=tree) u_obs_otu_counts = _observed_otu_counts(u_counts, otu_ids) u_total_count...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_weights(self, w):\n n = w.astype(np.float64, copy=True)\n c = float(np.sum(w))\n n /= c\n return n", "def compute_norm_fac_per_weight(fan_in):\n ksi = 1. / math.sqrt(fan_in)\n return (1 / 3) * ksi ** 2", "def u(self, k, m, z):\n result = (1. - self.fb) * sel...
[ "0.62866193", "0.6168332", "0.60630053", "0.60494703", "0.5957002", "0.59218806", "0.5918151", "0.58993274", "0.58558947", "0.5850155", "0.5842917", "0.5827281", "0.5779808", "0.5770108", "0.5739889", "0.56738794", "0.56464136", "0.56451756", "0.56447554", "0.56447554", "0.56...
0.61756164
1
to be call with .csv to return csv see views landcover/get_landcover_csv.csv
def get_landcover(): wdpaid = request.args[0] landcover = db(db.landcover.wdpaid==wdpaid).select(db.landcover.lc_2000, db.landcover.lc_2010, db.landcover.areakm2) return dict(landcover=landcover)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_csv():", "def main(csv_name):\n BASE_URL = \"https://www.thrashermagazine.com/{}\"\n COVER_URL = BASE_URL.format(\"covers/\")\n\n page = requests.get(COVER_URL)\n\n soup = BeautifulSoup(page.content, 'html.parser')\n image_spans = soup.find_all(\"span\", class_=\"icons\")\n date_spans ...
[ "0.66249716", "0.6470151", "0.6278387", "0.62153035", "0.6078332", "0.60775775", "0.6066134", "0.60183424", "0.5897358", "0.58904845", "0.58735585", "0.5837709", "0.58255124", "0.5822193", "0.57970434", "0.57764256", "0.5771422", "0.57561743", "0.57504046", "0.57358587", "0.5...
0.0
-1
Assert that two Expressions are equal
def assert_equal(left, right): msg = "{} != {}".format(left, right) assert left == right, msg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assertExpressionEqual(self, left, right):\n\n stmt = sa.select([left.label(\"value\")], from_obj=self.table)\n result = self.engine.execute(stmt)\n left_result = [row[\"value\"] for row in result]\n\n\n stmt = sa.select([right.label(\"value\")], from_obj=self.table)\n result ...
[ "0.7290886", "0.72509766", "0.71756524", "0.699899", "0.68636274", "0.6852251", "0.6833598", "0.6825536", "0.6778559", "0.671169", "0.66600335", "0.66432226", "0.6625708", "0.6545947", "0.6511113", "0.64782494", "0.6468275", "0.6468275", "0.6436739", "0.6402951", "0.63754636"...
0.63558614
25
Generate test cases from an iterable of ordered pairs
def generate_from_data(self, data): for left, right in data: yield self.assert_equal, left, right
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_what_to_run_concepts(pairs_to_test):\n\n pairs_for_sstesting = []\n # prepare pairs for concpet vs random.\n for pair in pairs_to_test:\n for concept in pair[1]:\n pairs_for_sstesting.append([pair[0], [concept]])\n return pairs_for_sstesting", "def _test_pairs(self, idx0...
[ "0.6630613", "0.6215423", "0.6009414", "0.60061336", "0.5980631", "0.5979496", "0.5959456", "0.5958225", "0.580495", "0.5800429", "0.57898694", "0.57013935", "0.5682468", "0.56762177", "0.56751466", "0.56724614", "0.564519", "0.56307524", "0.563066", "0.562664", "0.56140083",...
0.59740925
6
test composing variables with all operators
def test_first_level_composition(self): oe = expression.OperationalExpression v1, v2 = map(expression.Variable, ["v1", "v2"]) data = [ [(v1 + v2), oe('+', v1, v2)], [(v1 - v2), oe('-', v1, v2)], [(v1 / v2), oe('/', v1, v2)], [(v1 * v2), oe('*', v1,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_operator_sanity(self):\r\n var1 = 5.0\r\n var2 = 2.0\r\n operators = [('+', 7), ('-', 3), ('*', 10), ('/', 2.5), ('^', 25)]\r\n\r\n for (operator, answer) in operators:\r\n input_str = \"{0} {1} {2}\".format(var1, operator, var2)\r\n result = calc.evaluato...
[ "0.70314986", "0.6903428", "0.66045415", "0.65166736", "0.6297173", "0.62969416", "0.62389696", "0.6236109", "0.62030494", "0.61995924", "0.6189159", "0.6182945", "0.6145458", "0.6145458", "0.6132459", "0.6131872", "0.6077709", "0.6050098", "0.60376734", "0.60126805", "0.6009...
0.0
-1
test medium level composition of expressions
def test_primitive_composition(self): oe = expression.OperationalExpression v1 = expression.Variable("v1") f = Fraction(3 / 5) data = [ [(v1 + 1), oe('+', v1, 1)], [(v1 - 2.0), oe('-', v1, 2.0)], [(v1 / f), oe('/', v1, f)], [(1 * v1), oe('*...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_expr(self):\n self.common_test_expr(True)", "def test_expression(x, y, z):\n return x * y + y / z", "def test_second_level_composition(self):\n oe = expression.OperationalExpression\n v1, v2 = map(expression.Variable, [\"v1\", \"v2\"])\n exp = (v1 + v2) / (v1 - v2)\n ...
[ "0.77058685", "0.71593964", "0.67252547", "0.655287", "0.63776237", "0.6375139", "0.6357889", "0.6337127", "0.63133055", "0.6308272", "0.6283322", "0.6200537", "0.6189136", "0.61859864", "0.6176959", "0.61450034", "0.61379457", "0.6122228", "0.6110731", "0.61077434", "0.60823...
0.60047615
27
test slightly harder composition of expressions
def test_second_level_composition(self): oe = expression.OperationalExpression v1, v2 = map(expression.Variable, ["v1", "v2"]) exp = (v1 + v2) / (v1 - v2) expected_exp = oe('/', oe('+', v1, v2), oe('-', v1, v2)) self.assert_equal(exp, expected_exp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_expr(self):\n self.common_test_expr(True)", "def test_composition(self):\n\n i = Code()\n j = Code()\n k = Code()\n l = Code()\n\n c = j + i ** i // 5 / l < j - k\n self.assertEqual(str(c), 'j + i ** i // 5 / l < j - k')", "def test_bin_op_support():\n ...
[ "0.7180387", "0.67720294", "0.6408602", "0.64034086", "0.6381854", "0.62376976", "0.6234587", "0.6092578", "0.6032658", "0.6000569", "0.5960447", "0.59546", "0.5917527", "0.59171945", "0.5895119", "0.5881925", "0.5850813", "0.58494717", "0.5838811", "0.5827639", "0.5826372", ...
0.67275876
2
Test a composing expression that has vectors with variable attributes
def test_compose_vectors_with_attrs(self): oe = expression.OperationalExpression v1, v2 = map(expression.Variable, ["v1", "v2"]) exp = 1 + V(v1.x, v2.y) expected_exp = oe('+', 1, V(v1.x, v2.y)) self.assert_equal(exp, expected_exp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_complex_extraction_of_values(self):\n\t\ta = bf.Var(\"a\")\n\t\tb = bf.Var(\"b\")\n\t\tc = bf.Var(\"c\")\n\t\tformula = bf.And([bf.Or([b, a, c]), bf.Or([bf.Not(a), bf.Not(c)]), bf.Not(b)])\n\t\tself.assertEqual([\"a\", \"b\", \"c\"], au.extract_variables(formula), \"Invalid variables extracted, expected [...
[ "0.6213941", "0.60124946", "0.58145964", "0.57848656", "0.57236844", "0.57096756", "0.567647", "0.56665623", "0.5648646", "0.56261915", "0.5604976", "0.55950737", "0.55904126", "0.55702084", "0.5555966", "0.5552883", "0.5525541", "0.55212194", "0.54941386", "0.5478895", "0.54...
0.78425336
0
Function to start the process of saving the commands to xml.
def Write_XML(gui): # lock buttons gui.action_lock('Lock', gui.save_button) # clear output gui.output_clear() # get the desired delay from the gui. delay_time = gui.get_delay() # get the desired ascii delay from the gui. ascii_time = gui.get_ascii_delay() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _send_xml_cli(self, commands, no_end=False):\n if isinstance(commands, str):\n commands = [commands]\n if not no_end:\n commands.append(\"end\")\n self.logger.debug(\"Sending commands {} to {}\".format(str(commands), self.host))\n try:\n self._ncc.nx...
[ "0.6063771", "0.5795947", "0.5710056", "0.5695167", "0.5617394", "0.5534581", "0.5529304", "0.551602", "0.5449832", "0.54495037", "0.5444347", "0.5399038", "0.53412414", "0.53403497", "0.530564", "0.5292865", "0.529165", "0.52267593", "0.52267593", "0.52267593", "0.52267593",...
0.5952237
1
Function to load a command set, delays and address from a saved xml file
def Load_XML(gui): # lock the buttons gui.action_lock('Lock', gui.xml_button) # prepare to open a window to load a file through file_opt = options = {} options['defaultextension'] = '.xml' options['filetypes'] = [('xml files', '.xml')] options['initialdir'] = os.getcwd() + '/xml...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadData(self,filepath):\r\n self.removeCheckbuttons()\r\n self.tree = ET.parse(filepath)# Parse xml Tree\r\n self.data = self.tree.getroot().find(\"data\")# Find Data\r\n self.sensors = [i.text for i in self.tree.getroot().find('columns')]# Get Sensor Names\r\n for s in self...
[ "0.6020558", "0.55900437", "0.547431", "0.5467832", "0.54143196", "0.54053646", "0.5335379", "0.5326394", "0.5290998", "0.5274877", "0.5269875", "0.526416", "0.52612525", "0.52557683", "0.5247965", "0.52428174", "0.52398396", "0.52201504", "0.52079225", "0.52027446", "0.51986...
0.6403766
0
Function to read in the default values for GUI parameters from XML
def update_gui_defaults(GUI_defaults): # failure flag config_import_error = False # xml source directory src_dir = os.getcwd() + '\\src' # attempt to parse the xml file and get it's root try: tree = ET.parse(src_dir + '\\pySCPI_config.xml') root = tree.getroot() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initDefaults(self):\n return _libsbml.Parameter_initDefaults(self)", "def _read_custom_pars(self):\n if self.use_defaults:\n param_set = \"default_values\"\n else:\n param_set = \"parameters\"\n self.outpars = self.input_cfg_json_data[param_set][self.step_tit...
[ "0.60259306", "0.5917316", "0.5879052", "0.58556134", "0.5806529", "0.5773313", "0.57520735", "0.5735366", "0.5723001", "0.5692128", "0.5658283", "0.56419754", "0.5638085", "0.5636669", "0.5633002", "0.5620782", "0.55702066", "0.55439883", "0.55336916", "0.5531336", "0.552916...
0.6818052
0
Function to import updated SCPI library information from XML.
def update_commands(SCPI_library): # failure flag config_import_error = False # xml source directory src_dir = os.getcwd() + '\\src' # try to parse the xml file and get it's root try: tree = ET.parse(src_dir + '\\SCPI_Commands.xml') root = tree.getroot() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _populate_from_xml_file(self, xml):\n '''\n example from API: http://www.ga.gov.au/www/argus.argus_api.survey?pSurveyNo=921\n\n <?xml version=\"1.0\" ?>\n <ROWSET>\n <ROW>\n <SURVEYID>921</SURVEYID>\n <SURVEYNAME>Goomalling, WA, 1996</SURVEYN...
[ "0.58593714", "0.56911325", "0.5407649", "0.53319305", "0.53311896", "0.53112024", "0.52964", "0.5261561", "0.5247046", "0.5242455", "0.52102464", "0.51831394", "0.51444477", "0.51391345", "0.51136756", "0.5014432", "0.49752128", "0.49142268", "0.49138352", "0.49101362", "0.4...
0.53175026
5
Write an Aardvark compatible .xml file that can be used with the Total phase system or loaded back into pySCPI
def create_XML(directives, gui): # unpack the directives commands = directives.command_list Delay = directives.delay_time Ascii_delay = directives.ascii_time addr = directives.addr # Start XML aardvark = ET.Element('aardvark') # starup comment for historical reasons ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saving_file(xml):\r\n\r\n xml_string = etree.tostring(xml)\r\n parsed = minidom.parseString(xml_string)\r\n with open(self.app_path + \"\\\\temp_\\\\\" + file_name + \".xml\", \"w\") as file:\r\n file.write(parsed.toprettyxml(indent=\" \"))", "def export...
[ "0.6515338", "0.63872993", "0.6364386", "0.6297682", "0.62434924", "0.6230958", "0.621191", "0.60897154", "0.60321975", "0.6010241", "0.5969192", "0.5957748", "0.59319156", "0.59156126", "0.58857924", "0.5852645", "0.58315367", "0.57871634", "0.5785052", "0.5784642", "0.57793...
0.644834
1
Function to improve the readability of the xml file produced.
def beautify_xml(XML): # convert XML file to modifiable string to beautify it text_string = ET.tostring(XML, encoding='UTF-8', method='xml') # insert line breaks before end of file tag file_string = text_string.replace('</aardvark>', '\n\n</aardvark>') # insert double new line before comme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xml(self):\n raise NotImplementedError('must be implemented by all subclasses')", "def writeXml(self):\n text = u' type=\"%s\"' % self.typeName\n if self.format:\n text += u' format=\"%s\"' % escape(self.format, treedoc.escDict)\n if self.prefix:\n text += u'...
[ "0.65539247", "0.63723135", "0.63601106", "0.633199", "0.63063323", "0.63027126", "0.6289212", "0.6213498", "0.62073106", "0.6194992", "0.6152282", "0.6151681", "0.6146073", "0.6137961", "0.61245584", "0.609112", "0.6061833", "0.606017", "0.60590106", "0.6041505", "0.6037666"...
0.676322
0
Save the configuration requested by a config command to XML
def update_XML(command, address, XML): # return value new_address = address # split command into list command_list = command.split(' ') command_arg = command_list[1][0:-1] # determine the appropriate action to take if (command_list[0] == '<DELAY') and command_arg.isdigit(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_config():\n\n e = Element(\"Configuration\")\n r = SubElement(e, \"RepositoryList\")\n r = SubElement(r, \"Repository\", name = \"default\")\n SubElement(r, \"Module\").text = args.driver\n SubElement(r, \"TokenLabel\").text = args.token_label\n SubElement(r, \"PIN\").text = args.pin\n ElementTree...
[ "0.76294816", "0.7332591", "0.72645265", "0.7191158", "0.7133609", "0.71090084", "0.70826906", "0.6991815", "0.69753504", "0.69223756", "0.6897391", "0.6830783", "0.6830552", "0.6826689", "0.68222356", "0.68165976", "0.67617404", "0.67575526", "0.6747976", "0.6741561", "0.674...
0.0
-1
Fill in container instructions
def __instructions(self): self += comment('Arm Allinea Studio version {}'.format(self.__version)) if self.__ospackages: self += packages(ospackages=self.__ospackages) if self.__tarball: self += copy(src=self.__tarball, dest=self.__wd) self += shell(commands=se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_instructions(self):\n #de, aux, vers = self.rods\n de, aux, vers = 0, 1, 2\n n = self.num_rings\n\n self.recur(n, de, aux, vers)\n\n ### Add dummy tuple at end so I can look one move ahead on states\n self.instructions.append((0, 0, 0))", "def instructions(self)...
[ "0.61357474", "0.5750941", "0.5637806", "0.5637374", "0.55108917", "0.54922396", "0.5417737", "0.5323309", "0.5283579", "0.5279315", "0.52423096", "0.51637995", "0.5158927", "0.5156974", "0.51351786", "0.50859696", "0.5071212", "0.50173676", "0.49817103", "0.49499556", "0.494...
0.4697476
59
Based on the Linux distribution, set values accordingly. A user specified value overrides any defaults.
def __distro(self): if hpccm.config.g_linux_distro == linux_distro.UBUNTU: self.__directory_string = 'Ubuntu-16.04' # By specifying an install prefix, the installer bypasses # the deb package manager (debs are not relocatable like # rpms). Therefore, remove the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __distro(self):\n\n if hpccm.config.g_linux_distro == linux_distro.UBUNTU:\n if not self.__ospackages:\n self.__ospackages = ['build-essential', 'cpio']\n self.__bashrc = '/etc/bash.bashrc'\n elif hpccm.config.g_linux_distro == linux_distro.CENTOS:\n ...
[ "0.593223", "0.58652776", "0.585403", "0.576295", "0.576295", "0.5558115", "0.55375224", "0.5533098", "0.5482613", "0.54246676", "0.54144907", "0.5398145", "0.53678435", "0.5332948", "0.52729666", "0.5230247", "0.5221588", "0.5180811", "0.51568455", "0.515432", "0.5151007", ...
0.53032106
14
Construct the series of shell commands, i.e., fill in self.__commands
def __setup(self): if self.__tarball: tarball = posixpath.basename(self.__tarball) # Figure out the version from the tarbal name match = re.match(r'Arm-Compiler-for-HPC_(?P<year>\d\d)\.0?(?P<month>[1-9][0-9]?)', tarball) if match and...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commands():", "def process_commands(self, commands: List[str]):", "def command_create(self):\n command = []\n for macro in self.my_xml.tool_data[self.shell_dict['short_name']]['pre_tmpls']:\n command.append(self.my_xml.chth_tmpl.substitute(macro=macro))\n command.extend(self...
[ "0.6871228", "0.679808", "0.67225176", "0.6588337", "0.6577435", "0.65688705", "0.65423495", "0.6525996", "0.6524536", "0.6510382", "0.650695", "0.650695", "0.650695", "0.650695", "0.6501545", "0.6494713", "0.6449746", "0.6449303", "0.6420589", "0.6417928", "0.64127463", "0...
0.0
-1
Generate the set of instructions to install the runtime specific components from a build in a previous stage. Examples ```python a = arm_allinea_compiler(...) Stage0 += a Stage1 += a.runtime() ```
def runtime(self, _from='0'): instructions = [] instructions.append(comment('Arm Allinea Studio')) gcc_path = posixpath.join( self.__prefix, 'gcc-{0}_Generic-AArch64_{1}_aarch64-linux'.format( self.__gcc_version, self.__directory_string)) llvm_pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_runtime(self):\n s0 = Stage()\n s0 += gnu()\n s0 += shell(commands=['gcc -o hello hello.c'])\n s1 = Stage()\n s1 += s0.runtime()\n self.assertEqual(str(s1),\nr'''# GNU compiler runtime\nRUN yum install -y \\\n libgfortran \\\n libgomp && \\\n rm -...
[ "0.6434725", "0.620022", "0.61711156", "0.5887484", "0.5721989", "0.5680253", "0.5664536", "0.550372", "0.5462016", "0.53730744", "0.5336362", "0.5336342", "0.53230923", "0.5300937", "0.52958727", "0.5276965", "0.52585906", "0.52580607", "0.5237822", "0.51931524", "0.51877236...
0.68220097
0
load stock time and price data for two stocks The return values (d1,p1,d2,p2) are the trade time (in days) and prices for stocks 1 and 2 (intc and aapl)
def get_two_stock_data(): ticker1, ticker2 = 'INTC', 'AAPL' file1 = cbook.get_sample_data('INTC.dat.gz') file2 = cbook.get_sample_data('AAPL.dat.gz') M1 = fromstring(file1.read(), '<d') M1 = resize(M1, (M1.shape[0]//2, 2)) M2 = fromstring(file2.read(), '<d') M2 = resize(M2, (M2.shape[0]//...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(pair, other):\n days_ago = 7\n endtime = int(time())\n starttime = endtime - 60 * 60 * 24 * days_ago\n\n geckourl = '%s/markets?vs_currency=%s&ids=%s' % (API, pair[\"currency\"],\n pair[\"coin\"])\n liveprice = requests.get(geckourl).j...
[ "0.6660464", "0.6615989", "0.64531744", "0.6355358", "0.6307623", "0.6276847", "0.6220814", "0.61832434", "0.60175335", "0.60079485", "0.5918773", "0.585842", "0.5851734", "0.5843024", "0.5840139", "0.5792696", "0.5774242", "0.57644534", "0.574364", "0.57333547", "0.57249", ...
0.78072286
0
return stock1 and stock2 instances, each of which have attributes open, high, low, close, volume as numeric arrays
def get_daily_data(): class C: pass def get_ticker(ticker): vals = [] datafile = cbook.get_sample_data('%s.csv' % ticker, asfileobj=False) lines = open(datafile).readlines() for line in lines[1:]: vals.append([float(val) for val in line.split(',')[1:]]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_two_stock_data():\n ticker1, ticker2 = 'INTC', 'AAPL'\n\n file1 = cbook.get_sample_data('INTC.dat.gz')\n file2 = cbook.get_sample_data('AAPL.dat.gz')\n M1 = fromstring(file1.read(), '<d')\n\n M1 = resize(M1, (M1.shape[0]//2, 2))\n\n M2 = fromstring(file2.read(), '<d')\n M2 = resize(M2,...
[ "0.690658", "0.579665", "0.5742262", "0.56939626", "0.56424576", "0.55489075", "0.5467829", "0.5454544", "0.5423713", "0.5407581", "0.5386085", "0.5376399", "0.5357336", "0.53431493", "0.53205866", "0.53127074", "0.53015745", "0.5291757", "0.52858096", "0.52858096", "0.528171...
0.4965072
46
Q is a tensor with its last two dimensions as (..., seq_len_q, dk) containing the query matrix K is a tensor with its last two dimensions as (..., seq_len_v, dk) containing the key matrix V is a tensor with its last two dimensions as (..., seq_len_v, dv) containing the value matrix mask is a tensor that can be broadcas...
def sdp_attention(Q, K, V, mask=None): matmul_qk = tf.matmul(Q, K, transpose_b=True) # scale matmul_qk dk = tf.cast(tf.shape(K)[-1], tf.float32) scaled_attention_logits = matmul_qk / tf.math.sqrt(dk) # add the mask to the scaled tensor. if mask is not None: scaled_attention_logits += (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sdp_attention(Q, K, V, mask=None):\n matmul_qk = tf.matmul(Q, K, transpose_b=True)\n # scale matmul_qk\n dk = tf.cast(tf.shape(K)[-1], tf.float32)\n scaled_attention_logits = matmul_qk / tf.math.sqrt(dk)\n # add mask to scaled tensor\n if mask is not None:\n scaled_attention_logits += ...
[ "0.66350186", "0.66066206", "0.65810335", "0.64763", "0.64397424", "0.6408181", "0.63542753", "0.63542455", "0.63436663", "0.6335895", "0.6335895", "0.63351864", "0.6310624", "0.6304251", "0.6237615", "0.6224539", "0.61700386", "0.6101289", "0.60288817", "0.6009258", "0.58814...
0.6586491
2
dm is an integer representing the dimensionality of the model h is an integer representing the number of heads dm is divisible by h
def __init__(self, dm, h): super().__init__() self.h = h self.dm = dm self.depth = dm // h self.Wq = tf.keras.layers.Dense(dm) self.Wk = tf.keras.layers.Dense(dm) self.Wv = tf.keras.layers.Dense(dm) self.linear = tf.keras.layers.Dense(dm)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dim_per_head(self):\n p = self.params\n return p.dim_per_head or p.hidden_dim // p.num_heads", "def __init__(self, d_model, n_heads, use_cos, kernel, dropout,\n ffn_ratio, ln_eps, denom_eps, bias):\n super(MHA_block, self).__init__()\n self.ln1 = nn.LayerNorm(d_model, eps=...
[ "0.60416514", "0.59796304", "0.58199686", "0.56614614", "0.5604034", "0.55746675", "0.55614406", "0.55234414", "0.54783124", "0.5457982", "0.545518", "0.5452053", "0.5443593", "0.5433428", "0.54292744", "0.5412994", "0.5382375", "0.53673047", "0.5362075", "0.5312807", "0.5306...
0.5838266
2
Split the last dimension into (num_heads, depth). Transpose the result such that the shape is (batch_size, num_heads, seq_len, depth)
def split_heads(self, x, batch_size): x = tf.reshape(x, (batch_size, -1, self.h, self.depth)) return tf.transpose(x, perm=[0, 2, 1, 3])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_heads(x, batch_size, num_heads, depth):\n x = tf.reshape(x, (batch_size, -1, num_heads, depth))\n return tf.transpose(x, perm=[0, 2, 1, 3])", "def _split_heads(x, num_heads):\n\tshape_lst = bert_utils.get_shape_list(x)\n\tdepth = shape_lst[-1]\n\tbatch = shape_lst[0]\n\tseq = shap...
[ "0.7916115", "0.7600231", "0.7481175", "0.7254155", "0.72504663", "0.72504663", "0.72504663", "0.72504663", "0.72504663", "0.72504663", "0.72504663", "0.7161194", "0.7055214", "0.659434", "0.6588306", "0.6588306", "0.6527259", "0.63739264", "0.62708795", "0.60758406", "0.6002...
0.7328985
3
Q is a tensor of shape (batch, seq_len_q, dk) containing the input to generate the query matrix K is a tensor of shape (batch, seq_len_v, dk) containing the input to generate the key matrix V is a tensor of shape (batch, seq_len_v, dv) containing the input to generate the value matrix mask is always None
def call(self, Q, K, V, mask): batch_size = tf.shape(Q)[0] q = self.Wq(Q) k = self.Wk(K) v = self.Wv(V) q = self.split_heads(q, batch_size) k = self.split_heads(k, batch_size) v = self.split_heads(v, batch_size) scaled_attention, attention_weights = sd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call(self, querys, keys, values, mask = None, training = False):\n\n sequence_len = shape_list(keys)[1]\n\n # q_i = Q * W^Q_i\n #print('query.shape=', querys.shape)\n querys = self.w_q(querys)\n querys = tf.reshape(querys, shape = (-1, sequence_len, self.num_attention_heads, ...
[ "0.6493404", "0.6427816", "0.64240754", "0.6418321", "0.6301944", "0.6113004", "0.6097452", "0.6081869", "0.6049511", "0.60341233", "0.60284936", "0.5986255", "0.5980415", "0.5970355", "0.59539115", "0.59345806", "0.59323347", "0.59292626", "0.5913883", "0.5895534", "0.582593...
0.6124515
5
dm the dimensionality of the model h the number of heads hidden the number of hidden units in the fully connected layer drop_rate the dropout rate
def __init__(self, dm, h, hidden, drop_rate=0.1): super().__init__() self.mha = MultiHeadAttention(dm, h) self.ffn = point_wise_feed_forward_network(dm, hidden) self.layernorm1 = tf.keras.layers.LayerNormalization(epsilon=1e-6) self.layernorm2 = tf.keras.layers.LayerNormalizatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, dm, h, hidden, drop_rate=0.1):\n super().__init__()\n\n self.mha1 = MultiHeadAttention(dm, h)\n self.mha2 = MultiHeadAttention(dm, h)\n\n self.ffn = point_wise_feed_forward_network(dm, hidden)\n\n self.layernorm1 = tf.keras.layers.LayerNormalization(epsilon=1e-...
[ "0.6785643", "0.67229116", "0.6380261", "0.6364374", "0.6323939", "0.63031614", "0.625298", "0.6168952", "0.61116683", "0.603366", "0.60317063", "0.59837466", "0.5970474", "0.5934955", "0.5934622", "0.590435", "0.5896029", "0.5895661", "0.5886991", "0.5885217", "0.58829165", ...
0.69252604
0
dm the dimensionality of the model h the number of heads hidden the number of hidden units in the fully connected layer drop_rate the dropout rate
def __init__(self, dm, h, hidden, drop_rate=0.1): super().__init__() self.mha1 = MultiHeadAttention(dm, h) self.mha2 = MultiHeadAttention(dm, h) self.ffn = point_wise_feed_forward_network(dm, hidden) self.layernorm1 = tf.keras.layers.LayerNormalization(epsilon=1e-6) se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, dm, h, hidden, drop_rate=0.1):\n super().__init__()\n self.mha = MultiHeadAttention(dm, h)\n self.ffn = point_wise_feed_forward_network(dm, hidden)\n\n self.layernorm1 = tf.keras.layers.LayerNormalization(epsilon=1e-6)\n self.layernorm2 = tf.keras.layers.LayerN...
[ "0.6926322", "0.67232263", "0.6377668", "0.63622075", "0.63210016", "0.6301156", "0.62541866", "0.6165916", "0.61140305", "0.6033471", "0.60285664", "0.5983597", "0.59702533", "0.5933133", "0.5933072", "0.5901348", "0.5895014", "0.58933127", "0.588453", "0.5882685", "0.588206...
0.6786822
1
x a tensor of shape (batch, input_seq_len, dm)containing the input to the encoder training a boolean to determine if the model is training mask the mask to be applied for multi head attention
def call(self, x, training, mask): seq_len = tf.shape(x)[1] # adding embedding and position encoding. embedding = self.embedding(x) # (batch_size, input_seq_len, d_model) embedding *= tf.math.sqrt(tf.cast(self.dm, tf.float32)) embedding += self.positional_encoding[:, :seq_len, :...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, x, mask):\n x = self.sublayer[0](x, lambda x: self.self_attn(x, x, x, mask))\n #print('encoder')\n #print(x.shape)\n return self.sublayer[1](x, self.feed_forward)", "def forward(self, x: Tensor) -> Tensor:\n x1 = x[:, 0]\n x2 = x[:, 1]\n features...
[ "0.68944144", "0.6433218", "0.6370818", "0.6343878", "0.6306005", "0.6193689", "0.6187625", "0.61835486", "0.6144924", "0.6137682", "0.61019653", "0.60944766", "0.603872", "0.60364276", "0.6025595", "0.59151536", "0.5872006", "0.5864127", "0.5857473", "0.5822816", "0.5774186"...
0.629951
5
x a tensor of shape (batch, target_seq_len, dm)containing the input to the decoder encoder_output a tensor of shape (batch, input_seq_len, dm) containing the output of the encoder training a boolean to determine if the model is training look_ahead_mask the mask to be applied to the first multi head attention layer padd...
def call(self, x, encoder_output, training, look_ahead_mask, padding_mask): seq_len = tf.shape(x)[1] attention_weights = {} x = self.embedding(x) x *= tf.math.sqrt(tf.cast(self.dm, tf.float32)) x += self.positional_encoding[:, :seq_len, :] x = self.dropout(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, state, encoder_padding_mask):\n residual = state.clone()\n\n '''\n ___QUESTION-6-DESCRIBE-D-START___\n What is the purpose of encoder_padding_mask? What will the output shape of `state' Tensor \n be after multi-head attention? HINT: formulate your answer in ter...
[ "0.68980443", "0.6785151", "0.672374", "0.666072", "0.6574727", "0.649962", "0.64837235", "0.6482765", "0.6397254", "0.63569766", "0.634568", "0.6323986", "0.63232094", "0.62556964", "0.62244546", "0.6217759", "0.6191466", "0.6188659", "0.61652607", "0.6162906", "0.6146513", ...
0.72239923
0
N the number of blocks in the encoder and decoder dm the dimensionality of the model h the number of heads hidden the number of hidden units in the fully connected layers input_vocab the size of the input vocabulary target_vocab the size of the target vocabulary max_seq_input the maximum sequence length possible for th...
def __init__(self, N, dm, h, hidden, input_vocab, target_vocab, max_seq_input, max_seq_target, drop_rate=0.1): super().__init__() self.encoder = Encoder(N, dm, h, hidden, input_vocab, max_seq_input, drop_rate) self.decoder = Decoder(N, dm, h, hidde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n super(Decoder_1m, self).__init__()\n self.lconvtwos = nn.ModuleList(\n [\n nn.Sequential(\n nn.Dropout(p=0.1),\n nn.Conv2d(128, 32, kernel_size=(3, 3), padding=1),\n nn.BatchNorm2d(32),\n ...
[ "0.6649107", "0.6574562", "0.6515605", "0.64855504", "0.6468661", "0.64408153", "0.64387065", "0.64374036", "0.6415218", "0.63973427", "0.6371662", "0.6340037", "0.62952334", "0.6289063", "0.62647885", "0.62570995", "0.6251119", "0.6237663", "0.6213453", "0.61888", "0.6172886...
0.7143646
0
inputs a tensor of shape (batch, input_seq_len, dm) containing the inputs target a tensor of shape (batch, target_seq_len, dm) containing the target training a boolean to determine if the model is training encoder_mask the padding mask to be applied to the encoder look_ahead_mask the look ahead mask to be applied to th...
def call(self, inputs, target, training, encoder_mask, look_ahead_mask, decoder_mask): enc_output = self.encoder(inputs, training, encoder_mask) dec_output, attention = self.decoder(target, enc_output, training, look_ahead_mask, decoder_mask) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, inputs: tf.Tensor, outputs: tf.Tensor,\n out_mask: tf.Tensor,in_pad_mask: tf.Tensor=None,\n training: bool=False):\n encoder_outputs, enc_attention = self.encoder(\n inputs, in_pad_mask, training\n )\n # shape=(batch_size, inputs_seq_le...
[ "0.6993221", "0.6545811", "0.65400386", "0.65084684", "0.64289606", "0.6405675", "0.6401761", "0.6400004", "0.6378901", "0.6355544", "0.6320946", "0.6316737", "0.6313478", "0.6303749", "0.6302028", "0.6298374", "0.62815", "0.6278293", "0.6256351", "0.6249569", "0.6234648", ...
0.6196893
28
Aggregate metric value across towers.
def _aggregate_across_towers(metrics_collections, metric_value_fn, *args): def fn(distribution, *a): """Call `metric_value_fn` in the correct control flow context.""" if hasattr(distribution, '_outer_control_flow_context'): # If there was an outer context captured before this method was ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _aggregate_across_towers(metrics_collections, metric_value_fn, *args):\n def fn(distribution, *a):\n \"\"\"Call `metric_value_fn` in the correct control flow context.\"\"\"\n if hasattr(distribution, '_outer_control_flow_context'):\n # If there was an outer context captured before this method was c...
[ "0.6474678", "0.61006385", "0.60297525", "0.59245074", "0.584058", "0.5800489", "0.56997293", "0.56921005", "0.56350535", "0.5630873", "0.56030244", "0.5590685", "0.5583606", "0.55782723", "0.5570165", "0.5558878", "0.55482966", "0.5541951", "0.5541951", "0.55373263", "0.5535...
0.6526208
0
Call `metric_value_fn` in the correct control flow context.
def fn(distribution, *a): if hasattr(distribution, '_outer_control_flow_context'): # If there was an outer context captured before this method was called, # then we enter that context to create the metric value op. If the # caputred context is `None`, ops.control_dependencies...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fn(distribution, *a):\n if hasattr(distribution, '_outer_control_flow_context'):\n # If there was an outer context captured before this method was called,\n # then we enter that context to create the metric value op. If the\n # caputred context is `None`, ops.control_dependencies(None) gives ...
[ "0.6464017", "0.58839256", "0.5767293", "0.574908", "0.55788815", "0.5566902", "0.548517", "0.5422161", "0.537603", "0.5365945", "0.52946395", "0.52842236", "0.51841676", "0.5158378", "0.515165", "0.51359975", "0.51274526", "0.5114945", "0.5100913", "0.50856", "0.5031937", ...
0.6583132
0
for use in an mcmc sampler; e.g. > x ~ S(x|x) > computing S(x|x) may not be just a parameter replacement.
def apply_param_transformations(self,params_edict,**kwargs): if self.params_transforms == None: return params_edict for key,transform_function in self.params_transforms.items(): params_edict[key] = transform_function(params_edict,**kwargs) return params_edict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reparametrize(self, mu, sigma):\n return mu + sigma # TODO Your code goes here.", "def doParametersOfInterest(self):\n ''' ref : physicsmodel -> rvf\n self.modelBuilder.out.var(\"MH\").setRange(float(self.mHRange[0]),float(self.mHRange[1]))\n self.modelBuilder.out.var(\"MH...
[ "0.5839029", "0.5783593", "0.57772535", "0.57220954", "0.5710603", "0.5695862", "0.5565797", "0.5561556", "0.55528784", "0.5543692", "0.5518341", "0.5416179", "0.5407878", "0.54026794", "0.54021186", "0.5393204", "0.5393108", "0.53861153", "0.53641415", "0.53463084", "0.53016...
0.0
-1
l = self.rateself.shape / gamma_fx(self.rate) \ x(self.shape 1) np.exp(self.rate x)
def likelihood(self,x,params = None,**kwargs): return np.exp(self.log_likelihood(x,params=params,**kwargs))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def f(x):\n res = np.real(np.exp(-1j*x[1])*\\\n sum(y_obs[k+sample_size]*np.exp(1j*k*x[0]) \\\n for k in range(-sample_size,sample_size+1))) \n res = -res/np.sqrt(2*sample_size+1) \n return res", "def f(x):\n res = np.real(np.exp(...
[ "0.6485697", "0.6419354", "0.64037347", "0.6296128", "0.62531024", "0.6230634", "0.62213445", "0.61988693", "0.6122977", "0.606668", "0.6050784", "0.60382915", "0.6036193", "0.6016605", "0.6011339", "0.60109717", "0.59830993", "0.59787333", "0.5977478", "0.596798", "0.5966289...
0.0
-1
Set up the Compensation sensor.
async def async_setup_platform( hass: HomeAssistant, config: ConfigType, async_add_entities: AddEntitiesCallback, discovery_info: DiscoveryInfoType | None = None, ) -> None: if discovery_info is None: return compensation: str = discovery_info[CONF_COMPENSATION] conf: dict[str, Any] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup_sensor ( self ):\n self.spectral = Spectral ( np.array([500, 610, 780, 1580.] ),\n np.array([590, 680, 890, 1750.] ) )", "def _setup_sensor ( self ):\n self.spectral = Spectral ( np.array([450, 520, 630, 770., 1550, 2090.] ),\n ...
[ "0.6478045", "0.6474628", "0.63748217", "0.63305384", "0.5945454", "0.5933097", "0.5911297", "0.5906468", "0.5860258", "0.58439195", "0.5830285", "0.58104193", "0.58040017", "0.57652694", "0.5751883", "0.57220465", "0.5698215", "0.5668131", "0.56662774", "0.565487", "0.564631...
0.5624291
21
Initialize the Compensation sensor.
def __init__( self, unique_id: str | None, name: str, source: str, attribute: str | None, precision: int, polynomial: np.poly1d, unit_of_measurement: str | None, minimum: tuple[float, float] | None, maximum: tuple[float, float] | None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self._read_calibration_data()\n self.configure_sensor(\n TemperatureOversamplings.x08,\n PressureOversamplings.x16,\n HumidityOversamplings.x08,\n IIRFilterCoefficients.FC_003,\n 250,\n 250)", "def _initialize(s...
[ "0.67914665", "0.6568444", "0.64031917", "0.64006346", "0.6294963", "0.6220404", "0.6154173", "0.6138862", "0.6089179", "0.60084", "0.5986519", "0.58660346", "0.5860093", "0.58214515", "0.5811828", "0.580052", "0.5731715", "0.57221127", "0.56790245", "0.56587887", "0.5650349"...
0.0
-1
Handle added to Hass.
async def async_added_to_hass(self) -> None: self.async_on_remove( async_track_state_change_event( self.hass, [self._source_entity_id], self._async_compensation_sensor_state_listener, ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_handle(self, handle):\n\n self.pool.append(handle)", "def add_handler(self, handler):\n pass", "def handle(self) -> None:", "def add(self, handler, on_error=None):\n self.handlers.append(handler)", "def new_handle(self):\n\n raise NotImplementedError('new_handle')", "d...
[ "0.725439", "0.657552", "0.6394768", "0.6374983", "0.6372746", "0.6322899", "0.62675667", "0.6254536", "0.6239498", "0.6233317", "0.6200009", "0.6163698", "0.61499554", "0.6108559", "0.6108103", "0.6089797", "0.5973883", "0.59327257", "0.59327257", "0.592064", "0.5815749", ...
0.0
-1
Return the state attributes of the sensor.
def extra_state_attributes(self) -> dict[str, Any]: ret = { ATTR_SOURCE: self._source_entity_id, ATTR_COEFFICIENTS: self._coefficients, } if self._source_attribute: ret[ATTR_SOURCE_ATTRIBUTE] = self._source_attribute return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\r\n return self._attributes", "def device_state_attributes(self):\n return self.attr", "def device_state_attributes(self):\n return self.attr", "def device_state_attributes(self) ...
[ "0.8418945", "0.82497084", "0.8243777", "0.8243777", "0.8200083", "0.8169021", "0.8169021", "0.8159991", "0.8159991", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", ...
0.0
-1
Handle sensor state changes.
def _async_compensation_sensor_state_listener( self, event: EventType[EventStateChangedData] ) -> None: new_state: State | None if (new_state := event.data["new_state"]) is None: return if self.native_unit_of_measurement is None and self._source_attribute is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n print(\"sensorState Update\")", "def async_compensation_sensor_state_listener(event):\n new_state = event.data.get(\"new_state\")\n self.calc_state(new_state)\n self.async_write_ha_state()", "def update(self):\n self.data.update()\n for ...
[ "0.7827983", "0.7324876", "0.72655034", "0.7017487", "0.69500244", "0.6899691", "0.68305683", "0.674897", "0.6707175", "0.6699208", "0.6617866", "0.66092294", "0.6587371", "0.6576934", "0.64607686", "0.64607686", "0.64336", "0.64127284", "0.63538086", "0.6352331", "0.63261676...
0.64938736
14
return True if the ip address exists in the subnet address otherwise return False
def address_exists_in_network(ip_address, net_n_bits): ip_address = struct.unpack('<L', socket.inet_aton(ip_address))[0] net, bits = net_n_bits.split('/') net_address = struct.unpack('<L', socket.inet_aton(net))[0] net_mask = ((1L << int(bits)) - 1) return ip_address & net_mask == net_address & net_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ipcalc(self, ipaddr, subnet):\n if IPNetwork(ipaddr) in IPNetwork(subnet):\n return True\n else:\n return False", "def __contains__(self, address):\n return any([\n ipaddress.ip_address(address) in network\n for network in self.networks...
[ "0.81065077", "0.73484886", "0.7259473", "0.6860128", "0.66347903", "0.66137534", "0.65785533", "0.6569621", "0.6553362", "0.65437984", "0.6522481", "0.6495472", "0.64427274", "0.6418303", "0.6388048", "0.63813025", "0.6377752", "0.6375657", "0.6367962", "0.6317943", "0.62854...
0.74176997
1
get the client IP Address
def get_client_ip_address(request): x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR') if x_forwarded_for: ip_address = x_forwarded_for.split(',')[-1].strip() else: ip_address = request.META.get('REMOTE_ADDR') return ip_address
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getClientIP(self):\n if isinstance(self.client, IPv4Address):\n return self.client.host\n return None", "def client_ip(self):\n return self._client_ip", "def get_client_ip(request):\n ip_chain = request.META.get(\"HTTP_X_FORWARDED_FOR\") # forward ip\n if ip_chain:\n ...
[ "0.8652703", "0.8567096", "0.81901723", "0.814352", "0.81124896", "0.80822957", "0.80822957", "0.80810416", "0.80326486", "0.7998328", "0.7963591", "0.79506534", "0.79266024", "0.78766394", "0.78621244", "0.7749208", "0.7641865", "0.7623153", "0.75724876", "0.7569217", "0.753...
0.8159527
3
convert string to bool
def str2bool(value): if value: return value.lower() in ("true",) else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str_to_bool(self, s):\n if s == 'True':\n return True\n elif s == 'False':\n return False\n else:\n raise ValueError", "def toBool( string ):\r\n return string == 'true'", "def str_to_bool(a):\n if a == 'True':\n return True\n else:\n ...
[ "0.8893736", "0.8891024", "0.86924744", "0.864158", "0.8400088", "0.8397288", "0.83907926", "0.83267844", "0.8312677", "0.83008534", "0.83008534", "0.8291738", "0.82773185", "0.8274537", "0.8269423", "0.8265565", "0.8246185", "0.8227842", "0.8224764", "0.8224154", "0.8224154"...
0.828739
13
checks if a string value can be interpreted as integer
def is_int(value): try: int(value) return True except ValueError: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __is_int(self,string):\r\n try: \r\n int(string)\r\n return True\r\n except ValueError:\r\n return False", "def is_integer(self, string):\n try:\n return int(string)\n except:\n return False", "def is_int(string:str) -> bool...
[ "0.85836047", "0.84053147", "0.8392874", "0.82936084", "0.8283946", "0.82359105", "0.82089317", "0.81410223", "0.81367934", "0.81324106", "0.8119482", "0.7988272", "0.7985464", "0.7954548", "0.79346615", "0.78169835", "0.7803405", "0.77925634", "0.7789233", "0.77684367", "0.7...
0.7849056
16
examine a `obj` for given `items`. if all `items` are found in `obj` return True otherwise false. where `obj` is a dictionary and `items` is list of dictionaries
def dict_has_items(obj, items): has_items = False if isinstance(obj, basestring): obj = json.loads(obj) for item in items: for lookup_key, lookup_val in item.iteritems(): if lookup_key in obj and obj[lookup_key] == lookup_val: has_items = True else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __contains__(self, items):\n if type(items) != list:\n raise PJFInvalidType(items, list)\n ret = 0\n for item in items:\n for key in self.__dict__:\n if isinstance(self.__dict__[key], JsonFactory):\n ret += item in self.__dict__[key]\...
[ "0.7628567", "0.7596022", "0.7045878", "0.7019639", "0.6952219", "0.6796098", "0.6757188", "0.66694134", "0.65806514", "0.65183485", "0.64792097", "0.6399194", "0.63207513", "0.62711006", "0.62627935", "0.6229428", "0.6218", "0.61813146", "0.61776984", "0.6154515", "0.6083926...
0.831852
0
extracts all query params which starts with data__
def extract_data_params(request): data_params = [] for key, val in request.QUERY_PARAMS.iteritems(): if key.startswith('data__'): data_params.append({key[6:]: val}) return data_params
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_query_from_data(data):\n query_params = {}\n for key, value in data.items():\n if key == 'title':\n Product._set_query_params(query_params, key, value)\n elif isinstance(value, str):\n param_key = f'params.{str(key)}'\n Produc...
[ "0.67417115", "0.6304133", "0.6147768", "0.611534", "0.61150604", "0.60223615", "0.59562993", "0.59472", "0.5920123", "0.5918791", "0.5805078", "0.5745934", "0.5745177", "0.5745177", "0.57365286", "0.57353395", "0.5715842", "0.5676375", "0.56709933", "0.5644437", "0.56289977"...
0.8259755
0
Get a list of filehandle numbers from logger to be handed to DaemonContext.files_preserve
def getLogFileHandles(logger): handles = [] for handler in logger.handlers: handles.append(handler.stream.fileno()) if logger.parent: handles += getLogFileHandles(logger.parent) return handles
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fileHandlers(self):\n fileHandlers = list()\n handlers = self.logger.handlers\n for handler in handlers:\n try:\n if handler._name.startswith(\"LogFile-\"):\n fileHandlers.append(handler)\n except:\n pass\n retur...
[ "0.5972954", "0.5800055", "0.57424676", "0.57307327", "0.56020564", "0.5504199", "0.5497882", "0.5497588", "0.5413338", "0.53834784", "0.5348", "0.5341512", "0.5340336", "0.5339177", "0.5326712", "0.5315424", "0.5308099", "0.52998996", "0.52989507", "0.5291758", "0.52897704",...
0.6881586
0
Contextmanager for using a fasteners ipc lock in a nonblocking way.
def ipc_lock_nonblock(lock): acquired = lock.acquire(blocking=False) if acquired: yield lock lock.release() else: raise AgentLockException("Could not acquire lock.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def i_am_locking(self):\r\n pass", "def acquire(self, blocking=True, shared=False):", "def lock(*args):", "def __enter__(self):\r\n self.acquire()\r\n return self", "async def __aenter__(self):\n self.acquired = True\n return self", "def __enter__(self):\n return...
[ "0.6242284", "0.621957", "0.61042243", "0.573302", "0.5642721", "0.5634328", "0.5580956", "0.556809", "0.55674386", "0.5557476", "0.5536869", "0.5532729", "0.5532729", "0.55189383", "0.55090845", "0.5496174", "0.54606235", "0.54491425", "0.54491425", "0.5433907", "0.54096675"...
0.5499122
15
Create socket to listen on.
def make_server_socket(path): # Remove old socket. if os.path.exists(path): os.remove(path) # Set umask to create the socket with minimal permissions. old_umask = os.umask(0077) sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.bind(path) os.umask(old_umask) sock.lis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_socket():\n sock = socket.socket()\n return sock", "def CreateListenSocket(self):\r\n self.listenSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\r\n self.listenSocket.bind(('localhost', 0))\r\n self.listenSocket.listen(BACKLOG)\r\n self.listenSocket.setblo...
[ "0.76166683", "0.7588409", "0.7583967", "0.74945956", "0.7447012", "0.7447012", "0.7425985", "0.7217528", "0.7190284", "0.7139241", "0.7102865", "0.7098133", "0.7091456", "0.69858724", "0.69730246", "0.6971519", "0.69640803", "0.69456434", "0.69436437", "0.6940075", "0.693128...
0.68377393
23
Process a json message. This does user interaction and could block for a long time.
def process_message(self, message): if not isinstance(message, dict): return None mtype = message.get("type", None) self.maybe_expire_credentials() if mtype == None: return None if mtype == "ping": return {"pong": "pong"} if mtype ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process_message(self, json_object):\n\n message = json.loads(json_object)\n if message['type'] == \"relay\":\n self._process_relay(message)\n elif message['type'] == \"control\":\n self._process_control(message)\n else:\n print(\"ERROR Received m...
[ "0.7290384", "0.70513016", "0.70031065", "0.69798326", "0.69033194", "0.6897784", "0.6757918", "0.67505205", "0.66754055", "0.666377", "0.666377", "0.65524524", "0.64504385", "0.6433004", "0.6414654", "0.6400912", "0.63942283", "0.6390054", "0.6371682", "0.6353576", "0.633220...
0.5550369
100
Expire credentials if it has been too long.
def maybe_expire_credentials(self): time_since_last_auth = time.time() - self.last_auth logging.debug("Time since last auth {}.".format(time_since_last_auth)) if time_since_last_auth > CREDENTIALS_LIFETIME: logging.info("Expiring credentials.") hashpasslib.forget_master()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_password_expire(self):\n user_dn = \"cn=skip,ou=nerdherd,dc=bonsai,dc=test\"\n cli = LDAPClient(\"ldap://%s\" % self.ipaddr)\n cli.set_password_policy(True)\n cli.set_credentials(\"SIMPLE\", (user_dn, \"p@ssword\"))\n conn, ctrl = cli.connect()\n entry = conn.sear...
[ "0.65905154", "0.65896976", "0.63954246", "0.6326304", "0.63095117", "0.62831146", "0.62369967", "0.62012815", "0.6155768", "0.61305135", "0.60969484", "0.6067817", "0.60407585", "0.6034622", "0.60302615", "0.6014281", "0.6014172", "0.59970254", "0.59674865", "0.5948415", "0....
0.84588826
0
Gets the password via pinentry. Calls use_master if it works, otherwise does nothing.
def get_master_gui(use_bcrypt): try: pw = pinentry.get_pin(description="Enter hashpass master password:", prompt="Password:") while pw is None or not hashpasslib.is_correct_master(pw): if pw == None: logging.warn("User canceled password entry...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_password(self):\r\n return self._password", "def get_password(self):\n mpw = master_pass.MPW(self.user, self.master_password)\n return mpw.password(self.ucs_server)", "def _get_password(self):\n return self._password", "def masterPassword(self):\r\n return self...
[ "0.6644678", "0.66201836", "0.66150063", "0.65591604", "0.65305823", "0.64333534", "0.6419651", "0.63834316", "0.63571024", "0.63272214", "0.63112754", "0.63109064", "0.62714154", "0.6229617", "0.62100583", "0.61854845", "0.617317", "0.61616355", "0.6161462", "0.6152583", "0....
0.7349455
0
Remove html tags from a string
def remove_html_tags(text): print('VOU REMOVER AS TAGS DA STRING') clean = re.compile('<.*?>') print('',re.sub(clean, '', text)) return re.sub(clean, '', text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_html_tags(self,text):\n #https://medium.com/@jorlugaqui/how-to-strip-html-tags-from-a-string-in-python-7cb81a2bbf44\n clean = re.compile('<.*?>')\n return re.sub(clean, '', text)", "def remove_html_tags(text):\r\n clean = re.compile('<.*?>')\r\n return re.sub(clean, '', text...
[ "0.8504336", "0.8412507", "0.84054434", "0.83764374", "0.83524", "0.83524", "0.83290035", "0.8306803", "0.8299078", "0.82290506", "0.82162106", "0.81617314", "0.8151329", "0.8143021", "0.812958", "0.80990636", "0.8071161", "0.80520815", "0.80184025", "0.8011543", "0.79809445"...
0.8636281
0
picks and sets onebyone until all the regions are covered
def trivial_cover(regions_count, clinics_count, clinics): clinics_built = [0]*range(0, clinics_count) coverted = set() for clinic in clinics: clinics_built[clinic.index] = 1 coverted |= set(clinic.regions) if len(coverted) >= regions_count: break # We are done, we cover ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_assign_to_regions(self):\n \n tool = pybedtools.BedTool(clipper.test_file(\"FOX2Brain-05.15.09.polyATrim.adapterTrim.rmRep.sorted.rmDup.peaks.bed\"))\n \n assign_to_regions(tool=tool, \n clusters=\"test\", \n speciesFA= clipper....
[ "0.5690144", "0.56761265", "0.56038886", "0.5585656", "0.5530814", "0.5513189", "0.54393256", "0.5427754", "0.5368495", "0.5355389", "0.53465384", "0.53144586", "0.5309058", "0.5297361", "0.5285404", "0.5273793", "0.5240959", "0.52374387", "0.5226939", "0.52219576", "0.521646...
0.0
-1
Plot the grid generated by a flow. The displacement can be too small, so we add a scale factor
def plot_grid(ax, flow, factor=10): grid = factor * flow[:, ::8, ::8] lin_range = np.linspace(0, 512, 64) x, y = np.meshgrid(lin_range, lin_range) x = x + grid[0, ...] y = y + grid[1, ...] y = y segs1 = np.stack((x, y), axis=2) segs2 = segs1.transpose(1, 0, 2) ax.add_collection(Line...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_grid(frame, episode_nr):\n plt.grid('on')\n ax = plt.gca()\n ax.set_xticks(np.arange(0.5, 10, 1))\n ax.set_yticks(np.arange(0.5, 10, 1))\n ax.set_xticklabels([])\n ax.set_yticklabels([])\n ax.imshow(frame, cmap='binary')\n ax.set_title(\"Episode {}\".format(episode_nr))\n plt.pa...
[ "0.64805615", "0.6395517", "0.63600767", "0.6321238", "0.6193627", "0.61895263", "0.6010808", "0.59778", "0.5938082", "0.5934734", "0.59344804", "0.592055", "0.58944136", "0.5893408", "0.5877107", "0.58597356", "0.58251846", "0.5823605", "0.58234686", "0.58124083", "0.5784960...
0.7789411
0
Save some images and plots during training
def generate_plots(fixed, moving, warped, flows, train_loss, val_loss, reg_loss, epoch): moving = moving.detach().cpu().numpy() fixed = fixed.detach().cpu().numpy() warped = [w.detach().cpu().numpy() for w in warped] flows = [f.detach().cpu().numpy() for f in flows] fig = plt.figure(constrained_lay...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_images(PATH, show_img, datasets, from_dataset):\n dataset = datasets[from_dataset]\n imgModels = dataset['models']\n for modelname, model in imgModels.items():\n print('save', modelname)\n plt.imshow(model[70])\n plt.set_cmap(\"gray\")\n plt.axis('off')\n plt.sa...
[ "0.78799677", "0.7536049", "0.7308674", "0.7303662", "0.7167811", "0.7157019", "0.7031298", "0.69756454", "0.6960181", "0.6957856", "0.6898664", "0.6836575", "0.68074214", "0.6796281", "0.67932737", "0.6753751", "0.6747309", "0.6742162", "0.67349654", "0.6719155", "0.6683331"...
0.0
-1
GIFOutput a model defined in Swagger
def __init__(self, gif_fps=None, color_depth=None, gif_loop=None, height=None, start=None, duration=None, suffix=None, overlay=None, overlay_alignment=None, overlay_scale='fit', label=None): self._gif_fps = None self._color_depth = None self._gif_loop = None self._heigh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_random_gif():\n\n random_gif_url = giphy_random_generator()\n return jsonify(random_gif_url)", "def run(self):\n generated_gif = self.generate()\n with open(self.out_filename, 'wb') as out_fd:\n out_fd.write(generated_gif)", "def generate_im(self, model):\n ka...
[ "0.5817749", "0.5611348", "0.55694085", "0.5549498", "0.54999256", "0.5440405", "0.5431132", "0.540683", "0.53500056", "0.53045505", "0.529118", "0.526501", "0.5244855", "0.52252036", "0.52224654", "0.521024", "0.5190709", "0.5121285", "0.50855976", "0.50822467", "0.50727075"...
0.0
-1
Gets the gif_fps of this GIFOutput. The frame rate of the GIF. Default is the Video frame rate
def gif_fps(self): return self._gif_fps
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fps(self):\n return self._num_frames / (datetime.now() - self._start).total_seconds()", "def get_fps(self):\n # Take difference.\n interframe_intervals = np.diff(self.data[\"t\"])\n\n # Inter-frame interval in milliseconds.\n mean_interval = np.mean(interframe_intervals...
[ "0.7494257", "0.7355209", "0.7317423", "0.71695226", "0.70986986", "0.7062496", "0.70086706", "0.69287163", "0.69171", "0.68915033", "0.68721455", "0.6822134", "0.6741372", "0.6735853", "0.67118305", "0.6672671", "0.662301", "0.662301", "0.6597375", "0.6547688", "0.64681935",...
0.8816731
0
Sets the gif_fps of this GIFOutput. The frame rate of the GIF. Default is the Video frame rate
def gif_fps(self, gif_fps): if gif_fps is not None and gif_fps > 30: raise ValueError("Invalid value for `gif_fps`, must be a value less than or equal to `30`") self._gif_fps = gif_fps
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gif_fps(self):\n return self._gif_fps", "def set_fps(self, fps=25):\n raise NotImplementedError(\"set_fps is not implemented\")", "def set_framerate(self, framerate):\n self._framerate = int(framerate)", "def set_fps(self, fps=25):\n # self._root.knob('fps').setValue(fp...
[ "0.74496573", "0.69945496", "0.6775548", "0.6714409", "0.62625706", "0.6213025", "0.59868544", "0.5918831", "0.5851581", "0.5825714", "0.5825714", "0.5749928", "0.5744896", "0.5659933", "0.5629519", "0.56099874", "0.5604374", "0.5597134", "0.55247176", "0.550153", "0.54935694...
0.85410434
0
Gets the color_depth of this GIFOutput. Amount of colors in palette
def color_depth(self): return self._color_depth
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_explored(self):\n return self.__num_explored", "def queryNumberOfColors(self):\n self._numColorsInUse = \\\n self._readInt('How many colors are available', 2, len(self._palette))\n return self._numColorsInUse", "def num_depth(self):\n return len(self._sizes) + len(self._ra...
[ "0.68169844", "0.65945107", "0.65047747", "0.64739394", "0.6416106", "0.6415538", "0.6361293", "0.63216704", "0.6281688", "0.62379676", "0.622544", "0.61876786", "0.6183844", "0.6128096", "0.60531795", "0.60531795", "0.60180753", "0.592283", "0.5902543", "0.5848112", "0.58416...
0.8169639
0
Sets the color_depth of this GIFOutput. Amount of colors in palette
def color_depth(self, color_depth): self._color_depth = color_depth
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetDepth(*args, **kwargs):\n return _gdi_.Bitmap_SetDepth(*args, **kwargs)", "def set_depth(self, depth):\n self._depth = depth\n if self._scaled_image_coordinates is None:\n self._initialise()\n else:\n self._update_depth()", "def color_depth(self):\n ...
[ "0.6401659", "0.6380821", "0.6300926", "0.62612724", "0.5997467", "0.5974511", "0.5967667", "0.5931414", "0.5931148", "0.59209645", "0.58476746", "0.58119255", "0.57820714", "0.57815474", "0.5667481", "0.5611237", "0.5600413", "0.5562935", "0.5406338", "0.53640157", "0.535976...
0.756508
0
Gets the gif_loop of this GIFOutput. If to loop the GIF. 1 is no loop, 0 is infinite loops, and other numbers are number of loops.
def gif_loop(self): return self._gif_loop
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gif_loop(self, gif_loop):\n if gif_loop is not None and gif_loop < -1:\n raise ValueError(\"Invalid value for `gif_loop`, must be a value greater than or equal to `-1`\")\n\n self._gif_loop = gif_loop", "def get_loop(self):\n\n log(\"Getting loop for {} at {}\".format(self._lo...
[ "0.6869839", "0.6846498", "0.622958", "0.6160181", "0.5945182", "0.57386464", "0.55551046", "0.554464", "0.53494954", "0.5158095", "0.5133926", "0.5090462", "0.50807434", "0.5023866", "0.5007544", "0.4975262", "0.49709076", "0.49350947", "0.4925683", "0.4912694", "0.48901445"...
0.8365495
0
Sets the gif_loop of this GIFOutput. If to loop the GIF. 1 is no loop, 0 is infinite loops, and other numbers are number of loops.
def gif_loop(self, gif_loop): if gif_loop is not None and gif_loop < -1: raise ValueError("Invalid value for `gif_loop`, must be a value greater than or equal to `-1`") self._gif_loop = gif_loop
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gif_loop(self):\n return self._gif_loop", "def __loop(self):\n if self.loops is \"inf\":\n self.play()\n else:\n if self.loops > self.current_loop:\n self.current_loop += 1\n self.play()\n else:\n self.stop()",...
[ "0.7291405", "0.6020012", "0.59639007", "0.57001525", "0.54498154", "0.54039925", "0.53877467", "0.532594", "0.5293056", "0.523517", "0.52066076", "0.51812136", "0.51310414", "0.50876", "0.50081354", "0.49736694", "0.49516755", "0.4897915", "0.48965508", "0.4870012", "0.48547...
0.81786376
0
Gets the height of this GIFOutput. Height of the media to be rendered, in pixels. Should be the height of your scenes unless a smaller resolution is needed. Resolution higher than the scene resolution reduces quality. The width is automatically calculated to keep the aspect ratio.
def height(self): return self._height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_height(self) -> int:\n return self.rsimulator.get_frame_height()", "def get_height(self):\n if self.height:\n return self.height\n \n if not self._oembed:\n return ''\n \n return self._oembed.get('height', None)", "def height(self):\n return self...
[ "0.7565148", "0.73991317", "0.7380456", "0.736369", "0.7310083", "0.7279103", "0.72679317", "0.7228617", "0.72236824", "0.71272886", "0.71267223", "0.70312136", "0.70312136", "0.7028361", "0.70189685", "0.7004611", "0.6970833", "0.6970833", "0.6967758", "0.69549733", "0.69441...
0.66156316
56
Sets the height of this GIFOutput. Height of the media to be rendered, in pixels. Should be the height of your scenes unless a smaller resolution is needed. Resolution higher than the scene resolution reduces quality. The width is automatically calculated to keep the aspect ratio.
def height(self, height): if height is None: raise ValueError("Invalid value for `height`, must not be `None`") self._height = height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setHeight(self, *args):\n return _libsbml.Dimensions_setHeight(self, *args)", "def SetHeight(*args, **kwargs):\n return _gdi_.Bitmap_SetHeight(*args, **kwargs)", "def set_height(height):\n resize.transforms[1].size = height", "def SetHeight(self, h):\r\n\r\n self._height = h", "...
[ "0.6735364", "0.6383196", "0.63685995", "0.630886", "0.62710375", "0.62426734", "0.6142797", "0.60943526", "0.60887784", "0.60887784", "0.60887784", "0.60887784", "0.60887784", "0.6074497", "0.60136455", "0.60128236", "0.5981412", "0.5960381", "0.5942689", "0.59383595", "0.58...
0.5538502
57
Gets the start of this GIFOutput. What second of the storyboard timeline to start the GIF.
def start(self): return self._start
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getStartTime(self):\n return _osgAnimation.Animation_getStartTime(self)", "def getStartTime(self):\n return _osgAnimation.Channel_getStartTime(self)", "def get_start(self):\n return self._start", "def getStart(self):\n return self._start", "def _get_start(self):\n ret...
[ "0.7076997", "0.6851174", "0.66245645", "0.6571833", "0.65565145", "0.6531953", "0.65159637", "0.65159637", "0.63531405", "0.63480484", "0.6346194", "0.63422894", "0.6338405", "0.6206076", "0.6201802", "0.61647004", "0.6138878", "0.6114829", "0.6110501", "0.607757", "0.606464...
0.61608136
20
Sets the start of this GIFOutput. What second of the storyboard timeline to start the GIF.
def start(self, start): if start is None: raise ValueError("Invalid value for `start`, must not be `None`") self._start = start
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self, start):\n\n self._start = start", "def start(self, start):\n\n self._start = start", "def start(self, start):\n\n self._start = start", "def start(self, start):\n\n self._start = start", "def start(self):\n\t\tif self._start is not None:\n\t\t\traise RuntimeError...
[ "0.6723576", "0.6723576", "0.6723576", "0.6723576", "0.6678015", "0.665719", "0.6505287", "0.6384998", "0.6332083", "0.62387615", "0.62376267", "0.62024736", "0.6184223", "0.6178705", "0.60933346", "0.60816824", "0.60661453", "0.5995193", "0.5995193", "0.59945655", "0.5989577...
0.60994416
14
Gets the duration of this GIFOutput. Seconds for the duration of the GIF. Can't be longer than the video.
def duration(self): return self._duration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration():\r\n elapsed_time, duration = video_time()\r\n return duration", "def video_duration(self):\n # type: () -> int\n return self._video_duration", "def get_duration(self):\n frame_dur = self.get_frame_duration()\n num_frames = self.get_num_frames()\n motion_dur = frame_...
[ "0.7762158", "0.7709614", "0.75428295", "0.7538186", "0.74586827", "0.74504477", "0.74190795", "0.7403893", "0.7340937", "0.733311", "0.7328377", "0.7324417", "0.72875273", "0.7262277", "0.7247565", "0.72455525", "0.72377896", "0.7232972", "0.721482", "0.7209425", "0.7201544"...
0.7359599
12
Sets the duration of this GIFOutput. Seconds for the duration of the GIF. Can't be longer than the video.
def duration(self, duration): self._duration = duration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDuration(self, *args):\n return _osgAnimation.Animation_setDuration(self, *args)", "def duration(self, duration):\n self._duration = duration", "def duration(self, duration):\n self._duration = duration", "async def async_set_duration(self, duration):\n self._duration = dur...
[ "0.7234786", "0.72298867", "0.72298867", "0.7033115", "0.6978191", "0.6903736", "0.6718069", "0.6541939", "0.65389705", "0.64146113", "0.623737", "0.6063905", "0.6063905", "0.5945565", "0.5841082", "0.58208543", "0.5790863", "0.57763195", "0.5763773", "0.5758399", "0.56954765...
0.7048977
8
Gets the suffix of this GIFOutput. Unique ending of the file name so several outputs can be created then identified. Required if there is more then 1 video output.
def suffix(self): return self._suffix
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suffix(self):\n return self[\"suffix\"]", "def suffix(self):\n return self[\"suffix\"]", "def file_suffix(self):\n return f'{self.image_count:05}' if self.sequential_naming else \\\n datetime.datetime.now().strftime(\"%Y-%m-%d-%H-%M-%S\")", "def suffix ( self ) :\n ...
[ "0.7610536", "0.7610536", "0.75316405", "0.7521287", "0.7521287", "0.7347243", "0.7304037", "0.70785016", "0.70785016", "0.70710915", "0.7039384", "0.69881004", "0.6693291", "0.6596418", "0.65870094", "0.651454", "0.64653707", "0.6425669", "0.63848877", "0.63419944", "0.63229...
0.7638083
2
Sets the suffix of this GIFOutput. Unique ending of the file name so several outputs can be created then identified. Required if there is more then 1 video output.
def suffix(self, suffix): self._suffix = suffix
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setSuffix(self, value):\n return self._set(suffix=value)", "def file_suffix(self):\n return f'{self.image_count:05}' if self.sequential_naming else \\\n datetime.datetime.now().strftime(\"%Y-%m-%d-%H-%M-%S\")", "def suffix(self):\n return self._suffix", "def suffix(self):\...
[ "0.7028223", "0.69330084", "0.67990613", "0.67990613", "0.67990613", "0.67454875", "0.67454875", "0.67304456", "0.66012996", "0.66012996", "0.6601247", "0.6541266", "0.63328516", "0.6209011", "0.6205128", "0.61271995", "0.6105634", "0.6063221", "0.60500926", "0.60498923", "0....
0.73530364
3
Gets the overlay of this GIFOutput.
def overlay(self): return self._overlay
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gif_loop(self):\n return self._gif_loop", "def layer(self):\n return self.GetLayer()", "def draw_overlay(self):\n pass", "def gif(self):\n\n if self._gif is None:\n\n url = self.url.replace('f=fits', 'f=gif')\n\n try:\n url_data = urllib.re...
[ "0.58112276", "0.5789104", "0.5632958", "0.5590468", "0.55475557", "0.5475671", "0.54720825", "0.54714066", "0.54669756", "0.54507834", "0.54363924", "0.5428256", "0.5422926", "0.54158616", "0.5394534", "0.5377252", "0.5376429", "0.53099346", "0.53099346", "0.53099346", "0.52...
0.77030104
0
Sets the overlay of this GIFOutput.
def overlay(self, overlay): self._overlay = overlay
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_overlay(self, image_path):\n if not osp.isfile(image_path):\n raise ValueError(\"Invalid background image '{}'\".format(image_path))\n self._overlay_image = image_path\n self._final = None # Force rebuild", "def draw_overlay(self):\n pass", "def set_image_overlay...
[ "0.6185808", "0.6119764", "0.5662509", "0.56069213", "0.54998136", "0.5440037", "0.54383683", "0.53346497", "0.5262761", "0.5242616", "0.5206041", "0.5164456", "0.51297665", "0.5111875", "0.50731605", "0.50062686", "0.4991521", "0.4922425", "0.4873345", "0.48438504", "0.48411...
0.71629286
0
Gets the overlay_alignment of this GIFOutput. Alignment for overlay image in case the image doesn't fit the video perfectly. The first item in the array is X. The second is Y.
def overlay_alignment(self): return self._overlay_alignment
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overlay_alignment(self, overlay_alignment):\n allowed_values = [\"left\", \"center\", \"right\", \"top\", \"middle\", \"bottom\"]\n if not set(overlay_alignment).issubset(set(allowed_values)):\n raise ValueError(\n \"Invalid values for `overlay_alignment` [{0}], must be ...
[ "0.6082157", "0.5811847", "0.57966024", "0.5563203", "0.5563203", "0.5563203", "0.5542505", "0.54789925", "0.5473381", "0.5473381", "0.5473381", "0.54557025", "0.5414728", "0.5391308", "0.53716415", "0.53711426", "0.53711426", "0.5358381", "0.5308002", "0.5301803", "0.5293957...
0.78458405
0
Sets the overlay_alignment of this GIFOutput. Alignment for overlay image in case the image doesn't fit the video perfectly. The first item in the array is X. The second is Y.
def overlay_alignment(self, overlay_alignment): allowed_values = ["left", "center", "right", "top", "middle", "bottom"] if not set(overlay_alignment).issubset(set(allowed_values)): raise ValueError( "Invalid values for `overlay_alignment` [{0}], must be a subset of [{1}]" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overlay_alignment(self):\n return self._overlay_alignment", "def overlay(self, overlay):\n\n self._overlay = overlay", "def gonio_axis_align():\n \n # Invert camera image, so dark pin on light image becomes a peak\n cam_7.proc1.scale.put(-1)\n cam_8.proc1.scale.put(-1)\n \n ...
[ "0.6678817", "0.5036174", "0.49780422", "0.49720982", "0.49529678", "0.4905251", "0.48996106", "0.48916376", "0.48693442", "0.4828346", "0.48276195", "0.4773495", "0.46798646", "0.46748582", "0.46645558", "0.46387076", "0.4636476", "0.46264026", "0.46152508", "0.45992303", "0...
0.7055731
0
Gets the overlay_scale of this GIFOutput.
def overlay_scale(self): return self._overlay_scale
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_scale(self):\n\n if not hasattr(self, \"scale\"):\n raise NotImplementedError(\"\"\"All end-use subclasses of Color should define\n a get_scale method.\"\"\")\n\n return self.scale", "def scale(self):\n return self._scale", "def scaling(self):\n return self...
[ "0.6790271", "0.6653809", "0.66482663", "0.66482663", "0.65947706", "0.6566475", "0.6556108", "0.6550792", "0.6483977", "0.646856", "0.64394736", "0.64268297", "0.6364694", "0.6363281", "0.635813", "0.63503003", "0.6337674", "0.63340884", "0.62737983", "0.62683964", "0.626098...
0.8657468
0
Sets the overlay_scale of this GIFOutput.
def overlay_scale(self, overlay_scale): allowed_values = ["fit", "fill", "none"] if overlay_scale not in allowed_values: raise ValueError( "Invalid value for `overlay_scale` ({0}), must be one of {1}" .format(overlay_scale, allowed_values) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overlay_scale(self):\n return self._overlay_scale", "def scale(self, scale):\n\n self._scale = scale", "def scale(self, scale):\n\n self._scale = scale", "def overlay(self, overlay):\n\n self._overlay = overlay", "def with_scale_op(self, scale):\n\t\tself.variables['scale'] ...
[ "0.63258976", "0.6225319", "0.6225319", "0.60859454", "0.6069903", "0.599363", "0.5942604", "0.59057343", "0.5672578", "0.55856156", "0.55695605", "0.5541849", "0.54761684", "0.54468507", "0.5435712", "0.543293", "0.54186404", "0.53943425", "0.5391189", "0.5248213", "0.518084...
0.7558165
0
Gets the label of this GIFOutput. This label is another way to identify this specific output. The label is returned in the response, but does not appear in the file name.
def label(self): return self._label
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def label(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"label\")", "def label(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"label\")", "def label(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"label\")", "def GetLabel(self) -> str:\n return self._la...
[ "0.7676132", "0.7676132", "0.7676132", "0.72346693", "0.72052455", "0.7165676", "0.7153336", "0.7116317", "0.709397", "0.709397", "0.709397", "0.709397", "0.7070629", "0.70703095", "0.69807523", "0.6979013", "0.69762206", "0.69762206", "0.69762206", "0.69762206", "0.69762206"...
0.69314796
36
Sets the label of this GIFOutput. This label is another way to identify this specific output. The label is returned in the response, but does not appear in the file name.
def label(self, label): self._label = label
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetLabel(self, label):\r\n\r\n self.label = label", "def set_label(self, value: str = \"nowhere\"):\r\n self._logger.info(log_message_formatter(\r\n \"set\", f\"{self}\", \"label\"))\r\n self._name = value", "def label(self, label: str):\n\n self._label = label", "d...
[ "0.7037132", "0.7015011", "0.6995444", "0.69905746", "0.6945674", "0.69194204", "0.69194204", "0.69194204", "0.6830198", "0.6777393", "0.6766795", "0.67664", "0.6736288", "0.6702227", "0.6684909", "0.6660016", "0.66550493", "0.66285706", "0.6598174", "0.6524958", "0.65165377"...
0.6942709
14
Returns the model properties as a dict
def to_dict(self): result = {} for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n return self.properties", "def to_dict(self):\n return self.properties", "def get_properties(self):\n return self.properties", "def asdict(self):\n return self._prop_dict", "def json(self):\n rv = {\n prop: getattr(self, prop)\n f...
[ "0.7751993", "0.7751993", "0.73391134", "0.7334895", "0.7297356", "0.727818", "0.7159078", "0.71578115", "0.71494967", "0.71494967", "0.71283495", "0.71275014", "0.7122587", "0.71079814", "0.7060394", "0.7043251", "0.7034103", "0.70233124", "0.69635814", "0.69586295", "0.6900...
0.0
-1
Returns the string representation of the model
def to_str(self): return pprint.pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self) -> str:\n # noinspection PyUnresolvedReferences\n opts = self._meta\n if self.name_field:\n result = str(opts.get_field(self.name_field).value_from_object(self))\n else:\n ...
[ "0.85856134", "0.7814518", "0.77898884", "0.7751367", "0.7751367", "0.7712228", "0.76981676", "0.76700574", "0.7651133", "0.7597206", "0.75800353", "0.7568254", "0.7538184", "0.75228703", "0.7515832", "0.7498764", "0.74850684", "0.74850684", "0.7467648", "0.74488163", "0.7442...
0.0
-1
For `print` and `pprint`
def __repr__(self): return self.to_str()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pprint(*args, **kwargs):\n if PRINTING:\n print(*args, **kwargs)", "def print_out():\n pass", "def custom_print(*objects):\n print(*objects, sep=OFS, end=ORS)", "def _print(self, *args):\n return _ida_hexrays.vd_printer_t__print(self, *args)", "def _printable(self):\n ...
[ "0.7557754", "0.7338058", "0.6987503", "0.69850004", "0.69455147", "0.6924971", "0.6898882", "0.6898829", "0.6815187", "0.68062454", "0.6751603", "0.6749909", "0.67452943", "0.67000484", "0.66911054", "0.66751033", "0.6657706", "0.6609648", "0.6608622", "0.66017973", "0.65629...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, GIFOutput): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Returns the start state for the search problem.
def getStartState(self): util.raiseNotDefined()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getStartState(self):\n return self._start_loc", "def getStartState(self):\n\t\tutil.raiseNotDefined()", "def getStartState(self):\n\t\tutil.raiseNotDefined()", "def getStartState(self):\r\n\t\tutil.raiseNotDefined()", "def get_start_state(self):\n util.raiseNotDefined()", "def get_start...
[ "0.75840217", "0.7533028", "0.7533028", "0.7457706", "0.7429071", "0.7384781", "0.7342245", "0.7342245", "0.7342245", "0.7342245", "0.7342245", "0.7342245", "0.7342245", "0.7342245", "0.7342245", "0.7339077", "0.69931024", "0.6990535", "0.6884872", "0.6682311", "0.6666652", ...
0.74203616
37
Returns a sequence of moves that solves tinyMaze. For any other maze, the sequence of moves will be incorrect, so only use this for tinyMaze.
def tinyMazeSearch(problem): from game import Directions s = Directions.SOUTH w = Directions.WEST return [s, s, w, s, w, w, s, w]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tinyMazeSearch(problem):\n from game import Directions\n s = Directions.SOUTH\n w = Directions.WEST\n n = Directions.NORTH\n\n return [s, s, n, s, w, s, w, w, s, w]", "def tinyMazeSearch(problem):\n from game import Directions\n\n s = Directions.SOUTH\n w = Directions.WEST\n retur...
[ "0.7175067", "0.71658105", "0.7148162", "0.7116588", "0.7116588", "0.7116588", "0.7103733", "0.7103733", "0.7103733", "0.7103733", "0.7103733", "0.7103733", "0.7103733", "0.7101113", "0.7101113", "0.7101113", "0.7101113", "0.7101113", "0.7101113", "0.7101113", "0.7101113", ...
0.7095842
44
Search the deepest nodes in the search tree first. Your search algorithm needs to return a list of actions that reaches the goal. Make sure to implement a graph search algorithm. To get started, you might want to try some of these simple commands to
def depthFirstSearch(problem): # Initialization startState = problem.getStartState() # print "Start:", startState if problem.isGoalState(startState): return [] # No action needed route = util.Stack() closed = set([startState]) stack = util.Stack() # DFS use stack # print prob...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def depthFirstSearch(problem):\n \"*** YOUR CODE HERE ***\"\n class Node:\n def __init__(self, state, parent, action, pathCost):\n self.state = state #state of the game\n self.parent = parent #parent of the node\n self.action = action #action that led to that node\n ...
[ "0.7513152", "0.7225696", "0.7204362", "0.7134987", "0.71109664", "0.7070234", "0.70049804", "0.69962883", "0.6984793", "0.6974376", "0.6913317", "0.69028807", "0.6886942", "0.6876935", "0.68767977", "0.6869486", "0.682488", "0.67664015", "0.67569697", "0.675022", "0.6741336"...
0.655119
33