query stringlengths 10 2k | document stringlengths 20 51.2k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
The type of Infrastructure alert condition. Valid values are `infra_process_running`, `infra_metric`, and `infra_host_not_reporting`. | def type(self) -> pulumi.Input[str]:
return pulumi.get(self, "type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def warning(self) -> Optional[pulumi.Input['InfraAlertConditionWarningArgs']]:\n return pulumi.get(self, \"warning\")",
"def warning(self) -> Optional[pulumi.Input['InfraAlertConditionWarningArgs']]:\n return pulumi.get(self, \"warning\")",
"def compliance_type(self) -> str:\n return pulum... | [
"0.5661686",
"0.5661686",
"0.5651729",
"0.5576339",
"0.55726457",
"0.5549238",
"0.5503812",
"0.5473678",
"0.5467394",
"0.5466508",
"0.5411519",
"0.5358302",
"0.5323999",
"0.53036934",
"0.5276756",
"0.52449065",
"0.52449065",
"0.5237316",
"0.52096754",
"0.5193726",
"0.518921",... | 0.0 | -1 |
Whether the condition is turned on or off. Valid values are `true` and `false`. Defaults to `true`. | def enabled(self) -> Optional[pulumi.Input[bool]]:
return pulumi.get(self, "enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_off_bool(value):\n return value == 'on'",
"def bool_on_off(value):\n return 'on' if value else 'off'",
"def is_on(self):\n return self._on",
"def is_on(self):\n return bool(self.enabled)",
"def is_on(self):\n return False",
"def bool_to_on_off(boolean: bool):\n if... | [
"0.7499114",
"0.72155994",
"0.7031116",
"0.69913435",
"0.6947452",
"0.69128597",
"0.68893796",
"0.6845058",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6828385",
"0.6827777",... | 0.0 | -1 |
The Infrastructure alert condition's name. | def name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def condition(self) -> Optional[str]:\n return pulumi.get(self, \"condition\")",
"def condition(self) -> Optional[str]:\n return pulumi.get(self, \"condition\")",
"def condition(self) -> Optional[str]:\n return pulumi.get(self, \"condition\")",
"def condition(self) -> Optional[str]:\n ... | [
"0.6467698",
"0.6467698",
"0.6467698",
"0.6467698",
"0.6467698",
"0.6467698",
"0.6274172",
"0.62368834",
"0.6229333",
"0.6223379",
"0.62201166",
"0.6096254",
"0.60329676",
"0.6030111",
"0.6013398",
"0.58811367",
"0.5865319",
"0.5860286",
"0.58443415",
"0.5842059",
"0.5819074"... | 0.0 | -1 |
The timestamp the alert condition was created. | def created_at(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "created_at") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_timestamp(self):\n return self._create_ts",
"def creation_timestamp(self) -> str:\n return pulumi.get(self, \"creation_timestamp\")",
"def creation_timestamp(self) -> str:\n return pulumi.get(self, \"creation_timestamp\")",
"def creation_timestamp(self) -> str:\n return... | [
"0.71380407",
"0.70738316",
"0.70738316",
"0.70738316",
"0.6971391",
"0.69248474",
"0.69248474",
"0.69248474",
"0.69158214",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",... | 0.0 | -1 |
Whether the condition is turned on or off. Valid values are `true` and `false`. Defaults to `true`. | def enabled(self) -> Optional[pulumi.Input[bool]]:
return pulumi.get(self, "enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_off_bool(value):\n return value == 'on'",
"def bool_on_off(value):\n return 'on' if value else 'off'",
"def is_on(self):\n return self._on",
"def is_on(self):\n return bool(self.enabled)",
"def is_on(self):\n return False",
"def bool_to_on_off(boolean: bool):\n if... | [
"0.7499114",
"0.72155994",
"0.7031116",
"0.69913435",
"0.6947452",
"0.69128597",
"0.68893796",
"0.6845058",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6828385",
"0.6827777",... | 0.0 | -1 |
The unique entity identifier of the condition in New Relic. | def entity_guid(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "entity_guid") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_id(self) -> str:\n return get_frigate_entity_unique_id(\n self._config_entry.entry_id, \"sensor_status\", \"frigate\"\n )",
"def entity_id(self) -> str:\n return self._entity_id",
"def unique_id(self) -> str:\n return get_frigate_entity_unique_id(\n ... | [
"0.67278975",
"0.65903354",
"0.65829486",
"0.651208",
"0.651208",
"0.651208",
"0.651208",
"0.651208",
"0.6444412",
"0.64094245",
"0.64083374",
"0.6367968",
"0.63664293",
"0.63531464",
"0.63480943",
"0.63480943",
"0.63480943",
"0.63480943",
"0.63480943",
"0.63480943",
"0.63480... | 0.5827621 | 97 |
The Infrastructure alert condition's name. | def name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def condition(self) -> Optional[str]:\n return pulumi.get(self, \"condition\")",
"def condition(self) -> Optional[str]:\n return pulumi.get(self, \"condition\")",
"def condition(self) -> Optional[str]:\n return pulumi.get(self, \"condition\")",
"def condition(self) -> Optional[str]:\n ... | [
"0.6467698",
"0.6467698",
"0.6467698",
"0.6467698",
"0.6467698",
"0.6467698",
"0.6274172",
"0.62368834",
"0.6229333",
"0.6223379",
"0.62201166",
"0.6096254",
"0.60329676",
"0.6030111",
"0.6013398",
"0.58811367",
"0.5865319",
"0.5860286",
"0.58443415",
"0.5842059",
"0.5819074"... | 0.0 | -1 |
The ID of the alert policy where this condition should be used. | def policy_id(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "policy_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def policyid(self):\n return self._policyid",
"def policy_id(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"policy_id\")",
"def policy_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"policy_id\")",
"def policy_id(self) -> Optional[pulumi.Input[str]]:\n return ... | [
"0.7621485",
"0.7555805",
"0.74066585",
"0.7342257",
"0.7328843",
"0.7284987",
"0.69406074",
"0.69406074",
"0.6639695",
"0.6572657",
"0.6375167",
"0.6201921",
"0.61860025",
"0.61285186",
"0.61283237",
"0.608911",
"0.6047822",
"0.6047822",
"0.6047202",
"0.6047202",
"0.6047202"... | 0.75163525 | 2 |
The type of Infrastructure alert condition. Valid values are `infra_process_running`, `infra_metric`, and `infra_host_not_reporting`. | def type(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def warning(self) -> Optional[pulumi.Input['InfraAlertConditionWarningArgs']]:\n return pulumi.get(self, \"warning\")",
"def warning(self) -> Optional[pulumi.Input['InfraAlertConditionWarningArgs']]:\n return pulumi.get(self, \"warning\")",
"def compliance_type(self) -> str:\n return pulum... | [
"0.5662047",
"0.5662047",
"0.56509364",
"0.5576896",
"0.5570673",
"0.55505216",
"0.5504894",
"0.547616",
"0.5469822",
"0.5468035",
"0.54124534",
"0.5358572",
"0.5325733",
"0.53048134",
"0.5278124",
"0.52441317",
"0.52441317",
"0.52392954",
"0.5209477",
"0.51924914",
"0.518874... | 0.0 | -1 |
The timestamp the alert condition was last updated. | def updated_at(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "updated_at") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updated_on(self):\n return self.get_time(\"updated_on\")",
"def dt_last_update(self):\n return self.last_update",
"def last_update_time(self):\n return self._last_update_time",
"def get_last_update_time(self):\n return self.last_update_time",
"def last_updated_time(self) -> ... | [
"0.762979",
"0.7608725",
"0.7605361",
"0.748754",
"0.7313269",
"0.72942257",
"0.72780055",
"0.72780055",
"0.71793914",
"0.71793914",
"0.717186",
"0.7137201",
"0.71108305",
"0.71108305",
"0.7103716",
"0.7103716",
"0.7103716",
"0.7103716",
"0.7103716",
"0.7103716",
"0.7103716",... | 0.6735517 | 57 |
The timestamp the alert condition was created. | def created_at(self) -> pulumi.Output[int]:
return pulumi.get(self, "created_at") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_timestamp(self):\n return self._create_ts",
"def creation_timestamp(self) -> str:\n return pulumi.get(self, \"creation_timestamp\")",
"def creation_timestamp(self) -> str:\n return pulumi.get(self, \"creation_timestamp\")",
"def creation_timestamp(self) -> str:\n return... | [
"0.71380407",
"0.70738316",
"0.70738316",
"0.70738316",
"0.6971391",
"0.69248474",
"0.69248474",
"0.69248474",
"0.69158214",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",
"0.68889064",... | 0.0 | -1 |
Whether the condition is turned on or off. Valid values are `true` and `false`. Defaults to `true`. | def enabled(self) -> pulumi.Output[Optional[bool]]:
return pulumi.get(self, "enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_off_bool(value):\n return value == 'on'",
"def bool_on_off(value):\n return 'on' if value else 'off'",
"def is_on(self):\n return self._on",
"def is_on(self):\n return bool(self.enabled)",
"def is_on(self):\n return False",
"def bool_to_on_off(boolean: bool):\n if... | [
"0.7499114",
"0.72155994",
"0.7031116",
"0.69913435",
"0.6947452",
"0.69128597",
"0.68893796",
"0.6845058",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6844087",
"0.6828385",
"0.6827777",... | 0.0 | -1 |
The unique entity identifier of the condition in New Relic. | def entity_guid(self) -> pulumi.Output[str]:
return pulumi.get(self, "entity_guid") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_id(self) -> str:\n return get_frigate_entity_unique_id(\n self._config_entry.entry_id, \"sensor_status\", \"frigate\"\n )",
"def entity_id(self) -> str:\n return self._entity_id",
"def unique_id(self) -> str:\n return get_frigate_entity_unique_id(\n ... | [
"0.67278975",
"0.65903354",
"0.65829486",
"0.651208",
"0.651208",
"0.651208",
"0.651208",
"0.651208",
"0.6444412",
"0.64094245",
"0.64083374",
"0.6367968",
"0.63664293",
"0.63531464",
"0.63480943",
"0.63480943",
"0.63480943",
"0.63480943",
"0.63480943",
"0.63480943",
"0.63480... | 0.60369545 | 66 |
The Infrastructure alert condition's name. | def name(self) -> pulumi.Output[str]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def condition(self) -> Optional[str]:\n return pulumi.get(self, \"condition\")",
"def condition(self) -> Optional[str]:\n return pulumi.get(self, \"condition\")",
"def condition(self) -> Optional[str]:\n return pulumi.get(self, \"condition\")",
"def condition(self) -> Optional[str]:\n ... | [
"0.6467698",
"0.6467698",
"0.6467698",
"0.6467698",
"0.6467698",
"0.6467698",
"0.6274172",
"0.62368834",
"0.6229333",
"0.6223379",
"0.62201166",
"0.6096254",
"0.60329676",
"0.6030111",
"0.6013398",
"0.58811367",
"0.5865319",
"0.5860286",
"0.58443415",
"0.5842059",
"0.5819074"... | 0.0 | -1 |
The ID of the alert policy where this condition should be used. | def policy_id(self) -> pulumi.Output[int]:
return pulumi.get(self, "policy_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def policyid(self):\n return self._policyid",
"def policy_id(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"policy_id\")",
"def policy_id(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"policy_id\")",
"def policy_id(self) -> Optional[pulumi.Input[str]]:\n ... | [
"0.7621485",
"0.7555805",
"0.75163525",
"0.7342257",
"0.7328843",
"0.7284987",
"0.69406074",
"0.69406074",
"0.6639695",
"0.6572657",
"0.6375167",
"0.6201921",
"0.61860025",
"0.61285186",
"0.61283237",
"0.608911",
"0.6047822",
"0.6047822",
"0.6047202",
"0.6047202",
"0.6047202"... | 0.74066585 | 3 |
The type of Infrastructure alert condition. Valid values are `infra_process_running`, `infra_metric`, and `infra_host_not_reporting`. | def type(self) -> pulumi.Output[str]:
return pulumi.get(self, "type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def warning(self) -> Optional[pulumi.Input['InfraAlertConditionWarningArgs']]:\n return pulumi.get(self, \"warning\")",
"def warning(self) -> Optional[pulumi.Input['InfraAlertConditionWarningArgs']]:\n return pulumi.get(self, \"warning\")",
"def compliance_type(self) -> str:\n return pulum... | [
"0.5661686",
"0.5661686",
"0.5651729",
"0.5576339",
"0.55726457",
"0.5549238",
"0.5503812",
"0.5473678",
"0.5467394",
"0.5466508",
"0.5411519",
"0.5358302",
"0.5323999",
"0.53036934",
"0.5276756",
"0.52449065",
"0.52449065",
"0.5237316",
"0.52096754",
"0.5193726",
"0.518921",... | 0.0 | -1 |
The timestamp the alert condition was last updated. | def updated_at(self) -> pulumi.Output[int]:
return pulumi.get(self, "updated_at") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updated_on(self):\n return self.get_time(\"updated_on\")",
"def dt_last_update(self):\n return self.last_update",
"def last_update_time(self):\n return self._last_update_time",
"def get_last_update_time(self):\n return self.last_update_time",
"def last_updated_time(self) -> ... | [
"0.762979",
"0.7608725",
"0.7605361",
"0.748754",
"0.7313269",
"0.72942257",
"0.72780055",
"0.72780055",
"0.71793914",
"0.71793914",
"0.717186",
"0.7137201",
"0.71108305",
"0.71108305",
"0.7103716",
"0.7103716",
"0.7103716",
"0.7103716",
"0.7103716",
"0.7103716",
"0.7103716",... | 0.68144554 | 46 |
Creates a question with the given `question_text` and published the given number of `days` offset to now (negative for questions published in the past, positive for questions that have yet to be published). | def create_question(question_text, days):
time = timezone.now() + datetime.timedelta(days=days)
return Question.objects.create(question_text=question_text, pub_date=time) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_question(question_text, days):\n\ttime = timezone.now()+dt.timedelta(days=days)\n\treturn Question.objects.create(question_text=question_text, pub_date=time)",
"def create_question(question_text, days):\n time = timezone.now() + timezone.timedelta(days=days)\n return Question.objects.create(ques... | [
"0.79876256",
"0.79184616",
"0.7831265",
"0.7164554",
"0.70442086",
"0.67740005",
"0.6038545",
"0.60149467",
"0.5439451",
"0.5426052",
"0.5338831",
"0.5275894",
"0.5244542",
"0.5227839",
"0.5215876",
"0.52008915",
"0.5191852",
"0.5183849",
"0.5126257",
"0.5101655",
"0.5101106... | 0.7891996 | 3 |
Get a string describing the specified device. | def device_info(devid: int = 0) -> str: # pragma: no cover
numdev = jax.device_count()
if devid >= numdev:
raise RuntimeError(f"Requested information for device {devid} but only {numdev} present.")
dev = jax.devices()[devid]
if dev.platform == "cpu":
info = "CPU"
else:
info ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_device(self) -> str:\n pass",
"def name(self):\n return self._device.description_pretty()",
"def get_device_info(ns, device, human_friendly):\n if device.NumberOfBlocks and device.BlockSize:\n size = size2str(device.NumberOfBlocks * device.BlockSize, human_friendly)\n else:\n... | [
"0.7887894",
"0.76288337",
"0.7441998",
"0.72848535",
"0.7253757",
"0.72277105",
"0.72277105",
"0.7177207",
"0.71696687",
"0.7123858",
"0.6961991",
"0.68476677",
"0.67809844",
"0.67576134",
"0.67576134",
"0.67551595",
"0.674339",
"0.6726568",
"0.67043376",
"0.6687653",
"0.664... | 0.7600714 | 2 |
Return string representation of object. | def __str__(self) -> str:
# Get current time
t = timer()
# Length of label field, calculated from max label length
fldlen = [len(lbl) for lbl in self.t0] + [
len(self.default_label),
]
lfldln = max(fldlen) + 2
# Header string for table of timers
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_string(self):\r\n return self.__str__()",
"def __str__(self):\n return str(self.__dict__['_obj'])",
"def __str__(self):\n return str(self.obj)",
"def __str__(self):\n return str(self.serialize())",
"def get_str(self, obj):\n if self.pretty:\n ret... | [
"0.8202483",
"0.8194033",
"0.81537503",
"0.8110911",
"0.80861384",
"0.7986001",
"0.795318",
"0.795318",
"0.7941585",
"0.7919824",
"0.7890698",
"0.78666025",
"0.78666025",
"0.78666025",
"0.78666025",
"0.78666025",
"0.7862679",
"0.7852875",
"0.7848591",
"0.77972656",
"0.7793289... | 0.0 | -1 |
Return the elapsed time for the timer. | def elapsed(self, total: bool = True) -> float:
return self.timer.elapsed(self.label, total=total) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def elapsed(self):\r\n if self._elapsed is None:\r\n raise ValueError('Timer has not been finished yet.')\r\n return self._elapsed",
"def get_elapsed_time(self):\n\n return datetime.timedelta(seconds=int(time.time() - self.start_time))",
"def get_time_elapsed(self):\n return self.__tim... | [
"0.8270945",
"0.8001469",
"0.7999036",
"0.79117316",
"0.78508145",
"0.78352016",
"0.78242683",
"0.7799764",
"0.7789545",
"0.77721655",
"0.77415097",
"0.77258044",
"0.7669469",
"0.76259",
"0.75820214",
"0.74886906",
"0.74634415",
"0.7460801",
"0.7423272",
"0.74127465",
"0.7388... | 0.66739964 | 58 |
Reflect a plane wave with propagation vector ki off an interface with unit normal vector n. The normal vector points towards the incident side of the surface. | def reflect(ki,n):
#Transform into array
ki,n = map(np.asarray, (ki,n))
return Fresnel._reflect(ki,n) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reflect_step(r0, step, intersection, normal_vector, step_length):\n \n # Calculate distance to intersection point and update step length\n step_length -= math.sqrt((r0[0] - intersection[0])**2 + (r0[1] - intersection[1])**2 + (r0[2] - intersection[2])**2)\n \n # Calculate reflection off the surf... | [
"0.5783631",
"0.54103905",
"0.53345233",
"0.51281464",
"0.5101055",
"0.50541586",
"0.5045662",
"0.5029312",
"0.50185",
"0.49982736",
"0.4976185",
"0.49586076",
"0.49564868",
"0.49416",
"0.49365014",
"0.4905595",
"0.4905151",
"0.4898161",
"0.4882807",
"0.488044",
"0.48789933",... | 0.583364 | 0 |
Computes the accuracy of a binary prediction task using a given threshold for generating hard predictions. Alternatively, computes accuracy for a multiclass prediction task by picking the largest probability. | def accuracy(targets: List[int],
preds: Union[List[float], List[List[float]]],
threshold: float = 0.5) -> float:
if type(preds[0]) == list: # multiclass
hard_preds = [p.index(max(p)) for p in preds]
else:
hard_preds = [1 if p > threshold else 0 for p in preds] # binar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def accuracy(targets: List[int], preds: Union[List[float], List[List[float]]], \n threshold: float = 0.5) -> float:\n if type(preds[0]) == list: # multiclass\n hard_preds = [p.index(max(p)) for p in preds]\n else:\n hard_preds = [1 if p > threshold else 0 for p in preds] # binary ... | [
"0.77499986",
"0.7511836",
"0.727769",
"0.70491886",
"0.7032729",
"0.69132173",
"0.69093937",
"0.68307245",
"0.6725764",
"0.6716893",
"0.6643207",
"0.65705127",
"0.6481787",
"0.64334875",
"0.643296",
"0.64013684",
"0.6399944",
"0.63946074",
"0.6382104",
"0.6365462",
"0.636097... | 0.7710366 | 1 |
Get the next node for this walk of the tree. | def Next(self):
while self.stack:
if self.stack[-1].wkids:
# Node has children we haven't examined, so iterate into the first
# child
node = self.stack[-1].wkids.pop(0)
if not self.stack[-1].wkids:
# No more children... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_node(self):\n return self.__next_node",
"def next_node(self):\n return self.__next_node",
"def next_node(self):\n return self.__next_node",
"def next_node(self):\n\n return self.__next_node",
"def get_next(self):\n return self.cur_node.next.data",
"def get_next... | [
"0.7876059",
"0.7876059",
"0.7876059",
"0.78064173",
"0.77684414",
"0.7610213",
"0.7422212",
"0.7389502",
"0.73636675",
"0.73636675",
"0.73339605",
"0.72964925",
"0.7232752",
"0.72322804",
"0.72144437",
"0.72040415",
"0.71780944",
"0.71260107",
"0.70969427",
"0.70851976",
"0.... | 0.71879655 | 16 |
Test that an empty input list of dictionaries outputs an empty list of rows. | def test_convert_dicts_to_teradata_rows_returns_empty_list():
data = []
output = row_handling.convert_dicts_to_teradata_rows(data)
assert output == [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_empty_list_of_dict_arg(self):\n self.assertEqual(self.obj.to_json_string([{}, {}]), '[{}, {}]')",
"def test_all_empty(self):\n s1 = ListTimeSeries([])\n s2 = ListTimeSeries([])\n c = CompositeTimeSeries(\"abc\", [s1, s2])\n rows = [r for r in c.rows()]\n assert_... | [
"0.6613374",
"0.65847343",
"0.6508583",
"0.6445028",
"0.62030375",
"0.61807406",
"0.6063946",
"0.60202837",
"0.6009778",
"0.5970433",
"0.595333",
"0.5947183",
"0.5943326",
"0.59403884",
"0.59185034",
"0.5904748",
"0.58956224",
"0.58795667",
"0.58570904",
"0.58564216",
"0.5832... | 0.7519158 | 0 |
Yield successive nsized chunks from lst. | def chunks(seq: Sequence[T], n: int) -> Iterator[Sequence[T]]:
for i in range(0, len(seq), n):
yield seq[i:i + n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chunks(self, lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]",
"def chunks(lst: list, n: int):\n for i in range(0, len(lst), n):\n yield lst[i : i + n]",
"def chunks(lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]",
"de... | [
"0.83071756",
"0.81939614",
"0.81910837",
"0.81910837",
"0.8190213",
"0.81267184",
"0.81218547",
"0.81218547",
"0.80773693",
"0.80533457",
"0.80533457",
"0.80533457",
"0.80533457",
"0.80533457",
"0.80533457",
"0.80533457",
"0.80533457",
"0.80533457",
"0.80533457",
"0.80533457",... | 0.0 | -1 |
Returns current learning rate for schedulers | def get_lr(self):
if self.opt is None:
raise ValueError('No learning rate schedulers initialized')
else:
for pg in self.opt.param_groups:
return pg['lr'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_learning_rate(self):\n for scheduler in self.schedulers:\n if self.opt.lr_policy == 'plateau':\n scheduler.step(self.metric)\n else:\n scheduler.step()\n\n lr = self.optimizers[0].param_groups[0]['lr']\n print('learning rate = %.7f... | [
"0.78413856",
"0.7734168",
"0.76562774",
"0.76403457",
"0.753925",
"0.7529502",
"0.7507424",
"0.7385591",
"0.733695",
"0.7234649",
"0.7157819",
"0.7154793",
"0.7154137",
"0.7101975",
"0.7101975",
"0.708598",
"0.7082444",
"0.7021959",
"0.7008077",
"0.698346",
"0.6982941",
"0... | 0.7177858 | 10 |
Gets the gold_per_min of this InlineResponse20020Result. | def gold_per_min(self):
return self._gold_per_min | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gold_per_min(self, gold_per_min):\n\n self._gold_per_min = gold_per_min",
"def hero_damage_per_min(self):\n return self._hero_damage_per_min",
"def hero_healing_per_min(self):\n return self._hero_healing_per_min",
"def gold_sentiment(self):\n return self._gold_sentiment",
"d... | [
"0.6570591",
"0.60523266",
"0.5995693",
"0.59009284",
"0.5707459",
"0.56356597",
"0.53681",
"0.5342648",
"0.5326343",
"0.5206011",
"0.5122965",
"0.51223356",
"0.5095834",
"0.5079125",
"0.5078987",
"0.5078987",
"0.5069859",
"0.5006361",
"0.4963009",
"0.4959669",
"0.49561858",
... | 0.7756437 | 0 |
Gets the xp_per_min of this InlineResponse20020Result. | def xp_per_min(self):
return self._xp_per_min | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xp_per_min(self, xp_per_min):\n\n self._xp_per_min = xp_per_min",
"def gold_per_min(self):\n return self._gold_per_min",
"def min_ps(self):\n return self._min_ps",
"def last_hits_per_min(self):\n return self._last_hits_per_min",
"def hero_damage_per_min(self):\n retur... | [
"0.66401887",
"0.60151184",
"0.5761203",
"0.5716077",
"0.5710882",
"0.55330044",
"0.5530388",
"0.5482984",
"0.54639035",
"0.54539394",
"0.5424184",
"0.5424184",
"0.54018825",
"0.5283203",
"0.5278779",
"0.5276702",
"0.5268915",
"0.5260181",
"0.51815933",
"0.512973",
"0.507817"... | 0.7727261 | 0 |
Sets the xp_per_min of this InlineResponse20020Result. | def xp_per_min(self, xp_per_min):
self._xp_per_min = xp_per_min | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xp_per_min(self):\n return self._xp_per_min",
"def kills_per_min(self, kills_per_min):\n\n self._kills_per_min = kills_per_min",
"def gold_per_min(self, gold_per_min):\n\n self._gold_per_min = gold_per_min",
"def hero_damage_per_min(self, hero_damage_per_min):\n\n self._hero_d... | [
"0.6794262",
"0.60163176",
"0.593308",
"0.55021465",
"0.5487536",
"0.54378605",
"0.5312601",
"0.5300915",
"0.5164367",
"0.51172835",
"0.5034468",
"0.5001014",
"0.49705204",
"0.49705204",
"0.48971516",
"0.48912334",
"0.48625064",
"0.4857145",
"0.4857145",
"0.4857145",
"0.48436... | 0.7902423 | 0 |
Gets the kills_per_min of this InlineResponse20020Result. | def kills_per_min(self):
return self._kills_per_min | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def kills_per_min(self, kills_per_min):\n\n self._kills_per_min = kills_per_min",
"def hero_damage_per_min(self):\n return self._hero_damage_per_min",
"def get_kills_overall(self, uuid):\n\n return self.template(uuid, \"kills\")",
"def xp_per_min(self):\n return self._xp_per_min",... | [
"0.62467605",
"0.52549475",
"0.5167037",
"0.5165779",
"0.5144147",
"0.51433516",
"0.50329465",
"0.50300163",
"0.5010628",
"0.49922937",
"0.48647162",
"0.47639352",
"0.4675116",
"0.4650097",
"0.46382612",
"0.4601454",
"0.46001622",
"0.4594842",
"0.45903254",
"0.45801684",
"0.4... | 0.7344477 | 0 |
Gets the last_hits_per_min of this InlineResponse20020Result. | def last_hits_per_min(self):
return self._last_hits_per_min | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_hits_per_min(self, last_hits_per_min):\n\n self._last_hits_per_min = last_hits_per_min",
"def gold_per_min(self):\n return self._gold_per_min",
"def dist_between_last_hits(self):\n return self._dist_between_last_hits",
"def last_hit(self):\n return self._last_hit",
"def xp_per_... | [
"0.60299295",
"0.51972646",
"0.5167603",
"0.51539886",
"0.5107783",
"0.5060876",
"0.50547755",
"0.5021324",
"0.49984843",
"0.49831578",
"0.49697378",
"0.49697378",
"0.49694526",
"0.49339756",
"0.48727024",
"0.4870445",
"0.48587853",
"0.4851274",
"0.48468545",
"0.48241684",
"0... | 0.75517744 | 0 |
Sets the last_hits_per_min of this InlineResponse20020Result. | def last_hits_per_min(self, last_hits_per_min):
self._last_hits_per_min = last_hits_per_min | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_hits_per_min(self):\n return self._last_hits_per_min",
"def _update_insights_throttle_limit(self, response: FacebookResponse):\n ads_insights_throttle = response.headers().get(\"x-fb-ads-insights-throttle\")\n if ads_insights_throttle:\n ads_insights_throttle = json.loads... | [
"0.6040935",
"0.514187",
"0.50855255",
"0.5012373",
"0.49247316",
"0.48566207",
"0.48345515",
"0.4802341",
"0.47688344",
"0.47638887",
"0.4742218",
"0.4733403",
"0.472307",
"0.4711311",
"0.46935388",
"0.46839407",
"0.46503213",
"0.46436587",
"0.4511439",
"0.44994017",
"0.4499... | 0.76154613 | 0 |
Sets the hero_damage_per_min of this InlineResponse20020Result. | def hero_damage_per_min(self, hero_damage_per_min):
self._hero_damage_per_min = hero_damage_per_min | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hero_healing_per_min(self, hero_healing_per_min):\n\n self._hero_healing_per_min = hero_healing_per_min",
"def hero_damage_per_min(self):\n return self._hero_damage_per_min",
"def hero_healing_per_min(self):\n return self._hero_healing_per_min",
"def gold_per_min(self, gold_per_min):... | [
"0.7305224",
"0.6911798",
"0.6100881",
"0.55762124",
"0.5159218",
"0.5144495",
"0.5122835",
"0.4913672",
"0.48918527",
"0.48813",
"0.48364538",
"0.48246345",
"0.48178858",
"0.47696966",
"0.47240442",
"0.47208142",
"0.4716114",
"0.46928132",
"0.46817893",
"0.46502987",
"0.4647... | 0.83388376 | 0 |
Gets the hero_healing_per_min of this InlineResponse20020Result. | def hero_healing_per_min(self):
return self._hero_healing_per_min | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hero_healing_per_min(self, hero_healing_per_min):\n\n self._hero_healing_per_min = hero_healing_per_min",
"def hero_damage_per_min(self):\n return self._hero_damage_per_min",
"def hero_damage_per_min(self, hero_damage_per_min):\n\n self._hero_damage_per_min = hero_damage_per_min",
"d... | [
"0.7513039",
"0.7151844",
"0.6144606",
"0.5918634",
"0.58448255",
"0.55120933",
"0.53806424",
"0.53737754",
"0.53737754",
"0.53530025",
"0.53394747",
"0.51647097",
"0.51553035",
"0.51187056",
"0.5090103",
"0.5090103",
"0.5028556",
"0.5022421",
"0.50217867",
"0.49741703",
"0.4... | 0.8337502 | 0 |
Sets the hero_healing_per_min of this InlineResponse20020Result. | def hero_healing_per_min(self, hero_healing_per_min):
self._hero_healing_per_min = hero_healing_per_min | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hero_healing_per_min(self):\n return self._hero_healing_per_min",
"def hero_damage_per_min(self, hero_damage_per_min):\n\n self._hero_damage_per_min = hero_damage_per_min",
"def hero_damage_per_min(self):\n return self._hero_damage_per_min",
"def gold_per_min(self, gold_per_min):\n\n... | [
"0.7415864",
"0.7029015",
"0.59450954",
"0.5660888",
"0.5337505",
"0.51571393",
"0.5091092",
"0.50258124",
"0.49955446",
"0.49942484",
"0.49697953",
"0.4863225",
"0.480238",
"0.47631046",
"0.47535107",
"0.474339",
"0.47330782",
"0.47292155",
"0.47102693",
"0.4692092",
"0.4676... | 0.8673049 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, InlineResponse20020Result):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Imports the given PNG file into a tensor | def import_PNG(filename, device='cuda:0'):
return numpy2torch(numpy.array(Image.open(filename), dtype=float) / 255, dtype=torch.float, device=device) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _load_image(self, id_: str) -> Tensor:\n filename = os.path.join(self.root, \"output\", id_ + \".jpg\")\n with Image.open(filename) as img:\n array = np.array(img)\n tensor: Tensor = torch.from_numpy(array) # type: ignore[attr-defined]\n # Convert from HxWxC to C... | [
"0.7366232",
"0.7186321",
"0.7128785",
"0.7075608",
"0.6777765",
"0.66779464",
"0.6638546",
"0.6597355",
"0.65931064",
"0.6561708",
"0.653991",
"0.6514638",
"0.6451437",
"0.64223593",
"0.64171576",
"0.6415891",
"0.63420635",
"0.6318495",
"0.6276321",
"0.6230643",
"0.6230643",... | 0.68672293 | 4 |
Set learning rate for specific optimizer `optimizer_name` to `lr` | def set_learning_rate_for(self, optimizer_name, lr):
optimizer = self.get_optimizer(optimizer_name)
if not hasattr(optimizer, 'learning_rate'):
self._log.error(f"No valid optimizer available with name {optimizer_name}, unable to set learning rate")
return False
try:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_learning_rate(optimizer, lr):\n for param_group in optimizer.param_groups:\n param_group['lr'] = lr",
"def set_learning_rate(optimizer, lr):\n for param_group in optimizer.param_groups:\n param_group['lr'] = lr",
"def adjust_learning_rate(optimizer, lr):\n for param_group in opti... | [
"0.88676",
"0.88676",
"0.8540691",
"0.8540691",
"0.8540691",
"0.8328715",
"0.82925755",
"0.8228727",
"0.8197906",
"0.81789523",
"0.8173105",
"0.81505495",
"0.81294346",
"0.81177646",
"0.8102779",
"0.8097881",
"0.80954444",
"0.8094016",
"0.8092554",
"0.8089433",
"0.80891395",
... | 0.80783033 | 24 |
Verify that a nesting of unordered list, text, new line, ordered list, text, new line, block quote with a skipped block quote character works properly. | def test_nested_three_unordered_text_nl_ordered_text_nl_block_skip():
# Arrange
source_markdown = """+ abc
1. def
> list
item"""
expected_tokens = [
"[ulist(1,1):+::2:]",
"[para(1,3):]",
"[text(1,3):abc:]",
"[end-para:::True]",
"[olist(2,3):.:1:5: :\n ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_nested_three_unordered_nl_ordered_nl_block():\n\n # Arrange\n source_markdown = \"\"\"+\n 1.\n > list\n > item\"\"\"\n expected_tokens = [\n \"[ulist(1,1):+::2:]\",\n \"[BLANK(1,2):]\",\n \"[olist(2,3):.:1:5: :\\n]\",\n \"[BLANK(2,5):]\",\n \"[block-qu... | [
"0.7919451",
"0.7903044",
"0.7882267",
"0.7822617",
"0.78033537",
"0.77806526",
"0.7684962",
"0.70840746",
"0.70714027",
"0.70622176",
"0.7058773",
"0.7052888",
"0.70147824",
"0.69623405",
"0.68593335",
"0.6852606",
"0.68329054",
"0.6781592",
"0.6764296",
"0.6754365",
"0.6750... | 0.785858 | 3 |
Verify that a nesting of unordered list, ordered list, block quote, with the maximum number of spaces allowed, works properly, with no block quote characters on the second line, with a list item. | def test_nested_three_unordered_max_ordered_max_block_max_no_bq1_with_li1():
# Arrange
source_markdown = """ + 1. > list
+ item"""
expected_tokens = [
"[ulist(1,4):+::8: ]",
"[olist(1,9):.:1:14: ]",
"[block-quote(1,15): : > ]"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_nested_three_unordered_max_ordered_max_block_max_empty_with_li2():\n\n # Arrange\n source_markdown = \"\"\" + 1. >\n 1. > item\"\"\"\n expected_tokens = [\n \"[ulist(1,4):+::8: ]\",\n \"[olist(1,9):.:1:14: :]\",\n \"[block-quote(1,15): ... | [
"0.7947659",
"0.78816587",
"0.78266656",
"0.78133124",
"0.7803953",
"0.7764673",
"0.77293664",
"0.76947623",
"0.76548773",
"0.7649311",
"0.76321983",
"0.76258314",
"0.76196104",
"0.7609223",
"0.75819236",
"0.75494534",
"0.75003",
"0.7348698",
"0.7341323",
"0.7309577",
"0.7301... | 0.76659185 | 8 |
Verify that a nesting of unordered list, ordered list, block quote, with the maximum number of spaces allowed, works properly, with no block quote characters on the second line, with a list item. | def test_nested_three_unordered_max_ordered_max_block_max_no_bq1_with_li2():
# Arrange
source_markdown = """ + 1. > list
1. item"""
expected_tokens = [
"[ulist(1,4):+::8: ]",
"[olist(1,9):.:1:14: ]",
"[block-quote(1,15): : > ]"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_nested_three_unordered_max_ordered_max_block_max_empty_with_li2():\n\n # Arrange\n source_markdown = \"\"\" + 1. >\n 1. > item\"\"\"\n expected_tokens = [\n \"[ulist(1,4):+::8: ]\",\n \"[olist(1,9):.:1:14: :]\",\n \"[block-quote(1,15): ... | [
"0.79482484",
"0.7882222",
"0.78273594",
"0.78137827",
"0.780434",
"0.77650464",
"0.7729802",
"0.76954824",
"0.76663953",
"0.76551956",
"0.7649979",
"0.7632971",
"0.7619068",
"0.76096386",
"0.758169",
"0.75496185",
"0.7500494",
"0.734848",
"0.7341794",
"0.73098916",
"0.730150... | 0.76262873 | 12 |
Verify that a nesting of unordered list, ordered list, block quote, with the maximum number of spaces allowed, works properly, with no block quote characters on the second line, with a list item. | def test_nested_three_unordered_max_ordered_max_block_max_no_bq1_with_li3():
# Arrange
source_markdown = """ + 1. > list
+ 1. item"""
expected_tokens = [
"[ulist(1,4):+::8: ]",
"[olist(1,9):.:1:14: ]",
"[block-quote(1,15): : > ]"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_nested_three_unordered_max_ordered_max_block_max_empty_with_li2():\n\n # Arrange\n source_markdown = \"\"\" + 1. >\n 1. > item\"\"\"\n expected_tokens = [\n \"[ulist(1,4):+::8: ]\",\n \"[olist(1,9):.:1:14: :]\",\n \"[block-quote(1,15): ... | [
"0.7947877",
"0.7881778",
"0.78268015",
"0.7813544",
"0.7804131",
"0.77647644",
"0.7730531",
"0.76947457",
"0.76658833",
"0.76547277",
"0.7649218",
"0.76320994",
"0.7625707",
"0.761993",
"0.75822145",
"0.75494057",
"0.7499787",
"0.73489714",
"0.7340663",
"0.7309162",
"0.73002... | 0.7609083 | 14 |
Turns a binary vector into a list of indexes | def toIndexes(self, binaryVector):
return n.array([i for i,v in enumerate(binaryVector) if v], dtype="int32") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def int_to_indices(value: int, length: int, radix_bits: int) -> Iterable[int]:\n mask = (1 << radix_bits) - 1\n return ((value >> (i * radix_bits)) & mask for i in reversed(range(length)))",
"def vir_indices(self):\n indices = []\n for index,item in enumerate(self):\n if item==0:\n... | [
"0.69717425",
"0.67675155",
"0.65211445",
"0.6518628",
"0.6492025",
"0.6458553",
"0.64042383",
"0.63075125",
"0.62945503",
"0.6290464",
"0.621717",
"0.6187358",
"0.61541677",
"0.6132317",
"0.6033118",
"0.5997663",
"0.5997339",
"0.59958464",
"0.59479785",
"0.59338516",
"0.5928... | 0.8658558 | 0 |
Returns if the word is in the trie. | def search(self, word: str) -> bool:
cur = self.root
for letter in word:
if letter not in cur:
return False
cur = cur[letter]
if "isWord" not in cur:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr... | [
"0.838632",
"0.8150416",
"0.8123471",
"0.7856802",
"0.7830664",
"0.77935004",
"0.7792806",
"0.77642965",
"0.7753436",
"0.7747724",
"0.7711298",
"0.76816714",
"0.7677101",
"0.76506114",
"0.76338875",
"0.7628353",
"0.76114196",
"0.7577657",
"0.75695884",
"0.756079",
"0.75591743... | 0.7664614 | 13 |
Renders the about page. | def about():
return render_template(
'about.html',
title='About',
year=datetime.now().year,
message='Your application description page.'
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def about():\n return render_template('about.html', title='About')",
"def about():\n\n return render_template('about_page.html', title='About')",
"def about():\n\n\treturn render_template(\"about.html\")",
"def on_about(self):\n render_about_window()",
"def about():\n return render_temp... | [
"0.85650355",
"0.85034525",
"0.84489655",
"0.84044397",
"0.8394454",
"0.82935613",
"0.82680845",
"0.8243358",
"0.8239194",
"0.8224137",
"0.82079816",
"0.8204868",
"0.8173699",
"0.8172736",
"0.80967313",
"0.80501616",
"0.80501616",
"0.80501616",
"0.80501616",
"0.80501616",
"0.... | 0.82709616 | 9 |
Add optimizers to graph Creates member variables grads_and_vars and apply_grads for each weight both member variables are indexed by [schedule_idx][weight_idx] grads_and_vars holds the gradients for the weight updates apply_grads is the operator to be called to perform weight updates | def add_optimizers_to_graph(self):
with tf.device(self.params.device):
with self.graph.as_default():
with tf.compat.v1.variable_scope("optimizers") as scope:
self.grads_and_vars = list() # [sch_idx][weight_idx]
self.apply_grads = list() # [sch_idx][weight_idx]
self.learni... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _build_optimizers(self):\r\n self._optimize_ops = []\r\n all_trainable_variables = tf.trainable_variables()\r\n all_update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS)\r\n all_reg_losses = tf.losses.get_regularization_losses()\r\n for spec in self._learning_schedule:\r\n ... | [
"0.7060876",
"0.65073574",
"0.64592016",
"0.638172",
"0.6366843",
"0.63480633",
"0.6341133",
"0.6284946",
"0.61891395",
"0.61777943",
"0.6161693",
"0.61508954",
"0.6137635",
"0.612589",
"0.61185044",
"0.6095007",
"0.6079903",
"0.60641646",
"0.6059115",
"0.60133237",
"0.600455... | 0.7979775 | 0 |
Returns the current schedule being executed | def get_schedule(self, key=None):
if key is not None:
assert key in self.params.schedule[self.sched_idx].keys(), (
key+" was not found in the schedule.")
return self.params.schedule[self.sched_idx][key]
return self.params.schedule[self.sched_idx] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def schedule(self):\n return self._schedule",
"def schedule(self):\n return self._schedule",
"def schedule(self):\n return self._schedule",
"def schedule(self) -> pulumi.Output['outputs.CanarySchedule']:\n return pulumi.get(self, \"schedule\")",
"def _schedule(self):\n re... | [
"0.8241424",
"0.8241424",
"0.8241424",
"0.78633064",
"0.77537864",
"0.76327115",
"0.7550291",
"0.74706477",
"0.7444716",
"0.7324528",
"0.730787",
"0.7294553",
"0.72675014",
"0.71095055",
"0.7096352",
"0.7082575",
"0.7082575",
"0.7082575",
"0.7082575",
"0.7082575",
"0.7082575"... | 0.7144877 | 13 |
Slice input array along last dimension using indices gather_nd only gets first indices, so we permute the last index (or "features', which we want to slice into) to the first index | def slice_features(self, input, indices):
t_input = tf.transpose(a=input)
gather_idxs = np.array([[i] for i in indices]).astype(np.int32)
t_actual = tf.gather_nd(t_input, gather_idxs)
actual = tf.transpose(a=t_actual)
return actual | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_gather_nd(g, op, block):\n\n x = g.get_node(op.input(\"X\")[0])\n index = g.get_node(op.input(\"Index\")[0])\n shape = infer_shape(index)\n perm = list(range(0, len(shape) - 1))\n perm.insert(0, len(shape) - 1)\n index = _op.transpose(index, axes=perm)\n out = _op.gather_nd(x, inde... | [
"0.6676458",
"0.6375015",
"0.6183133",
"0.6166764",
"0.6128783",
"0.6063044",
"0.60380155",
"0.5980691",
"0.59442776",
"0.58903867",
"0.58584046",
"0.5843933",
"0.58352816",
"0.58158165",
"0.5805377",
"0.58009225",
"0.57757986",
"0.57533133",
"0.5743089",
"0.57422256",
"0.571... | 0.74104905 | 0 |
Return `True` if the ionic fractions, number density scaling factor (if set), and electron temperature (if set) are all equal, and `False` otherwise. Raises `TypeError` If ``other`` is not an `~plasmapy.particles.ionization_state.IonizationState` instance. `ParticleError` If ``other`` corresponds to a different element... | def __eq__(self, other):
if not isinstance(other, IonizationState):
return False
same_element = self.element == other.element
same_isotope = self.isotope == other.isotope
if not same_element or not same_isotope:
return False
# Use the tighter of the two... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n if type(other) != type(self):\n return False\n # Check the properties inherited from Data\n if not super(DataND, self).__eq__(other):\n return False\n if other.axes != self.axes:\n return False\n if other.normalizations ... | [
"0.6132851",
"0.6042686",
"0.59167534",
"0.58537894",
"0.5841612",
"0.58323395",
"0.5779877",
"0.57582444",
"0.5713025",
"0.57104146",
"0.568884",
"0.5658503",
"0.56564176",
"0.56526566",
"0.56435984",
"0.5639753",
"0.56363505",
"0.56203544",
"0.561297",
"0.561189",
"0.560286... | 0.72617525 | 0 |
The electron number density assuming a single species plasma. | def n_e(self) -> u.m**-3:
return np.sum(self._n_elem * self.ionic_fractions * self.charge_numbers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def electron_density(self):\n return N_avo * self.num_electrons * self.density / self.molar_mass",
"def electron_density_per_m3(self):\n return self.electron_density * 1e6",
"def density(self):\n return (1e-3*self.molar_mass) * self.pressure / (gas_constant * self.temperature) # kg/m^3",
... | [
"0.8208116",
"0.772114",
"0.7492268",
"0.73415",
"0.72171164",
"0.7055132",
"0.7050327",
"0.69328755",
"0.68760365",
"0.6837361",
"0.68152803",
"0.68152803",
"0.68152803",
"0.677161",
"0.66770214",
"0.6630102",
"0.66200376",
"0.6572599",
"0.6533091",
"0.6509516",
"0.6498794",... | 0.0 | -1 |
Set the number density of neutrals and all ions. | def n_elem(self, value: u.m**-3):
if value < 0 * u.m**-3:
raise ParticleError
if 0 * u.m**-3 < value <= np.inf * u.m**-3:
self._n_elem = value.to(u.m**-3)
elif np.isnan(value):
self._n_elem = np.nan * u.m**-3 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setMolarDensity(self, n):\n _cantera.phase_setfp(self._phase_id,3,n)",
"def density(self, density):\n\n self._density = density",
"def set_density(self, density, asset=None):\n self._set_property('pc:density', density, asset)",
"def test_changeNumberDensities(self):\n self.com... | [
"0.6847964",
"0.6815618",
"0.655986",
"0.62826604",
"0.6255224",
"0.6176637",
"0.61060137",
"0.60912836",
"0.606155",
"0.60576373",
"0.592625",
"0.5869609",
"0.57148427",
"0.5703412",
"0.56291807",
"0.56264323",
"0.56033283",
"0.55778855",
"0.5555968",
"0.55461407",
"0.554363... | 0.0 | -1 |
Return the mean charge number. | def Z_mean(self) -> np.float64:
if np.nan in self.ionic_fractions:
raise ChargeError(
"Z_mean cannot be found because no ionic fraction "
f"information is available for {self.base_particle}."
)
return np.sum(self.ionic_fractions * self.charge_numbe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cf_mean(self):\n return self['capacity_factor'] / 100",
"def cf_mean(self):\n return self['capacity_factor'] / 100",
"def cf_mean(self):\n net_power = self['annual_field_energy'] \\\n - self['annual_thermal_consumption'] # kW-hr\n # q_pb_des is in MW, convert to kW-h... | [
"0.7242042",
"0.7242042",
"0.72226775",
"0.7204606",
"0.7112258",
"0.7112258",
"0.7021056",
"0.6982288",
"0.6982212",
"0.69409925",
"0.6912707",
"0.68906873",
"0.6876924",
"0.6874476",
"0.684466",
"0.68334174",
"0.68206453",
"0.679109",
"0.6770526",
"0.6760289",
"0.67386115",... | 0.73241633 | 0 |
Return a |CustomParticle| instance representing the average particle in this ionization state. By default, the weighted mean will be used as the average, with the ionic fractions as the weights. If ``use_rms_charge`` or ``use_rms_mass`` is `True`, then this method will return the root mean square of the charge or mass,... | def average_ion(
self,
*,
include_neutrals: bool = True,
use_rms_charge: bool = False,
use_rms_mass: bool = False,
) -> CustomParticle:
min_charge = 0 if include_neutrals else 1
particle_list = self.to_list()[min_charge:]
abundances = self.ionic_fract... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mean(self):\n return np.average(self.particles, weights=self.weights, axis=0)",
"def calculate_mean(self) -> float:\n\n if self.data:\n return np.mean(self.data)\n else:\n return self.mu",
"def mean(self):\n\n return self._reduce_for_stat_function(F.mean, o... | [
"0.6849189",
"0.6511334",
"0.63403744",
"0.62518185",
"0.6247632",
"0.6218716",
"0.621464",
"0.62070537",
"0.62059855",
"0.61980915",
"0.61980915",
"0.6156777",
"0.6127539",
"0.61201876",
"0.6119217",
"0.61126703",
"0.60834473",
"0.6079694",
"0.6025766",
"0.5986594",
"0.59547... | 0.74809647 | 0 |
Function to return the value after applying sigmoid function | def activate(self,x):
return 1 / (1 + np.exp(-x)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sigmoid(x):\n\treturn 1 / (1 + m.exp(-x))",
"def sigmoid(x):\n return 1 / (1 + exp(-x))",
"def sigmoid(x):\n return 1 / (1 + exp(-x))",
"def sigmoid(value):\n return 1.0 / (1.0 + math.exp(-value))",
"def sigmoid(x):\r\n #pred_x = (np.exp(x) - np.exp(-x)) / (np.exp(x) + np.exp(-x))\r... | [
"0.8378301",
"0.8318568",
"0.8318568",
"0.83142364",
"0.831107",
"0.83076775",
"0.8292056",
"0.82864773",
"0.82831764",
"0.82817686",
"0.82817686",
"0.82817686",
"0.82817686",
"0.82817686",
"0.82817686",
"0.8236655",
"0.82353204",
"0.823195",
"0.82236487",
"0.822142",
"0.8218... | 0.0 | -1 |
Function to calculate the derivative of the activation function | def dactivate(self, y):
return self.activate(y) * (1-self.activate(y)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def derivative_activation(z):\n return activation(z) * (1 - activation(z))",
"def cost_derivative(output_activations, y):\n return (output_activations - y)",
"def derivative(a, y, z):\n return (a - y) * Sigmoid.derivative(z)",
"def activ_fn_derivative(z):\n return 1 - np.square(np... | [
"0.873046",
"0.7616676",
"0.7500061",
"0.74728197",
"0.7433681",
"0.7377254",
"0.7302921",
"0.7302921",
"0.7302921",
"0.7302921",
"0.72838485",
"0.72430116",
"0.72430116",
"0.72291636",
"0.71728384",
"0.7166218",
"0.7122738",
"0.7122424",
"0.7111619",
"0.7061321",
"0.70064044... | 0.0 | -1 |
Function for thresholding sigmoid function value | def oactivate(self,x):
value = 1 / (1 + math.exp(-x))
if value > 0.5:
return 1
else:
return -1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hard_sigmoid(x):\n x = (0.2 * x) + 0.5\n x = F.threshold(-x, -1, -1)\n x = F.threshold(-x, 0, 0)\n return x",
"def sigmoid(x):\r\n return 1 / (1 + np.exp(-x))",
"def sigmoid(x):\n return 1 / (1 + np.exp(-x))",
"def sigmoid(x):\n return 1 / (1 + np.exp(-x))",
"def sigmoid(x):\n r... | [
"0.8615102",
"0.8065904",
"0.79993886",
"0.79993886",
"0.79993886",
"0.79993886",
"0.79993886",
"0.79993886",
"0.79961115",
"0.798904",
"0.79874486",
"0.7978602",
"0.7969261",
"0.7951784",
"0.7951784",
"0.7948864",
"0.79439",
"0.79263717",
"0.7925278",
"0.7913497",
"0.7889591... | 0.0 | -1 |
Evaluate Azure Key Vault secret for expiry date. | def eval(self, record):
com = record.get('com', {})
if com is None:
return
if com.get('cloud_type') != 'azure':
return
ext = record.get('ext', {})
if ext is None:
return
if ext.get('record_type') != 'key_vault_secret':
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _about_to_expire(self, secret: Secret) -> bool:\n return secret.is_expired(datetime.now(UTC) + self.expiry_margin)",
"def get_expiry():\n\n return get_or_append_details('expiry', \"Please enter your expiry date, two digits for the month and two digits for the year\")",
"def new_token_expiry_date(... | [
"0.6466133",
"0.57040143",
"0.5653081",
"0.558438",
"0.55263054",
"0.5428931",
"0.53713125",
"0.5315793",
"0.5313908",
"0.53027415",
"0.53018",
"0.52965206",
"0.52965206",
"0.5259325",
"0.5259325",
"0.52515715",
"0.5199066",
"0.5158509",
"0.5083754",
"0.5079271",
"0.5073525",... | 0.55126137 | 5 |
Add a member to the database | def add_member(data):
print("Adding: %s " % data)
conn = create_connection(db_location)
sql = "INSERT INTO members(member_uid, name, email, badge_id, new) VALUES({}, \"{}\", \"{}\", \"{}\", \"{}\");".format(
data['id'], data['forename'] + " " + data['surname'], data['email'], data['badge_id'], d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_member():\n client = RequestManager()\n client.set_method(\"POST\")\n client.set_endpoint(\"/accounts/{0}/memberships\".format(CONFIG_DATA['account_id']))\n body = {\"person_id\": CONFIG_DATA['member_id']}\n client.set_body(json.dumps(body))\n client.execute_reques... | [
"0.8186277",
"0.75905424",
"0.75477",
"0.7381984",
"0.72967446",
"0.7196322",
"0.7079792",
"0.70696676",
"0.70110077",
"0.69353133",
"0.69166315",
"0.6908266",
"0.68542427",
"0.6802113",
"0.67826295",
"0.67401403",
"0.66827697",
"0.6651435",
"0.6644156",
"0.66132164",
"0.6584... | 0.80187815 | 1 |
Given a dictionarieswithindictionary representation of a 2D table `dicts_within_dict_table`, computes a new 2D table that's also a dictionarieswithindictionary representation that is the transpose of | def transpose_2d_table(dicts_within_dict_table):
transposed_table = {}
for x2 in dicts_within_dict_table:
for x1 in dicts_within_dict_table[x2]:
if x1 not in transposed_table:
transposed_table[x1] = \
{x2: dicts_within_dict_table[x2... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sur_dict2mat(dicts):\n n_dicts = len(dicts.keys())\n mat = np.vstack((dicts[t] for t in range(n_dicts)))\n return(mat)",
"def transpose(h):\n res = {}\n for i in list(h.keys()):\n v = h[i]\n for j in list(v.keys()):\n if not res.get(j, None):\n res[j] = ... | [
"0.6077311",
"0.5731723",
"0.5661214",
"0.555139",
"0.54653287",
"0.5387086",
"0.53776944",
"0.53652453",
"0.5323893",
"0.5300463",
"0.5280475",
"0.5164876",
"0.51374084",
"0.5132219",
"0.51298785",
"0.5122671",
"0.5093747",
"0.50315523",
"0.50065494",
"0.49976254",
"0.499230... | 0.85521066 | 0 |
Sets the application_expiry_date of this TransactEncryptedData. | def application_expiry_date(self, application_expiry_date):
self._application_expiry_date = application_expiry_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expiration_date(self, expiration_date):\n\n self._expiration_date = expiration_date",
"def expire_date(self, expire_date):\n\n self._expire_date = expire_date",
"def expiry(self, expiry):\n\n self._expiry = expiry",
"def hide_expiration_date(self, hide_expiration_date):\n\n se... | [
"0.6670425",
"0.6477528",
"0.6012533",
"0.57987577",
"0.56279045",
"0.56279045",
"0.56279045",
"0.5608653",
"0.55944216",
"0.559206",
"0.55604446",
"0.55592215",
"0.54703665",
"0.5434897",
"0.53794986",
"0.5376627",
"0.5372674",
"0.53639853",
"0.5346294",
"0.5321932",
"0.5242... | 0.8626131 | 0 |
Sets the pan_sequence_number of this TransactEncryptedData. | def pan_sequence_number(self, pan_sequence_number):
self._pan_sequence_number = pan_sequence_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_pan_number(self, pan_number=None):\n self.__input_mandatory_fields[self.__data_sets.PAYMENT_METHOD_DATA_PAN] = self.__data_types.PAYMENT_METHOD_DATA_PAN\n\n self.__input_data_structure.update({self.__data_sets.PAYMENT_METHOD_DATA_PAN: pan_number})\n self.__input_data_set.update(self.__... | [
"0.6227426",
"0.59800524",
"0.5840573",
"0.5735053",
"0.56391203",
"0.56188595",
"0.54548913",
"0.53965795",
"0.535288",
"0.53286475",
"0.52916485",
"0.5188079",
"0.5161343",
"0.5128333",
"0.50676703",
"0.4971411",
"0.4971411",
"0.49694964",
"0.49591285",
"0.49266264",
"0.489... | 0.8531007 | 0 |
Sets the track2_equivalent of this TransactEncryptedData. | def track2_equivalent(self, track2_equivalent):
self._track2_equivalent = track2_equivalent | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trilha2(self, trilha2):\n self._trilha2 = trilha2",
"def setVolume2(self):\n\n self.mediaplayer2.audio_set_volume(self.volumeslider2.value())",
"def set_svpn2(self, svpn2):\n self.svpn2 = svpn2",
"def testTrackDict2(self):\n\n goodTrackDict = {\n \"number\": \"2\", ... | [
"0.55064416",
"0.5403088",
"0.5385922",
"0.53050345",
"0.515486",
"0.50215244",
"0.50077754",
"0.49967092",
"0.49662542",
"0.4959033",
"0.49487174",
"0.48687613",
"0.48419127",
"0.48141876",
"0.4810734",
"0.48083243",
"0.47232974",
"0.47232974",
"0.47213706",
"0.46923453",
"0... | 0.8563708 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, TransactEncryptedData):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Return the element stored at this Position. | def element(self):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_element(self):\n return self.element",
"def get_element(self):\n return self.element",
"def get_element(self):\n return self._element",
"def element(self):\n return self._element",
"def element(self):\n return self._element",
"def element(self):\n ... | [
"0.7991133",
"0.7991133",
"0.79683876",
"0.78909487",
"0.7818736",
"0.7818736",
"0.7818736",
"0.75961065",
"0.75703907",
"0.7495175",
"0.7495175",
"0.7495175",
"0.7495175",
"0.7495175",
"0.7486983",
"0.7271655",
"0.7221839",
"0.70869666",
"0.6923757",
"0.69016874",
"0.6874401... | 0.72033703 | 19 |
Return True if other Position represents the same location. | def __eq__(self, other):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sameLocation(self, other):\n if not isinstance(other,Point):\n return False\n return self.longitude == other.getLongitude() and self.latitude == other.getLatitude()",
"def is_same_as(self, other) -> bool:\n return self.x == other.x and self.y == other.y",
"def __eq__(self, o... | [
"0.84157455",
"0.8079219",
"0.7786436",
"0.7786436",
"0.7691206",
"0.7679783",
"0.76025367",
"0.75659394",
"0.7451102",
"0.73797554",
"0.7364951",
"0.7344662",
"0.7325785",
"0.7313814",
"0.72921383",
"0.7285434",
"0.72343457",
"0.7201619",
"0.71943647",
"0.71350956",
"0.71306... | 0.0 | -1 |
Return True if other does not represents the same location. | def __ne__(self, other):
return not (self == other) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: 'LocationOutput') -> bool:\n return not self == other",
"def sameLocation(self, other):\n if not isinstance(other,Point):\n return False\n return self.longitude == other.getLongitude() and self.latitude == other.getLatitude()",
"def __ne__(self, other: 'L... | [
"0.8463859",
"0.8191476",
"0.81641716",
"0.77996683",
"0.7691365",
"0.76386124",
"0.76091105",
"0.75729895",
"0.75639737",
"0.75639737",
"0.7553283",
"0.7539971",
"0.7533917",
"0.7529889",
"0.7522071",
"0.7493094",
"0.74578124",
"0.7416824",
"0.7246307",
"0.72377926",
"0.7176... | 0.0 | -1 |
Return Position representing p's parent (or None if p is root). | def parent(self, p):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parent(self, p):\n node = self._validate(p)\n return self._make_position(node._parent)",
"def parent(self, p):\n node = self._validate_position(p)\n return self._make_position(node)",
"def parent(self, p):\n node = self._validate(p)\n return self._make_position(node.parent... | [
"0.8724605",
"0.8647921",
"0.86457145",
"0.86071634",
"0.86071634",
"0.86071634",
"0.8466291",
"0.749229",
"0.742937",
"0.739244",
"0.7344775",
"0.7343782",
"0.72972333",
"0.72337985",
"0.7195726",
"0.7195726",
"0.7169738",
"0.7156756",
"0.7131003",
"0.7124905",
"0.71045357",... | 0.0 | -1 |
Return the total number of elements in the tree. | def __len__(self):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size(self) -> int:\n #binary search tree == empty\n if self.root is None:\n return 0\n\n #recursive helper count nodes\n return self.size_helper(self.root)",
"def count(self):\n return self.__tree.node_count",
"def tree_size(self) -> int:\n Q = Queue()\n... | [
"0.82806945",
"0.8237969",
"0.8194857",
"0.81456095",
"0.81141615",
"0.79324174",
"0.7896753",
"0.7888584",
"0.7883656",
"0.7883183",
"0.7838633",
"0.78125507",
"0.7799082",
"0.7753667",
"0.772821",
"0.77164763",
"0.7714283",
"0.771321",
"0.7678607",
"0.76691777",
"0.7658198"... | 0.0 | -1 |
Return a Position representing p's left child. Return None if p does not have a left child. | def left(self, p):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def left(self, p):\n node = self._validate_position(p)\n return self._make_position(node.left)",
"def left(self, p):\n node = self._validate(p)\n return self._make_position(node._left)",
"def left(self, p):\n node = self._validate(p)\n return self._make_position(node.left)",
... | [
"0.8620991",
"0.8563931",
"0.85632145",
"0.8528951",
"0.8528951",
"0.81108725",
"0.7891028",
"0.78896725",
"0.77040464",
"0.7652949",
"0.762416",
"0.7623946",
"0.75850433",
"0.7545657",
"0.7545657",
"0.7526716",
"0.7473045",
"0.7468302",
"0.74537134",
"0.7407409",
"0.73230255... | 0.7012597 | 39 |
Return a Position representing p's right child. Return None if p does not have a right child. | def right(self, p):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def right(self, p):\n node = self._validate_position(p)\n return self._make_position(node.right)",
"def right(self, p):\n node = self._validate(p)\n return self._make_position(node._right)",
"def right(self, p):\n node = self._validate(p)\n return self._make_position(node.righ... | [
"0.823185",
"0.8162556",
"0.81507885",
"0.8125631",
"0.8076614",
"0.7799529",
"0.77959615",
"0.765635",
"0.74845636",
"0.74530536",
"0.74530536",
"0.71604353",
"0.7149966",
"0.71359104",
"0.7132811",
"0.71279186",
"0.71204734",
"0.71146595",
"0.7102796",
"0.7094181",
"0.70916... | 0.6356336 | 47 |
Return the element stored at this Position. | def element(self):
return self._node.element | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_element(self):\n return self.element",
"def get_element(self):\n return self.element",
"def get_element(self):\n return self._element",
"def element(self):\n return self._element",
"def element(self):\n return self._element",
"def element(self):\n ... | [
"0.7991133",
"0.7991133",
"0.79683876",
"0.78909487",
"0.7818736",
"0.7818736",
"0.7818736",
"0.75961065",
"0.7495175",
"0.7495175",
"0.7495175",
"0.7495175",
"0.7495175",
"0.7486983",
"0.7271655",
"0.7221839",
"0.72033703",
"0.72033703",
"0.72033703",
"0.72033703",
"0.708696... | 0.75703907 | 8 |
Return True if other is a Position representing the same location. | def __eq__(self, other):
return type(other) is type(self) and other._node is self._node | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sameLocation(self, other):\n if not isinstance(other,Point):\n return False\n return self.longitude == other.getLongitude() and self.latitude == other.getLatitude()",
"def is_same_as(self, other) -> bool:\n return self.x == other.x and self.y == other.y",
"def __eq__(self, o... | [
"0.8375726",
"0.7963154",
"0.7680126",
"0.7680126",
"0.7654848",
"0.7579365",
"0.7465109",
"0.7343548",
"0.7315395",
"0.73144364",
"0.72930986",
"0.7281304",
"0.727859",
"0.72441643",
"0.7229009",
"0.7228473",
"0.71951085",
"0.71835446",
"0.71659315",
"0.71549267",
"0.7135935... | 0.0 | -1 |
Return the total number of elements in the tree. | def __len__(self):
return self._size | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size(self) -> int:\n #binary search tree == empty\n if self.root is None:\n return 0\n\n #recursive helper count nodes\n return self.size_helper(self.root)",
"def count(self):\n return self.__tree.node_count",
"def tree_size(self) -> int:\n Q = Queue()\n... | [
"0.82806945",
"0.8237969",
"0.8194857",
"0.81456095",
"0.81141615",
"0.79324174",
"0.7896753",
"0.7888584",
"0.7883656",
"0.7883183",
"0.7838633",
"0.78125507",
"0.7799082",
"0.7753667",
"0.772821",
"0.77164763",
"0.7714283",
"0.771321",
"0.7678607",
"0.76691777",
"0.7658198"... | 0.0 | -1 |
Return the root number of the tree (or None if tree is empty). | def root(self):
return self._make_position(self._root) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def root_index(self):\n if self.is_binary_tree:\n return 0\n return -1",
"def root(tree):\n\n return tree[0]",
"def _root():\n return 0",
"def tree_id(self):\n if self.is_root:\n return 0\n elif self._link is not None:\n return self._link.tre... | [
"0.75605446",
"0.7047659",
"0.70134336",
"0.6997209",
"0.6696021",
"0.6659778",
"0.663898",
"0.6559241",
"0.65430266",
"0.6539334",
"0.65146524",
"0.64918035",
"0.6472418",
"0.6409361",
"0.6398684",
"0.63525987",
"0.6349419",
"0.6318196",
"0.6277471",
"0.62755716",
"0.626411"... | 0.0 | -1 |
Return the Position of p's parent (or None if p is root). | def parent(self, p):
node = self._validate(p)
return self._make_position(node.parent) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parent(self, p):\n node = self._validate(p)\n return self._make_position(node._parent)",
"def parent(self, p):\n node = self._validate(p)\n return self._make_position(node._parent)",
"def parent(self, p):\n node = self._validate(p)\n return self._make_position(node._parent... | [
"0.8663646",
"0.85847527",
"0.85847527",
"0.85847527",
"0.856103",
"0.8456258",
"0.7550549",
"0.7375405",
"0.737523",
"0.73730576",
"0.728682",
"0.7260338",
"0.7260338",
"0.72140986",
"0.7194887",
"0.71675175",
"0.7150456",
"0.71065",
"0.7093016",
"0.7034267",
"0.7033344",
... | 0.86323506 | 1 |
Return the Position of p's left child (or None if no left child). | def left(self, p):
node = self._validate(p)
return self._make_position(node.left) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def left(self, p):\n node = self._validate_position(p)\n return self._make_position(node.left)",
"def left(self, p):\n node = self._validate(p)\n return self._make_position(node._left)",
"def left(self, p):\n node = self._validate(p)\n return self._make_position(node._left)",
... | [
"0.8242705",
"0.82008016",
"0.81770074",
"0.81770074",
"0.79586065",
"0.79495573",
"0.770442",
"0.76300657",
"0.76300657",
"0.7448692",
"0.73823774",
"0.7375141",
"0.7368798",
"0.73518646",
"0.73385125",
"0.7326691",
"0.73166406",
"0.7289645",
"0.727695",
"0.72332084",
"0.722... | 0.8222059 | 1 |
Return the Position of p's right child (or None if no right child). | def right(self, p):
node = self._validate(p)
return self._make_position(node.right) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def right(self, p):\n node = self._validate_position(p)\n return self._make_position(node.right)",
"def right(self, p):\n node = self._validate(p)\n return self._make_position(node._right)",
"def right_child(self, position):\n child = 2 * position + 2\n if child > len(self.tab... | [
"0.77787644",
"0.77666533",
"0.77347696",
"0.77311033",
"0.7675908",
"0.75368047",
"0.75368047",
"0.7443582",
"0.7323119",
"0.7301952",
"0.69393224",
"0.69292396",
"0.6919928",
"0.69034195",
"0.69034195",
"0.6858714",
"0.685022",
"0.6836057",
"0.68163663",
"0.6798013",
"0.679... | 0.77639914 | 2 |
Create a new left child for Position p, storing element e. Return the Position of new node. Raise ValueError if Position p is invalid or p already has a left child. | def _add_left(self, p, e):
node = self._validate(p)
if node.left is not None:
raise ValueError('Left child exists')
self._size += 1
node.left = self._Node(e, node)
return self._make_position(node.left) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _add_left(self, p, e):\n node = self._validate_position(p)\n if node.left is not None:\n raise ValueError(\"left child exists\")\n self._size += 1\n node.left = self._Node(e, parent=node)\n return self._make_position(node.left)",
"def _add_left(self, p, e):\n ... | [
"0.8765724",
"0.87229836",
"0.8719782",
"0.8317975",
"0.8176431",
"0.81404996",
"0.8132675",
"0.81129074",
"0.8102215",
"0.8102215",
"0.7889035",
"0.7888217",
"0.71877635",
"0.71877635",
"0.70885485",
"0.70485795",
"0.7012132",
"0.6999497",
"0.6897632",
"0.6867543",
"0.680432... | 0.87110996 | 3 |
Create a new right child for Position p, storing element e. Return the Position of new node. Raise ValueError if Position p is invalid or p already has a right child. | def _add_right(self, p, e):
node = self._validate(p)
if node.right is not None:
raise ValueError('Right child exists')
self._size += 1
node.right = self._Node(e, node)
return self._make_position(node.right) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _add_right(self, p, e):\n node = self._validate(p)\n if node._right is not None:\n raise ValueError('Right child exists')\n self._size += 1\n node._right = self._Node(e, node) # node is its parent\n return self._make_position(node._right)",
"def _add_right(self, p, e):\n ... | [
"0.8358963",
"0.83361083",
"0.82930535",
"0.76939607",
"0.75688714",
"0.7507484",
"0.7300031",
"0.72150135",
"0.71928525",
"0.71867317",
"0.71819973",
"0.69933915",
"0.69933915",
"0.6959054",
"0.69515187",
"0.6943696",
"0.6924508",
"0.6848907",
"0.68486756",
"0.653704",
"0.64... | 0.82142824 | 3 |
Recursive version of the default dict.update Merges upd recursively into dest If recursive_update=False, will use the classic dict.update, or fall back on a manual merge (helpful for nondict types like FunctionWrapper) If merge_lists=True, will aggregate list object types instead of replace. The list in ``upd`` is adde... | def dict_merge(dest, upd, recursive_update=True, merge_lists=False):
if (not isinstance(dest, collections.Mapping)) \
or (not isinstance(upd, collections.Mapping)):
raise TypeError('Cannot update using non-dict types in dictupdate.update()')
updkeys = list(upd.keys())
if not set(list(des... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recursive_update(to_update, update):\n if update:\n for key, value in update.items():\n if isinstance(value, dict):\n value = recursive_update(to_update.get(key, {}), value)\n to_update[key] = value\n return to_update",
"def update_dictionary_extending_lists(... | [
"0.6962555",
"0.6860996",
"0.6755679",
"0.65711886",
"0.63403904",
"0.6304217",
"0.62866795",
"0.6231472",
"0.62014145",
"0.6151081",
"0.6147958",
"0.60863143",
"0.6083631",
"0.607236",
"0.6058421",
"0.5928258",
"0.5891257",
"0.5790715",
"0.5771591",
"0.57289034",
"0.56722796... | 0.8090398 | 0 |
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes. | def add_header(response):
response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'
response.headers['Cache-Control'] = 'public, max-age=0'
return response | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response",
"def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m... | [
"0.82236516",
"0.8222848",
"0.8222848",
"0.8222848",
"0.8222848",
"0.81961995",
"0.81130683",
"0.8087131",
"0.79731816",
"0.7865566",
"0.76608694",
"0.7237256",
"0.7159597",
"0.7152245",
"0.7152245",
"0.71505773",
"0.71505773",
"0.7141042",
"0.71363574",
"0.712754",
"0.712754... | 0.8163723 | 16 |
Home page view for chipy | def index(request):
try:
meeting = Meeting.objects.latest('when')
num_rsvped = Person.objects.filter(ynm='Y').count()
except (KeyError, Meeting.DoesNotExist, Person.DoesNotExist):
raise Http404
return render(request,'chipy/chipy.html',{'meeting':meeting,'num_rsvped':num_rsvped}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home(request):\n\treturn render(request, \"compta/home.html\")",
"def home_page(request):\r\n return render(request, 'ez_main/home_page.html')",
"def home():\n\n return render_template('home_page.html')",
"def home(request):\n assert isinstance(request, HttpRequest)\n return render(\n r... | [
"0.7724705",
"0.76073754",
"0.75873536",
"0.7557321",
"0.75458544",
"0.75407",
"0.75076807",
"0.7500881",
"0.7500854",
"0.749374",
"0.7456238",
"0.7456238",
"0.7456238",
"0.7456238",
"0.7456238",
"0.7456238",
"0.7456238",
"0.7456238",
"0.7456238",
"0.7456238",
"0.7456238",
... | 0.0 | -1 |
Tests that a repost notification is created on repost correctly | def test_repost_of_repost_notification(app, entities):
with app.app_context():
db = get_db()
populate_mock_db(db, entities)
repost_entities = {
"reposts": [
{
"user_id": 4,
"repost_item_id": 101,
"repost_type": RepostType.track,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_repost_of_repost_notification_mult_reposts(app, entities):\n with app.app_context():\n db = get_db()\n\n populate_mock_db(db, entities)\n repost_entities = {\n \"reposts\": [\n {\n \"user_id\": 1,\n \"repost_item_id\": 100,\n \... | [
"0.7499519",
"0.7173785",
"0.7173785",
"0.7100738",
"0.7050088",
"0.70471966",
"0.70471966",
"0.7024377",
"0.70021373",
"0.6938679",
"0.69130844",
"0.689414",
"0.6710344",
"0.6690702",
"0.6690594",
"0.66886204",
"0.66886204",
"0.6667865",
"0.665863",
"0.66271776",
"0.6583739"... | 0.7449385 | 1 |
Tests that a repost notification is created on repost correctly | def test_repost_of_repost_notification_multiple_followees_repost(app, entities):
with app.app_context():
db = get_db()
populate_mock_db(db, entities)
repost_entities = {
"reposts": [
{
"user_id": 1,
"repost_item_id": 100,
"repost_t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_repost_of_repost_notification_mult_reposts(app, entities):\n with app.app_context():\n db = get_db()\n\n populate_mock_db(db, entities)\n repost_entities = {\n \"reposts\": [\n {\n \"user_id\": 1,\n \"repost_item_id\": 100,\n \... | [
"0.7499519",
"0.7449385",
"0.7173785",
"0.7173785",
"0.7100738",
"0.7050088",
"0.70471966",
"0.70471966",
"0.7024377",
"0.70021373",
"0.69130844",
"0.689414",
"0.6710344",
"0.6690702",
"0.6690594",
"0.66886204",
"0.66886204",
"0.6667865",
"0.665863",
"0.66271776",
"0.6583739"... | 0.6938679 | 10 |
Tests that a repost notification is created on repost correctly | def test_repost_of_repost_notification_within_month(app, entities):
with app.app_context():
db = get_db()
populate_mock_db(db, entities)
repost_entities = {
"reposts": [
{
"user_id": 1,
"created_at": datetime.date.today() - datetime.timedelta(days... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_repost_of_repost_notification_mult_reposts(app, entities):\n with app.app_context():\n db = get_db()\n\n populate_mock_db(db, entities)\n repost_entities = {\n \"reposts\": [\n {\n \"user_id\": 1,\n \"repost_item_id\": 100,\n \... | [
"0.7499519",
"0.7449385",
"0.7173785",
"0.7173785",
"0.7050088",
"0.70471966",
"0.70471966",
"0.7024377",
"0.70021373",
"0.6938679",
"0.69130844",
"0.689414",
"0.6710344",
"0.6690702",
"0.6690594",
"0.66886204",
"0.66886204",
"0.6667865",
"0.665863",
"0.66271776",
"0.6583739"... | 0.7100738 | 4 |
Tests that a repost notification is created on repost correctly | def test_repost_of_repost_notification_mult_reposts(app, entities):
with app.app_context():
db = get_db()
populate_mock_db(db, entities)
repost_entities = {
"reposts": [
{
"user_id": 1,
"repost_item_id": 100,
"repost_type": RepostT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_repost_of_repost_notification(app, entities):\n with app.app_context():\n db = get_db()\n\n populate_mock_db(db, entities)\n repost_entities = {\n \"reposts\": [\n {\n \"user_id\": 4,\n \"repost_item_id\": 101,\n \"repost_type\... | [
"0.7449385",
"0.7173785",
"0.7173785",
"0.7100738",
"0.7050088",
"0.70471966",
"0.70471966",
"0.7024377",
"0.70021373",
"0.6938679",
"0.69130844",
"0.689414",
"0.6710344",
"0.6690702",
"0.6690594",
"0.66886204",
"0.66886204",
"0.6667865",
"0.665863",
"0.66271776",
"0.6583739"... | 0.7499519 | 0 |
Called once, when this object is first created. This is the normal hook to overload for most object types. Adds attributes for a character's current and maximum HP. We're just going to set this value at '100' by default. You may want to expand this to include various 'stats' that can be changed at creation and factor i... | def at_object_creation(self):
self.db.max_hp = 100 # Set maximum HP to 100
self.db.hp = self.db.max_hp # Set current HP to maximum
self.db.spells_known = [] # Set empty spells known list
self.db.max_mp = 20 # Set maximum MP to 20
self.db.mp = self.db.max_mp # Set current MP ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, ai, color, bling):\n Base.__init__(self,ai, color, bling)\n self.name = \"Max\"\n self.desc = \"Strong tanks, weak artillery.\"\n self.level1 = 50\n self.level2 = 100\n self.WeaponBonus = 1.2",
"def __init__(\r\n self,\r\n attributes: Opt... | [
"0.6557723",
"0.6385095",
"0.6350348",
"0.6246148",
"0.6061389",
"0.6008727",
"0.6007935",
"0.5998821",
"0.5962402",
"0.59050447",
"0.58988154",
"0.5879003",
"0.5859374",
"0.5854268",
"0.58517605",
"0.58330345",
"0.5781362",
"0.5770124",
"0.5720347",
"0.5649448",
"0.56453174"... | 0.6187426 | 4 |
generates a csv file from a data set | def make_csv(data_dict):
fieldnames = ['name'] + data_dict.itervalues().next().keys()
with open('data.csv', 'w') as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
for record in data_dict:
person = data_dict[record]
per... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_dataset_csv(request):\n\n response = csv_export(request,Dataset)\n return response",
"def generate_csv(lists, output_file):\n if os.path.isfile(output_file):\n with open(output_file, 'a') as file:\n dataset = tablib.Dataset()\n for l in lists:\n d... | [
"0.752348",
"0.7356172",
"0.7199357",
"0.7079323",
"0.69062215",
"0.6869951",
"0.68573946",
"0.6854152",
"0.68383396",
"0.68309975",
"0.68036556",
"0.67790544",
"0.6744998",
"0.67427397",
"0.67322654",
"0.67182416",
"0.6707477",
"0.6701398",
"0.66884536",
"0.6688307",
"0.6678... | 0.0 | -1 |
Getter for protected _type attribute. Trailing underscore used by convention (pep8) to avoid conflict with Python's type keyword. | def type_(self):
return self._type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_type(self):\n return self.__type",
"def _get_type(self):\n return self.__type",
"def _get_type(self):\n return self.__type",
"def _get_type(self):\n return self.__type",
"def _get_type(self):\n return self.__type",
"def _get_type(self):\n return self.__type",
"def _get_type(s... | [
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966",
"0.80737966"... | 0.7710893 | 33 |
Static method to instantiate a new Link from a Python dictionary | def read(data):
return Link(**data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, d: Dict[str, Any]) -> \"Link\":\n d = copy(d)\n rel = d.pop(\"rel\")\n href = d.pop(\"href\")\n media_type = d.pop(\"type\", None)\n title = d.pop(\"title\", None)\n\n extra_fields = None\n if any(d):\n extra_fields = d\n\n retur... | [
"0.7585469",
"0.73409307",
"0.7120695",
"0.7014297",
"0.6814129",
"0.66957146",
"0.6539203",
"0.6439069",
"0.6335253",
"0.62418365",
"0.62418365",
"0.62182194",
"0.61151224",
"0.6097609",
"0.6020982",
"0.6006182",
"0.59797776",
"0.59721065",
"0.59603125",
"0.5952863",
"0.5943... | 0.6300969 | 9 |
initialize stacked encoderblock layer | def __init__(self,
num_layer,
num_conv,
num_head,
unit_dim,
window_size,
activation,
dropout,
att_dropout,
layer_dropout,
num_gpus=1,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_encoder(self):\n\n vgg = models.vgg16(pretrained=True)\n\n blocks = [self.layer_1,\n self.layer_2,\n self.layer_3,\n self.layer_4,\n self.layer_5]\n\n ranges = [[0, 4], [5, 9], [10, 16], [17, 23], [24, 29]]\n f... | [
"0.6991601",
"0.69514793",
"0.64924973",
"0.64051217",
"0.635108",
"0.6343788",
"0.6343413",
"0.62750274",
"0.6262455",
"0.62570435",
"0.6231058",
"0.62187093",
"0.62178916",
"0.6209512",
"0.620135",
"0.61964524",
"0.61924064",
"0.61924064",
"0.6189796",
"0.61618227",
"0.6156... | 0.72275174 | 0 |
initialize wordlevel featurization layer | def __init__(self,
vocab_size,
embed_dim,
dropout,
pretrained,
embedding=None,
num_gpus=1,
default_gpu_id=0,
regularizer=None,
random_seed=0,
trainabl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fillFrameLayer(self, words):\n layer = self.createEmptyLayer()\n for key in layer:\n if key in words:\n layer[key] = words[key]\n for k in words:\n layer[wt.sentence].append(k)\n return layer",
"def init_dense(self, layer):\n pass",
"d... | [
"0.65855914",
"0.64093685",
"0.6350352",
"0.6227776",
"0.6202507",
"0.6185357",
"0.6156972",
"0.6142506",
"0.61057216",
"0.60256684",
"0.60150665",
"0.6013052",
"0.60043776",
"0.6003291",
"0.6003064",
"0.59987146",
"0.59627146",
"0.5938274",
"0.5936861",
"0.5921778",
"0.58796... | 0.6045423 | 9 |
initialize charlevel featurization layer | def __init__(self,
vocab_size,
embed_dim,
unit_dim,
window_size,
hidden_activation,
pooling_type,
dropout,
num_gpus=1,
default_gpu_id=0,
regularizer=N... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_dense(self, layer):\n pass",
"def _init_layers(self) -> None:\n super()._init_layers()\n self.controller = nn.Conv2d(\n self.feat_channels, self.num_params, 3, padding=1)",
"def __init__ (self, binary_features_model, name):\n if not hasattr(self, '_initialised'):... | [
"0.64243114",
"0.63899577",
"0.63694817",
"0.6255313",
"0.61293525",
"0.607758",
"0.6064155",
"0.60342103",
"0.6025609",
"0.601161",
"0.6009258",
"0.600605",
"0.59989893",
"0.5996648",
"0.59963197",
"0.59862936",
"0.5969505",
"0.5941638",
"0.59142786",
"0.5894164",
"0.5853574... | 0.62633353 | 3 |
Determines if the natural number n is prime. >>> is_prime(10) False >>> is_prime(11) True | def is_prime(n: int) -> bool:
# simple test for small n: 2 and 3 are prime, but 1 is not
if n <= 3:
return n > 1
# check if multiple of 2 or 3
if n % 2 == 0 or n % 3 == 0:
return False
# search for subsequent prime factors around multiples of 6
max_factor = int(math.sqrt(n))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isprime(n):\r\n\treturn is_prime(n)",
"def isprime(n):\n\treturn is_prime(n)",
"def is_prime(n):\n return mr_prime(n)",
"def is_prime(n):\n\tprime = True\n\tif n == 1:\n\t\tprime = False\n\tc = 2\n\twhile c * c <= n:\n\t\tif n % c == 0:\n\t\t\tprime = False\n\t\tc += 1\n\treturn prime",
"def if_prim... | [
"0.8731948",
"0.8724651",
"0.85982585",
"0.8573844",
"0.85295326",
"0.8508193",
"0.8430657",
"0.8426408",
"0.84221",
"0.8402833",
"0.839124",
"0.83811307",
"0.8376897",
"0.8371599",
"0.8370754",
"0.8367128",
"0.83473325",
"0.8342998",
"0.8328841",
"0.8327244",
"0.8326578",
... | 0.821232 | 32 |
Return the path to the Chrome executable. | def _chrome_path():
return _application_path('chrome.exe') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def executable_path(self):\n prepend = self._active_environment(ActiveEnvironment).prepend\n return prepend.get(\"PATH\", \"\")",
"def get_executable(self) -> str:\n ...",
"def find_chromium() -> None:\n the_path=chromium_executable()\n if the_path.is_file():\n print(f\"Path t... | [
"0.682568",
"0.6806813",
"0.67212206",
"0.6607963",
"0.66040426",
"0.63626593",
"0.62940645",
"0.6214658",
"0.62008667",
"0.61780846",
"0.61527306",
"0.61252016",
"0.610895",
"0.6083731",
"0.6073184",
"0.6001101",
"0.59763426",
"0.59763426",
"0.597359",
"0.596171",
"0.5911931... | 0.8735482 | 0 |
Open a default Vview window in a browser. | def open_top():
_open_url_path('') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def open_browser(url):\n import webbrowser\n webbrowser.open_new(url)",
"def preview():\n url = \"http://{}:{}\".format(_hostname, _port)\n webbrowser.open(url)",
"def open_browser_window(url):\n logger.debug('about to open url \"{url}\" in browser \"{browser}\"'.format(url=url, browser=BROW... | [
"0.6813021",
"0.6699307",
"0.6646516",
"0.6637175",
"0.6576298",
"0.65210867",
"0.649374",
"0.6391088",
"0.63705873",
"0.63585186",
"0.6262766",
"0.626152",
"0.6229379",
"0.62164474",
"0.6212034",
"0.6185603",
"0.6180273",
"0.60984075",
"0.6060231",
"0.60525334",
"0.6037137",... | 0.5534439 | 69 |
Return the path for storing VVbrowser's user profile. | def _browser_profile_path():
local_data = Path(os.getenv('LOCALAPPDATA'))
data_dir = local_data / 'vview'
return data_dir / 'browser' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_home_path(self):\n return path.join(env.user_home, self._user_home_path)",
"def profile_directory_path(request, file):\n return directory_path('profile', file)",
"def profile_upload_path(instance, filename):\n return f'profile/{instance.user.id}/{filename}'",
"def store_path(self):\n ... | [
"0.67627424",
"0.672726",
"0.6709601",
"0.6436925",
"0.63023204",
"0.624626",
"0.61984825",
"0.61694235",
"0.6124313",
"0.6112936",
"0.61129063",
"0.60969824",
"0.6096659",
"0.60947907",
"0.60587054",
"0.6053224",
"0.6053224",
"0.6046309",
"0.60159767",
"0.60104626",
"0.59831... | 0.81521857 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.