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 |
|---|---|---|---|---|---|---|
TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. | def toleration_seconds(self) -> Optional[int]:
return pulumi.get(self, "toleration_seconds") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toleration(self, toleration: Dict[str, str]):\n\n self._toleration = toleration",
"def toleration(self) -> Dict[str, str]:\n return self._toleration",
"def tolerations(self) -> Optional[Sequence['outputs.CSIIsilonSpecDriverNodeTolerations']]:\n return pulumi.get(self, \"tolerations\")"... | [
"0.7145785",
"0.6784965",
"0.63332194",
"0.6318991",
"0.6268237",
"0.62456185",
"0.6188198",
"0.6141869",
"0.6133166",
"0.611359",
"0.60085297",
"0.59721303",
"0.596976",
"0.5968623",
"0.59598845",
"0.59339416",
"0.5879813",
"0.57686585",
"0.5751171",
"0.56945944",
"0.5682505... | 0.7421097 | 17 |
ImagePullPolicy is the image pull policy for the image | def image_pull_policy(self) -> Optional[str]:
return pulumi.get(self, "image_pull_policy") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _determine_image_pull_policy(self) -> ImagePullPolicy:\n if not self.image_pull_policy:\n _, tag = self._get_image_and_tag()\n if tag == \"latest\" or not tag:\n return ImagePullPolicy.ALWAYS\n return ImagePullPolicy.IF_NOT_PRESENT\n return self.ima... | [
"0.8125607",
"0.7769917",
"0.68590343",
"0.622387",
"0.5951845",
"0.5950428",
"0.5817936",
"0.57732624",
"0.56761223",
"0.56241024",
"0.561501",
"0.55290407",
"0.5482199",
"0.54586315",
"0.54287744",
"0.5416411",
"0.54072386",
"0.5384012",
"0.53806716",
"0.5362444",
"0.535377... | 0.7894309 | 19 |
NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. | def node_selector(self) -> Optional[Mapping[str, str]]:
return pulumi.get(self, "node_selector") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_selector(self, node_selector: Dict[str, str]):\n\n self._node_selector = node_selector",
"def list_of_pods_in_a_node(self, node_name, namespace: Optional[str] = None, label_selector: Optional[str] = None):\n pod_list = []\n if namespace is None:\n api_response = self.list... | [
"0.65051675",
"0.59177065",
"0.59023947",
"0.5699683",
"0.5659096",
"0.5650913",
"0.56342506",
"0.5581961",
"0.5539387",
"0.5539387",
"0.5539387",
"0.5399756",
"0.5399756",
"0.5399756",
"0.53279376",
"0.5301275",
"0.5301275",
"0.5301275",
"0.5231039",
"0.5231039",
"0.5231039"... | 0.6244406 | 20 |
EnvVar represents an environment variable present in a Container. | def __init__(__self__, *,
name: str,
value: Optional[str] = None,
value_from: Optional['outputs.CSIVXFlexOSSpecDriverNodeEnvsValueFrom'] = None):
pulumi.set(__self__, "name", name)
if value is not None:
pulumi.set(__self__, "value", value)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def env(var):\n return os.environ[var]",
"def with_env_variable(\n self,\n name: str,\n value: str,\n expand: Optional[bool] = None,\n ) -> \"Container\":\n _args = [\n Arg(\"name\", name),\n Arg(\"value\", value),\n Arg(\"expand\", expand... | [
"0.6759011",
"0.64400876",
"0.6365067",
"0.6353957",
"0.6332777",
"0.63078386",
"0.6261371",
"0.61820585",
"0.60630727",
"0.6052506",
"0.6047019",
"0.6040598",
"0.6039395",
"0.6014736",
"0.5986097",
"0.59742486",
"0.5959875",
"0.59374666",
"0.5901712",
"0.58948684",
"0.585241... | 0.0 | -1 |
Name of the environment variable. Must be a C_IDENTIFIER. | def name(self) -> str:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._env_name",
"def environment_variable_string(self, name):\n return \"$(\" + name + \")\"",
"def windows_get_env_value(var_name: str) -> str:\n if var_name in os.environ.keys():\n return os.environ[var_name]",
"def name(self):\n return get_env_name(... | [
"0.7078505",
"0.7015536",
"0.68641573",
"0.6832507",
"0.6733183",
"0.6631044",
"0.6607965",
"0.6513792",
"0.6485412",
"0.6482523",
"0.6422871",
"0.6411862",
"0.6372754",
"0.63251024",
"0.62988293",
"0.62966317",
"0.6243278",
"0.6223558",
"0.62014925",
"0.617274",
"0.61518526"... | 0.0 | -1 |
Source for the environment variable's value. Cannot be used if value is not empty. | def value_from(self) -> Optional['outputs.CSIVXFlexOSSpecDriverNodeEnvsValueFrom']:
return pulumi.get(self, "value_from") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value_from(self) -> Optional[pulumi.Input['EnvVarSourceArgs']]:\n return pulumi.get(self, \"value_from\")",
"def get(self):\n self.value = os.getenv(self.name, self.default)\n return self.value",
"def env_var_line(key: str) -> str:\n return str(os.environ.get(key) or \"\").strip()",... | [
"0.7228451",
"0.6452011",
"0.635478",
"0.6339654",
"0.6327877",
"0.62141955",
"0.6186485",
"0.6174624",
"0.61109644",
"0.60693794",
"0.6045376",
"0.6032341",
"0.6012038",
"0.60104096",
"0.5993801",
"0.5993495",
"0.5978553",
"0.59582996",
"0.59345484",
"0.5901107",
"0.58747065... | 0.57703084 | 31 |
Source for the environment variable's value. Cannot be used if value is not empty. | def __init__(__self__, *,
config_map_key_ref: Optional['outputs.CSIVXFlexOSSpecDriverNodeEnvsValueFromConfigMapKeyRef'] = None,
field_ref: Optional['outputs.CSIVXFlexOSSpecDriverNodeEnvsValueFromFieldRef'] = None,
resource_field_ref: Optional['outputs.CSIVXFlexOSSpecDr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value_from(self) -> Optional[pulumi.Input['EnvVarSourceArgs']]:\n return pulumi.get(self, \"value_from\")",
"def get(self):\n self.value = os.getenv(self.name, self.default)\n return self.value",
"def env_var_line(key: str) -> str:\n return str(os.environ.get(key) or \"\").strip()",... | [
"0.72283417",
"0.6452805",
"0.635622",
"0.6339417",
"0.632665",
"0.62133074",
"0.61853224",
"0.617515",
"0.61103386",
"0.60699874",
"0.60446334",
"0.6031965",
"0.6012811",
"0.60110235",
"0.5994091",
"0.5993541",
"0.5981215",
"0.5959463",
"0.5935289",
"0.59011126",
"0.58757883... | 0.0 | -1 |
The key of the secret to select from. Must be a valid secret key. | def key(self) -> str:
return pulumi.get(self, "key") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def secret_key(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"secret_key\")",
"def secret_key(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"secret_key\")",
"def secret_key(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"secret_key\")",
"def secret_key... | [
"0.8150934",
"0.8150934",
"0.79965764",
"0.77527404",
"0.76310414",
"0.7568463",
"0.75259495",
"0.7503479",
"0.7439221",
"0.7319453",
"0.7319453",
"0.728863",
"0.728863",
"0.71629614",
"0.71629614",
"0.7155791",
"0.71103626",
"0.7094697",
"0.7077122",
"0.7058756",
"0.69238305... | 0.6643705 | 80 |
Specify whether the Secret or its key must be defined | def optional(self) -> Optional[bool]:
return pulumi.get(self, "optional") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def know_secret(self):\r\n return(self.secret != \"\") and (self.key != \"\")",
"def secret(self) -> pulumi.Input[bool]:\n return pulumi.get(self, \"secret\")",
"def _secret_not_in_order():\n pecan.abort(400, u._(\"Secret metadata expected but not received.\"))",
"def testSecretKey(loggingMi... | [
"0.732649",
"0.67606384",
"0.65427554",
"0.6434086",
"0.63853836",
"0.63853836",
"0.6303913",
"0.6225126",
"0.6225126",
"0.62211883",
"0.62158",
"0.61208487",
"0.61052066",
"0.60800326",
"0.6021938",
"0.5967823",
"0.5905159",
"0.589961",
"0.58436424",
"0.5805063",
"0.5787778"... | 0.0 | -1 |
Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. | def effect(self) -> Optional[str]:
return pulumi.get(self, "effect") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testEffects(self):\n \n action = Parser.parse_as(drive.split(\"\\n\"), Action, self.domain)\n self.assert_(isinstance(action.effect, SimpleEffect))",
"def test_effect(self):\n self.check_search(\n dict(similar_to=u'icy wind'),\n [ u'Bubble', u'BubbleBeam', u'... | [
"0.5249045",
"0.51753664",
"0.50939983",
"0.5070544",
"0.46807265",
"0.4672379",
"0.45765623",
"0.45485628",
"0.45339823",
"0.45085293",
"0.44730505",
"0.4467193",
"0.44431973",
"0.4404874",
"0.43885973",
"0.43770444",
"0.43662375",
"0.4364882",
"0.4277755",
"0.42570713",
"0.... | 0.51976055 | 7 |
TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. | def toleration_seconds(self) -> Optional[int]:
return pulumi.get(self, "toleration_seconds") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toleration(self, toleration: Dict[str, str]):\n\n self._toleration = toleration",
"def toleration(self) -> Dict[str, str]:\n return self._toleration",
"def tolerations(self) -> Optional[Sequence['outputs.CSIIsilonSpecDriverNodeTolerations']]:\n return pulumi.get(self, \"tolerations\")"... | [
"0.7147842",
"0.67870635",
"0.6334559",
"0.6320272",
"0.6269226",
"0.62464815",
"0.6189818",
"0.6143222",
"0.6134462",
"0.6114868",
"0.60094",
"0.59734225",
"0.5971313",
"0.59695727",
"0.5961522",
"0.5935294",
"0.58811635",
"0.5770352",
"0.57524425",
"0.5696225",
"0.56837475"... | 0.7421432 | 4 |
ImagePullPolicy is the image pull policy for the image | def image_pull_policy(self) -> Optional[str]:
return pulumi.get(self, "image_pull_policy") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _determine_image_pull_policy(self) -> ImagePullPolicy:\n if not self.image_pull_policy:\n _, tag = self._get_image_and_tag()\n if tag == \"latest\" or not tag:\n return ImagePullPolicy.ALWAYS\n return ImagePullPolicy.IF_NOT_PRESENT\n return self.ima... | [
"0.8125533",
"0.7769158",
"0.68589365",
"0.62248176",
"0.59526604",
"0.5950211",
"0.5819258",
"0.5774122",
"0.56765014",
"0.5624425",
"0.56165045",
"0.5529986",
"0.54840046",
"0.5459022",
"0.54292417",
"0.54169023",
"0.5408534",
"0.53826547",
"0.53813297",
"0.5363186",
"0.535... | 0.7893667 | 6 |
NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. | def node_selector(self) -> Optional[Mapping[str, str]]:
return pulumi.get(self, "node_selector") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_selector(self, node_selector: Dict[str, str]):\n\n self._node_selector = node_selector",
"def list_of_pods_in_a_node(self, node_name, namespace: Optional[str] = None, label_selector: Optional[str] = None):\n pod_list = []\n if namespace is None:\n api_response = self.list... | [
"0.6502156",
"0.5918389",
"0.59019166",
"0.56973386",
"0.56566566",
"0.5647969",
"0.56320477",
"0.5579677",
"0.5537389",
"0.5537389",
"0.5537389",
"0.5397992",
"0.5397992",
"0.5397992",
"0.53265005",
"0.52993214",
"0.52993214",
"0.52993214",
"0.52291834",
"0.52291834",
"0.522... | 0.62425923 | 5 |
EnvVar represents an environment variable present in a Container. | def __init__(__self__, *,
name: str,
value: Optional[str] = None,
value_from: Optional['outputs.CSIVXFlexOSSpecDriverSideCarsEnvsValueFrom'] = None):
pulumi.set(__self__, "name", name)
if value is not None:
pulumi.set(__self__, "value", valu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def env(var):\n return os.environ[var]",
"def with_env_variable(\n self,\n name: str,\n value: str,\n expand: Optional[bool] = None,\n ) -> \"Container\":\n _args = [\n Arg(\"name\", name),\n Arg(\"value\", value),\n Arg(\"expand\", expand... | [
"0.67591375",
"0.643926",
"0.6365626",
"0.63541126",
"0.6332176",
"0.63082224",
"0.6262704",
"0.6181674",
"0.6062436",
"0.60531247",
"0.6047651",
"0.60412985",
"0.6039377",
"0.6015537",
"0.5986704",
"0.59753656",
"0.59602004",
"0.5937697",
"0.5902644",
"0.5895642",
"0.5852487... | 0.0 | -1 |
Name of the environment variable. Must be a C_IDENTIFIER. | def name(self) -> str:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._env_name",
"def environment_variable_string(self, name):\n return \"$(\" + name + \")\"",
"def windows_get_env_value(var_name: str) -> str:\n if var_name in os.environ.keys():\n return os.environ[var_name]",
"def name(self):\n return get_env_name(... | [
"0.707886",
"0.70169437",
"0.68652874",
"0.68336385",
"0.67338234",
"0.6632225",
"0.66093564",
"0.6515423",
"0.6485804",
"0.6483849",
"0.6423898",
"0.64139676",
"0.6373172",
"0.63263583",
"0.6298889",
"0.6297938",
"0.62448883",
"0.6225822",
"0.62034917",
"0.6172938",
"0.61534... | 0.0 | -1 |
Source for the environment variable's value. Cannot be used if value is not empty. | def value_from(self) -> Optional['outputs.CSIVXFlexOSSpecDriverSideCarsEnvsValueFrom']:
return pulumi.get(self, "value_from") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value_from(self) -> Optional[pulumi.Input['EnvVarSourceArgs']]:\n return pulumi.get(self, \"value_from\")",
"def get(self):\n self.value = os.getenv(self.name, self.default)\n return self.value",
"def env_var_line(key: str) -> str:\n return str(os.environ.get(key) or \"\").strip()",... | [
"0.72283417",
"0.6452805",
"0.635622",
"0.6339417",
"0.632665",
"0.62133074",
"0.61853224",
"0.617515",
"0.61103386",
"0.60699874",
"0.60446334",
"0.6031965",
"0.6012811",
"0.60110235",
"0.5994091",
"0.5993541",
"0.5981215",
"0.5959463",
"0.5935289",
"0.59011126",
"0.58757883... | 0.0 | -1 |
Source for the environment variable's value. Cannot be used if value is not empty. | def __init__(__self__, *,
config_map_key_ref: Optional['outputs.CSIVXFlexOSSpecDriverSideCarsEnvsValueFromConfigMapKeyRef'] = None,
field_ref: Optional['outputs.CSIVXFlexOSSpecDriverSideCarsEnvsValueFromFieldRef'] = None,
resource_field_ref: Optional['outputs.CSIVXFlex... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value_from(self) -> Optional[pulumi.Input['EnvVarSourceArgs']]:\n return pulumi.get(self, \"value_from\")",
"def get(self):\n self.value = os.getenv(self.name, self.default)\n return self.value",
"def env_var_line(key: str) -> str:\n return str(os.environ.get(key) or \"\").strip()",... | [
"0.7228451",
"0.6452011",
"0.635478",
"0.6339654",
"0.6327877",
"0.62141955",
"0.6186485",
"0.6174624",
"0.61109644",
"0.60693794",
"0.6045376",
"0.6032341",
"0.6012038",
"0.60104096",
"0.5993801",
"0.5993495",
"0.5978553",
"0.59582996",
"0.59345484",
"0.5901107",
"0.58747065... | 0.0 | -1 |
The key of the secret to select from. Must be a valid secret key. | def key(self) -> str:
return pulumi.get(self, "key") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def secret_key(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"secret_key\")",
"def secret_key(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"secret_key\")",
"def secret_key(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"secret_key\")",
"def secret_key... | [
"0.81515235",
"0.81515235",
"0.79967463",
"0.77533454",
"0.7631605",
"0.7569842",
"0.7526095",
"0.7503426",
"0.74400395",
"0.73191357",
"0.73191357",
"0.72888464",
"0.72888464",
"0.716242",
"0.716242",
"0.7155205",
"0.71101844",
"0.7094617",
"0.7077072",
"0.7058335",
"0.69245... | 0.66455597 | 77 |
Specify whether the Secret or its key must be defined | def optional(self) -> Optional[bool]:
return pulumi.get(self, "optional") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def know_secret(self):\r\n return(self.secret != \"\") and (self.key != \"\")",
"def secret(self) -> pulumi.Input[bool]:\n return pulumi.get(self, \"secret\")",
"def _secret_not_in_order():\n pecan.abort(400, u._(\"Secret metadata expected but not received.\"))",
"def testSecretKey(loggingMi... | [
"0.7326546",
"0.676084",
"0.6542811",
"0.64349353",
"0.63848764",
"0.63848764",
"0.63051176",
"0.62259144",
"0.62259144",
"0.6222053",
"0.62163496",
"0.61213213",
"0.61051255",
"0.60802877",
"0.6022407",
"0.5968715",
"0.5903682",
"0.5900447",
"0.5843276",
"0.58046025",
"0.578... | 0.0 | -1 |
Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. | def effect(self) -> Optional[str]:
return pulumi.get(self, "effect") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testEffects(self):\n \n action = Parser.parse_as(drive.split(\"\\n\"), Action, self.domain)\n self.assert_(isinstance(action.effect, SimpleEffect))",
"def test_effect(self):\n self.check_search(\n dict(similar_to=u'icy wind'),\n [ u'Bubble', u'BubbleBeam', u'... | [
"0.5249481",
"0.51760536",
"0.50947005",
"0.5071912",
"0.4680096",
"0.46736106",
"0.45775712",
"0.45492044",
"0.45352313",
"0.45058474",
"0.44740582",
"0.44682917",
"0.44423032",
"0.44062462",
"0.43896046",
"0.43759257",
"0.43650132",
"0.4364706",
"0.42771178",
"0.4255112",
"... | 0.51985604 | 9 |
TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. | def toleration_seconds(self) -> Optional[int]:
return pulumi.get(self, "toleration_seconds") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toleration(self, toleration: Dict[str, str]):\n\n self._toleration = toleration",
"def toleration(self) -> Dict[str, str]:\n return self._toleration",
"def tolerations(self) -> Optional[Sequence['outputs.CSIIsilonSpecDriverNodeTolerations']]:\n return pulumi.get(self, \"tolerations\")"... | [
"0.7149501",
"0.67880994",
"0.63350546",
"0.6320798",
"0.6269676",
"0.6247005",
"0.6190168",
"0.6143736",
"0.61347246",
"0.6115356",
"0.6010081",
"0.59738016",
"0.5971729",
"0.5970144",
"0.5961882",
"0.5935562",
"0.58815575",
"0.57704884",
"0.57529044",
"0.5696642",
"0.568429... | 0.74212337 | 8 |
A topology selector requirement is a selector that matches given label. This is an alpha feature and may change in the future. | def __init__(__self__, *,
key: str,
values: Sequence[str]):
pulumi.set(__self__, "key", key)
pulumi.set(__self__, "values", values) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_topology(self) -> \"LabelSelector\":\n return typing.cast(\n \"LabelSelector\",\n self._properties.get(\"nodeTopology\"),\n )",
"def select_node_by_label(conn, label):\n cur = conn.cursor()\n cur.execute(\"SELECT * FROM Nodes WHERE label=?\", (label,))",
"def ... | [
"0.62710166",
"0.6257632",
"0.5678044",
"0.56717664",
"0.55771273",
"0.5513535",
"0.5468137",
"0.5441316",
"0.54026204",
"0.5382597",
"0.51818746",
"0.5171293",
"0.5171293",
"0.5171293",
"0.51533604",
"0.5102047",
"0.5102047",
"0.5102047",
"0.5099373",
"0.50851035",
"0.507547... | 0.0 | -1 |
The label key that the selector applies to. | def key(self) -> str:
return pulumi.get(self, "key") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_label(self, key):\n return self.labels.get(key, None)",
"def label(self):\n return self.__label",
"def label(self):\n return self.__label",
"def label(self) -> str:\n return self.keysym.label",
"def label(self):\n return self.label_",
"def label(self) -> str:\n ... | [
"0.74799424",
"0.724912",
"0.724912",
"0.7210478",
"0.7205637",
"0.71650213",
"0.71586597",
"0.7146725",
"0.7111848",
"0.7111848",
"0.7111848",
"0.7111848",
"0.7111848",
"0.7111848",
"0.7111848",
"0.7111848",
"0.7111848",
"0.7111848",
"0.7086638",
"0.7081567",
"0.7009067",
... | 0.0 | -1 |
ControllerStatus is the status of Controller pods | def controller_status(self) -> Optional['outputs.CSIVXFlexOSStatusControllerStatus']:
return pulumi.get(self, "controller_status") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def controller_status(self) -> Optional['outputs.CSIUnityStatusControllerStatus']:\n return pulumi.get(self, \"controller_status\")",
"def status(self) -> ControllerStatus:\n return self._status",
"def controller_status(self) -> Optional['outputs.CSIPowerStoreStatusControllerStatus']:\n re... | [
"0.7716838",
"0.76570404",
"0.7581352",
"0.74678415",
"0.7435039",
"0.6915596",
"0.6864449",
"0.59351426",
"0.59238404",
"0.5888972",
"0.584402",
"0.58390266",
"0.58311397",
"0.5826533",
"0.58211887",
"0.5818358",
"0.5816246",
"0.58006066",
"0.57969457",
"0.57903516",
"0.5789... | 0.7894275 | 0 |
LastUpdate is the last updated state of the driver | def last_update(self) -> Optional['outputs.CSIVXFlexOSStatusLastUpdate']:
return pulumi.get(self, "last_update") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_update(self):\n return self._last_update",
"def last_update(self):\n return self._last_update",
"def getLastUpdate():\n swDB = switchdb.DB()\n lastupdate = swDB.getLastUpdate()\n swDB.close()\n return lastupdate",
"def last_update(self, last_update):\n\n self._last_u... | [
"0.77131146",
"0.77131146",
"0.7577367",
"0.75120014",
"0.7311992",
"0.72735405",
"0.72320783",
"0.71976095",
"0.7169759",
"0.71614677",
"0.71553385",
"0.7066601",
"0.70494956",
"0.7022449",
"0.7012528",
"0.6990631",
"0.6966273",
"0.69175315",
"0.6902252",
"0.6851522",
"0.685... | 0.71771914 | 8 |
ControllerStatus is the status of Controller pods | def __init__(__self__, *,
available: Optional[Sequence[str]] = None,
ready: Optional[Sequence[str]] = None,
starting: Optional[Sequence[str]] = None,
stopped: Optional[Sequence[str]] = None):
if available is not None:
pulumi.set(__s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def controller_status(self) -> Optional['outputs.CSIVXFlexOSStatusControllerStatus']:\n return pulumi.get(self, \"controller_status\")",
"def controller_status(self) -> Optional['outputs.CSIUnityStatusControllerStatus']:\n return pulumi.get(self, \"controller_status\")",
"def status(self) -> Cont... | [
"0.78950554",
"0.7717445",
"0.7656238",
"0.7582138",
"0.74687314",
"0.7435508",
"0.6915362",
"0.68638337",
"0.5934879",
"0.5923136",
"0.5888573",
"0.58432204",
"0.58387125",
"0.58308405",
"0.5828534",
"0.58209366",
"0.5818346",
"0.5816",
"0.5798976",
"0.57974327",
"0.57905334... | 0.0 | -1 |
LastUpdate is the last updated state of the driver | def __init__(__self__, *,
condition: Optional[str] = None,
error_message: Optional[str] = None,
time: Optional[str] = None):
if condition is not None:
pulumi.set(__self__, "condition", condition)
if error_message is not None:
pul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_update(self):\n return self._last_update",
"def last_update(self):\n return self._last_update",
"def getLastUpdate():\n swDB = switchdb.DB()\n lastupdate = swDB.getLastUpdate()\n swDB.close()\n return lastupdate",
"def last_update(self, last_update):\n\n self._last_u... | [
"0.77131146",
"0.77131146",
"0.7577367",
"0.75120014",
"0.7311992",
"0.72735405",
"0.72320783",
"0.71976095",
"0.71771914",
"0.7169759",
"0.71614677",
"0.71553385",
"0.7066601",
"0.70494956",
"0.7022449",
"0.7012528",
"0.6990631",
"0.6966273",
"0.69175315",
"0.6902252",
"0.68... | 0.0 | -1 |
Find the ranges for the x and yaxis. | def _timeseries_scatter_plot_rges(large_scale_signal_ts,
regional_signal_ts, var_combination):
if var_combination == "pr:tas":
max_range = max(regional_signal_ts)
min_range = min(regional_signal_ts)
else:
if max(regional_signal_ts... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _compute_equal_axes_ranges(x_min, x_max, y_min, y_max):\n\n x_axis_min, x_axis_max, y_axis_min, y_axis_max = x_min, x_max, y_min, y_max\n x_range, y_range = abs(x_max - x_min), abs(y_max - y_min)\n if x_range > y_range:\n y_center = (y_max + y_min) / 2\n ... | [
"0.7038357",
"0.69188225",
"0.6822843",
"0.6799604",
"0.6711304",
"0.6701169",
"0.6650155",
"0.6630826",
"0.6627386",
"0.6543166",
"0.6519973",
"0.6513459",
"0.65131867",
"0.64761215",
"0.6447253",
"0.6444749",
"0.6435899",
"0.6434535",
"0.64343566",
"0.6365117",
"0.63555425"... | 0.0 | -1 |
Returns the class kind. | def name(self):
return self.resource["metadata"]["name"] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_kind(cls):\n return cls.__name__",
"def kind(cls):\n return cls.__name__",
"def get_kind(self):\n\n return self._kind",
"def kind(self):\n return self._kind()",
"def kind(self):\n return self._kind",
"def kind(self):\n return self._kind",
"def GetKind(... | [
"0.8401211",
"0.82933146",
"0.77451766",
"0.7630437",
"0.76030344",
"0.76030344",
"0.7585235",
"0.7547958",
"0.7410835",
"0.72447073",
"0.72447073",
"0.72447073",
"0.72447073",
"0.72447073",
"0.72447073",
"0.72447073",
"0.72447073",
"0.72447073",
"0.72447073",
"0.72447073",
"... | 0.0 | -1 |
Plots the metric vs. epoch plots for all parameters in history.history. | def calc_params_train_val(history):
# Metric of each feature
acc_params = ['covid_severity_output_categorical_accuracy',
'pleural_regular_output_binary_accuracy',
'consolidation_output_binary_accuracy']
precision_params = ['covid_severity_output_precision',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_history(history):\n ## First retrieve metrics names ## \n metrics_names = [a for a in history.history.keys() if a[:3]!='val']\n \n rows = 1\n cols = len(metrics_names)\n\n for i,a in enumerate(metrics_names,1):\n plt.subplot(rows,cols,i)\n plt.title(a)\n plt.plot(his... | [
"0.84863293",
"0.8371654",
"0.8149485",
"0.8114253",
"0.7964488",
"0.79554695",
"0.79231477",
"0.78546804",
"0.77559406",
"0.775222",
"0.7746721",
"0.77435976",
"0.76884466",
"0.766535",
"0.7652883",
"0.76215297",
"0.754686",
"0.7489796",
"0.7475369",
"0.7465203",
"0.744656",... | 0.0 | -1 |
Plot the total loss vs. epoch plots. | def calc_loss_train_val(history):
# overall loss
fig = go.Figure()
fig.add_trace(go.Scattergl(
y=history.history['loss'],
name='Train'))
fig.add_trace(go.Scattergl(
y=history.history['val_loss'],
name='Validation'))
fig.update_layout(height=500,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_loss_curve(num_epochs, losses):\n plt.xlabel('Epochs')\n plt.ylabel('Loss') \n plt.title('Loss Curve') \n plt.plot(range(num_epochs), losses)\n plt.show()",
"def plot_loss(stats):\r\n plt.plot(stats['train_loss_ind'], stats['train_loss'], label='Training loss')\r\n plt.plot(st... | [
"0.77724487",
"0.7726205",
"0.7714978",
"0.764956",
"0.76233965",
"0.7623274",
"0.7517096",
"0.74981314",
"0.74836874",
"0.74612004",
"0.74283427",
"0.7426968",
"0.74252635",
"0.74244916",
"0.7389975",
"0.7377316",
"0.73710495",
"0.73676664",
"0.7341486",
"0.72886115",
"0.727... | 0.64613515 | 100 |
Readonly interface for the active torch device. Autodetected in the constructor based on CUDA support. | def device(self) -> torch.device:
return self._device | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_device(self):\n return torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")",
"def device():\n return torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')",
"def set_device(self, device: torch.Tensor) -> None:\n raise NotImplementedError",
"def setup_device(... | [
"0.7243774",
"0.6864857",
"0.67070234",
"0.6623963",
"0.66236806",
"0.65979505",
"0.65841067",
"0.65643656",
"0.64700145",
"0.6351698",
"0.6300667",
"0.62400496",
"0.62294424",
"0.61740786",
"0.61147404",
"0.610777",
"0.6085627",
"0.6059798",
"0.59826255",
"0.5965916",
"0.593... | 0.6884824 | 1 |
Function to set digital PIN value. | def setPIN(self, DPIN, value):
try:
with open('/sys/class/gpio/' + DPIN + '/value', 'a') as f:
f.write(value)
except Exception as err:
LOG.error("Error setting PIN value: " + str(err)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def digital_pin_write(self, pin, value):\n\n command = (PrivateConstants.SET_DIGITAL_PIN_VALUE, pin, value)\n\n await self._send_command(command)",
"def set(pin, val=1):\n if val not in [0,1]:\n raise RuntimeError\n GPIO.output(pin,val)",
"def Set(self,value):\n self.Bus... | [
"0.75729305",
"0.7364922",
"0.6986811",
"0.6898064",
"0.6795176",
"0.67899877",
"0.6787525",
"0.67728305",
"0.6735007",
"0.6669532",
"0.6632994",
"0.65423346",
"0.653754",
"0.64920366",
"0.6398399",
"0.6333039",
"0.6301748",
"0.62127906",
"0.61851203",
"0.61605304",
"0.615732... | 0.7687744 | 0 |
Scans the analyzers collection for analyzer modules that were executed and performs validation on their generated observations. If they are ok, the observations are committed to the observatory and a new action is inserted into the action_log. | def check_for_analyzers(self):
executed = self.analyzer_state.executed_analyzers()
for analyzer in executed:
# check for wish
if self.analyzer_state.check_wish(analyzer, 'cancel'):
print("validator: cancelled {} upon request".format(analyzer['_id']))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check(self):\r\n for action in self._actions:\r\n action.check()",
"def run_analyzers(args: argparse.Namespace):\n log = logging.getLogger(\"run\")\n model_repository = create_model_repo_from_args(args)\n log.info(\"Created %s\", model_repository)\n if args.request_server == \"a... | [
"0.6238496",
"0.5721421",
"0.5691736",
"0.56328654",
"0.5553783",
"0.54151267",
"0.53628486",
"0.53609884",
"0.53175175",
"0.5306766",
"0.5306371",
"0.52737206",
"0.5269958",
"0.5251529",
"0.524727",
"0.5210122",
"0.51994556",
"0.519592",
"0.5194466",
"0.51939213",
"0.5181274... | 0.73985136 | 0 |
Return a configured oslo.messaging notifier. | def get_notifier(publisher_id):
global NOTIFIER
return NOTIFIER.prepare(publisher_id=publisher_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, connection_str, project=None, service=None, host=None,\n context=None, conf=None, transport_url=None,\n idle_timeout=1, **kwargs):\n\n self.oslo_messaging = importutils.try_import(\"oslo_messaging\")\n if not self.oslo_messaging:\n raise V... | [
"0.6319003",
"0.6077141",
"0.5677209",
"0.5492569",
"0.5240515",
"0.521849",
"0.5081094",
"0.5035869",
"0.4864788",
"0.48478985",
"0.48109055",
"0.48100156",
"0.47851297",
"0.47429472",
"0.47210187",
"0.472045",
"0.46528593",
"0.46505916",
"0.46424112",
"0.4617852",
"0.460744... | 0.5734912 | 2 |
Initialise the oslo.messaging layer. | def setup(url=None):
global TRANSPORT, NOTIFIER
if not TRANSPORT:
messaging.set_transport_defaults('payloadvoice')
TRANSPORT = messaging.get_transport(
cfg.CONF, url)
if not NOTIFIER:
serializer = RequestContextSerializer(None)
NOTIFIER = messaging.Notifier(TRANSP... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, connection_str, project=None, service=None, host=None,\n context=None, conf=None, transport_url=None,\n idle_timeout=1, **kwargs):\n\n self.oslo_messaging = importutils.try_import(\"oslo_messaging\")\n if not self.oslo_messaging:\n raise V... | [
"0.6536732",
"0.6455044",
"0.62834156",
"0.6281776",
"0.6269005",
"0.6253622",
"0.62450844",
"0.6163542",
"0.6106945",
"0.6092088",
"0.6071446",
"0.60238194",
"0.6018348",
"0.6004823",
"0.5964352",
"0.59500813",
"0.59415984",
"0.5935369",
"0.5934872",
"0.59163034",
"0.5916008... | 0.0 | -1 |
Extract a set of ngrams from a list of integers. create_ngram_set([1, 4, 9, 4, 1, 4], ngram_value=2) {(4, 9), (4, 1), (1, 4), (9, 4)} create_ngram_set([1, 4, 9, 4, 1, 4], ngram_value=3) [(1, 4, 9), (4, 9, 4), (9, 4, 1), (4, 1, 4)] | def create_ngram_set(self, input_list, ngram_value=2):
return set(zip(*[input_list[i:] for i in range(ngram_value)])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_ngram_set(input_list, ngram_value=2):\n return set(zip(*[input_list[i:] for i in range(ngram_value)]))",
"def create_ngram_set(input_list, ngram_value=2):\n return set(zip(*[input_list[i:] for i in range(ngram_value)]))",
"def find_ngrams(input_list, n=3):\n return zip(*[input_list[i:] ... | [
"0.86892813",
"0.8686444",
"0.6891724",
"0.68082756",
"0.67560047",
"0.6714797",
"0.6690468",
"0.6466467",
"0.6426356",
"0.6401128",
"0.63991886",
"0.63766843",
"0.63381296",
"0.6334503",
"0.6331014",
"0.63169235",
"0.6287123",
"0.6283678",
"0.62735546",
"0.62642986",
"0.6240... | 0.85161185 | 2 |
Augment the input list of list (sequences) by appending ngrams values. | def add_ngram(self, sequences, token_indice, ngram_range=2):
new_sequences = []
for input_list in sequences:
new_list = input_list[:]
for ngram_value in range(2, ngram_range + 1):
for i in range(len(new_list) - ngram_value + 1):
ngram = tuple(n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_ngram(sequences, token_indice, ngram_range=2):\n new_sequences = []\n for input_list in sequences:\n new_list = input_list[:]\n for ngram_value in range(2, ngram_range + 1):\n for i in range(len(new_list) - ngram_value + 1):\n ngram = tu... | [
"0.7458851",
"0.74285233",
"0.7409004",
"0.6396972",
"0.62301904",
"0.6204364",
"0.6146134",
"0.59812844",
"0.59750307",
"0.5966128",
"0.5933903",
"0.59307075",
"0.58711743",
"0.583522",
"0.5820863",
"0.57999927",
"0.5797987",
"0.5785808",
"0.5743939",
"0.5743449",
"0.5723442... | 0.73193306 | 3 |
creates example data set | def make_data(n,m):
I = range(1,n+1)
J = range(1,m+1)
x,y,w = {},{},{}
for i in I:
x[i] = random.randint(0,100)
y[i] = random.randint(0,100)
w[i] = random.randint(1,5)
return I,J,x,y,w | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_11_dataset(self, example):\n example.zonenumbers_i = np.array([100, 200, 300])\n example.groupnames_g = np.array(['Female', 'Male'], dtype='O')\n example.create_ds()\n assert isinstance(example.ds, xr.Dataset)\n for attr, dtype in example.dtypes.items():\n dat... | [
"0.71696997",
"0.71209043",
"0.6922489",
"0.6922238",
"0.68418807",
"0.67209417",
"0.6698017",
"0.6695592",
"0.6692311",
"0.65975165",
"0.65809387",
"0.65769386",
"0.6525955",
"0.652534",
"0.6509908",
"0.6502669",
"0.64971864",
"0.6494189",
"0.6483646",
"0.64835423",
"0.64834... | 0.0 | -1 |
Indicator function for nonnegative values. | def fun(self, x):
if np.any(x < 0):
return np.inf
else:
return 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_nonpositive(self, a):\n return a <= 0",
"def is_nonnegative(self, a):\n return a >= 0",
"def sign(n):\n return (n > 0) - (n < 0)",
"def missing_values(dataset, inverse=False):\n zero = numpy.int8(0)\n one = numpy.int8(1)\n if inverse:\n converter = numpy.vectorize(lamb... | [
"0.7022498",
"0.6900396",
"0.6867466",
"0.67449296",
"0.66644",
"0.66473335",
"0.6636995",
"0.663636",
"0.6529282",
"0.6483808",
"0.6482244",
"0.64730865",
"0.644649",
"0.6416464",
"0.63978416",
"0.6360335",
"0.6339245",
"0.6329919",
"0.6308594",
"0.6287483",
"0.6286171",
"... | 0.65219015 | 9 |
Indicator function for nonpositive values. | def fun(self, x):
if np.any(x > 0):
return np.inf
else:
return 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_nonpositive(self, a):\n return a <= 0",
"def missing_values(dataset, inverse=False):\n zero = numpy.int8(0)\n one = numpy.int8(1)\n if inverse:\n converter = numpy.vectorize(lambda x:\n zero if (x == 0.0 and math.copysign(1, x) < 0.0) else one)\n ... | [
"0.71385205",
"0.68249905",
"0.6750668",
"0.6607781",
"0.6562009",
"0.65373284",
"0.6502175",
"0.64506906",
"0.6417179",
"0.6360618",
"0.63361377",
"0.63188004",
"0.6315432",
"0.6315432",
"0.63064057",
"0.62635255",
"0.6253365",
"0.62266886",
"0.62233937",
"0.6220108",
"0.621... | 0.65197897 | 6 |
Indicator for positive semidefinite matrices as Stokes params. | def fun(self, x_s):
i, q, u, v = [x_s[..., k] for k in range(4)]
if np.min(i) < -np.spacing(np.max(i)):
# negative intensity (trace of 2x2 block), obviously not PSD
return np.inf
else:
i_pol = np.sqrt(q ** 2 + u ** 2 + v ** 2)
i_diff = i - i_pol
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_pos_semidef(X, positive_definite=False):\n if not positive_definite:\n return np.all(np.linalg.eigvals(X) >= 0)\n else:\n return np.all(np.linalg.eigvals(X) > 0)",
"def spikingModel(wEE, wEI, wIE, wII, stim_e, stim_i,\n time=1000, dt=0.1, Vth=1.0, Vre=0.0,\n ... | [
"0.60279363",
"0.5501407",
"0.5483503",
"0.5460084",
"0.5439035",
"0.5437168",
"0.53763294",
"0.53041947",
"0.521203",
"0.5174137",
"0.51529044",
"0.5151613",
"0.5146633",
"0.5141662",
"0.51396877",
"0.513506",
"0.51329935",
"0.5092792",
"0.5071337",
"0.5069647",
"0.5063792",... | 0.0 | -1 |
Boolean array giving the zero locations. | def z(self):
return self._z | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_data(self):\n return np.zeros(self.shape, dtype=bool)",
"def nonzero_values(a):\r\n return a.flatten()[flatnonzero(a)]",
"def move_zeros(array):\n zero_count = [x for x in array if x is not False].count(0)\n output = [str(x) if type(x) == bool else x for x in array]\n for i in range... | [
"0.67262363",
"0.6542561",
"0.64471185",
"0.6389665",
"0.63440216",
"0.6322823",
"0.6299878",
"0.6297497",
"0.6250785",
"0.6244633",
"0.6223548",
"0.62033176",
"0.6195846",
"0.61813116",
"0.61802924",
"0.61591893",
"0.61591893",
"0.6127544",
"0.61229503",
"0.6101888",
"0.6087... | 0.0 | -1 |
Returns the index page | def index():
return "Hello HBNB!" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index():\n\n return {\n 'page': 'index',\n }",
"def get_index():\n return render_template('index.html')",
"def index():\n return render_template('pages/index.html', isNav=True)",
"def show_index_page():\n\n return render_template('index.html')",
"def index_page():\n\n return re... | [
"0.83766484",
"0.75777495",
"0.75127184",
"0.737066",
"0.7351426",
"0.7351426",
"0.7351426",
"0.73428637",
"0.7339814",
"0.72751635",
"0.7265929",
"0.7253839",
"0.7229421",
"0.7229421",
"0.7229064",
"0.7212475",
"0.72124636",
"0.72092193",
"0.7191566",
"0.7191566",
"0.7178178... | 0.0 | -1 |
r"""Initializes a GeneralizedLinearPath instance. | def __init__(
self,
feature_map: FeatureMap,
weight: Union[Parameter, Tensor],
bias_module: Optional[Module] = None,
input_transform: Optional[TInputTransform] = None,
output_transform: Optional[TOutputTransform] = None,
):
super().__init__()
self.feat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, space):\n super().__init__(space=space, linear=False, grad_lipschitz=2)",
"def __init__(self, linearExpression):\n LinearExpression.__init__(self)\n\n self.linearExpression = linearExpression",
"def __init__(self, linearExpression):\n LinearExpression.__init__(sel... | [
"0.62436974",
"0.6240675",
"0.6240675",
"0.6202698",
"0.6150635",
"0.6139009",
"0.60582954",
"0.602496",
"0.59993076",
"0.5980701",
"0.59527546",
"0.5931877",
"0.5898659",
"0.5898152",
"0.584744",
"0.5839741",
"0.5827139",
"0.58236396",
"0.58129513",
"0.58129513",
"0.57924896... | 0.0 | -1 |
Sets the device_id of this GetSesameResponse. | def device_id(self, device_id):
if device_id is None:
raise ValueError("Invalid value for `device_id`, must not be `None`") # noqa: E501
self._device_id = device_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_id(self, device_id):\n\n self._device_id = device_id",
"def device_id(self, device_id):\n\n self._device_id = device_id",
"def setDeviceID(self, id, unitCode=0):\n resp = self.XAPCommand('DID', id, unitCode=unitCode)\n return int(resp)",
"def set_device(self, device):\n... | [
"0.700931",
"0.700931",
"0.60126156",
"0.5829542",
"0.5720839",
"0.55810153",
"0.5542617",
"0.5510767",
"0.54938644",
"0.54418683",
"0.5405906",
"0.5380714",
"0.53777826",
"0.5288224",
"0.52558506",
"0.52358085",
"0.5233379",
"0.5224354",
"0.52087706",
"0.51717687",
"0.515321... | 0.62145525 | 2 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, GetSesameResponse):
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.8457167",
"0.8393036",
"0.81455255",
"0.8139734",
"0.81333447",
"0.8094964",
"0.8093362",
"0.8093362",
"0.8093362",
"0.80863476",
"0.80863476",
"0.8077286",
"0.8077286",
"0.806682"
] | 0.0 | -1 |
Returns user group as a string | def get_user_group(username):
sql = "SELECT user_group " \
"FROM users " \
"WHERE username=:username"
result = db.session.execute(sql, {"username": username})
user = result.fetchone()
if user is None:
return ""
user_group = user[0]
return user_group | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_grp_string(self):\n\n grp = self.get_grp()\n\n if grp == -1:\n\n return \"\"\n\n return \"grp \" + str(grp)",
"def __repr__(self):\n return str(self.group)",
"def group(self) -> str:\n return pulumi.get(self, \"group\")",
"def get_group_name(self):\n ... | [
"0.7658941",
"0.72906244",
"0.72261673",
"0.71505326",
"0.70787483",
"0.70524406",
"0.69846094",
"0.6967443",
"0.69551086",
"0.69551086",
"0.69551086",
"0.69551086",
"0.6947939",
"0.68521893",
"0.6828671",
"0.6799733",
"0.6728261",
"0.6724673",
"0.6624013",
"0.6540505",
"0.65... | 0.6563194 | 19 |
returns true if username is 320 characters long and consists of letters and numbers | def validate_username(username):
if re.match(r"^[a-zA-Z0-9åäöÅÄÖ]{3,20}$", username):
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_valid_username(username):\n import string\n\n if not (len(username) > 2 and len(username) < 65):\n return False\n if not username[0] in string.letters:\n return False\n m = re_valid_username.match(username)\n return m.start() == 0 and m.end() == len(username)",
"def valid_user... | [
"0.8129229",
"0.802046",
"0.7856697",
"0.78465015",
"0.7807625",
"0.7737749",
"0.77061975",
"0.7577953",
"0.75188816",
"0.74485296",
"0.74175674",
"0.7263239",
"0.72422117",
"0.7236359",
"0.7226702",
"0.7120683",
"0.71028626",
"0.70918745",
"0.7064604",
"0.70298004",
"0.69451... | 0.79397225 | 2 |
Checking string p if it is a number | def only_int(p):
if p.isdigit():
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_number(s):\r\n try:\r\n int(s)\r\n return True\r\n except ValueError:\r\n return False",
"def is_valid_numeric(inString):\r\n return is_int(inString) or is_float(inString)",
"def is_number(s):\n try:\n int(s)\n return True\n except ValueError:\n r... | [
"0.7745314",
"0.77070385",
"0.77024615",
"0.7669912",
"0.76215434",
"0.7618651",
"0.7612965",
"0.7612965",
"0.7612965",
"0.76081437",
"0.75851744",
"0.7576033",
"0.7553714",
"0.7505941",
"0.74994946",
"0.74663144",
"0.74628717",
"0.7444951",
"0.7428649",
"0.74080735",
"0.7373... | 0.7694845 | 3 |
Returns UTC offset for given time zone in seconds | def _get_utcoffset(self, tzname):
# SQL Server has no built-in support for tz database
# see http://blogs.msdn.com/b/sqlprogrammability/archive/2008/03/18/using-time-zone-data-in-sql-server-2008.aspx
zone = pytz.timezone(tzname)
# no way to take DST into account at this point
now... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_utc_offset():\n timedelta = datetime.datetime.now() - datetime.datetime.utcnow()\n # XXX: `return -time.timezone`?\n return timedelta.total_seconds()",
"def get_tz_offset_seconds() -> float:\n import time\n import datetime\n tval = time.time()\n utc_offset = (datetime.datetime.fromti... | [
"0.77134335",
"0.7620696",
"0.73021644",
"0.7288033",
"0.71969664",
"0.71927583",
"0.71321934",
"0.69315094",
"0.67964756",
"0.67882025",
"0.6731522",
"0.6702315",
"0.66063005",
"0.656698",
"0.65348405",
"0.64356804",
"0.6358015",
"0.63446474",
"0.6288238",
"0.62134916",
"0.6... | 0.6688498 | 12 |
Returns a quoted version of the given table, index or column name. Does not quote the given name if it's already been quoted. | def quote_name(self, name):
if name.startswith(self.left_sql_quote) and name.endswith(self.right_sql_quote):
return name # Quoting once is enough.
return '%s%s%s' % (self.left_sql_quote, name, self.right_sql_quote) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quote_dotted(\n name: Union[\"quoted_name\", str], quote: functools.partial\n) -> Union[\"quoted_name\", str]:\n\n if isinstance(name, quoted_name):\n return quote(name)\n result = \".\".join([quote(x) for x in name.split(\".\")])\n return result",
"def sql_for_tablespace(self, tablespace,... | [
"0.60627484",
"0.5968109",
"0.5906213",
"0.5800245",
"0.5722166",
"0.5646786",
"0.55683017",
"0.5497559",
"0.54963726",
"0.54942673",
"0.54909176",
"0.5466382",
"0.5427123",
"0.54071015",
"0.54071015",
"0.5401644",
"0.53815466",
"0.5361875",
"0.53616196",
"0.5352527",
"0.5338... | 0.66145134 | 0 |
Prepares a value for use in a LIKE query. | def prep_for_like_query(self, x):
# http://msdn2.microsoft.com/en-us/library/ms179859.aspx
return smart_text(x).replace('%', '\%').replace('_', '\_') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_prep_lookup(self, lookup_type, value):\n\n if hasattr(value, 'prepare'):\n return value.prepare()\n if hasattr(value, '_prepare'):\n return value._prepare()\n\n if lookup_type in ('indexexact', 'distinct', 'slice',\\\n 'contains', 'containedby',... | [
"0.62387824",
"0.62335867",
"0.60099083",
"0.57378113",
"0.5714425",
"0.5617409",
"0.5498217",
"0.5473074",
"0.5430203",
"0.5371442",
"0.5293164",
"0.52836585",
"0.5271929",
"0.52164465",
"0.51479703",
"0.5127178",
"0.5091327",
"0.5089108",
"0.50791",
"0.50724685",
"0.5052547... | 0.6611588 | 0 |
Transform a time value to an object compatible with what is expected by the backend driver for time columns. | def adapt_timefield_value(self, value):
if value is None:
return None
# Expression values are adapted by the database.
if hasattr(value, 'resolve_expression'):
return value
# SQL Server doesn't support microseconds
if isinstance(value, string_type... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_to_time(value):\n if isinstance(value, datetime.time):\n return value\n elif isinstance(value, str):\n return datetime.time.fromisoformat(value)\n else:\n return datetime.time(value)",
"def dehydrate_time(value):\n if isinstance(value, ... | [
"0.7205994",
"0.7059694",
"0.7051511",
"0.67561054",
"0.6677156",
"0.6417766",
"0.63727784",
"0.63563097",
"0.6295769",
"0.6213761",
"0.6160596",
"0.6135675",
"0.6091793",
"0.60568434",
"0.60233325",
"0.5982329",
"0.5982329",
"0.59743375",
"0.5955505",
"0.5954497",
"0.5911527... | 0.7745255 | 0 |
Transform a decimal.Decimal value to an object compatible with what is expected by the backend driver for decimal (numeric) columns. | def adapt_decimalfield_value(self, value, max_digits=None, decimal_places=None):
strvalue = super().adapt_decimalfield_value(value, max_digits, decimal_places)
return Decimal(strvalue) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_decimal(value: t.Any) -> Decimal:\n return Decimal(value)",
"def to_python(self, value):\n if not value or value is models.fields.NOT_PROVIDED:\n value = None\n elif not isinstance(value, Decimal):\n try:\n value = Decimal(value)\n exce... | [
"0.7969698",
"0.7188288",
"0.71392053",
"0.71392053",
"0.6939672",
"0.66969055",
"0.6430194",
"0.6353258",
"0.6316882",
"0.62632227",
"0.6101107",
"0.60049605",
"0.59809107",
"0.5948554",
"0.59253144",
"0.5916739",
"0.59030634",
"0.5854302",
"0.57844627",
"0.57636404",
"0.574... | 0.6072684 | 11 |
From position in the projection plane to image array index (%s). | def xy2ij(self, x, y=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def location_of(self, index):\n img_w, img_h = self.conv_dims()\n \n x = (index % img_w) * self.stride\n y = (index // img_w) * self.stride\n \n return x, y",
"def pointToWorld( nImageX, nImageY, rDepth, rMaxX = 320, rMaxY = 240, rFieldOfViewX = 60, rFieldOfViewY = 40 ):\n ... | [
"0.61856717",
"0.59937155",
"0.59355927",
"0.5910584",
"0.58417475",
"0.5773766",
"0.5500559",
"0.54853505",
"0.5481735",
"0.5467423",
"0.5447157",
"0.5437867",
"0.54293275",
"0.54237473",
"0.5423516",
"0.54198277",
"0.54067165",
"0.53824925",
"0.5375318",
"0.5371573",
"0.536... | 0.0 | -1 |
Computes minimum of voltage. | def Vmin(V):
return np.min(V) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_min_cell_voltage(self):\n summary = \" \".join(self.get_summary().split())\n pattern = '\\$.... .. .*? .*? .*? (.*?) .*? . .*? .*? . . . .*?'\n minv = float(re.findall(pattern,summary).pop())\n return minv",
"def hemt_gate_min_voltage(self):\n return self._hemt_gate_min... | [
"0.75651085",
"0.72486717",
"0.7138131",
"0.68351734",
"0.6807372",
"0.6727665",
"0.66549414",
"0.665015",
"0.65709823",
"0.64375454",
"0.64165014",
"0.6410586",
"0.6393397",
"0.63890225",
"0.63823736",
"0.63823736",
"0.6381286",
"0.6368098",
"0.63344324",
"0.63281834",
"0.63... | 0.7622577 | 0 |
Computes voltage drop using voltage trace. | def voltage_drop(V):
vmin = Vmin(V)
resting = Vrest(V)
return vmin - resting | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def voltage_drop_abf(abf, epoch_start):\n vmin = Vmin_abf(abf, epoch_start)\n resting = Vrest_abf(abf, epoch_start)\n return vmin - resting",
"def drop(u, v):\n return u - v * (u.dot(v) / v.dot(v))",
"def dvdt(self, args: List[float]) -> float:\n v, h_nav, n_kvhh, h_kva, m_kvsi, s_ampar, _, ... | [
"0.64880204",
"0.5908261",
"0.5774052",
"0.5733856",
"0.56801546",
"0.5569362",
"0.55316657",
"0.55160147",
"0.5500494",
"0.5499955",
"0.54843986",
"0.5478288",
"0.5471517",
"0.5442814",
"0.5422475",
"0.5381904",
"0.5378291",
"0.5374405",
"0.5367712",
"0.5356332",
"0.5355079"... | 0.75108176 | 0 |
Computes the time constant (usually called tau) using a fit to an exponential function. | def time_constant(t, V):
a_init = 1
b_init = -100
c_init = V[-1]
popt, pcov = curve_fit(func_exp, t, V, p0=[a_init, b_init, c_init],
bounds=(-np.inf, np.inf))
Vpred = np.zeros(len(t))
for i in range(len(t)):
Vpred[i] = func_exp(t[i], popt[0], popt[1], popt[2]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exp(t,tau):\n return np.exp(-t/tau)",
"def exp_func(x, initial, lifetime):\n return initial * np.exp(-x/lifetime)",
"def time_constant_abf(abf, epoch_start):\n p0 = abf.sweepEpochs.p1s[epoch_start]\n p1 = abf.sweepEpochs.p1s[epoch_start + 1]\n\n t = abf.sweepX[p0:p1] - abf.sweepX[p0]\n V ... | [
"0.7259245",
"0.6025949",
"0.59778154",
"0.59671766",
"0.59623075",
"0.5949129",
"0.5861898",
"0.5844591",
"0.58408463",
"0.58236575",
"0.58123475",
"0.58123475",
"0.57859",
"0.5768751",
"0.5766582",
"0.57458115",
"0.57265747",
"0.56759924",
"0.56325513",
"0.5629962",
"0.5628... | 0.69503814 | 1 |
Computes spike amplitude from voltage trace V and spike index t_spike. | def spike_amplitude(V, t_spike):
# handle no spike found
if t_spike is None:
return None
Vmax = V[t_spike]
Vmin = np.min(V[t_spike+1:t_spike+500])
return Vmax - Vmin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spike_amplitude_abf(abf, t_spike, epoch_start=3):\n p0 = abf.sweepEpochs.p1s[epoch_start]\n V = abf.sweepY[p0:-1]\n\n return spike_amplitude(V, t_spike)",
"def get_spike_frequency_adaptation(t, V):\n # check that there are 2 spikes minimum\n intervals = interspike_intervals(t, V)\n raise_if... | [
"0.6659725",
"0.65162295",
"0.64531356",
"0.64009815",
"0.63487196",
"0.60847944",
"0.59346",
"0.5815772",
"0.5731569",
"0.56815606",
"0.5331351",
"0.5330158",
"0.53281474",
"0.5322849",
"0.5302969",
"0.52671605",
"0.52634954",
"0.52188766",
"0.5206136",
"0.51838505",
"0.5182... | 0.8268467 | 0 |
Computes interspike intervals for time t and voltage trace V. If there are N spikes, then there will be N1 intervals. | def interspike_intervals(t, V):
# first pass -- get number of spikes and locations
spike_inds = all_spike_ind(t, V)
n_spikes = len(spike_inds)
if n_spikes == 0:
return []
# generate array to hold time intervals
intervals = np.zeros((n_spikes-1), dtype=float)
for ti in range(1, n_sp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_spike_ind(t, V):\n spikes, _ = find_peaks(V, [1, 1000])\n\n return spikes",
"def analyzeIV(t, V, I, tw, thr):\n ntraces = numpy.shape(V)[0]\n vss = []\n vmin = []\n vm = []\n ic = []\n nspikes = []\n ispikes = []\n tmin = []\n fsl = []\n fisi = []\n ... | [
"0.6780872",
"0.66757673",
"0.6342778",
"0.61360574",
"0.6082667",
"0.6070609",
"0.597286",
"0.58500314",
"0.57331735",
"0.5723254",
"0.5691698",
"0.5659111",
"0.5644936",
"0.56319046",
"0.55685604",
"0.55277026",
"0.54763794",
"0.5443054",
"0.53831714",
"0.53791595",
"0.5372... | 0.8620648 | 0 |
Creates a new Keras model. | def create_model(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_model():\n\n # Create a sequential model (a simple NN is created) adding a softmax activation at the end with 10 units:\n model = Sequential()\n model.add(Dense(units=128, activation=\"relu\", input_shape=(784,)))\n model.add(Dense(units=128, activation=\"relu\"))\n model.add(Dense(units=... | [
"0.78584814",
"0.78223974",
"0.7430939",
"0.73827416",
"0.7376995",
"0.73478806",
"0.7236016",
"0.7204708",
"0.718715",
"0.7143969",
"0.7120544",
"0.7114542",
"0.7078098",
"0.70692307",
"0.7053473",
"0.7045293",
"0.7043199",
"0.6997166",
"0.6983474",
"0.6969486",
"0.6967505",... | 0.0 | -1 |
The status of the resource. | def status(self) -> str:
return pulumi.get(self, "status") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status(self):\n return self._get(path='status')",
"def status(self):\n\t\treturn self._status",
"def status(self):\n return self.status",
"def status(self):\r\n return self._status",
"def status(self):\r\n return self._status",
"def status(self):\n return self.__sta... | [
"0.863125",
"0.85223794",
"0.85106975",
"0.8509618",
"0.8509618",
"0.8481368",
"0.8481368",
"0.8478021",
"0.8478021",
"0.8478021",
"0.8478021",
"0.8478021",
"0.8478021",
"0.8478021",
"0.8478021",
"0.8478021",
"0.8478021",
"0.8478021",
"0.8478021",
"0.8478021",
"0.8478021",
... | 0.8318795 | 67 |
The Eflo VPD ID. | def vpd_id(self) -> str:
return pulumi.get(self, "vpd_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id(self):\n return self.vdu_info.vdu_id",
"def vat_id(self) -> str:\n return self._vat_id",
"def vat_id(self):\n return self._vat_id",
"def id(self):\n return int(self.__nvXxPr.cNvPr.get('id'))",
"def vm_id(self):\n return self.vm_info.get('id', 'Error retrieving ID')... | [
"0.7936278",
"0.7136131",
"0.6907432",
"0.6904606",
"0.6881559",
"0.68572456",
"0.6835941",
"0.6706659",
"0.6685424",
"0.6678652",
"0.6605415",
"0.66002005",
"0.6591701",
"0.65612185",
"0.65474844",
"0.6488551",
"0.64564127",
"0.6436533",
"0.6436533",
"0.6436533",
"0.6436533"... | 0.85733056 | 1 |
The id of the vpd. | def id(self) -> str:
return pulumi.get(self, "id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vpd_id(self) -> str:\n return pulumi.get(self, \"vpd_id\")",
"def vpd_id(self) -> str:\n return pulumi.get(self, \"vpd_id\")",
"def id(self):\n return self.vdu_info.vdu_id",
"def vat_id(self) -> str:\n return self._vat_id"
] | [
"0.89650935",
"0.89650935",
"0.8721102",
"0.7705356"
] | 0.0 | -1 |
The id of the vpd. | def vpd_id(self) -> str:
return pulumi.get(self, "vpd_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id(self):\n return self.vdu_info.vdu_id",
"def vat_id(self) -> str:\n return self._vat_id",
"def id(self) -> str:\n return pulumi.get(self, \"id\")",
"def id(self) -> str:\n return pulumi.get(self, \"id\")",
"def id(self) -> str:\n return pulumi.get(self, \"id\")",
... | [
"0.8721102",
"0.7705356",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"0.7478009",
"... | 0.89650935 | 0 |
The Name of the VPD. | def vpd_name(self) -> str:
return pulumi.get(self, "vpd_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_name(self):\n return self.nvPublic.get_name()",
"def name(self):\n return self.__nvXxPr.cNvPr.get('name')",
"def get_name():\n return \"SVMd+\"",
"def getVhdlName(self):\n return self.name.replace(TOP_NODE_NAME + '.', '').replace('.', '_')",
"def virtual_name(self) -> Op... | [
"0.77821183",
"0.7476595",
"0.73026973",
"0.7113421",
"0.7092685",
"0.7092685",
"0.7085843",
"0.707482",
"0.707482",
"0.707482",
"0.707482",
"0.707482",
"0.707482",
"0.707482",
"0.707482",
"0.707482",
"0.707482",
"0.707482",
"0.707482",
"0.707482",
"0.707482",
"0.707482",
... | 0.91165507 | 0 |
Sets the axis2 limits | def set_axis2_limits(self, start, end):
if start > end:
raise ValueError("Start point over end for this view.")
self.axis2_limits = start, end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def adjust_ylimits(self, ylim1, ylim2):\n self.axplot.set_ylim(ylim1, ylim2)\n self.fig.canvas.draw()\n return",
"def setlimits(self, Xlim=[], Ylim=[]):\n self.data['Xmin'] = Xlim[0]\n self.data['Xmax'] = Xlim[1]\n self.data['Ymin'] = Ylim[0]\n self.data['Ymax'] =... | [
"0.7679957",
"0.7137881",
"0.6968403",
"0.6968129",
"0.69276756",
"0.66304326",
"0.6625808",
"0.65875417",
"0.6522321",
"0.64404905",
"0.6419612",
"0.6401575",
"0.63996685",
"0.63885385",
"0.63736707",
"0.62931263",
"0.6214984",
"0.6184074",
"0.61167693",
"0.6107988",
"0.6054... | 0.82910025 | 0 |
Creates a _Head for multi class single label classification. The Head uses softmax cross entropy loss. | def _multi_class_head(n_classes,
label_name=None,
weight_column_name=None,
enable_centered_bias=False,
head_name=None,
thresholds=None,
metric_class_ids=None):
if (n_classes is None) or ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _multi_label_head(n_classes,\n label_name=None,\n weight_column_name=None,\n enable_centered_bias=False,\n head_name=None,\n thresholds=None,\n metric_class_ids=None):\n if n_classes <... | [
"0.7676755",
"0.6761584",
"0.66569084",
"0.6371564",
"0.6371564",
"0.6371564",
"0.6289213",
"0.6183466",
"0.6155606",
"0.61344504",
"0.59884363",
"0.5926488",
"0.58939695",
"0.5892835",
"0.5892204",
"0.58319116",
"0.58294505",
"0.58045626",
"0.5804537",
"0.58013827",
"0.57893... | 0.7576061 | 1 |
Creates a _Head for multi label classification. The Head uses softmax cross entropy loss. | def _multi_label_head(n_classes,
label_name=None,
weight_column_name=None,
enable_centered_bias=False,
head_name=None,
thresholds=None,
metric_class_ids=None):
if n_classes < 2:
rais... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _multi_class_head(n_classes,\n label_name=None,\n weight_column_name=None,\n enable_centered_bias=False,\n head_name=None,\n thresholds=None,\n metric_class_ids=None):\n if (n_classes ... | [
"0.7336204",
"0.7173082",
"0.6579786",
"0.6405291",
"0.6405291",
"0.6405291",
"0.63451236",
"0.6327597",
"0.6323638",
"0.6302445",
"0.61321354",
"0.60909694",
"0.6047005",
"0.6039839",
"0.603225",
"0.59006226",
"0.5891783",
"0.58525467",
"0.58370924",
"0.5797899",
"0.5795075"... | 0.76452595 | 0 |
Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'. An empty string is returned if the value cannot be determined. | def system():
return uname().system | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(cls):\n\n system = platform.system()\n\n # Apply system map\n if system in NAME_MAP:\n system = NAME_MAP[system]\n\n return system",
"def _get_osname():\n osname = sys.platform.lower()\n if osname == \"linux2\":\n osname = \"linux\"\n return osname"... | [
"0.8345913",
"0.82425404",
"0.82387227",
"0.8031345",
"0.7995693",
"0.7934802",
"0.7910757",
"0.7879968",
"0.7818427",
"0.7790467",
"0.77134573",
"0.7703032",
"0.76673216",
"0.7580333",
"0.7575576",
"0.752049",
"0.750987",
"0.750987",
"0.74547154",
"0.74217063",
"0.7413599",
... | 0.7032149 | 42 |
Returns the system's release, e.g. '2.2.0' or 'NT' An empty string is returned if the value cannot be determined. | def release():
return uname().release | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_os_release():\n if platform.linux_distribution()[0]:\n return \" \".join(platform.linux_distribution())\n elif platform.mac_ver()[0]:\n return \"%s %s\" % (platform.mac_ver()[0], platform.mac_ver()[2])\n else:\n return \"Unknown\"",
"def systemversion... | [
"0.7696313",
"0.72571176",
"0.71684474",
"0.6917526",
"0.6874673",
"0.6845623",
"0.68387914",
"0.68337727",
"0.67974937",
"0.6603752",
"0.66011405",
"0.65965104",
"0.65777576",
"0.6561211",
"0.65531766",
"0.652843",
"0.6520987",
"0.65073013",
"0.6501761",
"0.64859146",
"0.648... | 0.61746633 | 55 |
Returns the system's release version, e.g. '3 on degas' An empty string is returned if the value cannot be determined. | def version():
return uname().version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_version():\n vers = [\"%(major)i.%(minor)i\" % __version_info__, ]\n\n if __version_info__['micro']:\n vers.append(\".%(micro)i\" % __version_info__)\n if __version_info__['releaselevel'] != 'final':\n vers.append('%(releaselevel)s' % __version_info__)\n return ''.join(vers)",
"... | [
"0.7700443",
"0.748564",
"0.7469442",
"0.7467798",
"0.7450048",
"0.7437787",
"0.73153335",
"0.72960675",
"0.72951806",
"0.7287888",
"0.727192",
"0.7207584",
"0.7207432",
"0.7150606",
"0.71268046",
"0.711503",
"0.71078646",
"0.70728964",
"0.7043298",
"0.7041374",
"0.70371467",... | 0.6969386 | 36 |
Returns the machine type, e.g. 'i386' An empty string is returned if the value cannot be determined. | def machine():
return uname().machine | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def machine_type(self):\n\n return self._machine_type",
"def machine():\n mach = platform.machine()\n if mach.startswith('arm'):\n return 'arm'\n else:\n # Assume x86/x86_64 machine.\n return None",
"def get_arch():\n arch = platform.machine()\n if arch == \"i686\":\n... | [
"0.78806776",
"0.74272287",
"0.6863402",
"0.66155016",
"0.6585546",
"0.6506986",
"0.6451411",
"0.639304",
"0.6352209",
"0.6330591",
"0.63259107",
"0.62924564",
"0.62879866",
"0.62659264",
"0.6250324",
"0.6235625",
"0.6233492",
"0.6228581",
"0.62004006",
"0.61914057",
"0.61738... | 0.689856 | 2 |
Returns a string identifying the Python implementation revision. For CPython this is the SCM revision from which the Python binary was built. If not available, an empty string is returned. | def python_revision():
return _sys_version()[3] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scm_revision(self):\n return self._data.get('scm_revision')",
"def get_revision(self) -> str:\n try:\n return self.cmd.rev_parse(verify=True, args=\"HEAD\", check_returncode=True)\n except exc.CommandError:\n return \"initial\"",
"def git_version():\n def _mini... | [
"0.70552576",
"0.68873155",
"0.68783283",
"0.6868426",
"0.6786601",
"0.6774839",
"0.67549443",
"0.6749165",
"0.6732668",
"0.67236096",
"0.6641747",
"0.66417205",
"0.6628212",
"0.6615963",
"0.6615776",
"0.66124874",
"0.65684795",
"0.6500381",
"0.64956903",
"0.64826936",
"0.647... | 0.76246005 | 0 |
Initialize OpenGraphIO instance with required app_id. | def __init__(self, options={}):
# Throw an error if app_id is not present in options dict
if 'app_id' not in options:
raise KeyError('app_id must be supplied when making requests to the API. Get a free app_id by signing up here: https://www.opengraph.io/')
self.app_id = options['app... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_app(self, app):\n\n self.client = _Minio(\n app.config.get('MINIO_URL'),\n access_key=app.config.get('MINIO_ACCESS_KEY'),\n secret_key=app.config.get('MINIO_SECRET_KEY'),\n session_token=app.config.get('MINIO_SESSION_TOKEN'),\n secure=app.confi... | [
"0.6192013",
"0.591972",
"0.5916776",
"0.58450603",
"0.5828755",
"0.5670039",
"0.5624333",
"0.5607981",
"0.5518373",
"0.5470376",
"0.54298455",
"0.5378591",
"0.5377341",
"0.5332416",
"0.533165",
"0.53151256",
"0.53076196",
"0.5303742",
"0.5291694",
"0.5271775",
"0.52678025",
... | 0.58796865 | 3 |
Yield successive nsized chunks from l. | def chunks(l, n):
lists = []
for i in range(n):
list1 = np.arange( i*l/n+1 , (i+1)*l/n+1 )
lists.append(list1)
return lists | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]",
"def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def get_chunks(self, ... | [
"0.8038813",
"0.79248375",
"0.7923423",
"0.7885103",
"0.78773195",
"0.7815877",
"0.77655786",
"0.77556044",
"0.77441615",
"0.7731815",
"0.77288336",
"0.772473",
"0.77028215",
"0.76889825",
"0.76889825",
"0.7664208",
"0.76570904",
"0.7655856",
"0.7655856",
"0.76458347",
"0.764... | 0.0 | -1 |
Override initializer for Grid, add queue to store boundary of fire | def __init__(self, grid_height, grid_width):
poc_grid.Grid.__init__(self, grid_height, grid_width)
self._fire_boundary = poc_queue.Queue() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_init(self, queue=None, **kwargs):\n self.queue = queue if queue else Queue()",
"def __init__(self) -> None:\n self._queue = []",
"def __init__(self):\n self._grid = [[None]]",
"def __init__(self):\n self.queue = Queue()",
"def __init__(self):\n self.queue = []",
... | [
"0.6840169",
"0.6793105",
"0.6785803",
"0.67526734",
"0.6619239",
"0.6619239",
"0.6619239",
"0.6619239",
"0.6619239",
"0.6547735",
"0.653138",
"0.653138",
"0.65267134",
"0.65173596",
"0.6460772",
"0.64500934",
"0.64124566",
"0.64041156",
"0.63946074",
"0.6388912",
"0.63709074... | 0.82730323 | 0 |
Returns if the given coordinates are inside this region | def inside(self, x: int, y: int, z: int, chunk: bool=False) -> bool:
factor = 32 if chunk else 512
rx = x // factor
rz = z // factor
return not (rx != self.x or rz != self.z or y < 0 or y > 255) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_inside(self, coordinates: tuple) -> bool:\n if len(coordinates) != 2:\n raise IndexError(\"Coordinates consist of x and y\")\n x, y = coordinates\n if (self.MIN_X <= x <= self.MAX_X) and (self.MIN_Y <= y <= self.MAX_Y):\n return True\n else:\n ret... | [
"0.84541243",
"0.7661926",
"0.75449204",
"0.7480552",
"0.7462805",
"0.7387895",
"0.7338402",
"0.7321144",
"0.7318412",
"0.7318412",
"0.72889674",
"0.70857173",
"0.7080856",
"0.7079851",
"0.7062599",
"0.7041122",
"0.69965595",
"0.69764847",
"0.6963933",
"0.6961216",
"0.6957881... | 0.0 | -1 |
Merge from dict and/or iterable. | def merge(self, *args, **kwargs):
if args:
if len(args) != 1:
raise TypeError(f"update expected at most 1 argument, got {len(args)}")
arg = args[0]
if hasattr(arg, "keys"):
for k, v in arg.items():
merge(self, normalize({k: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _merge_dicts(*args):\n return reduce(lambda d, s: d.update(s) or d, args)",
"def _merge_dicts(*args):\n return reduce(lambda d, s: d.update(s) or d, args)",
"def merge(*dict_args):\n result = {}\n for dictionary in dict_args:\n result.update(dictionary)\n return result",
"def dict_mer... | [
"0.7188646",
"0.7179914",
"0.6967449",
"0.6895197",
"0.6890224",
"0.67972565",
"0.6599303",
"0.6599303",
"0.6599303",
"0.6599303",
"0.6599303",
"0.6599303",
"0.6577279",
"0.6577279",
"0.6567163",
"0.65555704",
"0.65321565",
"0.64989656",
"0.6496868",
"0.6493522",
"0.6493187",... | 0.6879342 | 5 |
Merge dict b into a recursively. If either dict has leaves that are nondicts, the leaf in dict b overwrites that in dict a. | def merge(a: dict, b: dict) -> dict:
return __merge(a, b) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _merge_a_into_b(a, b):\n if type(a) is not edict:\n return\n\n for k, v in a.items():\n # recursively merge dicts\n if type(v) is edict:\n try:\n b[k] = edict()\n _merge_a_into_b(a[k], b[k])\n except:\n print('Error u... | [
"0.8319601",
"0.8174002",
"0.80588746",
"0.80458677",
"0.7968708",
"0.77977437",
"0.77771854",
"0.77550876",
"0.76885587",
"0.76625067",
"0.7660665",
"0.76385546",
"0.76165384",
"0.7611907",
"0.76110893",
"0.7580659",
"0.7569589",
"0.7503111",
"0.7260632",
"0.71716815",
"0.71... | 0.7326641 | 18 |
creates a new population with population.evolve, sets the new population as the current and increment generation. After this the population in the previous generation is lost | def evolve_population(self, **options):
new_population = self.population.evolve(**options)
self.population = new_population
self.generation = new_population.generation_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_new_population(self):\n self.check_for_generation_cap()\n pop_container = list()\n for chromosome in self.population:\n partner = bm.select_partner(\n self.fitness_scores, self.population)\n child = bm.mutate(bm.crossover(chromosome, partner))\n ... | [
"0.7709369",
"0.7311488",
"0.7299069",
"0.7189038",
"0.7013157",
"0.6869076",
"0.67646176",
"0.6729715",
"0.66529423",
"0.66127074",
"0.66050977",
"0.65951574",
"0.65723693",
"0.6494388",
"0.6463658",
"0.6457739",
"0.64527386",
"0.64378035",
"0.642856",
"0.6409268",
"0.640652... | 0.78997153 | 0 |
To return the length of dataset | def __len__(self):
return len(self.list_dir) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __len__(self):\n return len(self.dataset)",
"def __len__(self):\n return self._dataset.size(dirs=self._dirs)",
"def __len__(self):\n return self.dataset.shape[0]",
"def data_count(self):\n return(len(self.data))",
"def __len__(self): \r\n length = len(self.data... | [
"0.8516907",
"0.84912366",
"0.8364447",
"0.8304318",
"0.8224745",
"0.8199259",
"0.80921394",
"0.80318046",
"0.7999765",
"0.79741806",
"0.7957206",
"0.7945299",
"0.79062647",
"0.78854144",
"0.7884208",
"0.7882316",
"0.7877013",
"0.7868715",
"0.785692",
"0.785692",
"0.7853347",... | 0.0 | -1 |
Function to create train and validation dataloaders Pytorch SUBSETRANDOMSAMPLER to create the trainval split | def get_dataloaders(data_dir,train_batch_size,val_batch_size,aug_flag):
# Create the dataset object.
transformed_dataset = PersonDataset(data_dir,False)
# dataloader for train and validation
validation_split = 0.2
shuffle_dataset = True
#random seed to keep the train-val split constant for infe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_loader(dataset, train_batch_size, validation_split=0.2):\n # number of samples in train and test set\n train_len = int(len(dataset) * (1 - validation_split))\n test_len = len(dataset) - train_len\n train_set, test_set = torch.utils.data.random_split(dataset, [train_len, test_len])\n # creat... | [
"0.7201771",
"0.71183455",
"0.7039381",
"0.70230645",
"0.7021642",
"0.69459516",
"0.6930882",
"0.6914037",
"0.6905554",
"0.6887354",
"0.6866528",
"0.68527347",
"0.6839723",
"0.6770282",
"0.6731235",
"0.671144",
"0.6705793",
"0.67056954",
"0.6657113",
"0.66413635",
"0.6580762"... | 0.6938299 | 6 |
Displays statistics on the most frequent times of travel. | def time_stats(month,day,data):
print('\nCalculating The Most Frequent Times of Travel...\n')
start_time = time.time()
#display the most common month
if month == 'none':
popular_month = data['month'].mode()[0]
popular_month_names= months[popular_month - 1]
print('Most Frequent M... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_stats(df):\n\n print('\\nDisplaying the statistics on the most frequent times of '\n 'travel...\\n')\n start_time = time.time()\n\n # display the most common month\n most_common_month = df['Month'].mode()[0]\n print('For the selected filter, the month with the most travels is: ' +\... | [
"0.80247396",
"0.80233026",
"0.7915788",
"0.78266186",
"0.7822246",
"0.78143597",
"0.77659196",
"0.7740343",
"0.773628",
"0.77344066",
"0.76867086",
"0.7668633",
"0.7651731",
"0.7644636",
"0.76399267",
"0.76367253",
"0.7625196",
"0.7623158",
"0.7612803",
"0.76002145",
"0.7583... | 0.70845896 | 84 |
Displays statistics on the most popular stations and trip. | def station_stats(data):
print('\nCalculating The Most Popular Stations and Trip...\n')
start_time = time.time()
# display most commonly used start station
popular_ss= data['Start Station'].mode()[0]
print('Most popular Start Station:', popular_ss)
# display most commonly used end station
po... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def station_stats(df):\n\n print('\\nCalculating The Most Popular Stations and Trip...\\n')\n start_time = time.time()\n\n # display most commonly used start station\n print(popular_start_station(df))\n\n # display most commonly used end station\n print(popular_end_station(df))\n\n # display m... | [
"0.7815675",
"0.7553417",
"0.74914914",
"0.74748665",
"0.7446617",
"0.7428588",
"0.74237514",
"0.74177027",
"0.7400495",
"0.7387161",
"0.7385634",
"0.73647535",
"0.735934",
"0.73566747",
"0.73548365",
"0.7351854",
"0.7351274",
"0.735057",
"0.73421645",
"0.7340198",
"0.7337384... | 0.7662213 | 1 |
Displays statistics on the total and average trip duration. | def trip_duration_stats(data):
print('\nCalculating Trip Duration...\n')
start_time = time.time()
# display total travel time
total_trip_time= data['Trip Duration'].sum()
print('The Total Travel Time is {} Hours'. format(total_trip_time/3600))
# display mean travel time
avg_trip= data['Trip ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trip_duration_stats(df):\n\n print('\\nCalculating Trip Duration...\\n')\n start_time = time.time()\n\n # TO DO: display total travel time\n total_time = df['Trip Duration'].sum()\n print(\"The total travel time was:\",str(total_time))\n\n # TO DO: display mean travel time\n mean_time = df... | [
"0.802504",
"0.8003995",
"0.7949535",
"0.7937111",
"0.793114",
"0.7926624",
"0.79147255",
"0.7913882",
"0.7907699",
"0.79052943",
"0.7900545",
"0.78914416",
"0.7889074",
"0.7886493",
"0.7884836",
"0.7884105",
"0.78822976",
"0.78735834",
"0.7868467",
"0.7866015",
"0.786337",
... | 0.8142488 | 0 |
The Api's constructor should be used to determine that a user is a valid admin. | def __init__(
self, user_id: int, data_access_layer: AbstractDataAccessLayer, logger
) -> None:
self._log = logger
self._dal = data_access_layer
self._user_id = user_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_admin_only(self, request):\r\n api_key = request.params.get(self.api_field, None)\r\n\r\n if request.user is None:\r\n user = self.user_fetcher(api_key=api_key)\r\n else:\r\n user = request.user\r\n\r\n if user is not None and user.is_admin:\r\n ... | [
"0.6775409",
"0.6525218",
"0.64528674",
"0.6393555",
"0.63561445",
"0.63389784",
"0.6282813",
"0.6251628",
"0.625011",
"0.6247186",
"0.6204685",
"0.6161153",
"0.61418045",
"0.6135568",
"0.61241984",
"0.611656",
"0.6112903",
"0.6088804",
"0.60850275",
"0.60775405",
"0.60775405... | 0.0 | -1 |
Draw line connecting points in two images. | def drawlines(self, img1, img2, lines, pts1, pts2, line_num=None):
if img1.ndim == 2:
img1 = cv2.cvtColor(img1, cv2.COLOR_GRAY2BGR)
img2 = cv2.cvtColor(img2, cv2.COLOR_GRAY2BGR)
r, c = img1.shape
else: # 3
r, c, _ = img1.shape
if line_num is not N... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drawlines(img1, img2, lines, pts1, pts2, color):\n r, c = img1.shape\n\n img1 = cv2.cvtColor(img1, cv2.COLOR_GRAY2BGR)\n img2 = cv2.cvtColor(img2, cv2.COLOR_GRAY2BGR)\n for r, pt1, pt2, co in zip(lines, pts1, pts2, color):\n x0, y0 = map(int, [0, -r[2] / r[1] ])\n x1, y1 = map(int, [c... | [
"0.774022",
"0.76846415",
"0.760362",
"0.7579236",
"0.7490336",
"0.73516387",
"0.726866",
"0.7152268",
"0.71128666",
"0.7055769",
"0.70415664",
"0.6848587",
"0.6828297",
"0.6784368",
"0.67540103",
"0.67409617",
"0.6721968",
"0.6714497",
"0.67031413",
"0.66801566",
"0.666988",... | 0.7423455 | 5 |
Get the year and month that start the FOLLOWING quarter. | def next_quarter_start(start_year:int, start_month:int, logger:lg.Logger = None) -> (int, int):
if logger:
logger.debug(F"start year = {start_year}; start month = {start_month}")
# add number of months for a Quarter
next_month = start_month + QTR_MONTHS
# use integer division to find out if the ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prev_quarter_boundaries(now):\n first_of_month = datetime.datetime(now.year, now.month, 1)\n\n # 75 days before the 1st is always in the previous quarter\n date_in_prev_q = first_of_month - datetime.timedelta(days=75)\n\n q_y = date_in_prev_q.year\n q_start_m = int((date_in_prev_q.month-1) / 3)*... | [
"0.7338803",
"0.7215223",
"0.7130429",
"0.7078758",
"0.6997591",
"0.690662",
"0.6612257",
"0.6464504",
"0.6396317",
"0.6276966",
"0.6186094",
"0.6084192",
"0.60228586",
"0.60228586",
"0.59833634",
"0.5969586",
"0.5969524",
"0.5858372",
"0.5796026",
"0.57202613",
"0.5689967",
... | 0.73292184 | 1 |
Get the date that ends the CURRENT quarter. | def current_quarter_end(start_year:int, start_month:int, logger:lg.Logger = None) -> date:
if logger:
logger.info(F"start year = {start_year}; start month = {start_month}")
end_year, end_month = next_quarter_start(start_year, start_month)
# end date is one day back from the start of the next period
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_quarter_end(x: Optional[Date] = None) -> Date:\n return get_quarter_start(x or get_today()) + relativedelta(months=+3, days=-1)",
"def last_quarter(today):\n quarter_date = today - relativedelta(months=1)\n while quarter_date.month % 3 != 0:\n quarter_date = quarter_date - relativedelta(m... | [
"0.8170659",
"0.7075324",
"0.6908958",
"0.6836984",
"0.66845727",
"0.6497959",
"0.64169747",
"0.62825865",
"0.62558955",
"0.6109868",
"0.6003702",
"0.60028976",
"0.60028976",
"0.5731196",
"0.5731196",
"0.57094854",
"0.57011384",
"0.5657141",
"0.5642791",
"0.5642791",
"0.55984... | 0.81834036 | 0 |
Sum values over given axis | def sum(self, axis: int = 0):
self.values = self.values.sum(axis=axis)
self.layers = [None]
return self.copy() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sum(tensor, axis=None):\n raise NotImplementedError",
"def sum(self, axis=None, keepdims=False):\n return F.Sum.apply(self, axis, keepdims)",
"def val_sum(self, axis = None):\n f = self.to_Poly()\n return f.val_sum(axis).to_PolyMesh(self.params)",
"def val_sum(self, axis = Non... | [
"0.7622369",
"0.7435083",
"0.742321",
"0.73752266",
"0.73362845",
"0.71223015",
"0.69976205",
"0.69614166",
"0.6825869",
"0.6780794",
"0.67299175",
"0.66423965",
"0.6566993",
"0.6565615",
"0.6412074",
"0.63147205",
"0.6298999",
"0.6296889",
"0.6282736",
"0.61980706",
"0.61980... | 0.8020687 | 0 |
KL divergence between two Diagonal Gaussians | def KLD_diag_gaussians_theano(mu, log_sigma, prior_mu, prior_log_sigma):
# return prior_log_sigma - log_sigma + 0.5 * ((2. * log_sigma).exp() + (mu - prior_mu).sqrt()) * math.exp(-2. * prior_log_sigma) - 0.5
return prior_log_sigma - log_sigma + 0.5 * ((2. * log_sigma).exp() + (mu - prior_mu)**2) * math.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def KL_divergence(model_1, model_2, samples):\n posterior_1 = create_posterior_object(model_1, samples)\n posterior_2 = create_posterior_object(model_2, samples)\n return posterior_1.KL(posterior_2)",
"def kl_divergence(a, b, normalize=True):\n a, b = np.array(a), np.array(b)\n\n x = np.linspace(\... | [
"0.71653867",
"0.713841",
"0.7070997",
"0.70418745",
"0.70069927",
"0.69288325",
"0.6903607",
"0.68908995",
"0.6868345",
"0.6842345",
"0.6838709",
"0.6815836",
"0.68020445",
"0.6741797",
"0.6715011",
"0.66926765",
"0.6688656",
"0.66130203",
"0.6605235",
"0.65749633",
"0.65749... | 0.62659675 | 45 |
Return a tupil represent the upper and lower values of the price range at the given index. If there is one dataseries then return the tupil (value, None) | def get_value_at_index(self, index, cc):
high = cc.dsget('high')
low = cc.dsget('low')
return (high[index], low[index]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_bounds(self, value = None, index = None):\n\n if self._data is None or 0 in self._data.shape:\n return (0.0, 0.0)\n\n if type(value) == types.IntType:\n if self.value_dimension == 0:\n maxi = nanmax(self._data[value, ::])\n mini = nanmin(sel... | [
"0.62020886",
"0.58060557",
"0.57509655",
"0.5696991",
"0.5630712",
"0.5555234",
"0.549801",
"0.5446549",
"0.54304546",
"0.5422337",
"0.54095584",
"0.5409541",
"0.5402449",
"0.53884476",
"0.5376142",
"0.5351813",
"0.5332987",
"0.53233963",
"0.5312718",
"0.53064764",
"0.529671... | 0.6731937 | 0 |
Return a tupil represent the upper and lower values of the price range at the given index. If there is one dataseries then return the tupil (value, None) | def get_value_at_index(self, index, cc):
tl = cc.dsget(self.title)
return (tl[index], None) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_value_at_index(self, index, cc):\n high = cc.dsget('high')\n low = cc.dsget('low')\n return (high[index], low[index])",
"def get_bounds(self, value = None, index = None):\n\n if self._data is None or 0 in self._data.shape:\n return (0.0, 0.0)\n\n if type(valu... | [
"0.6729211",
"0.62003016",
"0.5807488",
"0.5748795",
"0.5697325",
"0.56296307",
"0.5553952",
"0.54993695",
"0.54456204",
"0.5428383",
"0.54233044",
"0.5409726",
"0.54086286",
"0.5402972",
"0.53767973",
"0.53513384",
"0.5333265",
"0.53224176",
"0.5311461",
"0.5306173",
"0.5297... | 0.53866905 | 14 |
Set up the Anniversary sensor. | async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
if hass.config.time_zone is None:
_LOGGER.error("Timezone is not set in Home Assistant configuration")
return False
sensors = []
for device, device_config in config[CONF_SENSORS].items():
date_st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup(self):\n self.ae = None",
"def __init__(self):\n self._read_calibration_data()\n self.configure_sensor(\n TemperatureOversamplings.x08,\n PressureOversamplings.x16,\n HumidityOversamplings.x08,\n IIRFilterCoefficients.FC_003,\n ... | [
"0.58263314",
"0.5813658",
"0.5554764",
"0.55285585",
"0.55237263",
"0.5499565",
"0.54528546",
"0.5435289",
"0.5366579",
"0.5358487",
"0.53566223",
"0.5265668",
"0.5246712",
"0.52406555",
"0.5226664",
"0.5219182",
"0.52087945",
"0.520809",
"0.5206751",
"0.51675844",
"0.516474... | 0.56267613 | 2 |
Return the name of the sensor. | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._sensor.name",
"def get_sensor_name(self):\n return self.data[1]",
"def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'",
"def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso... | [
"0.91896784",
"0.9168378",
"0.890185",
"0.8770976",
"0.8511273",
"0.8479953",
"0.844435",
"0.8299758",
"0.8186503",
"0.8105667",
"0.8079737",
"0.8066149",
"0.8049647",
"0.7700968",
"0.7612295",
"0.7611456",
"0.7600605",
"0.7600605",
"0.7600605",
"0.75392073",
"0.75166553",
... | 0.0 | -1 |
Return the name of the sensor. | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._sensor.name",
"def get_sensor_name(self):\n return self.data[1]",
"def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'",
"def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso... | [
"0.91893077",
"0.91680735",
"0.89015853",
"0.87704504",
"0.85108286",
"0.8479386",
"0.8444154",
"0.8299531",
"0.81861234",
"0.8105427",
"0.8078726",
"0.80649143",
"0.804929",
"0.770065",
"0.76117194",
"0.7611273",
"0.76001656",
"0.76001656",
"0.76001656",
"0.75384134",
"0.751... | 0.0 | -1 |
Reshapes an input variable without copy. | def reshape(x, shape):
if x.shape == shape:
return chainer.as_variable(x)
y, = Reshape(shape).apply((x,))
return y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reshape(x, shape):\n return Reshape(shape)(x)",
"def reshape_var(var):\n dims = np.shape(var)\n nx = dims[0]\n ny = dims[1]\n nz = dims[2]\n\n var_2d = var.reshape(nx * ny, nz)\n return var_2d",
"def flatten_reshape(variable):\n dim = 1\n for d in variable.get_shape()[1:].as_list... | [
"0.7709701",
"0.73209643",
"0.709344",
"0.7088738",
"0.6896953",
"0.67383665",
"0.67162436",
"0.6679906",
"0.63716567",
"0.63189733",
"0.63096625",
"0.63083035",
"0.6296938",
"0.62918407",
"0.62788635",
"0.62673515",
"0.6232674",
"0.61841697",
"0.61799854",
"0.614986",
"0.612... | 0.78366554 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.