query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Computes the embedding for given wide_ftrs_sp_idx and wide_ftrs_sp_val. A SparseTensor is created using wide_ftrs_sp_idx and wide_ftrs_sp_val and then multiplied with weights to obtain an embedding for each document | def _compute_embedding_score_per_record(self, wide_ftrs_idx_with_value_per_record):
# Split idx and val back
wide_ftrs_sp_idx, wide_ftrs_sp_val = tf.split(wide_ftrs_idx_with_value_per_record, 2, axis=-1)
wide_ftrs_sp_idx = tf.cast(wide_ftrs_sp_idx, dtype=tf.int64)
# Transformation
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self,\n num_wide_sp: int,\n wide_ftrs_sp_idx: tf.Tensor,\n sp_emb_size: int,\n wide_ftrs_sp_val: tf.Tensor = None,\n padding_idx: int = 0,\n initializer=tf.contrib.layers.xavier_initializer()):\n wid... | [
"0.74690807",
"0.5747046",
"0.5677438",
"0.56014305",
"0.5536787",
"0.55277413",
"0.5525836",
"0.5523767",
"0.55162793",
"0.5460928",
"0.5435253",
"0.54200006",
"0.53970104",
"0.5396664",
"0.53539515",
"0.53538656",
"0.5292858",
"0.5253519",
"0.52486753",
"0.52143943",
"0.520... | 0.7925619 | 0 |
Returns grid of wrapped class if it exists, otherwise None. | def grid(self):
if hasattr(self.cls, "grid"):
return self.cls.grid | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_grid(self):\r\n return self.grid",
"def getGrid(self):\n\n\t\treturn self._grid",
"def get_grid( self ):\n\n return self.__grid",
"def get_grid(self):\n return self._grid",
"def getGrid(self):\n\n\t\t\treturn self._logic.getGrid()",
"def __getitem__(self, pos):\n if (s... | [
"0.6043967",
"0.5944432",
"0.592956",
"0.59174585",
"0.5895752",
"0.5777044",
"0.5777044",
"0.56115645",
"0.55932224",
"0.5587703",
"0.5494381",
"0.5486588",
"0.54390824",
"0.53928554",
"0.5361043",
"0.53522295",
"0.53305113",
"0.52599454",
"0.5226078",
"0.5182626",
"0.515089... | 0.70849097 | 0 |
Clean up series name by removing any . and _ characters, along with any trailing hyphens. Is basically equivalent to replacing all _ and . with a | def CleanSerieName(series_name):
try:
series_name = re.sub("(\D)\.(?!\s)(\D)", "\\1 \\2", series_name)
series_name = re.sub("(\d)\.(\d{4})", "\\1 \\2", series_name) # if it ends in a year then don't keep the dot
series_name = re.sub("(\D)\.(?!\s)", "\\1 ", series_name)
series_name =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sanitize_name(name: str) -> str:\n return re.sub(r\"[^A-Za-z0-9_-]\", \"-\", name)[0:128]",
"def sanitize_name(name):\n # For now just change dashes to underscores. Fix this more in the future\n return name.replace(\"-\", \"_\")",
"def clean_episode_title(filename):\n new_str = filename.replace... | [
"0.74064714",
"0.7253388",
"0.7148532",
"0.71050465",
"0.70775956",
"0.7051443",
"0.69524163",
"0.69253844",
"0.6901493",
"0.6870551",
"0.6868943",
"0.68440765",
"0.68252516",
"0.6810167",
"0.68019074",
"0.6784888",
"0.6768763",
"0.6760372",
"0.67535406",
"0.67399555",
"0.668... | 0.799551 | 0 |
Return how high the match is. Currently 15 is the best match This function give the flexibility to change the most important attribute for matching or even give the user the possibility to set his own preference release is the filename as it is in the result from used websites If source is matched, score is increased w... | def scoreMatch(release, wanted):
score = int(0)
if 'source' in release.keys() and 'source' in wanted.keys():
if release['source'] == wanted['source']:
score += 8
if 'quality' in release.keys() and 'quality' in wanted.keys():
if release['quality'] == wanted['quality']:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def match_score(self):\n return self._match_score",
"def find_best_match(fpl_teams: List[str], team: str) -> Tuple[str, int]:\n best_ratio = 0.0\n best_match = None\n for t in fpl_teams:\n if fuzz.partial_ratio(t, team) > best_ratio:\n best_ratio = fuzz.partial_ratio(t, team)\n ... | [
"0.6655822",
"0.60846305",
"0.6081943",
"0.60700995",
"0.60530263",
"0.6026354",
"0.5944691",
"0.5893109",
"0.5852491",
"0.58279943",
"0.58237416",
"0.5798685",
"0.5770047",
"0.576194",
"0.5688892",
"0.5686409",
"0.5685571",
"0.5665665",
"0.56466246",
"0.5630043",
"0.5586035"... | 0.70330405 | 0 |
This function calculates the BMI of a person based on the height in meters and mass in kilograms that they provided | def calculate_bmi(mass = 56, height = 1.5):
BMI = mass / (height**2)
return BMI | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bmi(weight, height):\n return weight / height ** 2",
"def calculate_bmi(height, weight):\n m_weight = 703 * weight\n m_height = height**2\n bmi = m_weight / m_height\n return bmi",
"def calculate_bmi(cls, height_cm, weight_kg):\n if height_cm is None or weight_kg is None:\n ... | [
"0.83242905",
"0.806568",
"0.764164",
"0.76323813",
"0.75619763",
"0.7452656",
"0.68758476",
"0.66670614",
"0.65086615",
"0.6396343",
"0.63882107",
"0.62999606",
"0.6258748",
"0.6254665",
"0.61130226",
"0.5970074",
"0.58918816",
"0.5685218",
"0.5593287",
"0.55461025",
"0.5546... | 0.8592544 | 0 |
Test case for team_template_folders_change_stream_get Create a change stream. | def test_team_template_folders_change_stream_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_change_stream_post(self):\n pass",
"def test_workflows_change_stream_get(self):\n pass",
"def portal_template_folders_change_stream_get(self, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('callback'):\n return self.por... | [
"0.755507",
"0.7026903",
"0.66827625",
"0.62135065",
"0.59119457",
"0.58844477",
"0.58758533",
"0.5808115",
"0.5783344",
"0.5732833",
"0.56628746",
"0.5575189",
"0.54996955",
"0.54252094",
"0.5422915",
"0.54228514",
"0.5402587",
"0.534042",
"0.5337802",
"0.53215986",
"0.53187... | 0.85309476 | 0 |
Test case for team_template_folders_change_stream_post Create a change stream. | def test_team_template_folders_change_stream_post(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_change_stream_get(self):\n pass",
"def test_workflows_change_stream_post(self):\n pass",
"def portal_template_folders_change_stream_post(self, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('callback'):\n return self.po... | [
"0.772903",
"0.73171365",
"0.68941355",
"0.62274915",
"0.6097967",
"0.60745305",
"0.60315573",
"0.6004187",
"0.5965138",
"0.5764315",
"0.57167226",
"0.5641095",
"0.5500242",
"0.54977274",
"0.54891986",
"0.54516405",
"0.53646666",
"0.53120434",
"0.530664",
"0.5295484",
"0.5292... | 0.8841244 | 0 |
Test case for team_template_folders_count_get Count instances of the model matched by where from the data source. | def test_team_template_folders_count_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_templates_count_get(self):\n pass",
"def test_team_template_folders_id_children_count_get(self):\n pass",
"def test_workflows_id_templates_count_get(self):\n pass",
"def test_count(self):\n\n command = Command()\n modellist = command.get_mo... | [
"0.812971",
"0.7428567",
"0.7044275",
"0.66002345",
"0.6333074",
"0.6258393",
"0.6168583",
"0.6167181",
"0.6113796",
"0.6025949",
"0.59740585",
"0.59104866",
"0.59100795",
"0.58996695",
"0.58489484",
"0.58410746",
"0.58345574",
"0.58324665",
"0.58177435",
"0.58169466",
"0.581... | 0.8291441 | 0 |
Test case for team_template_folders_find_one_get Find first instance of the model matched by filter from the data source. | def test_team_template_folders_find_one_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_team_get(self):\n pass",
"def test_team_template_folders_id_exists_get(self):\n pass",
"def test_team_template_folders_id_templates_fk_get(self):\n pass",
"def test_team_template_folders_id_get(self):\n pass",
"def test_team_template_folders_id_... | [
"0.6741028",
"0.66696125",
"0.6659063",
"0.6548872",
"0.6494747",
"0.63703674",
"0.63639253",
"0.6355142",
"0.62466127",
"0.5951043",
"0.5894491",
"0.5852349",
"0.5748025",
"0.5667436",
"0.5662029",
"0.56452614",
"0.55575687",
"0.55110466",
"0.55069876",
"0.5503777",
"0.54715... | 0.8466202 | 0 |
Test case for team_template_folders_get Find all instances of the model matched by filter from the data source. | def test_team_template_folders_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_find_one_get(self):\n pass",
"def test_team_template_folders_id_templates_get(self):\n pass",
"def test_team_template_folders_id_team_get(self):\n pass",
"def test_team_template_folders_id_get(self):\n pass",
"def test_team_template_folders_id_temp... | [
"0.7745991",
"0.7599349",
"0.7545926",
"0.7328151",
"0.7193395",
"0.70863736",
"0.69541967",
"0.679594",
"0.6721732",
"0.6666562",
"0.66541135",
"0.65030825",
"0.6460915",
"0.64054143",
"0.63062704",
"0.62567776",
"0.6240918",
"0.60979414",
"0.59302366",
"0.58679736",
"0.5838... | 0.791822 | 0 |
Test case for team_template_folders_id_children_count_get Counts children of TeamTemplateFolder. | def test_team_template_folders_id_children_count_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def portal_template_folders_id_children_count_get(self, id, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('callback'):\n return self.portal_template_folders_id_children_count_get_with_http_info(id, **kwargs)\n else:\n (data) = self.portal_template_f... | [
"0.76291406",
"0.74576056",
"0.7453799",
"0.73170596",
"0.7294022",
"0.6993843",
"0.6614962",
"0.66143423",
"0.65480965",
"0.6540002",
"0.65165895",
"0.6505344",
"0.64972985",
"0.6445665",
"0.637142",
"0.6343745",
"0.62351745",
"0.6225197",
"0.62086076",
"0.6185676",
"0.61606... | 0.89132285 | 0 |
Test case for team_template_folders_id_children_fk_delete Delete a related item by id for children. | def test_team_template_folders_id_children_fk_delete(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_templates_fk_delete(self):\n pass",
"def portal_template_folders_id_children_fk_delete(self, id, fk, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('callback'):\n return self.portal_template_folders_id_children_fk_delete_with... | [
"0.74967825",
"0.73387957",
"0.7176434",
"0.71450096",
"0.70276856",
"0.69281375",
"0.68056697",
"0.6547637",
"0.64695954",
"0.6458936",
"0.64097804",
"0.63891387",
"0.62271225",
"0.6220188",
"0.6212821",
"0.62127",
"0.6198733",
"0.6152488",
"0.6083034",
"0.60765576",
"0.6049... | 0.8815056 | 0 |
Test case for team_template_folders_id_children_fk_get Find a related item by id for children. | def test_team_template_folders_id_children_fk_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_children_get(self):\n pass",
"def test_team_template_folders_id_children_fk_put(self):\n pass",
"def test_team_template_folders_id_templates_fk_get(self):\n pass",
"def test_team_template_folders_id_children_post(self):\n pass",
"def test_team_t... | [
"0.80349183",
"0.70777005",
"0.69962776",
"0.6920054",
"0.6870119",
"0.67686564",
"0.67260855",
"0.6719751",
"0.655585",
"0.62000024",
"0.5972196",
"0.5950351",
"0.59449637",
"0.592893",
"0.5920968",
"0.59056914",
"0.58841914",
"0.58657634",
"0.5813402",
"0.5782501",
"0.57558... | 0.8680469 | 0 |
Test case for team_template_folders_id_children_fk_put Update a related item by id for children. | def test_team_template_folders_id_children_fk_put(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_children_post(self):\n pass",
"def test_team_template_folders_id_children_fk_get(self):\n pass",
"def test_team_template_folders_id_templates_fk_put(self):\n pass",
"def test_team_template_folders_id_children_fk_delete(self):\n pass",
"def porta... | [
"0.7230349",
"0.71743786",
"0.713646",
"0.7025978",
"0.6966624",
"0.6745306",
"0.6649519",
"0.6372774",
"0.62732536",
"0.6084119",
"0.60431314",
"0.59393644",
"0.59389395",
"0.5871714",
"0.57597464",
"0.5710098",
"0.56835604",
"0.5659726",
"0.5648161",
"0.561432",
"0.55963826... | 0.8613742 | 0 |
Test case for team_template_folders_id_children_get Queries children of TeamTemplateFolder. | def test_team_template_folders_id_children_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_children_fk_get(self):\n pass",
"def test_team_template_folders_id_children_count_get(self):\n pass",
"def test_team_template_folders_id_children_post(self):\n pass",
"def portal_template_folders_id_children_get(self, id, **kwargs):\n kwargs['_ret... | [
"0.8076144",
"0.7571682",
"0.75399965",
"0.6990369",
"0.6945252",
"0.6776617",
"0.6618336",
"0.6605643",
"0.6496574",
"0.6462159",
"0.6442438",
"0.6423893",
"0.6389917",
"0.6339748",
"0.63042325",
"0.6284398",
"0.61475986",
"0.608658",
"0.60053587",
"0.59573615",
"0.5838571",... | 0.8509956 | 0 |
Test case for team_template_folders_id_children_post Creates a new instance in children of this model. | def test_team_template_folders_id_children_post(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_children_fk_put(self):\n pass",
"def test_team_template_folders_id_templates_post(self):\n pass",
"def test_team_template_folders_id_children_fk_delete(self):\n pass",
"def test_team_template_folders_post(self):\n pass",
"def test_team_template_... | [
"0.7611713",
"0.6998816",
"0.68596876",
"0.68441486",
"0.6784264",
"0.67721206",
"0.6636559",
"0.622771",
"0.6163549",
"0.6042707",
"0.6032051",
"0.5965675",
"0.5883691",
"0.5852412",
"0.5784356",
"0.5633116",
"0.56085575",
"0.5578633",
"0.5532604",
"0.55291253",
"0.54448336"... | 0.84299403 | 0 |
Test case for team_template_folders_id_delete Delete a model instance by {{id}} from the data source. | def test_team_template_folders_id_delete(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_templates_fk_delete(self):\n pass",
"def test_team_template_folders_id_children_fk_delete(self):\n pass",
"def test_workflows_id_templates_fk_delete(self):\n pass",
"def delete(self, _id):",
"def test_delete_activity_template(self):\n pass",
"... | [
"0.8241988",
"0.7741044",
"0.709706",
"0.69458854",
"0.6785604",
"0.6664069",
"0.6638059",
"0.66359246",
"0.6572012",
"0.6536794",
"0.6530212",
"0.6513618",
"0.6498237",
"0.6491295",
"0.649003",
"0.6482968",
"0.6470163",
"0.64554095",
"0.6455347",
"0.6439067",
"0.6428669",
... | 0.8541751 | 0 |
Test case for team_template_folders_id_exists_get Check whether a model instance exists in the data source. | def test_team_template_folders_id_exists_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_find_one_get(self):\n pass",
"def test_team_template_folders_id_get(self):\n pass",
"def test_team_template_folders_id_templates_fk_get(self):\n pass",
"def test_team_template_folders_id_team_get(self):\n pass",
"def test_exists_true(self):\n ... | [
"0.7228429",
"0.7048265",
"0.69274354",
"0.6834718",
"0.6802283",
"0.6684083",
"0.66372013",
"0.65680605",
"0.6373904",
"0.63232",
"0.6322095",
"0.63205624",
"0.6253189",
"0.61801267",
"0.61632395",
"0.6132301",
"0.6129887",
"0.6092639",
"0.6070359",
"0.60247386",
"0.6021102"... | 0.8405338 | 0 |
Test case for team_template_folders_id_get Find a model instance by {{id}} from the data source. | def test_team_template_folders_id_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_team_get(self):\n pass",
"def test_team_template_folders_id_templates_fk_get(self):\n pass",
"def test_team_template_folders_find_one_get(self):\n pass",
"def test_team_template_folders_id_templates_get(self):\n pass",
"def test_team_template_fo... | [
"0.7867408",
"0.77084565",
"0.7705121",
"0.7619714",
"0.7559673",
"0.71020705",
"0.69662166",
"0.69017416",
"0.67775816",
"0.67593014",
"0.668215",
"0.6330275",
"0.6270727",
"0.62321335",
"0.6192319",
"0.61470085",
"0.6133207",
"0.5968212",
"0.59066397",
"0.59013623",
"0.5849... | 0.80761766 | 0 |
Test case for team_template_folders_id_head Check whether a model instance exists in the data source. | def test_team_template_folders_id_head(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_exists_get(self):\n pass",
"def test_team_template_folders_find_one_get(self):\n pass",
"def test_team_template_folders_id_get(self):\n pass",
"def test_team_template_folders_id_templates_fk_get(self):\n pass",
"def test_team_template_folders_id... | [
"0.80098855",
"0.7260974",
"0.7205708",
"0.70972705",
"0.69902855",
"0.6882515",
"0.68041307",
"0.66723204",
"0.647952",
"0.64639044",
"0.6451148",
"0.6378563",
"0.63705957",
"0.6277258",
"0.620578",
"0.6189444",
"0.6182183",
"0.6142092",
"0.60492706",
"0.5957383",
"0.5850607... | 0.76032066 | 1 |
Test case for team_template_folders_id_parent_get Fetches belongsTo relation parent. | def test_team_template_folders_id_parent_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_children_fk_get(self):\n pass",
"def test_team_template_folders_id_templates_fk_get(self):\n pass",
"def get_parent(self):\n if not self._parent:\n self._parent = yield self.parent_resource.get(self.parent_id)\n\n raise Return(self._paren... | [
"0.6964574",
"0.6613799",
"0.6521798",
"0.64490104",
"0.6403035",
"0.6270911",
"0.62071526",
"0.6174531",
"0.6174531",
"0.61695886",
"0.6150622",
"0.6112547",
"0.6101429",
"0.6071851",
"0.6070446",
"0.6058362",
"0.6058362",
"0.6058362",
"0.6050428",
"0.6038977",
"0.6032884",
... | 0.8288951 | 0 |
Test case for team_template_folders_id_put Replace attributes for a model instance and persist it into the data source. | def test_team_template_folders_id_put(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_templates_fk_put(self):\n pass",
"def test_team_template_folders_id_children_fk_put(self):\n pass",
"def test_team_template_folders_id_replace_post(self):\n pass",
"def test_team_template_folders_id_patch(self):\n pass",
"def test_team_template_... | [
"0.7504428",
"0.7104182",
"0.70466805",
"0.65424544",
"0.63857955",
"0.6227054",
"0.60847133",
"0.6040423",
"0.6029789",
"0.59896743",
"0.5904628",
"0.57987356",
"0.57302064",
"0.5700448",
"0.5645764",
"0.5642856",
"0.5634773",
"0.5634771",
"0.5626497",
"0.5549034",
"0.551491... | 0.7899408 | 0 |
Test case for team_template_folders_id_replace_post Replace attributes for a model instance and persist it into the data source. | def test_team_template_folders_id_replace_post(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_put(self):\n pass",
"def test_team_template_folders_id_templates_fk_put(self):\n pass",
"def test_team_template_folders_id_children_fk_put(self):\n pass",
"def test_team_template_folders_id_templates_post(self):\n pass",
"def test_team_template_... | [
"0.66780967",
"0.6648374",
"0.63940597",
"0.622652",
"0.61064726",
"0.60301924",
"0.5866185",
"0.5818852",
"0.57047206",
"0.54621875",
"0.5419091",
"0.53817344",
"0.537763",
"0.5370623",
"0.53631043",
"0.53486377",
"0.5335189",
"0.531689",
"0.53012997",
"0.52785236",
"0.52387... | 0.74417293 | 0 |
Test case for team_template_folders_id_team_get Fetches belongsTo relation team. | def test_team_template_folders_id_team_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_templates_fk_get(self):\n pass",
"def test_team_template_folders_id_get(self):\n pass",
"def test_team_template_folders_id_templates_get(self):\n pass",
"def test_team_template_folders_find_one_get(self):\n pass",
"def test_team_template_folders... | [
"0.78049576",
"0.74248075",
"0.7267805",
"0.71177256",
"0.7034635",
"0.68907964",
"0.68329453",
"0.6746703",
"0.6577737",
"0.60531944",
"0.6046749",
"0.6015794",
"0.5990343",
"0.598311",
"0.59649336",
"0.58300275",
"0.57651395",
"0.57589376",
"0.5682502",
"0.5672387",
"0.5650... | 0.78695655 | 0 |
Test case for team_template_folders_id_templates_count_get Counts templates of TeamTemplateFolder. | def test_team_template_folders_id_templates_count_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_count_get(self):\n pass",
"def test_workflows_id_templates_count_get(self):\n pass",
"def test_team_template_folders_id_children_count_get(self):\n pass",
"def team_members_id_team_template_folders_count_get(self, id, **kwargs):\n kwargs['_return_htt... | [
"0.79925585",
"0.75923383",
"0.73165613",
"0.722862",
"0.7195381",
"0.7187491",
"0.70838785",
"0.6988885",
"0.6731244",
"0.67306924",
"0.6324026",
"0.63047403",
"0.62745947",
"0.6207618",
"0.61564934",
"0.61472076",
"0.6124894",
"0.6027852",
"0.60278064",
"0.5964219",
"0.5953... | 0.88226944 | 0 |
Test case for team_template_folders_id_templates_fk_delete Delete a related item by id for templates. | def test_team_template_folders_id_templates_fk_delete(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_delete(self):\n pass",
"def test_team_template_folders_id_children_fk_delete(self):\n pass",
"def test_workflows_id_templates_fk_delete(self):\n pass",
"def portal_template_folders_id_templates_fk_delete(self, id, fk, **kwargs):\n kwargs['_return_... | [
"0.79190964",
"0.7877314",
"0.7691019",
"0.6831963",
"0.6803464",
"0.66661274",
"0.6630532",
"0.6619362",
"0.65896314",
"0.65800816",
"0.6549002",
"0.6506355",
"0.6483962",
"0.64786184",
"0.6470037",
"0.6384263",
"0.63710374",
"0.63246095",
"0.6287143",
"0.6272284",
"0.623613... | 0.8669718 | 0 |
Test case for team_template_folders_id_templates_fk_get Find a related item by id for templates. | def test_team_template_folders_id_templates_fk_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_templates_get(self):\n pass",
"def test_team_template_folders_id_children_fk_get(self):\n pass",
"def test_workflows_id_templates_fk_get(self):\n pass",
"def test_team_template_folders_id_get(self):\n pass",
"def test_team_template_folders_id_te... | [
"0.74701315",
"0.7434965",
"0.73949075",
"0.7077682",
"0.7034495",
"0.70042926",
"0.68805444",
"0.67343676",
"0.6631117",
"0.6597772",
"0.6347506",
"0.6252539",
"0.62216115",
"0.61500025",
"0.5987843",
"0.5977853",
"0.5967109",
"0.5960177",
"0.59008634",
"0.58921754",
"0.5891... | 0.8420041 | 0 |
Test case for team_template_folders_id_templates_fk_put Update a related item by id for templates. | def test_team_template_folders_id_templates_fk_put(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_put(self):\n pass",
"def test_team_template_folders_id_children_fk_put(self):\n pass",
"def test_workflows_id_templates_fk_put(self):\n pass",
"def test_team_template_folders_id_templates_fk_get(self):\n pass",
"def test_team_template_folders_id... | [
"0.75875634",
"0.7442952",
"0.7431759",
"0.68305796",
"0.68276864",
"0.68187314",
"0.6519196",
"0.6214955",
"0.6187192",
"0.6171082",
"0.6146838",
"0.60781616",
"0.5988694",
"0.59180284",
"0.5909078",
"0.58887845",
"0.5862075",
"0.5821459",
"0.5818591",
"0.57954454",
"0.57800... | 0.84282964 | 0 |
Test case for team_template_folders_id_templates_get Queries templates of TeamTemplateFolder. | def test_team_template_folders_id_templates_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_templates_fk_get(self):\n pass",
"def test_team_template_folders_id_get(self):\n pass",
"def test_team_template_folders_id_team_get(self):\n pass",
"def test_team_template_folders_id_templates_count_get(self):\n pass",
"def test_team_template_fo... | [
"0.7672202",
"0.7596844",
"0.7596276",
"0.7415448",
"0.7369875",
"0.72484344",
"0.69025093",
"0.68312633",
"0.67781764",
"0.6753093",
"0.6541428",
"0.646129",
"0.63168097",
"0.63137025",
"0.6275176",
"0.6272056",
"0.6232344",
"0.6222934",
"0.6220438",
"0.6214882",
"0.6123346"... | 0.85034555 | 0 |
Test case for team_template_folders_id_templates_post Creates a new instance in templates of this model. | def test_team_template_folders_id_templates_post(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_post(self):\n pass",
"def test_team_template_folders_id_templates_fk_put(self):\n pass",
"def test_team_template_folders_id_children_post(self):\n pass",
"def test_workflows_id_templates_post(self):\n pass",
"def test_team_template_folders_id_repla... | [
"0.7337337",
"0.721465",
"0.7060718",
"0.6698532",
"0.6563004",
"0.65542066",
"0.6341067",
"0.62356204",
"0.62096906",
"0.6188248",
"0.59654826",
"0.594923",
"0.5935483",
"0.58273405",
"0.58084404",
"0.57673085",
"0.5725541",
"0.57208335",
"0.57106185",
"0.57081985",
"0.56814... | 0.8269024 | 0 |
Test case for team_template_folders_post Create a new instance of the model and persist it into the data source. | def test_team_template_folders_post(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_team_template_folders_id_templates_post(self):\n pass",
"def test_team_template_folders_id_children_post(self):\n pass",
"def test_team_template_folders_id_templates_fk_put(self):\n pass",
"def test_team_template_folders_id_children_fk_put(self):\n pass",
"def test_team... | [
"0.7511183",
"0.708873",
"0.70515764",
"0.6798132",
"0.67463607",
"0.6450196",
"0.6295251",
"0.61858845",
"0.6110003",
"0.60111576",
"0.5994621",
"0.5928331",
"0.59159493",
"0.58993393",
"0.5871875",
"0.58599263",
"0.5834365",
"0.58327764",
"0.58270866",
"0.5795094",
"0.57877... | 0.77011627 | 0 |
Ensure md5 checksums match, STATUS_CRIT | def test_check_md5_crit_md5sum_mismatch(self, mock_generate_md5):
jdata = b'{"/etc/swift/object.ring.gz": ' \
b'"6b4f3a0ef3731f18291ecd053ce0d9b6", ' \
b'"/etc/swift/account.ring.gz": ' \
b'"93fc4ae496a7343362ebf13988a137e7", ' \
b'"/etc/swift/cont... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_md5sum(_setup_str, src_host, src_pfn):\n\n error = PilotErrors()\n\n _cmd = '%suberftp %s \"quote cksm md5sum 0 -1 %s\"' % (_setup_str, src_host, src_pfn)\n estat, coutp = commands.getstatusoutput(_cmd)\n tolog('md5 uberftp done <%s> (%s): %s' % (_cmd, estat, coutp))\n\n ... | [
"0.75136995",
"0.73375994",
"0.73223966",
"0.7005259",
"0.68892246",
"0.68501675",
"0.68256193",
"0.6749249",
"0.6720844",
"0.66895443",
"0.66667277",
"0.66560763",
"0.66402364",
"0.6631763",
"0.66275257",
"0.6622764",
"0.65499777",
"0.6546595",
"0.65142083",
"0.6500251",
"0.... | 0.74742234 | 1 |
Replication lag over CRIT threshold, STATUS_CRIT | def test_check_replication_crit_lag(self, mock_timestamp):
base_url = 'http://localhost:6000/recon/'
jdata = b'{"replication_last": 1493299546.629282, ' \
b'"replication_stats": {"no_change": 0, "rsync": 0, ' \
b'"success": 0, "failure": 0, "attempted": 0, "ts_repl": 0, '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_replication_crit_lag_notworking(self, mock_timestamp):\n base_url = 'http://localhost:6000/recon/'\n jdata = b'{\"replication_last\": 1493299546.629282, ' \\\n b'\"replication_stats\": {\"no_change\": 0, \"rsync\": 0, ' \\\n b'\"success\": 0, \"failure\": ... | [
"0.6290144",
"0.6109067",
"0.6005229",
"0.5530093",
"0.5335259",
"0.52734643",
"0.5261092",
"0.5073339",
"0.50290555",
"0.4997413",
"0.4988721",
"0.49720186",
"0.48985997",
"0.4878976",
"0.48768365",
"0.48759085",
"0.48734292",
"0.48707193",
"0.4865622",
"0.48405007",
"0.4831... | 0.6512004 | 0 |
Replication failures over CRIT threshold, STATUS_CRIT | def test_check_replication_crit_failures(self, mock_timestamp):
base_url = 'http://localhost:6000/recon/'
jdata = b'{"replication_last": 1493299546.629282, ' \
b'"replication_stats": {"no_change": 0, "rsync": 0, ' \
b'"success": 0, "failure": 0, "attempted": 0, "ts_repl":... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_replication_crit_lag_notworking(self, mock_timestamp):\n base_url = 'http://localhost:6000/recon/'\n jdata = b'{\"replication_last\": 1493299546.629282, ' \\\n b'\"replication_stats\": {\"no_change\": 0, \"rsync\": 0, ' \\\n b'\"success\": 0, \"failure\": ... | [
"0.6570607",
"0.6430304",
"0.63666743",
"0.6191292",
"0.6105379",
"0.60212624",
"0.5926016",
"0.58817255",
"0.5813054",
"0.55550146",
"0.55077624",
"0.549311",
"0.54468197",
"0.5378133",
"0.53728884",
"0.5360944",
"0.5360944",
"0.5347972",
"0.5341417",
"0.5293764",
"0.5282871... | 0.6924033 | 0 |
Replication lag over WARN threshold (below CRIT), STATUS_WARN | def test_check_replication_warn_lag(self, mock_timestamp):
base_url = 'http://localhost:6000/recon/'
jdata = b'{"replication_last": 1493299546.629282, ' \
b'"replication_stats": {"no_change": 0, "rsync": 0, ' \
b'"success": 0, "failure": 0, "attempted": 0, "ts_repl": 0, '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_replication_crit_lag(self, mock_timestamp):\n base_url = 'http://localhost:6000/recon/'\n jdata = b'{\"replication_last\": 1493299546.629282, ' \\\n b'\"replication_stats\": {\"no_change\": 0, \"rsync\": 0, ' \\\n b'\"success\": 0, \"failure\": 0, \"attemp... | [
"0.596336",
"0.58672875",
"0.5598584",
"0.5585561",
"0.55175346",
"0.5379869",
"0.53797185",
"0.5345961",
"0.53422654",
"0.53330433",
"0.5331419",
"0.5326337",
"0.5317457",
"0.5310167",
"0.5303663",
"0.5232191",
"0.52119166",
"0.5203335",
"0.52027446",
"0.5175046",
"0.516937"... | 0.6612414 | 0 |
Replication lag CRITS with day wrap, STATUS_CRIT | def test_check_replication_crit_day_plus_lag(self, mock_timestamp):
base_url = 'http://localhost:6000/recon/'
jdata = b'{"replication_last": 1493299546.629282, ' \
b'"replication_stats": {"no_change": 0, "rsync": 0, ' \
b'"success": 0, "failure": 0, "attempted": 0, "ts_re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_replication_crit_lag(self, mock_timestamp):\n base_url = 'http://localhost:6000/recon/'\n jdata = b'{\"replication_last\": 1493299546.629282, ' \\\n b'\"replication_stats\": {\"no_change\": 0, \"rsync\": 0, ' \\\n b'\"success\": 0, \"failure\": 0, \"attemp... | [
"0.57984966",
"0.5483226",
"0.5448702",
"0.536563",
"0.53027284",
"0.5287678",
"0.52505547",
"0.52078265",
"0.5189895",
"0.5172441",
"0.50707984",
"0.50514287",
"0.5050407",
"0.5031012",
"0.5027122",
"0.50037414",
"0.49881342",
"0.49560872",
"0.49285343",
"0.49259377",
"0.486... | 0.59120035 | 0 |
Replication failures over WARN threshold (below CRIT), STATUS_WARN | def test_check_replication_warn_failures(self, mock_timestamp):
base_url = 'http://localhost:6000/recon/'
jdata = b'{"replication_last": 1493299546.629282, ' \
b'"replication_stats": {"no_change": 0, "rsync": 0, ' \
b'"success": 0, "failure": 0, "attempted": 0, "ts_repl":... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_replication_warn_lag(self, mock_timestamp):\n base_url = 'http://localhost:6000/recon/'\n jdata = b'{\"replication_last\": 1493299546.629282, ' \\\n b'\"replication_stats\": {\"no_change\": 0, \"rsync\": 0, ' \\\n b'\"success\": 0, \"failure\": 0, \"attemp... | [
"0.64640194",
"0.6180904",
"0.5985898",
"0.5829283",
"0.58201987",
"0.57316804",
"0.5684867",
"0.5684867",
"0.5620412",
"0.56173164",
"0.5589144",
"0.5572592",
"0.5542815",
"0.5539604",
"0.5533179",
"0.5533179",
"0.5533179",
"0.5533179",
"0.5533179",
"0.5533179",
"0.5533179",... | 0.6709899 | 0 |
If there is no any published phrases in db, it would return an empty string, else it would return a phrase in popup | def render(self, context):
if not self.phrase:
return ''
t = context.template.engine.get_template('philosophy_phrases/phrase_popup.html')
return t.render(template.Context({'phrase': self.phrase})) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def showTranslatedWithoutJoin(cls):\n print (\"ALL WORDS WITH TRANSLATIONS STORED IN DATABASE:\")\n for word1 in EnglishHelper.query(\"SELECT english_word FROM EnglishWords\", fetchAll=True):\n try:\n print word1[0],\" - \", (EnglishHelper.query(\"select polish_word from Pol... | [
"0.6144274",
"0.5999164",
"0.5982543",
"0.59605277",
"0.59567666",
"0.5844588",
"0.5810861",
"0.57757527",
"0.5667609",
"0.55661607",
"0.552775",
"0.5445835",
"0.5340363",
"0.53307855",
"0.5327084",
"0.53270626",
"0.5305563",
"0.52846193",
"0.52846193",
"0.527648",
"0.5274116... | 0.60088485 | 1 |
If there is no any published phrases in db, it would return the empty strings in variables, else it would return a text of the phrase and author of the phrase. | def philosophy_phrase():
phrase = get_random_phrase()
if not phrase:
phrase = {'author': '', 'phrase': ''}
return phrase | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def text_for_posting(self) -> str:\n return self.text or self.publication.text",
"def get_valid_phrases():\n return [x[0] for x in all_topics if x[1] == \"1\"]",
"def phrase_list_filler():\n return (Parse.word('we').possibly() + first_word('put write have know see') + \n Parse.word('tha... | [
"0.5979129",
"0.5975303",
"0.5940745",
"0.5916747",
"0.57627124",
"0.5760304",
"0.5680341",
"0.56001073",
"0.55721706",
"0.55670494",
"0.5489164",
"0.54319537",
"0.54258007",
"0.54139996",
"0.54103196",
"0.53569394",
"0.53411996",
"0.53195655",
"0.5317708",
"0.53010523",
"0.5... | 0.6491961 | 0 |
Optimise the material parameters for the given stoma to the open shape is attained at the given pressure. | def optimise_material_parameters(stoma_cfg):
print('*' * 120)
print("--> Finding optimum '{}' material parameters for the '{}' stoma...".format(
stoma_cfg.material_model.label, stoma_cfg.label))
print('*' * 120)
optimisation_helper = MaterialParametersOptimisationHelper(stoma_cfg=stoma_cfg)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setMaterialParameters(val, ptype):\n pdict = {'ambient':'AMBIENT','diffuse':'DIFFUSE','specular':'SPECULAR',\n 'exponent':'EXPONENT'}\n dislin.matopt(val, pdict[ptype])",
"def updateParameters(self):\n\n if self.params[1].value:\n if arcpy.Exists(self.params[1].value):\n ... | [
"0.56353325",
"0.5370124",
"0.53695107",
"0.532933",
"0.5328432",
"0.52875483",
"0.5247943",
"0.52012515",
"0.51888525",
"0.51510626",
"0.51493967",
"0.5130091",
"0.5126285",
"0.5090735",
"0.5089308",
"0.50722903",
"0.5053663",
"0.5041106",
"0.5041106",
"0.5041106",
"0.501836... | 0.72586125 | 0 |
Get and format the initial guess for the optimisation Returns np.ndarray The initial guess | def initial_guess(self):
x0 = [self.material_model.isotropic_matrix.c1, self.material_model.isotropic_matrix.c2]
if not self.material_model.is_isotropic:
# c5 is scaled in the optimisation function
x0.append(self.material_model.fibres.c5 / c5_factor)
if self.includ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_initial_guess():\n x0 = np.zeros(6)\n x0[0] = 1\n x0[3] = 1\n return x0",
"def default_initial_params(self) -> numpy.ndarray:\n\n total_time = self.adiabatic_evolution_time\n step_time = total_time / self.iterations\n hamiltonian = self.hamiltonian\n\n params = []\... | [
"0.7000875",
"0.6070277",
"0.6045303",
"0.6023337",
"0.59964377",
"0.5964515",
"0.5947499",
"0.59411687",
"0.59016037",
"0.58711827",
"0.58324164",
"0.58324164",
"0.575756",
"0.57448596",
"0.57446176",
"0.5737668",
"0.57161623",
"0.56971306",
"0.5694137",
"0.5621573",
"0.5608... | 0.73199725 | 0 |
Perform the optimisation using SLSQP. Settings tested vs. validation model. | def do_optimisation(self):
print('--> Parameters for optimisation:')
print('--> Using measurements : {}'.format(self.stoma_cfg.comparison_helper.optimisation_keys))
print('')
x0 = self.initial_guess()
tol, eps = 1e-4, 0.001
print('--> Using SLSQP with tol={} and eps={... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def optimize(self):\n\n self.logger.info(\"Solving with Dynamic Slope Scaling Procedure in Julia :\")\n optimization_start = time.time()\n\n # 1. Preprocess for old network graph\n if self.old_network_graph is not None:\n\n # DSSP on old network\n old_network_obj =... | [
"0.65719897",
"0.6496645",
"0.6289987",
"0.62891555",
"0.6283293",
"0.61205184",
"0.6095392",
"0.60702574",
"0.6065315",
"0.6050676",
"0.60274816",
"0.60217804",
"0.59814197",
"0.5976579",
"0.59747475",
"0.59728956",
"0.5968939",
"0.59640926",
"0.59405863",
"0.5938876",
"0.58... | 0.73497164 | 0 |
Move the temporary file to it's permanent location. Return True if the key didn't exists before. | def _commit(self, key, tmppath, overwrite = True):
exists = self.has(key)
if exists:
if not overwrite:
os.unlink(tmppath)
return False
else:
self.prepare(key)
os.rename(tmppath, self._filename(key))
return not exists | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _move_temporary(self, url: str) -> bool:\n if self._file_path.exists():\n info('File already exists')\n return True\n # If download complete, make file permanent\n move(self._temp_path, self._file_path)\n info(\"DOWNLOADED: %s TO %s\" % (url, self._file_path))\... | [
"0.6546251",
"0.5571317",
"0.5493913",
"0.54838884",
"0.5460341",
"0.5343209",
"0.5323855",
"0.5305094",
"0.52894396",
"0.5285813",
"0.5267737",
"0.5262435",
"0.52582973",
"0.5255418",
"0.5252858",
"0.52222496",
"0.52116925",
"0.5201012",
"0.518724",
"0.51626956",
"0.51376057... | 0.6806565 | 0 |
Make sure the directory exists for holding the given key | def prepare(self, key):
_mkdirs(self._dirname(key)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_ensure_dir_exists(self):\n pass",
"def verify_dir_helper(dir):\n if not os.path.exists(dir):\n print(\"Creating cache directory at {}\".format(dir))\n os.makedirs(dir)",
"def _keypath(self) -> pathlib.Path:\n home = pathlib.Path.home()\n keyfile = home / \".cmdc\"... | [
"0.69710225",
"0.66094077",
"0.6429809",
"0.641802",
"0.62993103",
"0.6295084",
"0.6277301",
"0.61933404",
"0.6177444",
"0.6164815",
"0.6160266",
"0.6155942",
"0.61461115",
"0.6130273",
"0.61162114",
"0.6114681",
"0.610374",
"0.61000377",
"0.60758036",
"0.6052262",
"0.6044748... | 0.7036552 | 0 |
Open the file given by it's key for reading. | def open(self, key):
try:
return open(self._filename(key), "rb")
except FileNotFoundError:
raise KeyError(key) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def open_file(file_name):\n pass",
"def load_key(key_name):\n if not p.exists(key_name):\n write_key(key_name)\n\n return open(key_name, \"rb\").read()",
"def open(self, path, filename=None):\n scheme, key = self.getkey(path, filename=filename)\n return BotoReadFileHandle(sche... | [
"0.6818028",
"0.6678012",
"0.66192126",
"0.6459983",
"0.6388763",
"0.63320065",
"0.62570834",
"0.623832",
"0.62076575",
"0.61941403",
"0.61808246",
"0.6174946",
"0.61232173",
"0.6110161",
"0.6076455",
"0.6033957",
"0.6033038",
"0.6030252",
"0.6023124",
"0.59916943",
"0.597941... | 0.8616494 | 0 |
Registers a template filter function in the FILTERS dict. | def template_filter(name: Optional[str] = None) -> Callable:
def decorator(func):
name_ = name if name else func.__name__
FILTERS[name_] = func
return func
return decorator | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def register(self, filter_name, filter_func):\n self._filters[filter_name] = filter_func",
"def request_filter(self, fn):\n self.request_filters.append(fn)\n return fn",
"def add_filter(self, f):\n raise NotImplementedError",
"def test_filter_function_settings(self):\n def ... | [
"0.7237711",
"0.6231328",
"0.6202456",
"0.60305154",
"0.5976299",
"0.5930582",
"0.590993",
"0.58770925",
"0.5865919",
"0.57110393",
"0.55850905",
"0.5519374",
"0.55121994",
"0.5446713",
"0.5422097",
"0.5401396",
"0.5399587",
"0.5393217",
"0.539265",
"0.5392208",
"0.5359269",
... | 0.65563595 | 1 |
Wraps the input argument in brackets if it looks like an IPv6 address. Otherwise, returns the input unchanged. This is useful in templates that need to build valid URLs from host name variables that can be either FQDNs or any IPv4 or IPv6 address. | def ipwrap(address: Any) -> str:
try:
if not isinstance(address, int):
ipaddress.IPv6Address(address)
return f"[{address}]"
except ValueError:
pass
return str(address) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_url_address(address):\n try:\n addr = netaddr.IPAddress(address)\n if addr.version == constants.IPV6_FAMILY:\n return \"[%s]\" % address\n else:\n return str(address)\n except netaddr.AddrFormatError:\n return address",
"def expand_ipv6_address(a... | [
"0.6575976",
"0.6440431",
"0.6396398",
"0.6351718",
"0.6283994",
"0.6257915",
"0.61470795",
"0.6099252",
"0.60245305",
"0.5985608",
"0.59547496",
"0.594928",
"0.587961",
"0.58069444",
"0.57675177",
"0.57507926",
"0.57504153",
"0.5659189",
"0.5579736",
"0.5571313",
"0.551502",... | 0.6512216 | 1 |
Increment an IP address by a given value. Default increment value is 1. | def increment_ip(ip_string, increment=1):
if "/" in ip_string:
# IP with prefix
interface = ipaddress.ip_interface(ip_string)
address = interface.ip + increment
# ugly workaround for IPv4: incrementing an interface's address changes the prefix in some
# cases.
# Chec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def increment(cls, value):\r\n value.value += 1",
"def increment(val):\n return coerce_to_int(val) + 1",
"def inc(self):\n self._value += 1",
"def increment(self, amount):\n pass",
"def increment2(cls, var):\r\n var += 1",
"def nv_increment(self, path: Union[bytes, str]) ->... | [
"0.6776502",
"0.66956335",
"0.6532109",
"0.63723654",
"0.620784",
"0.6181279",
"0.6171777",
"0.6122767",
"0.6090748",
"0.6089337",
"0.6077814",
"0.60685587",
"0.60502255",
"0.6032057",
"0.602571",
"0.60226136",
"0.60221374",
"0.59705263",
"0.59495497",
"0.59495497",
"0.594188... | 0.7037077 | 0 |
Transforms an IPv4 address to an IPv6 interface address. This will combine an arbitrary IPv6 network address with the 32 address bytes of an IPv4 address into a valid IPv6 address + prefix length notation the equivalent of dotted quad compatible notation. | def ipv4_to_ipv6(v6_network: Union[str, ipaddress.IPv6Network], v4_address: Union[str, ipaddress.IPv4Interface]):
if isinstance(v6_network, str):
v6_network = ipaddress.IPv6Network(v6_network)
if isinstance(v4_address, str):
v4_address = ipaddress.IPv4Address(v4_address)
v6_address = v6_net... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expand_ipv6_address(address):\n\n if not is_valid_ipv6_address(address):\n raise ValueError(\"'%s' isn't a valid IPv6 address\" % address)\n\n # expand ipv4-mapped portions of addresses\n if address.count('.') == 3:\n ipv4_start = address.rfind(':', 0, address.find('.')) + 1\n ipv4_end = address.fi... | [
"0.7771464",
"0.72357774",
"0.711864",
"0.68538207",
"0.666113",
"0.6537633",
"0.618609",
"0.6113375",
"0.5976843",
"0.59432304",
"0.58778465",
"0.58773744",
"0.5876789",
"0.58582246",
"0.57257426",
"0.5724778",
"0.5716151",
"0.5713014",
"0.5699181",
"0.5686832",
"0.56770265"... | 0.7661712 | 1 |
Returns base16 encoded string. | def b16encode(s: str) -> str:
return base64.b16encode(s.encode()).decode() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_encode_random(self):\n return os.urandom(16).encode('hex')",
"def get_byte_string(self):\n return \"\".join(['%02X' % i for i in self._data]).decode('hex')",
"def b16decode(s: str) -> str:\n return base64.b16decode(s.encode()).decode()",
"def to_encoding(self):\n return \" \"... | [
"0.6492392",
"0.63015807",
"0.5999862",
"0.5878765",
"0.5876465",
"0.5854374",
"0.58291274",
"0.57957095",
"0.5775614",
"0.57602257",
"0.5722614",
"0.57142806",
"0.56969523",
"0.56813633",
"0.5668014",
"0.56313115",
"0.5608445",
"0.5593049",
"0.55623966",
"0.5544264",
"0.5541... | 0.7805905 | 0 |
Returns base16 decoded string. | def b16decode(s: str) -> str:
return base64.b16decode(s.encode()).decode() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_hex(x):\n return base64.b16decode(x, True)",
"def b16encode(s: str) -> str:\n return base64.b16encode(s.encode()).decode()",
"def decode_hex(self, s):\n return self.transcode(int(s, 16))",
"def decode_utf16le(s):\n if b\"\\x00\\x00\" in s:\n index = s.index(b\"\\x00\\x00\")\n ... | [
"0.71067536",
"0.7025799",
"0.6532113",
"0.6512282",
"0.6127934",
"0.6112855",
"0.6080767",
"0.5956205",
"0.59228486",
"0.58263737",
"0.576815",
"0.57412255",
"0.5718248",
"0.57160187",
"0.5713707",
"0.5713707",
"0.56611294",
"0.5641491",
"0.56263244",
"0.5615537",
"0.5604999... | 0.83401346 | 0 |
Return SHA256 hexdigest of string s. | def sha256(s: str) -> str:
return hashlib.sha256(s.encode()).hexdigest() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sha256_hexoutput(in_str):\r\n return sha256(in_str.encode('ascii')).hexdigest()",
"def get_256_hash_from_string(string):\n\n sha256 = hashlib.sha256()\n sha256.update(string.encode('utf-8'))\n\n return sha256.hexdigest()",
"def hex_hash(s):\n if not s:\n return '0'\n s ... | [
"0.78749025",
"0.78616035",
"0.7789191",
"0.7787693",
"0.77747834",
"0.7772844",
"0.7752103",
"0.7292027",
"0.7292027",
"0.71310705",
"0.70151746",
"0.6988451",
"0.6974215",
"0.6970847",
"0.69703436",
"0.696001",
"0.69504154",
"0.6933909",
"0.688362",
"0.6874997",
"0.6868837"... | 0.8390986 | 0 |
Evaluate all metrics in the collection and return the results. | def evaluate(self) -> Dict[str, Any]:
kwargs = {"ids": self._ids}
return {
metric.value: self._metric_funcs[metric](
self._targets, self._preds, **kwargs
)
for metric in self._metrics
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def evaluate(self) -> Dict[str, float]:\n eval_dataloader = self.get_eval_dataloader()\n\n output = self._prediction_loop(eval_dataloader, description=\"Evaluation\")\n return output.metrics",
"def evaluate(self, data_collection):\n outputs = self.meter.evaluate(data_collection)\n ... | [
"0.70427406",
"0.69830465",
"0.6881999",
"0.6870439",
"0.67992187",
"0.6793207",
"0.67534006",
"0.6707386",
"0.6638833",
"0.6621402",
"0.65452796",
"0.65181375",
"0.64700747",
"0.6465631",
"0.63947964",
"0.6357802",
"0.63296866",
"0.6318049",
"0.626176",
"0.626176",
"0.624562... | 0.7014923 | 1 |
Get the start date of the analysis period based on an end date | def get_start_date(end_date=datetime.now(), num_years=ANALYSIS_PERIOD):
start_date = end_date - timedelta(num_years*365)
start_date = pd.to_datetime(date(start_date.year, start_date.month, start_date.day))
return(start_date) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_start_and_end_dates(new_start_date=None):\n curr_date = datetime.utcnow()\n curr_date = pd.to_datetime(date(curr_date.year, curr_date.month, curr_date.day))\n if not(new_start_date):\n end_date = curr_date\n start_date = get_start_date(end_date, ANALYSIS_PERIOD)\n else:\n s... | [
"0.6723257",
"0.6191366",
"0.6188484",
"0.6066166",
"0.6057369",
"0.595907",
"0.5914861",
"0.5914648",
"0.5906011",
"0.58999103",
"0.5897399",
"0.5868481",
"0.58304363",
"0.5827823",
"0.5826368",
"0.57813686",
"0.57741296",
"0.5772709",
"0.5770168",
"0.57555985",
"0.57435155"... | 0.742821 | 0 |
Get the start and end dates based on the start date input if the start date is none, get the whole daya | def get_start_and_end_dates(new_start_date=None):
curr_date = datetime.utcnow()
curr_date = pd.to_datetime(date(curr_date.year, curr_date.month, curr_date.day))
if not(new_start_date):
end_date = curr_date
start_date = get_start_date(end_date, ANALYSIS_PERIOD)
else:
start_date = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def date_range(self):\n start_date = input(\"Enter a start date in the format DD/MM/YYYY> \")\n end_date = input(\"Enter an end date in the format DD/MM/YYYY> \")\n return start_date, end_date",
"def create_date_list(start_date = start_date, end_date = end_date):",
"def get_ticker_start_an... | [
"0.68113667",
"0.6709884",
"0.64297885",
"0.64231473",
"0.64026463",
"0.6387936",
"0.6387378",
"0.6332218",
"0.6329555",
"0.6272463",
"0.62494594",
"0.6216098",
"0.6211771",
"0.6210365",
"0.62078756",
"0.6185185",
"0.61821514",
"0.61221343",
"0.611361",
"0.61102355",
"0.61099... | 0.6989214 | 0 |
retrieve date from yahoo | def ping_yahoo_for_ticker(ticker, start_date, end_date):
logger.debug(f'retrieving for {ticker} from yahoo between {start_date} and {end_date}')
try:
df = web.DataReader(ticker, 'yahoo', start_date, end_date)
logger.debug('Successfully retrieved data for {}'.format(ticker))
return df
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_data_from_yahoo():\n try:\n ticker = input('Enter the ticker symbol: ').upper()\n start = dt.datetime(2004, 8, 19)\n end = dt.datetime.today()\n\n df = web.DataReader(ticker, 'yahoo', start, end)\n df.to_csv('stock_data.csv')\n except Exception as e:\n print(... | [
"0.6303952",
"0.62257695",
"0.5854441",
"0.5763959",
"0.5719899",
"0.5719668",
"0.57072276",
"0.5702455",
"0.56732655",
"0.56607074",
"0.56428176",
"0.56095546",
"0.5577825",
"0.54943275",
"0.5489212",
"0.5487476",
"0.54844296",
"0.54761714",
"0.5463254",
"0.54550713",
"0.540... | 0.62580943 | 1 |
Test getting a sorted document form an stream reader. | def test_stream_sorted():
archive = Archive()
archive.commit(doc=DataFrameDocument(df=DF1))
names = list(archive.open(version=0).sorted(keys=[0]).to_df()['Name'])
assert names == ['Alice', 'Alice', 'Bob', 'Claire'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sorted_page_stream(self):\n self._test_insertion(Macros, 0)",
"def test_document_retrieval(self):",
"def test_sorted_cursor_stream(self):\n self._test_insertion(TicketAudits, 0)",
"def test_loading_document(self):",
"def test_read(self):\n self.reader._timing = [3, 2, 2, 1, 1,... | [
"0.62664425",
"0.59971935",
"0.589076",
"0.5752063",
"0.5700779",
"0.5668757",
"0.5662684",
"0.56397104",
"0.55843824",
"0.557145",
"0.54686254",
"0.5442828",
"0.54101425",
"0.5386695",
"0.5313699",
"0.5304388",
"0.5282291",
"0.52730596",
"0.52730596",
"0.52368385",
"0.522486... | 0.630785 | 0 |
Save timezoneaware values for created and updated fields. | def save(self, *args, **kwargs):
if self.pk is None:
self.created = timezone.now()
self.updated = timezone.now()
super(Base, self).save(*args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save(self, *args, **kwargs):\r\n if self.pk is None:\r\n self.created = timezone.now()\r\n self.updated = timezone.now()\r\n super(Base, self).save(*args, **kwargs)",
"def save(self, *args, **kwargs):\n if not self.id:\n self.create_date = timezone.now()\n ... | [
"0.6919896",
"0.6347257",
"0.632574",
"0.63116753",
"0.62761855",
"0.61552626",
"0.61552626",
"0.61448216",
"0.61448216",
"0.6132212",
"0.6132212",
"0.6124235",
"0.61193013",
"0.61193013",
"0.60128635",
"0.6011387",
"0.59883195",
"0.5987516",
"0.59655243",
"0.59053195",
"0.59... | 0.68968886 | 1 |
Create Page objects if saved for the first time. | def save(self, *args, **kwargs):
created = False
if self.pk is None:
created = True
super(Base, self).save(*args, **kwargs)
if created is True:
for i in range(self.page_count):
page = Page(work=self, number=i+1)
page.save() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_page_objects(self, data):\n for page in data['pages']:\n self.create_page(page)",
"def pre_save_page(instance, raw, **kwargs):\n instance.old_page = None\n try:\n instance.old_page = Page.objects.get(pk=instance.pk)\n except ObjectDoesNotExist:\n pass",
"def ... | [
"0.69514966",
"0.6622692",
"0.6590603",
"0.6394531",
"0.62881696",
"0.62271976",
"0.6174904",
"0.6163099",
"0.61445093",
"0.6078789",
"0.605919",
"0.6027516",
"0.5903286",
"0.57282794",
"0.5698673",
"0.56549186",
"0.5653584",
"0.55958694",
"0.5554187",
"0.55439764",
"0.552726... | 0.7246435 | 0 |
Generic, classic Binary Search implementation >>> from py_algorithms.search import new_binary_search >>> | def new_binary_search() -> Search:
return _BinarySearch() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def binary_search(array, item):\n # implement binary_search_iterative and binary_search_recursive beleft, then\n # change this to call your implementation to verify it passes all tests\n return binary_search_iterative(array, item)\n # return binary_search_recursive(array, item)",
"def binary_search(a... | [
"0.7193458",
"0.7162694",
"0.7162694",
"0.7162694",
"0.7151702",
"0.71070755",
"0.7014812",
"0.69561255",
"0.6896984",
"0.6866832",
"0.6845102",
"0.6837522",
"0.683216",
"0.68076146",
"0.6786597",
"0.67074275",
"0.6704192",
"0.66481316",
"0.6644689",
"0.66392684",
"0.65938276... | 0.8576695 | 0 |
Provides a default method to compute the penalty incurred when two edges are of a same type or of different types. | def compute_penalty(edge_1, edge_2):
if edge_1 == edge_2:
return 0
elif {edge_1, edge_2} == {EdgeType.NONE, EdgeType.FORWARD}:
return 1
elif {edge_1, edge_2} == {EdgeType.NONE, EdgeType.BACKWARD}:
return 1
elif {edge_1, edge_2} == {EdgeType.NONE, Edge... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _by_weight_then_from_protocol_specificity(edge_1, edge_2):\n\n # edge_1 and edge_2 are edges, of the form (mro_distance, offer)\n\n mro_distance_1, offer_1 = edge_1\n mro_distance_2, offer_2 = edge_2\n\n # First, compare the MRO distance.\n if mro_distance_1 < mro_distance_2:\n return -1\... | [
"0.6627848",
"0.58065695",
"0.5716301",
"0.54881287",
"0.54837036",
"0.54098004",
"0.5400932",
"0.53619206",
"0.535488",
"0.532785",
"0.5312015",
"0.5289913",
"0.5235407",
"0.5224458",
"0.5208916",
"0.5180457",
"0.51760596",
"0.5172492",
"0.51664996",
"0.5129541",
"0.51100844... | 0.732774 | 0 |
Computes the Structural Hamming Distance between two graphs. By default it is equal to the number of edges in the graphs that are not of the same type. A different weighted scheme for penalty computation may be provided (we may want to penalise the presence of an edge in the opposite direction more than the absence of ... | def structural_hamming_distance(self,
other,
penalty_edge_mismatch_func=None):
edges_1 = self.edges
edges_2 = other.edges
if penalty_edge_mismatch_func is None:
penalty_edge_mismatch_func = GraphViaEdges.compute... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hamming_dist(s1, s2):\n\n if s1 is None or s2 is None:\n return np.NaN\n if pd.isnull(s1) or pd.isnull(s2):\n return np.NaN\n\n # Create the similarity measure object\n measure = sm.HammingDistance()\n\n s1 = gh.convert_to_str_unicode(s1)\n s2 = gh.convert_to_str_unicode(s2)\n\n... | [
"0.7030229",
"0.67276067",
"0.6668017",
"0.6613405",
"0.65800333",
"0.65618753",
"0.6504339",
"0.6503381",
"0.6501891",
"0.6434182",
"0.6396513",
"0.63164246",
"0.6268241",
"0.62652636",
"0.62545633",
"0.6210348",
"0.62090605",
"0.6204939",
"0.6188579",
"0.61692894",
"0.61634... | 0.82934976 | 0 |
Checks whether the object is equal to another GraphViaEdges object. Two GraphViaEdges objects are equal if they have the same edges and the same names. | def __eq__(self, other):
if self.edges != other.edges:
return False
if self.name != other.name:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other: Vertex) -> bool:\n if isinstance(other, self.__class__):\n return self.id == other.id and self.edges == other.edges\n return False",
"def __eq__(self, other):\n if not type(other) == type(self):\n return False\n sedges, oedges = self.edges... | [
"0.7573153",
"0.73986137",
"0.72373873",
"0.7203145",
"0.7197092",
"0.7126384",
"0.70328027",
"0.69937086",
"0.69937086",
"0.6891229",
"0.6870849",
"0.6869632",
"0.68648255",
"0.6817948",
"0.68070734",
"0.6747166",
"0.66999537",
"0.65927106",
"0.65927106",
"0.65757036",
"0.65... | 0.79617494 | 0 |
Se randomiza un numero (se usa para definir a que elemnto llamar de la lista 'posibilidades_de_movimiento') | def mover_aleatoriamente(self):
self.randomizador = random.randint(0,4) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mover_rectilineamente(self):\n if self.randomizador < 4:\n self.posibilidades_de_movimiento[self.randomizador]()",
"def randVacantPoint(L):\n pliste = vacantPoint(L)\n\n return pliste[random.randint(0, len(pliste)-1)]",
"def randomize(self, pos):\n random_value = random.randi... | [
"0.6768249",
"0.6449843",
"0.63939553",
"0.6114297",
"0.6083678",
"0.6059127",
"0.5929723",
"0.5912634",
"0.59067637",
"0.5902121",
"0.58631676",
"0.5811645",
"0.58034986",
"0.57963586",
"0.5784861",
"0.57704055",
"0.5750152",
"0.574356",
"0.5739486",
"0.5729298",
"0.57202774... | 0.6709772 | 1 |
El WhiteWalker en base a los resultados que le pidio al mapa se mueve o no a la derecha | def mover_bm_derecha(self):
self.nueva_posicion_posible_parte_superior = self.mapa.consultar_casilla_por_movimiento([self.casilla[0] + 1,
self.casilla[1]],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encontrarMejor(padre, hijos, dist):\n\n #el valor minimo de la distancia\n minimo = dist[hijos[0].getId()][padre]\n #aqui almacenaremos la posicion del mejor hijo en el arreglo hijos[]\n mejor = 0\n #se van a recorrer todos los hijos que posee el padre\n for i in range(1, len(hijos)):\n ... | [
"0.54672736",
"0.51602787",
"0.5158227",
"0.51512283",
"0.51180106",
"0.5109656",
"0.50967324",
"0.5000111",
"0.49935594",
"0.4985653",
"0.4984618",
"0.4949592",
"0.49373594",
"0.4920492",
"0.49203885",
"0.49047872",
"0.4896582",
"0.4890663",
"0.48779795",
"0.4862627",
"0.484... | 0.5229537 | 1 |
Se redefinen los vertices de los WhiteWalkers | def redefinir_vertices(self):
self.nueva_posicion_posible_parte_inferior = [0,0]
self.nueva_posicion_posible_parte_superior = [0,0]
self.vertice_1 = self.posicion
self.vertice_2 = [self.posicion[0] + self.medidas, self.posicion[1]]
self.vertice_3 = [self.posicion[0], self.posicio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dfs(self):\n # Run time => O(V)\n for aVertex in self:\n aVertex.setColor('white')\n aVertex.setPredecessor(-1)\n # Run time => O(V)\n for aVertex in self:\n if aVertex.getColor() == 'white':\n self.dfs_visit(aVertex)",
"def __init__... | [
"0.585346",
"0.5853237",
"0.58507043",
"0.5826494",
"0.57883185",
"0.5762866",
"0.5679694",
"0.56735766",
"0.5643428",
"0.5612465",
"0.55687296",
"0.5547157",
"0.5533484",
"0.54954654",
"0.5488889",
"0.5472278",
"0.544285",
"0.5436261",
"0.54361176",
"0.5413029",
"0.5389942",... | 0.6724158 | 0 |
Reconfigures the plugin it should be called when the configuration of the plugin is changed during the operation of the South device service; The new configuration category should be passed. | def plugin_reconfigure(handle, new_config):
_LOGGER.info("Old config for MAX31865 plugin {} \n new config {}".format(handle, new_config))
# Find diff between old config and new config
diff = utils.get_diff(handle, new_config)
# TODO
new_handle = copy.deepcopy(new_config)
new_handle['restart'] ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plugin_reconfigure(handle, new_config):\n _LOGGER.info(\"Old config for Enviro pHAT plugin {} \\n new config {}\".format(handle, new_config))\n new_handle = copy.deepcopy(new_config)\n return new_handle",
"def refresh_configuration(self):\n pass",
"def refresh_plugin(self):\n pass",
... | [
"0.6766236",
"0.6411359",
"0.6185151",
"0.6173756",
"0.6100152",
"0.5961948",
"0.5958596",
"0.58808684",
"0.5801247",
"0.5779878",
"0.5764558",
"0.5757872",
"0.56068724",
"0.55619735",
"0.5555461",
"0.55109584",
"0.5477052",
"0.54474026",
"0.5430415",
"0.54262197",
"0.539742"... | 0.691585 | 0 |
Regress each agent with a Gaussian process | def agent_regress(traj):
#TODO: regress x- y- coordinate saparately according to he time points
time = traj[:, 0].reshape(len(traj[:, 0]), 1)
x_dir = traj[:, 1]
x_dir = x_dir.reshape(len(x_dir), 1)
k = GPy.kern.RBF(input_dim=1, variance=1., lengthscale=1.)
mod_x = GPy.models.GPRegression(time, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cmd_gaus():\n cmds = []\n cmds.append(\"r_m[0.0,-1,1]\")\n cmds.append(\"r_s[2.5,0,10]\")\n cmds.append('Gaussian::res(x,r_m,r_s)')\n return cmds",
"def test_Gaussian_NB_estimators():",
"def gaussianise_series(self, train_x):\n\n n_batches = train_x.shape[0]\n\n for batch in ra... | [
"0.57449484",
"0.57261455",
"0.5646443",
"0.55190086",
"0.5501289",
"0.5473667",
"0.54654324",
"0.54576737",
"0.5431625",
"0.542115",
"0.54180634",
"0.54104614",
"0.537796",
"0.5360979",
"0.5360929",
"0.53550553",
"0.5354414",
"0.5327859",
"0.5325124",
"0.5316475",
"0.5309229... | 0.64945245 | 0 |
find the predicted path of the overall crowds with the max interaction potential | def path_prediction(mods, t_points, samp_num):
h = 1
alpha = 0.99
time_points = t_points.reshape((-1,1))
sample_collection = np.empty((samp_num, len(mods), len(time_points), 2))
interact_pot = np.empty((samp_num, 1))
for i in range(0, samp_num):
sample_path = path_sample(mods, time_point... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_closest_path(self):\n\t\tclosest_distance = sys.maxint\n\t\tclosest_path = 0\n\t\tbike_position = (self.map_model.bike.xB, self.map_model.bike.yB)\n\t\tfor path_index in range(len(self.map_model.paths)):\n\t\t\tnearest_point = geometry.nearest_point_on_path(self.map_model.paths[path_index], bike_position)... | [
"0.57972264",
"0.550477",
"0.54675025",
"0.5363666",
"0.53550845",
"0.5350111",
"0.5339136",
"0.53186786",
"0.53116816",
"0.5307387",
"0.52610135",
"0.51967216",
"0.51658577",
"0.5161842",
"0.5156469",
"0.5155317",
"0.51481575",
"0.51478475",
"0.51448447",
"0.5130879",
"0.513... | 0.60463923 | 0 |
Set internal import stop state to True | def stop_import_process(self):
self.stop_import = True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop(self):\n self._run = False",
"def stop(self):\n self._stop_flag = True",
"def stop(self):\n self.startState = None",
"def stop(self):\n self.startState = None",
"def stop(self):\n self._should_run = False",
"def stop(self):\r\n self.stopped = True",
"d... | [
"0.6483913",
"0.64209807",
"0.6380567",
"0.6380567",
"0.6356307",
"0.62640345",
"0.62431157",
"0.622715",
"0.622715",
"0.6218141",
"0.6171902",
"0.6171902",
"0.6168702",
"0.6164733",
"0.61421144",
"0.61421144",
"0.61421144",
"0.61421144",
"0.61421144",
"0.6140017",
"0.6134257... | 0.8206366 | 0 |
Convert mask to centroid image | def mask2centroid(mask: npt.NDArray[Union[bool, np.ubyte, np.ushort, np.uintc, np.uint]],
intensity_image: npt.NDArray[Any] = None) -> npt.NDArray[np.ushort]:
# Label objects if not done yet
mask = measure.label(mask, background=0)
# Check if particles are darker or brighter than backgro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_object_centroid(labelmask, id):\n # Get coordinates \n coords = np.where(labelmask == id)\n # Find mean of each coordinate, remove negatives, make int.\n return tuple([int(np.mean(x)) for x in coords])",
"def get_object_centroid(labelmask, id):\n # Get coordinates \n coords = np.where(l... | [
"0.6837863",
"0.6837863",
"0.67218816",
"0.66596466",
"0.66575944",
"0.66575944",
"0.6468121",
"0.6447253",
"0.64076734",
"0.64021444",
"0.628941",
"0.6269008",
"0.6233817",
"0.6229852",
"0.62211686",
"0.6215505",
"0.6189341",
"0.61493725",
"0.6097249",
"0.6065854",
"0.606162... | 0.73660994 | 0 |
Indicates whether the interface is designed specifically to handle the supplied object's type. By default simply checks if the object is one of the types declared on the class, however if the type is expensive to import at load time the method may be overridden. | def applies(cls, obj):
return type(obj) in cls.types | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_object_type(self):\n raise exceptions.NotImplementedError()",
"def verify_type(self, obj):\n return isinstance(obj, self.type_)",
"def isinstancemethod(cls, obj):\n return _isinstancemethod(cls, obj)",
"def is_type(obj):\n return type(obj) is type or type(obj) is types.ClassType",
... | [
"0.72881466",
"0.72243005",
"0.70506996",
"0.70410687",
"0.6942121",
"0.69025177",
"0.68854284",
"0.68413585",
"0.67842245",
"0.6779543",
"0.671683",
"0.66760117",
"0.6669651",
"0.6640231",
"0.66180044",
"0.6610032",
"0.65361595",
"0.65310186",
"0.65304136",
"0.6527261",
"0.6... | 0.7322255 | 0 |
Given a list of Dataset objects, cast them to the specified datatype (by default the format matching the current interface) with the given cast_type (if specified). | def cast(cls, datasets, datatype=None, cast_type=None):
datatype = datatype or cls.datatype
cast = []
for ds in datasets:
if cast_type is not None or ds.interface.datatype != datatype:
ds = ds.clone(ds, datatype=[datatype], new_type=cast_type)
cast.append(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def castData(data, type='int64'):\n data = data.astype(type)\n return data",
"def list_cast(inputs, dst_type):\n return iter_cast(inputs, dst_type, return_type=list)",
"def _cast(self, sample, set_dtype=True, other=None):\n cuda = self.cuda if other is None else other.is_cuda\n dtype = s... | [
"0.6137207",
"0.6128256",
"0.57472014",
"0.5688774",
"0.5682158",
"0.5568439",
"0.5551305",
"0.5530607",
"0.54946697",
"0.5493658",
"0.54673314",
"0.54476064",
"0.5440923",
"0.54331124",
"0.5413348",
"0.5373463",
"0.53722644",
"0.5361807",
"0.53259426",
"0.5319939",
"0.531993... | 0.8129356 | 0 |
Should return a persisted version of the Dataset. | def persist(cls, dataset):
return dataset | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save(self):\n if self.loaded:\n full_file_name = self.resource_manager.get_dataset(self.corpus, self.embeddings.vsm_name)\n logging.info('Saving dataset to [%s]', full_file_name)\n with lzma.open(full_file_name, 'wb') as f:\n pickle.dump(self, f)\n ... | [
"0.6963877",
"0.68919927",
"0.6889675",
"0.6845472",
"0.6794341",
"0.6776925",
"0.67478496",
"0.65695554",
"0.64923984",
"0.64115924",
"0.63665664",
"0.6357858",
"0.62832326",
"0.6263471",
"0.625156",
"0.6228931",
"0.6202975",
"0.61697525",
"0.61264986",
"0.60952103",
"0.6060... | 0.8214712 | 0 |
Should return a computed version of the Dataset. | def compute(cls, dataset):
return dataset | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_dataset(self):\n return",
"def dataset(self):\n with self._lock:\n if self._dataset is None:\n if isinstance(self._orig_dataset, DaskLazyIndexer):\n self._orig_dataset = self._orig_dataset.dataset\n dataset = dask_getitem(self._ori... | [
"0.7378825",
"0.72528124",
"0.71179456",
"0.70104563",
"0.67688876",
"0.6758021",
"0.6701081",
"0.6660037",
"0.6647292",
"0.66434914",
"0.6596838",
"0.65712315",
"0.6510925",
"0.64786947",
"0.64778185",
"0.6453151",
"0.6453069",
"0.6432501",
"0.63689977",
"0.6350902",
"0.6350... | 0.7553438 | 0 |
Replace `nodata` value in data with NaN | def replace_value(cls, data, nodata):
data = data.astype('float64')
mask = data != nodata
if hasattr(data, 'where'):
return data.where(mask, np.NaN)
return np.where(mask, data, np.NaN) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_nan(x):\n x[x == -999] = np.nan\n return x",
"def isnan(data):\n return _make.isnan(data)",
"def replace_nan(data):\r\n lst_ind = np.array(['valence_intensity', 'anger_intensity',\r\n 'fear_intensity', 'sadness_intensity', 'joy_intensity'])\r\n for i in lst_ind:\r\... | [
"0.72733575",
"0.7264341",
"0.71801853",
"0.70042026",
"0.6998662",
"0.6991272",
"0.6980195",
"0.69300354",
"0.6904613",
"0.68298775",
"0.6807619",
"0.67213553",
"0.6716433",
"0.6622631",
"0.65843123",
"0.65732735",
"0.657039",
"0.6568355",
"0.6560903",
"0.65405995",
"0.65153... | 0.7983567 | 0 |
Given a Dataset object and a dictionary with dimension keys and selection keys (i.e. tuple ranges, slices, sets, lists, or literals) return a boolean mask over the rows in the Dataset object that have been selected. | def select_mask(cls, dataset, selection):
mask = np.ones(len(dataset), dtype=np.bool_)
for dim, sel in selection.items():
if isinstance(sel, tuple):
sel = slice(*sel)
arr = cls.values(dataset, dim)
if util.isdatetime(arr):
try:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_mask(cls, dataset, selection):\n mask = None\n for dim, sel in selection.items():\n if isinstance(sel, tuple):\n sel = slice(*sel)\n arr = cls.values(dataset, dim, keep_index=True)\n if util.isdatetime(arr):\n try:\n ... | [
"0.7402568",
"0.7394645",
"0.59214824",
"0.5817601",
"0.56964636",
"0.56530863",
"0.55419517",
"0.54942536",
"0.54495037",
"0.5437994",
"0.5406027",
"0.53977627",
"0.5370405",
"0.5368601",
"0.53328323",
"0.5330212",
"0.53261733",
"0.5287541",
"0.52621627",
"0.52252233",
"0.52... | 0.7668252 | 0 |
Given a Dataset object and selection to be applied returns boolean to indicate whether a scalar value has been indexed. | def indexed(cls, dataset, selection):
selected = list(selection.keys())
all_scalar = all((not isinstance(sel, (tuple, slice, set, list))
and not callable(sel)) for sel in selection.values())
all_kdims = all(d in selected for d in dataset.kdims)
return all_scalar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_scalar(self, indexable, axis):\n index = self._obj.index\n complete_key = False\n partial_key = False\n duplicated_key = False\n if axis == 0 and self._has_fancy_index():\n try:\n if type(indexable) is tuple:\n complete_key = (l... | [
"0.6400813",
"0.61126477",
"0.57768244",
"0.56953377",
"0.56712884",
"0.5666469",
"0.56647056",
"0.565334",
"0.56435555",
"0.56070197",
"0.5548717",
"0.5503382",
"0.5455719",
"0.54446787",
"0.54330516",
"0.5416925",
"0.53629106",
"0.5330685",
"0.5303776",
"0.52907795",
"0.528... | 0.6942563 | 0 |
Utility function to concatenate an NdMapping of Dataset objects. | def concatenate(cls, datasets, datatype=None, new_type=None):
from . import Dataset, default_datatype
new_type = new_type or Dataset
if isinstance(datasets, NdMapping):
dimensions = datasets.kdims
keys, datasets = zip(*datasets.data.items())
elif isinstance(datase... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def concatDic(dic1, dic2):\n pass",
"def concatenate(data, dim=0):\n if isinstance(data[0], (tuple, list)):\n return honor_type(data[0], (concatenate([d[i] for d in data], dim=dim) for i in range(len(data[0]))))\n elif isinstance(data[0], Mapping):\n return type(data[0])({k: concatenate([d... | [
"0.6320997",
"0.611885",
"0.6035339",
"0.6027557",
"0.5929903",
"0.5878462",
"0.5772045",
"0.5706965",
"0.5619259",
"0.5577487",
"0.54758805",
"0.54367036",
"0.5373829",
"0.5343098",
"0.52893007",
"0.5261989",
"0.52427924",
"0.52400863",
"0.5187234",
"0.5172838",
"0.5171507",... | 0.697596 | 0 |
Returns the data of a Dataset as a dataframe avoiding copying if it already a dataframe type. | def as_dframe(cls, dataset):
return dataset.dframe() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_dataframe(dataset: LGBMTypes.DatasetType) -> pd.DataFrame:\n if isinstance(dataset, lgb.Dataset):\n x = LGBMUtils.to_dataframe(dataset=dataset.data)\n if dataset.label is None:\n return x\n y = LGBMUtils.to_dataframe(dataset=dataset.label)\n ... | [
"0.74988043",
"0.71751237",
"0.7006334",
"0.69861305",
"0.6919226",
"0.6832426",
"0.68180156",
"0.6808118",
"0.6801346",
"0.67590004",
"0.6756455",
"0.6708862",
"0.66681975",
"0.6589894",
"0.6567048",
"0.6565977",
"0.65588295",
"0.65258104",
"0.64525884",
"0.6371686",
"0.6346... | 0.7543955 | 0 |
parse the fec verity data to give the verity metadata and verity hash data offset and length | def parse_fec_verity_data(b_file,b_offset,b_len):
f = open(b_file, 'rb')
system_total_sz=getsize(b_file)
#read the beginning FEC_HEADER_SZ bytes at last block
f.seek(-FEC_BLOCK_SZ, 2)
header_bin = f.read(FEC_HEADER_SZ)
(magic, version, header_sz, roots, size, inp_size) = struct.unpack("<5IQ", he... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _parseHeader(self):\n # Big or little endian for the header.\n self._getEndianess()\n # Read the fixed header.\n self._readFixedHeader()\n # Get the present blockettes.\n self._getBlockettes()\n # Calculate the starttime.\n self._calculateStarttime()",
... | [
"0.61757946",
"0.6068177",
"0.5776372",
"0.56304955",
"0.557445",
"0.554829",
"0.55332154",
"0.54537684",
"0.538945",
"0.5372999",
"0.536848",
"0.5348484",
"0.53264505",
"0.53117347",
"0.53007567",
"0.5277842",
"0.5234419",
"0.52270865",
"0.52115095",
"0.52013606",
"0.5133841... | 0.70668906 | 0 |
lifecycle_query_installed will return a list installed in peer. then execute cmd to get all chaincode with tar.gz format installed in peer. | def lifecycle_get_installed_package(self, timeout):
if self.version in BasicEnv.binary_versions_v2:
res, installed = self.lifecycle_query_installed("3s")
res_return = 0
if res == 0:
for item in installed['installed_chaincodes']:
# packages_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lifecycle_query_installed(self, timeout):\n if self.version in BasicEnv.binary_versions_v2:\n # res = os.system(\"./../bin/{}/bin/peer lifecycle chaincode queryinstalled --output json --connTimeout\n # {} > queryInstalled.txt\"\n # .format(self.version, ti... | [
"0.79515684",
"0.55123",
"0.5289305",
"0.52338034",
"0.5118079",
"0.50910693",
"0.5029205",
"0.49814945",
"0.49266955",
"0.4898349",
"0.48580378",
"0.48288074",
"0.4790245",
"0.47845927",
"0.47845408",
"0.47839504",
"0.47588703",
"0.47367048",
"0.47221714",
"0.4721731",
"0.47... | 0.5991446 | 1 |
The administrator can use the peer lifecycle chaincode approveformyorg subcommand to approve the chain code on behalf of the organization. | def lifecycle_approve_for_my_org(self, orderer_url, orderer_tls_rootcert, channel_name, cc_name,
chaincode_version, policy, sequence=1):
res, installed = self.lifecycle_query_installed("3s")
cc_label = cc_name+"_"+chaincode_version
package_id = ""
for... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def approve(self):\n self._check_if_open()\n data = {\"approved\": True}\n return self.post(\"approve\", data)",
"def test_approve(self):\n\n username,userpass = self.testdata.find_account_for('toolsubmitter')\n\n self.utils.account.login_as(username,userpass)\n\n self.c... | [
"0.6677485",
"0.6585099",
"0.65434873",
"0.6402488",
"0.6379898",
"0.630007",
"0.6281091",
"0.6263889",
"0.6210674",
"0.6187286",
"0.5938496",
"0.5935341",
"0.59223574",
"0.59098077",
"0.5873319",
"0.5873149",
"0.58564305",
"0.582476",
"0.58143497",
"0.5805873",
"0.57971424",... | 0.73413444 | 0 |
Checks if boundary condition 'bc' is valid. Each bc must be either 'dirichlet' or 'neumann' | def checkBC(bc):
if isinstance(bc, string_types):
bc = [bc, bc]
assert isinstance(bc, list), 'bc must be a list'
assert len(bc) == 2, 'bc must have two elements'
for bc_i in bc:
assert isinstance(bc_i, string_types), "each bc must be a string"
assert bc_i in ['dirichlet', 'neuma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_branches(num_branches, num_blocks, in_channels, num_channels):\n if num_branches != len(num_blocks):\n error_msg = f'NUM_BRANCHES({num_branches}) != NUM_BLOCKS({len(num_blocks)})'\n raise ValueError(error_msg)\n if num_branches != len(num_channels):\n error... | [
"0.59690285",
"0.5924145",
"0.5829166",
"0.5814814",
"0.58086747",
"0.5798797",
"0.57984674",
"0.5739989",
"0.57389224",
"0.5719257",
"0.5700577",
"0.56972617",
"0.56966865",
"0.56768215",
"0.5673192",
"0.56680053",
"0.565017",
"0.56335694",
"0.562896",
"0.5600559",
"0.559692... | 0.68956906 | 0 |
Create 1D derivative operator from cellcenters to nodes this means we go from n to n+1 | def ddxCellGrad(n, bc):
bc = checkBC(bc)
D = sp.spdiags((np.ones((n+1, 1))*[-1, 1]).T, [-1, 0], n+1, n,
format="csr")
# Set the first side
if(bc[0] == 'dirichlet'):
D[0, 0] = 2
elif(bc[0] == 'neumann'):
D[0, 0] = 0
# Set the second side
if(bc[1] == 'dirich... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ddxCellGradBC(n, bc):\n bc = checkBC(bc)\n\n ij = (np.array([0, n]), np.array([0, 1]))\n vals = np.zeros(2)\n\n # Set the first side\n if(bc[0] == 'dirichlet'):\n vals[0] = -2\n elif(bc[0] == 'neumann'):\n vals[0] = 0\n # Set the second side\n if(bc[1] == 'dirichlet'):\n ... | [
"0.60936165",
"0.6051758",
"0.6035031",
"0.5841803",
"0.57565576",
"0.5718515",
"0.56391853",
"0.5623003",
"0.5616664",
"0.5558391",
"0.5462912",
"0.54524446",
"0.5431657",
"0.5402466",
"0.53735256",
"0.5369108",
"0.53685844",
"0.53657275",
"0.5364053",
"0.5359304",
"0.535342... | 0.62730515 | 0 |
Create 1D derivative operator from cellcenters to nodes this means we go from n to n+1 | def ddxCellGradBC(n, bc):
bc = checkBC(bc)
ij = (np.array([0, n]), np.array([0, 1]))
vals = np.zeros(2)
# Set the first side
if(bc[0] == 'dirichlet'):
vals[0] = -2
elif(bc[0] == 'neumann'):
vals[0] = 0
# Set the second side
if(bc[1] == 'dirichlet'):
vals[1] = 2
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ddxCellGrad(n, bc):\n bc = checkBC(bc)\n\n D = sp.spdiags((np.ones((n+1, 1))*[-1, 1]).T, [-1, 0], n+1, n,\n format=\"csr\")\n # Set the first side\n if(bc[0] == 'dirichlet'):\n D[0, 0] = 2\n elif(bc[0] == 'neumann'):\n D[0, 0] = 0\n # Set the second side\n i... | [
"0.62740684",
"0.60518783",
"0.60337484",
"0.5841564",
"0.5756277",
"0.57178116",
"0.56408596",
"0.56202203",
"0.5615585",
"0.5557149",
"0.5462184",
"0.545099",
"0.543022",
"0.54015505",
"0.53731513",
"0.5367494",
"0.53671384",
"0.53652203",
"0.5362306",
"0.53591526",
"0.5353... | 0.60949314 | 1 |
Construct divergence operator in the x component (facestg to cellcentres). | def faceDivx(self):
if getattr(self, '_faceDivx', None) is None:
# The number of cell centers in each direction
n = self.vnC
# Compute faceDivergence operator on faces
if(self.dim == 1):
D1 = ddx(n[0])
elif(self.dim == 2):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __call__(self, x):\n\n self.dbeads.q = x\n e = self.dforces.pot # Energy\n g = -self.dforces.f # Gradient\n\n return e, g",
"def x(self):\n values = self._interpolate_table(\"x\")\n values += self._corrections((\"ortho_eop\", iers.ortho_eop, 0, 1e-6), (\"pmsdnut2... | [
"0.5872187",
"0.5829122",
"0.5811972",
"0.58066034",
"0.5778079",
"0.577153",
"0.57689637",
"0.5755432",
"0.5672428",
"0.56478095",
"0.562732",
"0.5525031",
"0.5520553",
"0.5520544",
"0.551753",
"0.5508819",
"0.5459851",
"0.5396037",
"0.5354177",
"0.53370064",
"0.5333066",
... | 0.6976973 | 0 |
The cell centered Gradient, takes you to cell faces. | def cellGrad(self):
if getattr(self, '_cellGrad', None) is None:
G = self._cellGradStencil()
S = self.area # Compute areas of cell faces & volumes
V = self.aveCC2F*self.vol # Average volume between adjacent cells
self._cellGrad = sdiag(S/V)*G
return self... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nodalGrad(self):\n if getattr(self, '_nodalGrad', None) is None:\n # The number of cell centers in each direction\n n = self.vnC\n # Compute divergence operator on faces\n if(self.dim == 1):\n G = ddx(n[0])\n elif(self.dim == 2):\n ... | [
"0.5621755",
"0.5469282",
"0.546437",
"0.5444811",
"0.5382192",
"0.53690034",
"0.535502",
"0.5318761",
"0.5255991",
"0.52483857",
"0.523278",
"0.52231425",
"0.52080166",
"0.520761",
"0.52018565",
"0.5180706",
"0.51670074",
"0.51604354",
"0.5160297",
"0.51142305",
"0.51004773"... | 0.55576605 | 1 |
The weak form boundary condition projection matrices when mixed boundary condition is used | def getBCProjWF_simple(self, discretization='CC'):
if discretization is not 'CC':
raise NotImplementedError('Boundary conditions only implemented'
'for CC discretization.')
def projBC(n):
ij = ([0, n], [0, 1])
vals = [0, 0]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def boundary_conditions(self):\n ce = 2 * self.dy * self.g * self.mu * self.m_u / self.kb\n self.e[0, :] = (4 * self.e[1, :] - self.e[2, :]) / (\n ce / self.T[0, :] + 3\n )\n self.rho[0, :] = (\n self.e[0, :]\n * (self.Y - 1)\n * self.mu\n ... | [
"0.61380446",
"0.605193",
"0.59296656",
"0.56866676",
"0.5662838",
"0.56362325",
"0.56183934",
"0.5609619",
"0.55788034",
"0.5507546",
"0.54627687",
"0.5442847",
"0.54037845",
"0.53641254",
"0.5336187",
"0.5328589",
"0.53109026",
"0.5291004",
"0.5286625",
"0.52734387",
"0.526... | 0.6168079 | 0 |
Upgrade workflow of timeslots and days | def upgrade_timeslot_workflow(context, logger=None):
if logger is None:
# Called as upgrade step: define our own logger.
logger = logging.getLogger('uwosh.timeslot')
#Run the workflow setup
setup = getToolByName(context, 'portal_setup')
setup.runImportStepFromProfile(PROFILE_ID, 'workf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_workflows_restart(self):\n pass",
"def test_cron_workflow_service_update_cron_workflow(self):\n pass",
"def upgrade():\n\n op.execute(\"\"\"\n UPDATE task_group_tasks\n SET start_date = CURDATE(), end_date=CURDATE()\n WHERE (start_date IS NOT NULL AND start_date < \"1900-... | [
"0.6154629",
"0.61379015",
"0.60122925",
"0.59856623",
"0.579435",
"0.57895106",
"0.5563299",
"0.55514747",
"0.5502582",
"0.5454234",
"0.540223",
"0.53500813",
"0.5343529",
"0.53403306",
"0.53280693",
"0.53280693",
"0.53085685",
"0.53028834",
"0.52990687",
"0.52546155",
"0.52... | 0.729469 | 0 |
Add the new EHS notifications portal action | def upgrade_notifications_action(context, logger=None):
#Run the workflow setup
setup = getToolByName(context, 'portal_setup')
setup.runImportStepFromProfile(PROFILE_ID, 'actions')
return | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_action(self, action):\n self.action = action",
"def add_action(self, action):\n self.action = action",
"def add_action(self, action):\n self._main_model.add_action(action)",
"def registerAction(self, actionId, action): #$NON-NLS-1$\r",
"def add_action(self, action: BaseAction):... | [
"0.61897093",
"0.61897093",
"0.5927142",
"0.5921507",
"0.5749052",
"0.57384455",
"0.5704734",
"0.568285",
"0.5602667",
"0.55947185",
"0.5563545",
"0.5556106",
"0.55510795",
"0.55410975",
"0.5507621",
"0.54634005",
"0.5441426",
"0.5424937",
"0.53629506",
"0.5347637",
"0.532733... | 0.6326241 | 0 |
Get the registered hash value of an image id, None if not found | def search_image_hash(self, image_id: str) -> int:
return self._id_to_hash.get(image_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_old_hash(img):\n try:\n old_hash = seals_data[img.split('.')[0]]['hash']\n except KeyError:\n old_hash = None\n return old_hash",
"def image_hash(image_location):\n image = pygame.image.load(image_location)\n grey = greyscale(image)\n avg = average_image_value(grey)\n\n ... | [
"0.7397036",
"0.71517426",
"0.71407926",
"0.6864395",
"0.67980075",
"0.6432143",
"0.642891",
"0.6412715",
"0.6400453",
"0.6383878",
"0.63607794",
"0.62991333",
"0.6290454",
"0.627996",
"0.6270038",
"0.6223887",
"0.6196117",
"0.6196117",
"0.61933583",
"0.61728746",
"0.61723137... | 0.792045 | 0 |
Return the registered image id of an image content This function will match image by content and content only | def search_image_id(self, image_path: str) -> str:
try:
with open(image_path, "rb") as f:
content = f.read()
if self._check_corrupted:
nparr = np.frombuffer(content, np.uint8)
img_np = cv2.imdecode(nparr, cv2.IMREAD_COLOR)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __get_image_id(self):\n return self.__get_multi_images_ids(1)",
"def get_image_id(image):\n if not is_valid_image(image):\n return False\n\n return AVAILABLE_IMAGES[image]['imageid']",
"def search_id(self,obj):\r\n ##### create the new id ###########\r\n #for x in self.objectValues('Ima... | [
"0.6564013",
"0.6499344",
"0.64345217",
"0.64091",
"0.6397784",
"0.6262968",
"0.61659104",
"0.61129624",
"0.61129624",
"0.607925",
"0.6077456",
"0.60461605",
"0.6043515",
"0.6004683",
"0.5994362",
"0.59930915",
"0.59930915",
"0.59668595",
"0.5921665",
"0.5921665",
"0.5900386"... | 0.7357817 | 0 |
Simple function to start report manager (if any) | def _start_report_manager(self, start_time=None):
if self.report_manager is not None:
if start_time is None:
self.report_manager.start()
else:
self.report_manager.start_time = start_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start(self, report):\r\n self.report = report\r\n self.report.open()\r\n\r\n self._main_root_workunit = WorkUnit(run_tracker=self, parent=None, labels=[],\r\n name=RunTracker.DEFAULT_ROOT_NAME, cmd=None)\r\n self.register_thread(self._main_root_workunit)\r\n ... | [
"0.7185138",
"0.69041795",
"0.6595344",
"0.65820175",
"0.6453679",
"0.6412547",
"0.64120275",
"0.63057476",
"0.6291027",
"0.6269089",
"0.6235882",
"0.6231339",
"0.6214937",
"0.62096953",
"0.6059954",
"0.60499275",
"0.6017881",
"0.59796536",
"0.5939616",
"0.5906054",
"0.588080... | 0.74751675 | 0 |
Simple function to report training stats (if report_manager is set) see `onmt.utils.ReportManagerBase.report_training` for doc | def _maybe_report_training(self, step, num_steps, learning_rate,
report_stats):
if self.report_manager is not None:
return self.report_manager.report_training(
step, num_steps, learning_rate, report_stats,
multigpu=self.n_gpu > 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_training_metrics(self) -> None:\n self.trainer_metrics.write_training_metrics()",
"def report_func(opt, global_step, epoch, batch, num_batches,\n start_time, lr, report_stats):\n if batch % opt.steps_per_stats == -1 % opt.steps_per_stats:\n report_stats.print_out(epoch, ... | [
"0.683947",
"0.6739739",
"0.66196144",
"0.6327586",
"0.61808234",
"0.6113651",
"0.61012864",
"0.6088131",
"0.6067345",
"0.60212106",
"0.59971434",
"0.59587336",
"0.59487474",
"0.591192",
"0.5910844",
"0.5906236",
"0.58908254",
"0.58837074",
"0.58761394",
"0.58608997",
"0.5854... | 0.75158477 | 0 |
Simple function to report stats (if report_manager is set) see `onmt.utils.ReportManagerBase.report_step` for doc | def _report_step(self, learning_rate, step, train_stats=None,
valid_stats=None):
if self.report_manager is not None:
return self.report_manager.report_step(
learning_rate, step, train_stats=train_stats,
valid_stats=valid_stats) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def report_func(opt, global_step, epoch, batch, num_batches,\n start_time, lr, report_stats):\n if batch % opt.steps_per_stats == -1 % opt.steps_per_stats:\n report_stats.print_out(epoch, batch+1, num_batches, start_time)\n report_stats = nmt.Statistics()\n\n return report_stats"... | [
"0.73522985",
"0.65985715",
"0.6561438",
"0.65518916",
"0.6421544",
"0.6374874",
"0.6304178",
"0.62417376",
"0.6236645",
"0.6230698",
"0.6213709",
"0.6194249",
"0.6160915",
"0.6147586",
"0.61226684",
"0.6106042",
"0.6069683",
"0.60593307",
"0.60544866",
"0.6028478",
"0.602059... | 0.75299054 | 0 |
Save the model if a model saver is set | def _maybe_save(self, step):
if self.model_saver is not None:
self.model_saver.maybe_save(step) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_model(self):\n if self.model:\n self.model.save(self.config[\"model_path\"])",
"def save_model(self):\n pass",
"def _save_model(self):\n save_generic(self.model, self.model_pkl_fname)",
"def save(path_to_model):\n pass",
"def save(self):\n print(\"==> ... | [
"0.7979706",
"0.7732025",
"0.7690536",
"0.7415625",
"0.73621875",
"0.7316188",
"0.7281133",
"0.72715974",
"0.72543734",
"0.72068334",
"0.7184453",
"0.71583945",
"0.71555865",
"0.70722026",
"0.7051326",
"0.7045108",
"0.7034688",
"0.7021703",
"0.699732",
"0.69931716",
"0.699281... | 0.77783674 | 1 |
Clean EXIF metadata using exiv2 | def clean_exif(self, path):
try:
args = ['exiv2', 'rm', path]
check_call(args, shell=False, stdout=DEVNULL, stderr=DEVNULL)
if self.verbose:
print('File %s cleaned' % path)
except FileNotFoundError:
print('exiv2 not f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strip_exif(self,img):\n data = list(img.getdata())\n image_without_exif = PIL.Image.new(img.mode, img.size)\n image_without_exif.putdata(data)\n return image_without_exif",
"def CleanEpi(self):\n for entry in self.info.keys():\n info = self.info[entry]\n ... | [
"0.69053125",
"0.63573146",
"0.63087946",
"0.6254756",
"0.6251132",
"0.61521065",
"0.5934415",
"0.59326994",
"0.5930887",
"0.57566583",
"0.5745966",
"0.57040155",
"0.5628695",
"0.56155694",
"0.55910784",
"0.556056",
"0.555619",
"0.5512483",
"0.5477117",
"0.5393206",
"0.538650... | 0.7290019 | 0 |
Check the EXIF metadata presence in a given file | def check_exif_presence(self, path):
rc = False
try:
args = ['exiv2', 'pr', path]
check_call(args, shell=False, stdout=DEVNULL, stderr=DEVNULL)
rc = True # File has exif, rc=0 running exiv2
except CallProgramError as e:
if e.returncode i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _metadata_exif(self, metadata_file_path):\n # TODO: this method is kind of long, can we shorten it somehow?\n img = open(self.src_path, 'rb')\n tags = None\n try:\n tags = exifread.process_file(img, debug=True)\n except Exception as e:\n self.add_error(e... | [
"0.7204896",
"0.6898728",
"0.6584521",
"0.6531383",
"0.6483777",
"0.64496535",
"0.6253193",
"0.6245931",
"0.6216941",
"0.612987",
"0.61224896",
"0.6114118",
"0.61132056",
"0.61092824",
"0.61092824",
"0.61076564",
"0.61012423",
"0.60833186",
"0.60606617",
"0.60033613",
"0.5971... | 0.7412544 | 0 |
Show the errors after execution | def show_errors(self):
if self.errors:
print('Clean error in:')
for file in self.errors:
print(' %s' % file) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def showerrors():\n errorMessages = middleware.ixn.showErrorMessage(silentMode=True)\n if errorMessages:\n print(errorMessages)\n print()",
"def display(self):\n print self.careErrors\n\n\n return self.exec_()",
"def show_error(self):\n print('LSE Error : {}... | [
"0.77923447",
"0.75230545",
"0.7374107",
"0.7190836",
"0.7086748",
"0.7050644",
"0.70011866",
"0.6963619",
"0.69599324",
"0.693487",
"0.69319034",
"0.69010955",
"0.68853796",
"0.68728274",
"0.6846897",
"0.6839558",
"0.6790114",
"0.67648125",
"0.671032",
"0.6692815",
"0.666757... | 0.77545685 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.