query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
00586226ffc77d02ebb50ba9e226c65f
Wrap the target function and start a thread to run it
[ { "docid": "a71cffd8c668547f2fa0fa27a88b87e5", "score": "0.62145805", "text": "def thread_start(target, args):\n run_thread = threading.Thread(target=target,\n args=args)\n run_thread.setDaemon(True)\n run_thread.start()\n return run_thread", "title": "" ...
[ { "docid": "6e924478f945629b09fa4ba2dcac36b5", "score": "0.75560284", "text": "def run_thread(targetfunction, argsforfunction=[]):\n threads[targetfunction.__name__] = Thread(\n target=targetfunction, args=argsforfunction\n )\n threads[targetfunction.__name__].start()", "title": "" ...
1d03a6c432b1dfb23de19f78958d8c0c
GetInverseOrder(itkPermuteAxesImageFilterIUC3 self) > itkFixedArrayUI3
[ { "docid": "7426202c5fb06698cee92a700e33aceb", "score": "0.8726155", "text": "def GetInverseOrder(self) -> \"itkFixedArrayUI3 const &\":\n return _itkPermuteAxesImageFilterPython.itkPermuteAxesImageFilterIUC3_GetInverseOrder(self)", "title": "" } ]
[ { "docid": "f869bf6280669dbb704d90b2fc2419df", "score": "0.86088556", "text": "def GetInverseOrder(self) -> \"itkFixedArrayUI3 const &\":\n return _itkPermuteAxesImageFilterPython.itkPermuteAxesImageFilterIF3_GetInverseOrder(self)", "title": "" }, { "docid": "f69d662c93f72881fce6f0fbc...
c3bebcd033b560947ad52049832a17d9
Get domain numberings for a domain if it is present in target
[ { "docid": "2dc32ead8e14e19b59bd0851c38169d1", "score": "0.7273047", "text": "def get_domain_number(target, domain, database):\n query = \"SELECT num FROM component WHERE target='{}' AND domain = {} ORDER BY num\".format(target, domain)\n return [num for (num,) in database.execute(query)]", "t...
[ { "docid": "0be2d57dcdfadd4f8ef78a3cb7b24073", "score": "0.5897098", "text": "def find_domain():\r\n task_list=[]\r\n for x in range(0, len(input_dict[1])):\r\n task_list.append(input_dict[1][x].split(\",\")[1].split())\r\n for task_num in range(0,len(task_list)):\r\n domain[task_...
2f8cd6721dc274ac9d37686b45269349
get the match number of two sequences
[ { "docid": "fe06a3652b1ead85337a756c0cf74983", "score": "0.80829686", "text": "def GetSeqMatch(seq1, seq2):\r\n matchCnt = 0\r\n for idx, curChar1 in enumerate(seq1):\r\n curChar2 = seq2[idx]\r\n if curChar1 == curChar2: matchCnt += 1\r\n return matchCnt", "title": "" } ]
[ { "docid": "24ebcce5635738a22d8a171f3d367e30", "score": "0.68315715", "text": "def num_matches(list1, list2):\n list1.sort()\n list2.sort()\n if list1 == [] or list2 == []:\n return 0\n if list1[0] == list2[0]:\n return 1 + num_matches(list1[1:], list2[1:])\n if list1[0] < l...
5796bc034f99d5527a461c1ea52e0712
Divide two functions >>> f1 = ... >>> f2 = ... >>> ff = f1 / f2
[ { "docid": "4ed6aca71ab02122c6ea963f6b92d76a", "score": "0.6818164", "text": "def __div__ ( self , other ) :\n if self is other : return self.__constant ( 1 )\n elif isinstance ( other , constant_types ) and isequal ( other , 1 ) : return...
[ { "docid": "dadd470302d0200c7346cf74ed6fd6a2", "score": "0.79255766", "text": "def division(first, second):\n return first / second", "title": "" }, { "docid": "cea96b88efb4ec0b45112fa00abc625a", "score": "0.7900606", "text": "def div(a,b):\n return a/b", "title": "" }, ...
4ab5c8df5747eb88cda571a3127f936a
Here we are displaying index page.
[ { "docid": "669f62e23491941533b3b0a5faad4be9", "score": "0.0", "text": "def payment(request):\n user = User.objects.get(username=request.user)\n settings = Billing.objects.filter(user=user).first()\n\n # What you want the button to do.\n paypal_dict = {\n \"business\": settings.paypal...
[ { "docid": "6ed18a3b9c8828349f7b90206b8317e0", "score": "0.85786694", "text": "def index():\n # Render the main page-index\n return render_template(\"index.html\")", "title": "" }, { "docid": "d331dfd34f01bb05ab7a084f36c479b7", "score": "0.83920103", "text": "def index():\n ...
b4955fe99573a0588e1f42e9a7e5df02
Ensure marking a test is backing up old results if asked to.
[ { "docid": "4bc7f7bfe7076f8dca7e042f5371926a", "score": "0.6014928", "text": "def test_fixture_is_backing_up_old_results_to_default_path_if_no_path_provided(testdir):\n results_path = testdir.tmpdir.join(\"results.json\")\n results_path.ensure(file=True) # 'touch' the file\n\n # Run a dummy te...
[ { "docid": "2e1730d8980b0b51499f0f539e52bcfb", "score": "0.7026157", "text": "def test_fixture_is_backing_up_old_results(testdir):\n results_path = testdir.tmpdir.join(\"results.json\")\n old_results_path = testdir.tmpdir.join(\"results.old.json\")\n\n # Run a dummy test that performs queries\n...
acda800e0f29b50094bc5190cd90f6cc
private method of searching target node in the input subtree (backtracking version)
[ { "docid": "ce043f14d2a3c226d3dcfba097277b2b", "score": "0.0", "text": "def __treeSearch(self, root: BinaryTreeNode, key: int) -> BinaryTreeNode:\n if root == None or root.val == key: return root\n if root.val < key: return self.__treeSearch(root.right, key)\n else: return self.__tr...
[ { "docid": "09e7622b90f87cdc4caafc95b3d23ebb", "score": "0.6933266", "text": "def breadth_first_search(self, source_node, target_node):\n return False", "title": "" }, { "docid": "99a99728f1faac3dd8cf8e1e6093c62f", "score": "0.68992054", "text": "def recursive_search(node, ind...
9c56f06c5aedb2c724ba0b2b16b1ec9b
Create a file containing blow count vs depth.
[ { "docid": "a69ffe7e037a5f03d7d6e710e693f126", "score": "0.59456706", "text": "def create_bcount(\n did,\n bcounts,\n depths\n):\n bcounts_ = [bcounts, depths]\n\n with open(\n 'bcounts/{}.p'.format(did),\n 'wb'\n ) as out_file:\n pickle.dump(\n bcounts_...
[ { "docid": "a591fb0a1c1f83821fcb324131b569db", "score": "0.6140474", "text": "def write_png_depth(filename: str, depth: int) -> None:\n data = struct.pack('!i', depth)\n with open(filename, 'r+b') as f:\n # seek to the beginning of the IEND chunk\n f.seek(-LEN_IEND, 2)\n # ove...
0520fe6183a36493bd169bfdd893568e
Perform a Bayesian linear fit for a heteroscedastic set of points with uncertainties along both axes. See the accompanying article and D'Agostini2005 for further details of the method. The method allows not only to attach uncertainties to the data points, but also to the functional relation itself. Basically, this mean...
[ { "docid": "298708af0c0b338d80b4ce04e9f63123", "score": "0.7031217", "text": "def bayesian_linear_fit(x, y, Vx, Vy, c=True, prior=None):\n\n sigmaV_guess = 0\n m_guess = 1\n plot = False\n\n if c:\n # If not passing through the origin\n phi = posterior(x, y, Vx, Vy, c=True, pri...
[ { "docid": "e2fa5000de7ab8b17be83cb851c11008", "score": "0.59692013", "text": "def fit_line(\n x, y, xhat=None, fitprobs=None, fitlogs=None, dist=None, through_origin=False\n):\n\n fitprobs = validate.fit_arguments(fitprobs, \"fitprobs\")\n fitlogs = validate.fit_arguments(fitlogs, \"fitlogs\")...
9bc9e8fd60f198e6e2715832dcc25ddd
Reads a CODON MSA file and translates it to an integer array coded for Amino acids.
[ { "docid": "1ac40774e3fb5be53773cc01e88e2d93", "score": "0.7213606", "text": "def get_aa_msa_from_codon_msa(filename):\n msa = get_codon_msa_as_int_array(filename)\n return CODON_AA_MAP[msa.long()]", "title": "" } ]
[ { "docid": "7d60cdf54d31288c30a114ffd553da6f", "score": "0.7629135", "text": "def get_codon_msa_as_int_array(filename, as_torch=True):\n seq_iter = get_msa_from_aln_iter(filename)\n ret = np.array([codon_seq_to_int_list(seq) for seq in seq_iter], \n dtype=np.uint8) \n if ...
60ce49f563c0f7593b8c42628f149bc4
Takes data from a dictionary with a particular structure, and stores it in several Problem instances.
[ { "docid": "d9f4542ee50cec3b083462f12883bad2", "score": "0.59248495", "text": "def problems_from_dict(\n data: Mapping[str, Any], yaml_filename: str\n) -> Mapping[str, Problem]:\n problems, _ = _problems_and_ids_from_dict(data, yaml_filename)\n return problems", "title": "" } ]
[ { "docid": "7612f7c7c51a296b0cfd6ad809783f41", "score": "0.6503", "text": "def _problems_and_ids_from_dict(\n data: Mapping[str, Any], yaml_filename: str\n) -> Tuple[Mapping[str, Problem], Dict[Any, Any]]:\n\n # Mapping to remember which dictionaries were already converted to objects\n # Keys a...
468b816a7ffedcccb4557d5212ec44ff
plugins > print the number of plugins currently loaded.
[ { "docid": "f1c3235b866d5f55ca388bb8ebf47c15", "score": "0.712377", "text": "def show_plugins(bot, nick, chan, arg):\n plugins = len(bot.cmdhandler.loaded_plugins)\n out = bot.hicolor(\"Module Manager\" + box[\"vert\"])\n out += bot.style.color(\" %d plugins loaded\" % (plugins), color=\"silve...
[ { "docid": "dcacb8f68b550a3690bca2b827313e38", "score": "0.79757935", "text": "def num_available_plugins():\n return len(conf['plugins'])", "title": "" }, { "docid": "7cbc4fe4ae87850590bc366de633aac8", "score": "0.7857803", "text": "def __get_plugins_count(self):\n # First ...
19a4fb3923a20f6b31e95b0130b064d2
Gets an SQL insert statement suitable for finding the name. The SQL requires a parameter of name { getVariableName()}. the SQL, not null String
[ { "docid": "e09e1ef33e7ddc15d8d5a38872a17353", "score": "0.7751664", "text": "def sql_insert(self):\n return 'INSERT INTO ' + self.get_table_name() + ' (id, name) ' + \\\n 'VALUES (:dim_id, :' + self.get_variable_name() + ')'", "title": "" } ]
[ { "docid": "797df8230cf2fca03ac17ee5362befc1", "score": "0.7569555", "text": "def get_insert_statement(self) -> str:\r\n return (f\"INSERT INTO {self.table_name} VALUES({self.id}, \"\r\n f\"$${self.name}$$) ON CONFLICT (id) DO NOTHING\")", "title": "" }, { "docid": "797...
0ec645bd7a0883f088fd2421ec337771
Enables TLS on a domain using a certificate managed by Fastly. DNS records need to be modified on the domain being secured, in order to respond to the ACME domain ownership challenge.
[ { "docid": "8ee7609bb5435519e1fcd4dac819054c", "score": "0.0", "text": "def __init__(__self__,\n resource_name: str,\n opts: Optional[pulumi.ResourceOptions] = None,\n certificate_authority: Optional[pulumi.Input[str]] = None,\n common_name...
[ { "docid": "cd5cd5edb2b9bb7e31879024608cb884", "score": "0.59300214", "text": "def test_tls(self):\n self.setupTrafficDirectorGrpc()\n self.setupSecurityPolicies(server_tls=True,\n server_mtls=False,\n client_tls=True,\n ...
1a4b322d5b57367bcf7b5797e458b438
Convert arbitrary document to a certain output format.
[ { "docid": "c2f43e81af0deb2eb6f73c379e1c1b2e", "score": "0.0", "text": "def parse_document(self, state):\n # preprocess document\n d = self.parse_block(state)\n d += self.close_auto_break(state)\n return d", "title": "" } ]
[ { "docid": "901e4f5b03e58a84e897711711bdfa76", "score": "0.665919", "text": "def convert(record: cfg.OpenAPI, outformat: cfg.Format = None) -> NoReturn:\n content = record.oas\n # Output\n out(content, outformat \\\n or cfg.Format.JSON if record.oastype == cfg.Format.YAML \\\n els...
617a52f77ef670d3ce933cddbcc6dee0
Generate a proof that the ith leaf is in the tree.
[ { "docid": "47ae9b279773cebefee87327b4deffc7", "score": "0.6056217", "text": "def proof_of_inclusion(self, node_number):\n proof = str(self.root.data)\n node = self.leaves[node_number]\n while node.data != self.root.data:\n proof += \" \" + node.get_prefix_of_brother() + ...
[ { "docid": "ce657d99ef16ca127dd9ea0934ed7499", "score": "0.61243963", "text": "def test_proofs(self):\n\n for i in range(0, self.num_iters):\n elems = [random.randint(0, 100000000) for i in range(0, 100)]\n elems.sort()\n mht = MHT.new(elems)\n\n for el...
6b168d7bc2fb1b6ba301b47a626ba2d1
itkImageFunctionIRGBAUC3RGBAUCD_cast(itkLightObject obj) > itkImageFunctionIRGBAUC3RGBAUCD
[ { "docid": "27974120579307c54033c0a2f2e79c83", "score": "0.9448457", "text": "def itkImageFunctionIRGBAUC3RGBAUCD_cast(obj: 'itkLightObject') -> \"itkImageFunctionIRGBAUC3RGBAUCD *\":\n return _itkImageFunctionBasePython.itkImageFunctionIRGBAUC3RGBAUCD_cast(obj)", "title": "" } ]
[ { "docid": "452631e89920cd61ceb0e3baa7f6b392", "score": "0.93457943", "text": "def itkImageFunctionIRGBAUC2RGBAUCD_cast(obj: 'itkLightObject') -> \"itkImageFunctionIRGBAUC2RGBAUCD *\":\n return _itkImageFunctionBasePython.itkImageFunctionIRGBAUC2RGBAUCD_cast(obj)", "title": "" }, { "docid...
a315eac5e01b7996f85b0ee3e9037907
this functions return True is every slot is full with 'X' or 'O'
[ { "docid": "d57d5981fa5aba15ebedafea2aed08c3", "score": "0.6083814", "text": "def is_full(self):\r\n for i in range(self.width):\r\n if self.can_add_to(i):\r\n return False\r\n return True", "title": "" } ]
[ { "docid": "174b00346f9041dc36393673ea361c7d", "score": "0.6845584", "text": "def check_full():\n if table[1] in ['x', 'o'] and table[2] in ['x', 'o'] and table[3] in ['x', 'o'] and table[4] in ['x', 'o'] \\\n and table[5] in ['x', 'o'] and table[6] in ['x', 'o'] and table[7] in ['x', 'o']...
efecd4f2db07fcb8a9c5c70ca798be42
Get the map's content at the given x,y coordinates.
[ { "docid": "66c2928aa06147e1c947647c9b300532", "score": "0.58302176", "text": "def get_content(self, x: float, y: float) -> protocol.NavNodeContentType:\n return self._root_node.get_content(x, y)", "title": "" } ]
[ { "docid": "bad62267e3c84fb20f4d89fa0d887810", "score": "0.6279652", "text": "def get(self, x, y, z):\n cursor = self._conn.execute(\n \"\"\"\n SELECT tile_data FROM tiles\n WHERE zoom_level = :z AND\n tile_column = :x AND\n tile_...
5c729b495a476373c33f734718cc8c46
find optimal parameters on crossvalidation for xgboost by Hyperopt
[ { "docid": "9239610441cd07314801ad5c69e648da", "score": "0.71515936", "text": "def find_params_xgb(train_x, train_y, task, type, eval_metric, n_classes, folds, total_evals = 50, sparse = False, stopping_rounds = -1, missing = np.nan, verbose = False):\r\n\r\n np.random.seed(777)\r\n\r\n def score(...
[ { "docid": "3fb6f0fbafc0533ccb54bbf5551f4622", "score": "0.74352896", "text": "def xgb_hyperopt():\n\n xgb_best = xgb.XGBClassifier(n_estimators=300, **best_parameters, tree_method='gpu_hist')\n #xgb_best = xgboost.XGBClassifier(n_estimators=300, param_grid = best_parameters, tree_method='gpu_hist...
1b1435d1683487ecf3365967c1afada2
Define test class to handle assertEqual with `pandas.DataFrame`.
[ { "docid": "fea0b94710088a4ab085ced5d9880434", "score": "0.70121086", "text": "def add_data_frame_equality_func(test):\n def frame_equal(lhs, rhs, msg=None):\n \"\"\"Adapter for pandas.testing.assert_frame_equal.\"\"\"\n if msg:\n try:\n pdt.assert_frame_equal(...
[ { "docid": "7b1984d44b85fdf72e8e1b13af6da2c9", "score": "0.7090182", "text": "def test_dataframe(self):\n self.assertTrue(test_create_dataframe(DATA_FRAME, LIST_COL_NAME))", "title": "" }, { "docid": "7470b99ef3d62c2b4e8d0eaa6ab5121f", "score": "0.69681454", "text": "def test_...
e1c767c8f6243e23f22514657e32bb27
Sends rows to a BigQuery table. Iterates until all rows are sent.
[ { "docid": "5d1b54000dae9618b2358fb1d06f5ad1", "score": "0.79960674", "text": "def send_to_bq(table_name, rows):\n\n if rows:\n logging.info('Sending %d rows', len(rows))\n _send_to_bq_raw('swarming', table_name, rows)", "title": "" } ]
[ { "docid": "afe5eff31f8c2d1e4f035edc6ff89430", "score": "0.7848489", "text": "def _send_to_bq_raw(dataset, table_name, rows):\n # BigQuery API doc:\n # https://cloud.google.com/bigquery/docs/reference/rest/v2/tabledata/insertAll\n url = (\n 'https://www.googleapis.com/bigquery/v2/projects/%s/dat...
08b1a4d5ce1065b6a12128ff7982476e
Calculates the hyper_period of the network
[ { "docid": "5f1a2b49e80ae1417065d8a0744fd9a3", "score": "0.6522371", "text": "def calculate_hyper_period(periods):\n return lcm_multiple(*periods)", "title": "" } ]
[ { "docid": "51df2fd3ebacba7e4edc7b7815f617d9", "score": "0.6120404", "text": "def __get_hyperperiod(self):\r\n for task in self.taskset:\r\n pass", "title": "" }, { "docid": "1b2923e8789a715024dae5ad1d39142d", "score": "0.58434445", "text": "def period( self, treq):...
b81cda7c44c9a95a958a4ec21e97f111
Logic for handling sub dictionaries in table_output (hide, reparse)
[ { "docid": "8777b65c057a3b1fc26fb145ec0e0bc0", "score": "0.5488281", "text": "def check_sub_dict(parsed_dict, key, value):\n # check for specific well-known keys we want to format and show differently.\n if key == 'address':\n # street city state post_code country\n pretty_address = ...
[ { "docid": "166e72bbf193ac96653fef6836052aed", "score": "0.5735426", "text": "def printptable(typec, t=\"adv\", at=typedict, ad=typedefdict):\n typec = typec[0].upper() + typec[1:].lower() ## This line capitalizes the type correctly for future use with the dictionaries.\n if t == \"adv\":\n ...
fbf142af4779a30ee9ab42abf9b5eef3
Returns the value of the objective after solve.
[ { "docid": "33896780b6f57a9b89dd03d9bccfe9c4", "score": "0.84447485", "text": "def objective_value(self):\n self.__check_has_feasible_solution()\n return self.__solve_helper.objective_value()", "title": "" } ]
[ { "docid": "ac988b24dde3b60a3417a5ab21dcaaf5", "score": "0.79332906", "text": "def objective_value(self: \"Model\") -> Optional[numbers.Real]:\n return self.solver.get_objective_value()", "title": "" }, { "docid": "fd35a53ae58889ad4bf5d206e4ec6411", "score": "0.7464509", "text...
177d8bb99822d9f182c26406bbdbf2c4
Puts a list of the referenced UID into the loadable for use in the node if this is loaded.
[ { "docid": "b13acc039b95bfdb1c55439a4009eb24", "score": "0.6025457", "text": "def addReferences(self, loadable):\n dcm = pydicom.read_file(loadable.files[0])\n loadable.referencedInstanceUIDs = []\n self._addReferencedSeries(loadable, dcm)\n self._addReferencedImages(loadable, dcm)\n load...
[ { "docid": "d96bf21a885a86eebd587b28717baf1d", "score": "0.5601305", "text": "def put_list(self):\n self._check(pn_data_put_list(self._data))", "title": "" }, { "docid": "8f6609cd5d5501b1d2c674e337a5f338", "score": "0.54111516", "text": "def setInternalList(self, lst):\n\n se...
22c51d61993faeb008bf5a86d6f28863
Initialize new Tileset The heavy lifting is done by
[ { "docid": "23f5432f6952651e35d889a1b63d1c6f", "score": "0.0", "text": "def __init__(self, path, output='.', param_file=None, skip_file=None,\n label=None, **kwargs):\n self.basepath = os.path.dirname(__file__)\n try:\n os.makedirs(output)\n except OSError...
[ { "docid": "a88e6185afc685196ac28a3ff0eae075", "score": "0.796752", "text": "def __init__(self):\n self.tileset = None\n self.dim = 0\n self.size = None # dim of tileset in pixels\n self.tsize = None # dim of tileset in tiles\n self.tiles = [] # the tiles", "title"...
41b4b6d54777344fd608b93357ba30d7
Test listing directory with client method.
[ { "docid": "d7b854ac41c3b166c486145556ed7936", "score": "0.6901601", "text": "def test_client_list_dir_index():\n # Fetch list\n result = openedgar.clients.edgar.list_path(\"/Archives/edgar/daily-index/1994/\")\n\n # Compare lists\n expected = ['/Archives/edgar/daily-index/1994//QTR3/',\n ...
[ { "docid": "5f0f5133fb45190a7e0195fba7f7e1d2", "score": "0.7233427", "text": "def listdir(self, path):", "title": "" }, { "docid": "226f798688c7595c07b73d3ef7349b0f", "score": "0.7106514", "text": "def list_directory(self, uri: str) -> DirectoryListing:", "title": "" }, { ...
72c48f399241f9a7b82f9f34ccb5ce32
Function for reading in our full dataset, creating estimates for each citytime pair, and writing these estimates to a new dataset in addition to our old dataset.
[ { "docid": "79c372426cf4ef285186dc49f07be7da", "score": "0.0", "text": "def make_age_data():\n\n # Read in input dataframe\n dataset = pd.read_excel(os.path.join(\"..\", \"data\", \"dataset.xlsx\"))\n age_percents = []\n\n # Read in dataframe for age\n age_data = pd.read_excel(os.path.joi...
[ { "docid": "45a16e3c5f171aa393bb3e0b4a7b0e73", "score": "0.679058", "text": "def load_data(city, month, day):\n \n #Washington data have 8 columns not 10 like others. Gender and Birth Year left.\n \n c_path = 'chicago.csv'\n ny_path = 'new_york_city.csv'\n w_path = 'washington.csv'\n ...
dc6c2135517ccd8025af10f5c0c7967e
Return the reference ID for the current command section.
[ { "docid": "60f7faf63c367a3e1cdf197b3fb8a03f", "score": "0.7987671", "text": "def get_current_command_section_ref_id(env, for_subcommand=False):\n if for_subcommand:\n key = 'rbt-subcommand'\n else:\n key = 'rbt-command'\n\n return env.temp_data['%s:doc-prefix' % key]", "title...
[ { "docid": "b94e34f76c06201a2311a9fa0ae4c714", "score": "0.7150189", "text": "def get_current_command_usage_ref_id(env, for_subcommand=False):\n return ('%s-usage'\n % get_current_command_section_ref_id(\n env,\n for_subcommand=for_subcommand))", "title": ...
e3f2ebcfdf18e31720df7eb11cb19c61
Return a custom 404 error.
[ { "docid": "1af86d53d490245475ae70338cc85d7b", "score": "0.72552013", "text": "def page_not_found(e):\n return 'Sorry, Nothing at this URL.', 404", "title": "" } ]
[ { "docid": "6105f813d803e8846ed5b1e4e8e3cdd2", "score": "0.8263737", "text": "def not_found(error):\n return \"404\"", "title": "" }, { "docid": "1013b6ae3377c6fd3298615cea6c209e", "score": "0.79933435", "text": "def notFound404Error():\n return Response (HTTP_STATUS_NOT_FO...
af97e0480981b7f93e21e2b4b8b745de
Copy the configuration directory from keycloak into the temporary storage directory. If an error is raised because the copied directory already exists at the destination, abort the copy and ignore the error.
[ { "docid": "d6f701fa44752d860340bd53e4c4c5bd", "score": "0.64012563", "text": "def copy_base_files(keycloak_path, temp_dir):\n config_src = keycloak_path / \"standalone/configuration\"\n\n if not os.path.exists(config_src):\n raise FileNotFoundError(f\"The configuration file '{config_src}' ...
[ { "docid": "a96c21963a51716355afa845ded38cad", "score": "0.63141984", "text": "def _copy_setup_storage(self, tmp):\n for d in [ 'setup-storage', 'setup-storage/conf.d' ]:\n for src in glob.glob('%s/*' % d):\n if os.path.isfile(src):\n tmp_src = self._c...
5eb4f9e0ed93aa4bbff6383b5a544e3a
Return whether proper Docker version is installed.
[ { "docid": "ae878a289e1b547295f2bc227ba43dcb", "score": "0.8707321", "text": "def supported_docker_installed():\n\n try:\n clean_version = remove_leading_zeros_from_version(commands.version())\n return Version(clean_version) >= Version(SUPPORTED_DOCKER_V)\n # OSError = Not installed\...
[ { "docid": "70b9e6dcc648fff5b07e32daadad2677", "score": "0.77932274", "text": "def docker_is_present():\n return which('docker') is not None", "title": "" }, { "docid": "78f6a116b9517d3022997fb477775efb", "score": "0.7396688", "text": "def _check_docker_version():\n if os.envir...
e76147aff1fffc6c19c1dc908a51f3de
Return the queryset backing annotations. Executing this queryset is costly because there is no way to optimize the query execution. Since this is a related_set queryset, that was further filtered, each item in the queryset causes a db hit.
[ { "docid": "52440f6bcf1797455bab587bc901e505", "score": "0.6528129", "text": "def GetAnnotationsQS(self):\n return self._costly_annotations_qs", "title": "" } ]
[ { "docid": "187637764ad2b8c1f55ef062d620afcb", "score": "0.6831465", "text": "def get_queryset(self):\r\n queryset: QuerySet = super().get_queryset().prefetch_related('film_work_genre', 'genres', 'film_work_person',\r\n 'persons'...
7106374d64bb075e2635bcc0187ac5f2
This function needs to be hooked into the 100ms hook
[ { "docid": "216068cebb425908243433a81679ee0c", "score": "0.5795586", "text": "def clock_timer_100ms():\n global lastTime\n cTime = get_tmr_count(TMR5) >> 8\n if cTime < lastTime:\n clock_tick()\n lastTime = cTime", "title": "" } ]
[ { "docid": "d2757f26752208b1a80b70734a7e3c96", "score": "0.6760372", "text": "def work(self):\r\n time.sleep(1)", "title": "" }, { "docid": "843d0bf6411351159fc198d19ed80c12", "score": "0.6745067", "text": "def slow_down(self):\n pass", "title": "" }, { "doc...
15443b0a0d8c8f241d58c896a0964e66
Edit the inherit replication flag for volume.
[ { "docid": "c4835037b882671342707bd1e738352f", "score": "0.80905753", "text": "def edit_inherit_replication_flag(self, pool, project, volume, set=True):\n svc = ('/api/storage/v1/pools/%(pool)s/projects/%(project)s'\n '/filesystems/%(volume)s/replication'\n % {'pool': ...
[ { "docid": "46fd0cf5360d7f2c5330c34ba629af79", "score": "0.55705565", "text": "def extend_volume(self, volume, size):\n return self.set_volume(volume, size=size, truncate=False)", "title": "" }, { "docid": "ecad12e7ca1d65657ff9c51410beccdc", "score": "0.5562828", "text": "def ...
fcaca5e573437f485f9b4e4a15161943
r""" Import graphs from ``file`` into the database. This function is used to import new censuses of graphs and is not meant to be used by users of DiscreteZOO. To properly import the graphs, all graphs of the same order must be together in the file, and no graph of this order must be present in the database.
[ { "docid": "23e07053e4212c9cf56777e7c8f4894f", "score": "0.7322005", "text": "def import_graphs(file, cl=ZooGraph, db=None, format=\"sparse6\",\n index=\"index\", verbose=False):\n info = ZooInfo(cl)\n if db is None:\n db = info.getdb()\n info.initdb(db=db, commit=False)...
[ { "docid": "7139a8d85797a92497b30657ec0db74d", "score": "0.72724146", "text": "def load_graph(file):\n g = nx.DiGraph()\n mode = \"N\"\n for l in file:\n l = l.strip()\n if mode == \"N\":\n if l == \"// Nodes\":\n mode = \"LN\"\n elif mode == \"LN\":\n if l == \"// Edges\":\...
3fa9d87096dc3fad08e3952a0081d446
Called after a property has changed.
[ { "docid": "719cdb4e44572b9c254ca4771693d64f", "score": "0.0", "text": "def _on_time_formatter_property_changed(self, evt=None):\n \n self._is_dirty = True", "title": "" } ]
[ { "docid": "d91682be3dcb80886000459abf2b8b65", "score": "0.71458226", "text": "def onPropertyStoreChanged(self):\n self.haschanged = True\n self.update()", "title": "" }, { "docid": "06f1063962948be0a25c6606187672d7", "score": "0.6950608", "text": "def property_changed(...
dfcac79a457a0f57ceddfe715a787505
basic stability test of a Numba CPUDispatcher function (i.e., function compiled via / )
[ { "docid": "a3918b70ff5560c9c9829ff65beb3349", "score": "0.0", "text": "def stability_test(func, func_kw, ref_path, ignore_fails=False, define_as_ref=False):\n func_name = func.py_func.__name__\n logging.info(\"stability testing `%s`\", func_name)\n ref_path = expand(ref_path)\n\n test = exe...
[ { "docid": "b7dd18680ed15bae6aa27388de7f3f2a", "score": "0.6352842", "text": "def test_basic(self):\n a = 1\n\n @njit\n def foo(x):\n return x + 1\n\n foo(a)\n int_int_fc = types.FunctionType(types.int64(types.int64,))\n\n @njit(types.int64(int_int_fc...
afa6717e6fb11a1ff402ef058e0f7c37
Create binary array to pick out which idxs are accepted.
[ { "docid": "7b15995a47c10cea86fcd8a454f84d0c", "score": "0.0", "text": "def _get_accept_masks(accept_prob: tf.Tensor):\n accept_mask = tf.cast(\n accept_prob > tf.random.uniform(tf.shape(accept_prob)),\n dtype=TF_FLOAT,\n )\n reject_mask = 1. - accept_mask\n\n ...
[ { "docid": "2239fb1e619ab3b14d59c8d1c33c740e", "score": "0.585864", "text": "def bit_ids(self):\r\n return self.bit_IFT[:, 0]", "title": "" }, { "docid": "46d00f8d3b3120319105711da9cbabac", "score": "0.57368064", "text": "def encode_bin(data: list, cat: set) -> np.ndarray:\n ...
819ec84c2c0ec3aff03438ab3c1dd5fc
Delete Vserver's VLAN configuration from ports
[ { "docid": "c8810e698d34c56b1cabdec3c2ee9b0d", "score": "0.7316536", "text": "def _delete_vserver_vlans(self, network_interfaces_on_vlans):\n for interface in network_interfaces_on_vlans:\n try:\n home_port = interface['home-port']\n port, vlan = home_port...
[ { "docid": "8dc58697abd63fd1230d85da89499814", "score": "0.66775584", "text": "def _delete_vsx_interface_vlan_v1(vlan_id, **kwargs):\n ports_list = port.get_all_ports(**kwargs)\n vlan_name = \"vlan\" + str(vlan_id)\n\n if \"/rest/v1/system/ports/%s\" % vlan_name not in ports_list:\n logg...
27d6330cd2ac3e15327c1b9ecb2d6a37
return query for insert/update/delete our attributes preferrably this method should return an IBSQuery instance this is important when query can be large this method maybe overidded to customize the behaviour
[ { "docid": "e79cc87d22407219176bb96d2e160572", "score": "0.0", "text": "def getQuery(self,ibs_query,src,action,**args):\n\tself.checkInput(src,action,args)\n\tif self.query_funcs.has_key(src+\"_\"+action):\n\t return self.__callQueryFunc(ibs_query,src,action,args)\n\telse:\n\t return \"\"", "t...
[ { "docid": "fdbd1a3ebbdc263a93c58c51a21926da", "score": "0.6932648", "text": "def create_query(self):\n return db.models.sql.Query(self.model, connection)", "title": "" }, { "docid": "08defddebdbbeebcc24c766343365faf", "score": "0.675028", "text": "def query(self):\n qu...
e86259982dceb897147a0f82302c3f73
Called when a ticket is created.
[ { "docid": "8c67b05089d8ecae10759092b41e8665", "score": "0.81197613", "text": "def ticket_created(self, ticket):\r\n self.watch_complete(ticket)", "title": "" } ]
[ { "docid": "91f7bc790a62ecdcd4fcbc04a83db5af", "score": "0.7272276", "text": "def create_ticket(self, ticket):\n\n if ticket.user:\n person = self.require_person(ticket.user.email, user=ticket.user)\n elif ticket.email:\n person = self.require_person(ticket.email)\n ...
a4e6545ac2bd52a24944ef49a2ee388a
Test case for patch_hyperflex_software_version_policy
[ { "docid": "ab51cc834c4d97dcc025b138e2442456", "score": "0.9544049", "text": "def test_patch_hyperflex_software_version_policy(self):\n pass", "title": "" } ]
[ { "docid": "4d5e955de88f71dff747e6600e7521ce", "score": "0.91287255", "text": "def test_update_hyperflex_software_version_policy(self):\n pass", "title": "" }, { "docid": "4c50caac1f2c8f81955c4ae6602bfcf9", "score": "0.8505383", "text": "def test_create_hyperflex_software_vers...
f5b658fb54dc3fd91de64cbe1c75e84c
Handle the "change password" task both form display and validation.
[ { "docid": "667729a74ce5f7559dc6c6426bbaf866", "score": "0.0", "text": "def edit_my_shop(self, request, extra_context=None):\n defaults = {\n 'extra_context': {**self.each_context(request), **(extra_context or {})},\n }\n request.current_app = self.name\n return My...
[ { "docid": "a59271f0af92a9a76696c145a4dd8436", "score": "0.77990556", "text": "def _change_password(request):\n context = {\n 'change_password_form': PasswordChangeForm(request.user, request.POST),\n 'subscribe_form': SubscribeForm(request.user)\n }\n if context['change_password_f...
2f37efc678815635b5de026c34c64cf8
Create test fixture for source meta
[ { "docid": "7e10778b7fef0a7a07fbe08678b5d731", "score": "0.0", "text": "def source_meta():\n return [SourceName.HGNC.value, SourceName.ENSEMBL.value, SourceName.NCBI.value]", "title": "" } ]
[ { "docid": "1092eee1fd63f4e443c3f1744e987661", "score": "0.6867291", "text": "def pytest_generate_tests(metafunc):\n if \"lf_data\" in metafunc.fixturenames:\n with open(DATA_DIR / \"reference_data.csv\") as f:\n reader = csv.DictReader(f)\n records = list(reader)\n ...
886e76f5557ff2af61fd624b497e0ebd
Plot the completeness against the metric binned by bins. injgroups contains n arrays of t/F of ways you want to group against any other metric. labels should give the text to go into a legend for the plot
[ { "docid": "a304c3cec3aa3a275ef2186546d4e3fc", "score": "0.7307003", "text": "def plot1DCompletenessGroups(inj,metric,bins,injgroup,s=[0.0,1.0],xlabel='metric',labels=['a','b','c','d']):\n bins=np.array(bins)\n injpcs=passes(inj,s=s)\n #injfps=~injpcs\n \n for i in np.arange(0,len(injgrou...
[ { "docid": "4bcacfe659a2f825cb821ddf845ab2a7", "score": "0.64017665", "text": "def plot1DReliabilityGroups(ops,inv,metric,bins,opsgroup,invgroup,s=[0.0,1.0],xlabel='metric',labels=['a','b','c','d']):\n bins=np.array(bins)\n opspcs=passes(ops,s=s)\n opsfps=~opspcs\n invpcs=passes(inv,s=s)\n ...
55d49f29e95ea569ff907a293f75ed60
Generates summary statistics for the extracted unmapped regions
[ { "docid": "491efe2883d60911dd457945db5f1089", "score": "0.58510685", "text": "def unmapsum(unmappeddict, idunmap):\n \n # Create GC content, length and amino acid residues list to store values for each unmapped region\n gc_unmap = list()\n len_unmap = list()\n amino = pd.DataFrame(column...
[ { "docid": "0b7767a929343f878d5391ab16351e29", "score": "0.67602116", "text": "def compute_statistics(self, region_dict):\n min_area = 15\n stats = {}\n for k,pixels in region_dict.items():\n area = len(pixels)\n if area < min_area:\n continue\n ...
5985dba22fcc927115102f2c73371d31
Test equal initialization class methods
[ { "docid": "ad2b04faa22a7acf60ea7cd712f88359", "score": "0.0", "text": "def test_payload_and_api_init_are_equal(self, mock):\n # Camera ID Mocks\n subdomain = self.c_mock_esession['activeBrandSubdomain']\n setup_ee_camera_mock(\n mock, subdomain, 'device_camera.json')\n\n...
[ { "docid": "0714b55a928f10390dd112e4a71d64e7", "score": "0.76406264", "text": "def test_init(self):\n pass", "title": "" }, { "docid": "e1d913a5d348c714c776c3a28899f32b", "score": "0.7467957", "text": "def test_bad_init(self):", "title": "" }, { "docid": "eaa2604b3...
62b727fc7e53feddb778032e637fb7ac
place a phase subplot on a figure, given figure handle and axis postion
[ { "docid": "c0ed67a6293866971bdb811fe6115b47", "score": "0.6554235", "text": "def phase_sub_plot(self, ax, ttl_str=\"\", axRect=None, pred=None):\n\n phi = self.tf.phi\n # rotate phases so all are positive:\n negative_phi_indices = np.where(phi < 0)[0]\n phi[negative_phi_indi...
[ { "docid": "58cf15113cf22c51d3d0f51fc0925655", "score": "0.7136438", "text": "def phase_plot(self, pred=None):\n axRect = [0.1446, 0.2150, 0.7604, 0.7100]\n # plt.figure(22, figsize = (8.5, 11), dpi=300)\n fig, ax = plt.subplots()\n if pred is not None:\n self.phas...
edebb6923f67de52c31b16487d8a82c9
Sets the id of this BackupDestinationDetails. The `OCID`__ of the backup destination.
[ { "docid": "505f131f3c7d30d913060d9471641e05", "score": "0.0", "text": "def id(self, id):\n self._id = id", "title": "" } ]
[ { "docid": "02ade94f2aa174c9825ecc16daee95c3", "score": "0.68016785", "text": "def set_id(self, id):\n self._id = id", "title": "" }, { "docid": "ee1f68ce7dc94a233e968c37748ab47b", "score": "0.6691179", "text": "def set_id(self, id):\n self.id = id", "title": "" }...
509bc6bda7806d989647518f1dc299e5
Move a tile of the right color to the image.
[ { "docid": "241d5a5fe336a77a4759122d4c88cc13", "score": "0.6386266", "text": "def make_move_color(result, tile, scale, yx, bgr):\n patt = tile.copy()\n patt += bgr\n patt[ma.masked_where(patt > 255, patt).mask] = 255.\n\n y, x = yx[0]*scale, yx[1]*scale\n result[y:y+scale, x:x+scale] = pa...
[ { "docid": "e4076fcb157d174c58557f0ab492b0e2", "score": "0.73865634", "text": "def move_tiles_right(self):\r\n\r\n # inits\r\n\r\n _at = self.matrix.get_object_at\r\n\r\n _acted = False\r\n\r\n # loop on rows\r\n\r\n for _row in range(self.rows):\r\n\r\n # p...
1d066022498a74c3b6eadd3778b8f510
A func implementation of
[ { "docid": "f436231d28e816d9acda70fe43627bf9", "score": "0.0", "text": "def new_func(*args, **kwargs):\n new_func.__name__ = 'func_' + func.__name__\n source_code = inspect.getsource(new_func)\n\n new_func.__doc__ = new_func.__doc__.replace('<name>', new_func.__name__)\n new_...
[ { "docid": "78e33815d207e4aa34d4e52320435483", "score": "0.80307794", "text": "def func():", "title": "" }, { "docid": "e4d7e7c9fc12a76c3bb65941c64fde7f", "score": "0.77042663", "text": "def fn():", "title": "" }, { "docid": "bd8d0afbc87dd05c9fb56bf3f08e2dcf", "score"...
ce483546bd51b522d94fd650cefc14df
Return the batch indicator/group and file data to be sent to the ThreatConnect API.
[ { "docid": "0390df010960df7d2deeb30283b87181", "score": "0.5622479", "text": "def data(self) -> dict:\n data = {'file': {}, 'group': [], 'indicator': []}\n tracker = {'count': 0, 'bytes': 0}\n\n # process group from memory, returning if max values have been reached\n if self....
[ { "docid": "ced6a377b7eb95e3bb703e69b7b02b11", "score": "0.60656387", "text": "def get_batch(self):\n raise NotImplementedError", "title": "" }, { "docid": "21a6509f723e3d726cb18ae306a5f136", "score": "0.58504844", "text": "def _process_indicators_batch(self, owner):\n ...
b9094e1a5259b445aa8ed3a37cca49db
If selected, the controller sends a Role Request message after the connection is established; to change its role according to the Role Request option selected.
[ { "docid": "0fcce8ed0edd5cff1d5750eadf85482d", "score": "0.6079378", "text": "def SendRoleRequest(self):\r\n\t\treturn self._get_attribute('sendRoleRequest')", "title": "" } ]
[ { "docid": "2ddc31c9901295f34a525afe424dc013", "score": "0.6534953", "text": "def change_role():", "title": "" }, { "docid": "496b8d6a6fdd9ab0593bd8fbbd972a75", "score": "0.6400035", "text": "def userRequestedRole(self):\n return self.user_role == ROLE", "title": "" }, { ...
07b2fb0da537e30f7339871c8dec4c79
r""" Default train function takes a torch.utils.data.Dataset and train the model on the dataset
[ { "docid": "29a7a7381c73f8b1eda040c948d86d6c", "score": "0.0", "text": "def test_only_train_fn(model, train_data, loss_fn=_default_loss_fn):\n optimizer = torch.optim.Adam(model.parameters(), lr=0.001)\n train_loss, correct, total = 0, 0, 0\n for i in range(10):\n model.train()\n ...
[ { "docid": "8d17761d82e3f4144fbbd8ca43b5cb03", "score": "0.81942797", "text": "def train(self, dataset):\n raise NotImplementedError()", "title": "" }, { "docid": "8d17761d82e3f4144fbbd8ca43b5cb03", "score": "0.81942797", "text": "def train(self, dataset):\n raise NotIm...
4dbf8edcdf7c02def36a3203902b1dc2
Add object to scene. When you add a new object to scene after that object will be drawn to scene in every `draw` function call.
[ { "docid": "40fa2826ed55ed8f0ea314fa88b4a1e1", "score": "0.6973952", "text": "def add(self, obj: GameObject) -> None:\n self.objects[obj.get_id()] = obj", "title": "" } ]
[ { "docid": "1924230e8fc78f76f86e7c8506bfc203", "score": "0.7627554", "text": "def add_object(self, obj):\n found = self.lookup_object(obj)\n obj.scene = self\n if found:\n self.objects[found] = obj\n else:\n self.objects.append(obj)", "title": "" }...
a321327085845f89b15a4fd1c9bff20f
Respond to bulletalien collisions.
[ { "docid": "f6d3eff3d1b5e970d3681a443bc145f3", "score": "0.7386176", "text": "def check_bullet_alien_collisions(ai_settings,screen, stats, sb, ship, aliens, super_aliens, bullets):\n\n # Check if any bullet collision with any alien\n bullet_alien_collision(ai_settings,screen, stats, sb, ship, alie...
[ { "docid": "2da448b58ac9f807dd2ed67e78fb61c3", "score": "0.79089516", "text": "def handle_alien_bullets(self):\n for bullet in self.alien_bullet_sprite_list:\n if bullet.rect.colliderect(self.player.rect):\n # ammo hit the player\n bullet.kill() # remove ...
7e4a43f45c30c775c92adf178b8662af
Construct a Shannontype partition of the information contained in `dist`.
[ { "docid": "fee24e7a88089622770130c49c7c61af", "score": "0.6277066", "text": "def __init__(self, dist):\n self.dist = dist\n self._partition()", "title": "" } ]
[ { "docid": "868849b8dc673a2701134d0f8961766d", "score": "0.5895211", "text": "def write_st_dist(self, dist):", "title": "" }, { "docid": "ec4a4790f9292e43a14d8bbd4fe30ac2", "score": "0.58232087", "text": "def init_dist(dist, ndim):\n if isinstance(dist, str):\n return ndim*...
ca841fb507bc6522b9eec458a6c55011
Normalizing Filter for scaling data in incomming array so the max value is equal to 1
[ { "docid": "ed9c720cbe03e2c99b02ea9557002bb4", "score": "0.6344063", "text": "def normalized(x):\n maxi = 0\n X = np.zeros(len(x))\n for i in range(0, len(x)):\n if (x[i] > maxi):\n maxi = float(x[i])\n for i in range(0,len(x)):\n X[i] = x[i]/maxi\n return X", ...
[ { "docid": "6e1d1cee28ebf937cf6fbee5e8fe60df", "score": "0.6841447", "text": "def normalize(data):\r\n array_min = data.min()\r\n array_max = data.max()\r\n\r\n return ((data - array_min) / (array_max - array_min))\r\n # return new_array\r", "title": "" ...
b60ca2ec9e7d03edaa107d4c760a27f7
ID that can be used to find errors in the log files.
[ { "docid": "c7aef613a851f171aa2b4e8b4ee17ba2", "score": "0.5365587", "text": "def error_code(self) -> str:\n return pulumi.get(self, \"error_code\")", "title": "" } ]
[ { "docid": "d5c865f049bd4181090bf5764b5dba62", "score": "0.6419121", "text": "def get_id(self):\n import re\n last_line = self.list_of_logs[-1]\n if re.search(\"error\", last_line, re.IGNORECASE):\n return None\n elif re.search(\"successfully built\", last_line, re...
b97fc381e1474d4b8691b703445d2fe9
Enable/Disable best practices validation for all items in the model.
[ { "docid": "e9b7d93b3391eae201f07c6faec0ae1c", "score": "0.6128238", "text": "def enable_best_practices(self, enabled=True):\n for item in self._data:\n item.validate_best_practices = enabled\n\n self.reset_results()", "title": "" } ]
[ { "docid": "e438db992897457c6a9e2dc4169a1ad7", "score": "0.67385113", "text": "def validate_all(self):\n \n pass", "title": "" }, { "docid": "7850a42c15eedad44f2c8a953044cf06", "score": "0.65433544", "text": "def set_validated(self):\n self.__validationerrors=[]\n ...
32ab93180ad5e9e197cf9d5f682e4033
set_test(self) Set the default test for the cipher.
[ { "docid": "b1b9d037a48909c5d03ec5c61560f832", "score": "0.80053985", "text": "def set_test(self):\r\n\t\tself.test_plain = 'Help me I am under attack.'\r\n\t\tself.test_cipher = 'HENTEIDTLAEAPMRCMUAK'\r\n\t\tself.test_kwargs = {'n': 4}", "title": "" } ]
[ { "docid": "5d2b0cc46955f4a7aa07f3a74f53bcc4", "score": "0.8267654", "text": "def set_test(self):\r\n\t\tself.test_cipher = 'LXFOPVEFRNHR'\r\n\t\tself.test_plain = 'ATTACKATDAWN'\r\n\t\tself.test_kwargs = {'key': 'LEMON'}", "title": "" }, { "docid": "abc7ad75e8c28691219b37f21f63f512", "s...
ba9232b89afd208790466ffcc6ae83e3
Test get model factory on CPU.
[ { "docid": "c63ab4ef24642f0cd5bad78718a743ce", "score": "0.7142461", "text": "def test_get_model_cpu():\n arch = {'conv1_filters': 20, 'conv2_filters': 50, 'output_classes': 10}\n model = get_model('lenet5', F.nll_loss, arch, torch.device('cpu'), 0)\n\n assert isinstance(model, QLeNet5)\n as...
[ { "docid": "33d4e4f053607709d6aba0227c9d267f", "score": "0.69362444", "text": "def test_cpu_model():\n\n trainer_options = dict(\n progress_bar=False,\n experiment=get_exp(),\n max_nb_epochs=1,\n train_percent_check=0.4,\n val_percent_check=0.4\n )\n\n model, ...
71cad424af1cfed320da85bfeb9e1129
Can either use index (idx) or the direct path (img_path) to return image
[ { "docid": "6a31ecf2731166221430055dac13630f", "score": "0.7684441", "text": "def get_image(self, idx, img_path=None):\n if idx is not None:\n img_path = self.image_paths[idx]\n else:\n assert(img_path is not None)\n image = io.imread(img_path)\n if self...
[ { "docid": "1857528a91e680dc985e3882fa6cac7c", "score": "0.78116846", "text": "def get_image(self,idx):\n return get_image_prepared(self.cfg, self.imdb.roidb[idx])", "title": "" }, { "docid": "0e3a0717ee1ff6c6a49001e595bdf651", "score": "0.7789988", "text": "def image_path...
afcebe25fd3accfad4d0eea5b1a8e1b7
Delete property file(s) for the specified set of resources
[ { "docid": "9614b83b901b0dd7a9cfddd121b33f78", "score": "0.5541111", "text": "def delete(\n ctx,\n resource_type=None,\n select=None,\n models=None,\n exclude=None,\n selector=None,\n project_dir=None,\n profiles_dir=None,\n profile=None,\n target=None,\n vars=None,\n ...
[ { "docid": "07091de612c92dcf179b0b7a0ce53403", "score": "0.7127628", "text": "def _delete_all_property_files(ctx, transformed_ls_results):\n resource_paths = [\n Path(ctx.config['project_path'], resource_location)\n for resource_location in transformed_ls_results\n ]\n property_pa...
cb367b9c25cd0cb0be785c2e03d99dda
1. Scrape Wikipedia for list of Illinois counties and store in list 2. Loop through county list including county name in each request submission
[ { "docid": "e31debce864abfd1529b4c1bc7b14036", "score": "0.6705514", "text": "def get_response(self):\n\n # Scrape Illinois counties in order to pass county name to URL\n url_counties = \"https://en.wikipedia.org/wiki/List_of_counties_in_Illinois\"\n response_url_counties = requests...
[ { "docid": "8ee020d5481124082ff88a983611dbf9", "score": "0.6404991", "text": "def _input_county_to_search_on_list_page(self):\n self.driver.get(secrets.SITE_URL + '/list/geography')\n time.sleep(2)\n previous_counties_to_remove = self.driver.find_elements_by_class_name('listed')\n ...
a66c5d07085932ee8d1d62e0ee04be2d
New() > itkBayesianClassifierImageFilterVIUC2ULDD Create a new object of the class itkBayesianClassifierImageFilterVIUC2ULDD and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first no...
[ { "docid": "7ca29369721e24c3f4d9c79cebb5103c", "score": "0.7953373", "text": "def New(*args, **kargs):\n obj = itkBayesianClassifierImageFilterVIUC2ULDD.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "title": "" } ]
[ { "docid": "a4fda03e1794568db25e2955babdf8f2", "score": "0.7995358", "text": "def New(*args, **kargs):\n obj = itkBayesianClassifierImageFilterVIUC2USDD.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "title": "" }, { "doc...
1ae17b54df4db987d1f0422e0571a527
Update existing records to set live_attendance with timestamps keys.
[ { "docid": "bee43b2fcf1520aea12722da671c22df", "score": "0.7211444", "text": "def migrate_live_attendance(apps, schema_editor):\n try:\n livesessions = apps.get_model(\"core\", \"LiveSession\")\n except LookupError:\n return\n livesessions_to_migrate = livesessions.objects.filter(...
[ { "docid": "14d72cecd8716d4bdc3c82e4f041fb1e", "score": "0.5741195", "text": "def update_timestamp(self, pit_entry: PendingInterestTableEntry):", "title": "" }, { "docid": "df41953ba4f601f9b8fe31a11bf1886a", "score": "0.5737282", "text": "def _update_something_ts(data, key, value):\n...
2557a78fa169d34f7413297f037539f7
Convert a naive datetime that uses the machine's timezone to a UTC one.
[ { "docid": "08004ba29b1d185fd4128e6bebd710b7", "score": "0.7784218", "text": "def to_utc(dt):\n # Don't modify it if it already has a timezone -- even if it's not UTC!\n # Yes, this is kinda limited, but should be enough for working with Taskwarrior.\n if dt.tzinfo is not None:\n return ...
[ { "docid": "f9217e57807189c69cdcecfdc048ff30", "score": "0.80217886", "text": "def to_naive_utc(d):\n assert isinstance(d, datetime)\n if not is_naive_datetime(d):\n d = d.astimezone(pytz.UTC).replace(tzinfo=None)\n return d", "title": "" }, { "docid": "e4409cefe9bdb32ff193e3...
2d932ff2982e42f300390ffbc62bb91c
Get the nth variable saved internally in the tuple (used for inhomogeneous variables)
[ { "docid": "38f8b634d70dc51636de80aa80500e02", "score": "0.60192716", "text": "def get_var(self, variable_idx):\n return self._vars[variable_idx]", "title": "" } ]
[ { "docid": "42e60083787ccb0582288c5fbc1a95cf", "score": "0.68985456", "text": "def get_variable_by_index(self, i):\n if not isinstance(i, int):\n raise TypeError('i must be int: %s' % i)\n var = None\n if i < self.get_num_variables():\n name, var = self._vars.items()[i]\n return va...
4742e9667543d7672b73995437beb541
Returns source minus comments and docstrings.
[ { "docid": "8857504e72a705b5c341849824fc17b4", "score": "0.6218315", "text": "def remove_comments(source, docstrings=False):\n io_obj = io.StringIO(source)\n out = \"\"\n prev_toktype = tokenize.INDENT\n last_lineno = -1\n last_col = 0\n for tok in tokenize.generate_tokens(io_obj.readl...
[ { "docid": "d3b9a8f99b5f4315f21e1380ddb89caa", "score": "0.7017617", "text": "def source(self):\r\n # return source only for that part of code\r\n return py.code.Source(self.raw)", "title": "" }, { "docid": "c41a2ee9aac8a62938784c9bb5443b37", "score": "0.7007371", "text...
ad67e6976ca0a0dbf36c4e643c745b65
Return the curve with rounded corners Replaces two points with their midpoint while retaining the start and end points
[ { "docid": "30b1f13669be15452c8148cddd08e497", "score": "0.6989627", "text": "def round_corners(self, curve):\n round_weight = 3\n rounded_curve = [curve[0]] # retain the first point\n current_point = curve[0]\n for next_point in curve[1:]:\n mid_point = (\n ...
[ { "docid": "71e372926e3cc59de3c212a9607ba596", "score": "0.6365892", "text": "def roundJoin(p1, p2, x, y, dist):\n\n (x0, y0) = p1.atend()\n (x1, y1) = p2.atbegin()\n\n (dx0, dy0) = (pyx.unit.topt(x - x0), pyx.unit.topt(y - y0))\n (dx1, dy1) = (pyx.unit.topt(x - x1), pyx.unit.topt(y - y1))\n...
ecb0ee01b6ccb11e75677aa7d9ee8dfb
Plot the strain data in the frequency domain
[ { "docid": "d9bd7a000ba278376e63a5fe428de478", "score": "0.6397094", "text": "def _frequency_domain_plot(self, *args, **kwargs):\n from pesummary.gw.plots.detchar import frequency_domain_strain_data\n\n return frequency_domain_strain_data(*args, **kwargs)[self.IFO]", "title": "" } ]
[ { "docid": "9a1712a9bdcd3cfbf3521c02ffd920db", "score": "0.6559505", "text": "def plot(self):\n x_range = np.arange(0, 1.0, 0.01)\n y_vals = [self.get_freq(x) for x in x_range]\n plt.plot(x_range, y_vals)\n plt.show()", "title": "" }, { "docid": "32df4677233cf5ac0...
09c4e58955a8b4e19f869fca7078f2d8
subscribe the web client to this socket
[ { "docid": "8806147f6d946aa383d7fb9f5fb8964f", "score": "0.6003841", "text": "def sub(self, uri, prefix=''):\n\n ident = self.ident(uri, prefix)\n idents = self.recievers.iterkeys()\n self.log('subscribe:', 'requested', ident)\n\n # we don't need to actually create more filte...
[ { "docid": "109c83d9994e8d99aa6478bff90b40e6", "score": "0.70212555", "text": "def subscribe(self):\n try:\n self.client.subscribe()\n except Exception as e:\n logger.error(\"Unknown error: {}\".format(e))\n raise Exception", "title": "" }, { "d...
9afc8cba396106e0c0e2d2cf5abd0df5
Search a word's phonetic in 'WordReference'.
[ { "docid": "a39f189fce2e8d571f78c75ac7966b03", "score": "0.66305864", "text": "def getPhonetic(word, language, variant=\"UK\") :\n\n\tlangFrom = \"\"\n\tlangTo = \"\"\n\n\tif language == \"English\":\n\t\tlangFrom = \"en\"\n\t\tlangTo = \"fr\"\n\n\ttry:\n\t\tpage = requests.get(f\"https://www.wordrefere...
[ { "docid": "f621e037c12702cc9d483850528970ea", "score": "0.6215948", "text": "def check_word_as_pounct(self,word):\t\t\n\t\tdetailed_result=[]\n\t\t# ToDo : fix it to isdigit, by moatz saad\n\t\tif word.isnumeric():\n\t\t\tdetailed_result.append(wordCase.wordCase({\n\t\t\t'word':word,\n\t\t\t'affix': ('...
a62790cae6789b1d12d43b936f35c3a6
Decoder block for albedo
[ { "docid": "e2767a3a5b8c9cf3aa792d1df864d5aa", "score": "0.5774206", "text": "def _albedo_decoder(albedo_mlp_output, encoder_op_each_layer):\n\t\tfilters = [ 256, 256, 256, 128, 64]\n\t\tdeconvolved = albedo_mlp_output\n\n\t\tfor i in range(5):\n\t\t\tdeconvolved_input = tf.concat(\n\t\t\t\t[deconvolved...
[ { "docid": "626baf0b964a809a74e5496021d993f6", "score": "0.6972518", "text": "def _decode(self):\n pass", "title": "" }, { "docid": "38895bd4f86a4a78899953d8615e9326", "score": "0.68361384", "text": "def decoder(self, decoder: decoders.Decoder):\n pass", "title": ""...
814a86ccb163c5aa3b30a811286a1675
Get the currently selected job
[ { "docid": "9ccb19c631ea05b86427f4c455904752", "score": "0.83990645", "text": "def get_job(self) -> Job:\n return self.jobs_list[self.sel_idx]", "title": "" } ]
[ { "docid": "af8b12dff6f2530fbbc6ac201ccc6a00", "score": "0.76543224", "text": "def job(self):\n return self.batch[self.job_id]", "title": "" }, { "docid": "c77c5c99ee3ce12ea54d8fa4e31cad56", "score": "0.74811244", "text": "def current_job(self):\n assert(ExecutorThread....
02855788f1ab0f7e4223d629dd005483
Recursive function that checks for nonindexable columns.
[ { "docid": "8a7947e76ac9931b926d1f3a3c9fbd55", "score": "0.5383323", "text": "def check_indexable(token_list):\n for tok in token_list.tokens:\n if tok.ttype == tokens.Name:\n col = self.schema.get_column(self.table.value, tok.value)\n if col and not col.indexable:\n ...
[ { "docid": "e3fa63a2b75dd4515481dc104bb244c8", "score": "0.6160125", "text": "def _check(self, df):\n cols_to_check = []\n try:\n cols_to_check.append(getattr(self, 'field'))\n except AttributeError:\n pass\n try:\n cols_to_check += getattr(se...
7d4440ed8fc28e2206639809e8615ddc
Tests if this user can change the hierarchy. A return of true does not guarantee successful authorization. A return of false indicates that it is known performing any update will result in a ``PermissionDenied``. This is intended as a hint to an application that may opt not to offer these operations to an unauthorized ...
[ { "docid": "96a1e125c7c2c93baf4e3b63c5b3e402", "score": "0.66537386", "text": "def can_modify_family_hierarchy(self):\n return # boolean", "title": "" } ]
[ { "docid": "f086a73bf3494ee3a3cea9a84eaad19a", "score": "0.7123733", "text": "def can_modify_objective_hierarchy(self):\n return # boolean", "title": "" }, { "docid": "4ae42bba99802e77eb731d9315fbcaf2", "score": "0.71223724", "text": "def change(self, user, energy, *args):\n ...
1659d94502ed19e7b08785e4a0c75390
Add a service variable of type ``ty`` to this model
[ { "docid": "88bde6386277d2c2911bb53b42cd1230", "score": "0.6668062", "text": "def service_define(self, service, ty):\n\n if service in self._data:\n raise NameError('Service variable <{}> already defined in _data'.format(service))\n if service in self._algebs:\n raise...
[ { "docid": "9defd39fc9f8510cf3e2c3a479654431", "score": "0.6076422", "text": "def add(stype: ServiceType, service, name: str = None, *args, **kwargs):\n name = service.__name__ if name is None else name\n dynamic_provider = stype.value(service, *args, **kwargs)\n containers.DynamicC...
16d45c9acf46f40f244ccc434e3d5dfb
Adds liquid fuel or atomic fuel tanks to design
[ { "docid": "6723dea64db5b09e54a14db3774b557c", "score": "0.69049513", "text": "def add_conventional_tanks(self, lf):\n if self.mainengine.name == \"LFB Twin-Boar\":\n lf = max(lf, 36000)\n self.notes.append(\"6400 units of liquid fuel are already included in the engine\")\n ...
[ { "docid": "c4376dbfe4ecc36c450fad9f25cf7233", "score": "0.63634956", "text": "def add_special_tanks(self, xf, tank):\n tankcount = ceil(xf / tank.m_full)\n if tank.size == parts.RadialSize.RadiallyMounted:\n tankcount = max(tankcount, 2)\n self.requiredscience.add(tank.l...
53115a545456a4f0c2aade0d3a8c94ed
loads the specified image.
[ { "docid": "49beec7092879a0b08ea6d7fed006276", "score": "0.0", "text": "def __load__(self, item):\n \n # the name for parent of parent directory where the image is located and the name of the image are same.\n # an example directory breakup is shown below -\n # - data-science...
[ { "docid": "8738269cbd579759308a2a386d6ce210", "score": "0.77812254", "text": "def load_image(self, image_id):\n info = self.image_info[image_id]\n image = info['img']\n return image", "title": "" }, { "docid": "a978904aa9088dba70ec448b95ab2849", "score": "0.7713859"...
06fa4b50e745e149999779d1fefdcc29
Get this user's given name.
[ { "docid": "a9bedb947418ec71ca1ce03e332b80e8", "score": "0.7923014", "text": "def get_given_name(self):\r\n return self.__given_name", "title": "" } ]
[ { "docid": "d3e35db1a2327055baa7cf8197681877", "score": "0.85153365", "text": "def get_name(self):\n return self._user.name", "title": "" }, { "docid": "cd962d543d325b6cb86da8222ad995fe", "score": "0.84088993", "text": "def get_user_name(self):\n user = User.by_id(self....
7b22a96ecec5b39ecad79489fa76e28b
Given a dictionary and a set of valid keys, return a dictionary which only contains keys found in `valid`.
[ { "docid": "08a3ed9cbce96c06a4e9829a12d1274d", "score": "0.65921986", "text": "def _strip_keys(obj, valid):\n return {key: obj[key] for key in obj if key in valid}", "title": "" } ]
[ { "docid": "e7640a96ac8c550bd84f13f830e1a7f1", "score": "0.6878941", "text": "def subset_dict(dictionary, keys):\n\n result = dictionary.copy()\n for original_key in dictionary:\n if original_key not in keys:\n del result[original_key]\n\n return result", "title": "" }, ...
c35652b26ac9b90ab52b8a7de68039e5
Returns true if there is any boolean True in A
[ { "docid": "488f7cc7ab70b194a5fd819ee1942cf5", "score": "0.7278255", "text": "def any_(A):\n return A.any()", "title": "" } ]
[ { "docid": "2b72524cb32c8aea61e7fb5e34fc692e", "score": "0.7511237", "text": "def __nonzero__(self):\n return any([bool(i) for i in self])", "title": "" }, { "docid": "fb85a89afbc2a2508032f356aedf04dd", "score": "0.6771524", "text": "def all(self):\n if not all(dt == 'b...
3471ed748751f1988b094a1dd75394f2
Allows to get Piano C chord with predetermined octave, harmony and duration
[ { "docid": "19446f336a41d59941282262ac238341", "score": "0.844064", "text": "def create_c_chord(self, octave, duration, harmony):\n\n result = None\n\n if str(harmony) == \"major\":\n c_note = AudioSegment.from_file(self.path_to_directory + \"/samples/piano/\"+str(octave)+\"/c.w...
[ { "docid": "07e77d4f3665179daa18aa85ae1ad833", "score": "0.84081155", "text": "def create_c_chord(self, octave, duration, harmony):\n\n result = None\n\n if str(harmony) == \"major\":\n c_note = AudioSegment.from_file(self.path_to_directory + \"/samples/guitar/\"+str(octave)+\"/...
ccdbd001147d5b9402f617c20d9e2566
MC approximation of individual Generalized GaussNewton/Fisher diagonal.
[ { "docid": "e09aba5e7a974d75ea6a635b3bb67e70", "score": "0.0", "text": "def diag_ggn_mc_batch(self, mc_samples: int) -> List[Tensor]:\n return", "title": "" } ]
[ { "docid": "83fc45443edde46c289583e7f26e160b", "score": "0.6200017", "text": "def _mmd_g_(self):\r\n # calculate pairwise distance\r\n dist_gg, dist_gd, dist_dd = get_squared_dist(\r\n self.score_gen, self.score_data, z_score=False, do_summary=self.do_summary)\r\n\r\n # m...
7f5f715f96636816652301188d4a7d08
Return the linear transformation of `y` by `x` or `x` by `y` when one or both of `x` and `y` is a LinearTransform instance
[ { "docid": "8e445e1df5116820f63b2719a02595de", "score": "0.5793339", "text": "def dot_shape(x, y):\n if isinstance(x, LinearTransform):\n return dot_shape_from_shape(x, tuple(y.shape))\n elif isinstance(y, LinearTransform):\n return dot_shape_from_shape(tuple(x.shape), y)\n else:\...
[ { "docid": "345bd03e2d81a8f108ff75220e9a3080", "score": "0.66478336", "text": "def transform(self, x, y):\n \n return numpy.array((x, y, 1)).dot(self._matrix.T)[0:2]", "title": "" }, { "docid": "fa8bde99f2c683e4d0c5f040c3610a54", "score": "0.61888194", "text": "def _tra...
78b9154d02d7e2e82a6670697ecad797
Called when app is resized.
[ { "docid": "54a5013ed2c7440077ce98fbcf991d1d", "score": "0.65565294", "text": "def on_resize_parent(self,event):\n #print(\"parent event size=\"+str(event.width)+\" X \"+str(event.height))\n self.canvas_width = event.width\n self.canvas_height = event.height\n self.canvas.con...
[ { "docid": "cf95f21cd7739a672db6e5c661a5ca90", "score": "0.8178788", "text": "def onResize(self, window, width, height):\n pass", "title": "" }, { "docid": "e1743c098b05d52132a2b8d8e82d29e0", "score": "0.80237764", "text": "def _resize(self, event):\n pass", "title"...
a926b398d55b0d419a47a274dabe7003
Return distbelief conditional_gradient values. Return values been generated from the distbelief conditional_gradient unittest, running with a learning rate of 0.1 and a lambda_ of 0.1. These values record how a parameter vector of size 10, initialized with 0.0, gets updated with 10 consecutive conditional_gradient step...
[ { "docid": "28f73ae6b769b9399f6857f05c9b9ce7", "score": "0.0", "text": "def _dbParamsCG01(self):\n db_grad = [[]] * 10\n db_out = [[]] * 10\n # pylint: disable=line-too-long\n db_grad[0] = [\n 0.00096264342, 0.17914793, 0.93945462, 0.41396621, 0.53037018,\n ...
[ { "docid": "36c653aeb3b687e085e9534cdbd33142", "score": "0.608587", "text": "def value_gradient():\n # sess.run(calculated) to calculate value of state\n state = tf.placeholder(\"float\",[None,4])\n w1 = tf.get_variable(\"w1\",[4,10])\n b1 = tf.get_variable(\"b1\",[10])\n h1 = tf.nn.relu(...
32f78e2a0364d8bb29944dbe2da16fc5
Tracker for next neuron id in the given genome
[ { "docid": "dedcb910b62f8b3963721ac1eaea7b52", "score": "0.8468444", "text": "def next_nid(genome):\n nid = genome['last_neuron'] + 1\n genome['last_neuron'] = nid\n return nid", "title": "" } ]
[ { "docid": "fcf8bdb7177722960dff82a8755c738f", "score": "0.59789985", "text": "def next_id(self):\n nid = self._next_id\n self._next_id = self._next_id + 1\n return nid", "title": "" }, { "docid": "a3d6cfa9e8896e9291b73b372ea92d75", "score": "0.59274477", "text":...
a32121a9940e96988968f7fa32f121dc
Load training data from file in ``.npz`` format.
[ { "docid": "f8d684abd15e1b6a8abcd32d14e978da", "score": "0.0", "text": "def load_training_data(file, validation_split=0, axes=None, n_images=None, verbose=False):\n\n f = np.load(file)\n X, Y = f['X'], f['Y']\n if axes is None:\n axes = f['axes']\n axes = axes_check_and_normalize(axes...
[ { "docid": "ace84a1c87b92c64a54709a4a12c05a0", "score": "0.72628057", "text": "def load_npy(self, filename):\n self.set_data(np.load(filename))", "title": "" }, { "docid": "7b2e39750ff5265c68e2283630227104", "score": "0.70330673", "text": "def load(self, filename: str) -> None...
55581e6316965b25df6fc0a49bab86fe
Check pickling of an object across another process. python is the path to the python interpreter (defaults to sys.executable) Set verbose=True to print the unpickled object in the other process.
[ { "docid": "03fa3ae7b2e67f43a813be7bd9c17298", "score": "0.63948804", "text": "def check(obj, *args, **kwds):\n # == undocumented ==\n # python -- the string path or executable name of the selected python\n # verbose -- if True, be verbose about printing warning messages\n # all other args and k...
[ { "docid": "be5a0d70305d6329b2a939b438987978", "score": "0.57015604", "text": "def is_picklable(obj):\n try:\n pickle.dumps(obj)\n except Exception:\n return False\n return True", "title": "" }, { "docid": "f261160b7dd7376478f85f0b1a0037bc", "score": "0.554075", ...
cfba5384395dd909785d5d1aa4c50363
Load recurrent neural network from h5.file
[ { "docid": "091e5e3e7c9e117ec65308a08f85f7cb", "score": "0.60439736", "text": "def load_RNN(self, model=None):\n\n if model != None:\n return models.load_model(model)", "title": "" } ]
[ { "docid": "a472291e19ca01e1c6c4f112fa1d57ec", "score": "0.7449959", "text": "def load(path: str):\n with h5py.File(path, 'r') as net_file:\n net = TensorNetwork(backend=net_file[\"backend\"][()])\n nodes = list(net_file[\"nodes\"].keys())\n edges = list(net_file[\"edges\"].keys())\n\n for ...
0026b325ddb64c5a21bdaac90ec27543
custom list display field with detail page link
[ { "docid": "b9a3176761efd1812c32b02f6fd6589b", "score": "0.6043342", "text": "def name_with_detail_link(self, obj):\n detail_url = reverse(\"admin:program_program_detail\", kwargs={\"object_id\": obj.pk})\n return format_html(f\"<a href='{detail_url}'>{obj.name}</a>\")", "title": "" ...
[ { "docid": "f84c2a47205e9e79022c971200627e3c", "score": "0.6725328", "text": "def UserListShow(self, listType, itemList):", "title": "" }, { "docid": "60551363c68ef31e6434f1d0b4dca0d0", "score": "0.6423562", "text": "def detail_page(self, obj):\n url = reverse('materials_inven...
bbd2618f260fa87d81098f2ff45fac81
Calculate mean value of each individual ensemble. Output is array of values, with the row denoting the ensemble size, and the column the ensemble number
[ { "docid": "b82ed16086ee487a802c2e45ce774e8b", "score": "0.85388535", "text": "def get_ensemble_mean(self):\n #edit 08/08/2019: new function, virtually the same as get_ensemble_min and get_ensemble_max, but for mean value of each ensemble\n\t\t\n self.ensemble_mean=np.zeros((np.size(self.d...
[ { "docid": "50290dcda63e53e00a4ec5bc68d2e814", "score": "0.71021867", "text": "def get_ensemble_average(self, outputs):\n predictions = [output for output in outputs]\n predictions = torch.stack(predictions, dim=1)\n average_prediction = predictions.mean(1)\n\n return ave...
b457f85545bdbe626233021296bda052
Inserts current datetime into self.text_field from menu
[ { "docid": "95ccaab5628f955541d65e71bfae1ca1", "score": "0.78224796", "text": "def do_time_date(self) -> None:\n text = datetime.datetime.now().isoformat()\n self.text_field.buffer.insert_text(text)", "title": "" } ]
[ { "docid": "504bed008c61e56657817a7d85fd8522", "score": "0.68654907", "text": "def OnInsertDate(self, event):\n self.AddText(str(time.ctime()))\n event.Skip()", "title": "" }, { "docid": "41bb243f0f260b6a653da25124d49ba4", "score": "0.66584486", "text": "def changeText(...
b86cfeadcd0e778c255b943bd13ea05c
This method translates a single line of comma separated values to a dictionary which can be loaded into BigQuery.
[ { "docid": "0b4dc123bd3df140da9c0d4e624e267c", "score": "0.0", "text": "def parse_method(self, string_input):\n # strip out the return characters and quote characters.\n values = re.split(\",\",\n re.sub('\\r\\n', '', re.sub(u'\"', '', string_input)))\n row ...
[ { "docid": "ac1b5d6fb18bcf081f1eb7a62476847b", "score": "0.6674348", "text": "def parse_line_to_dict(line, header):\n\tfields = line.strip().split(',')\n\tif len(header) != len(fields):\n\t\traise DataImportFormatError(\"Mismatch in header and data line in incoming data file.\")\n\trecord = {}\n\tfor i ...