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 |
|---|---|---|---|---|---|---|
Sets the default_docker_pull_conn_name of this ModelDeploymentConfig. | def default_docker_pull_conn_name(self, default_docker_pull_conn_name: str):
self._default_docker_pull_conn_name = default_docker_pull_conn_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_docker_pull_conn_name(self) -> str:\n return self._default_docker_pull_conn_name",
"def __init__(self, default_docker_pull_conn_name: str=None, edge: EdgeConfig=None, enabled: bool=None, istio: ModelDeploymentIstioConfig=None, namespace: str=None, node_selector: Dict[str, str]=None, security: ... | [
"0.84254616",
"0.55292255",
"0.5336123",
"0.5293507",
"0.5142674",
"0.5068303",
"0.48983973",
"0.48697236",
"0.4856466",
"0.48131534",
"0.47866023",
"0.47749367",
"0.47717255",
"0.47625014",
"0.47428453",
"0.47107556",
"0.4710022",
"0.47075102",
"0.4658843",
"0.46469423",
"0.... | 0.88551044 | 0 |
Gets the enabled of this ModelDeploymentConfig. | def enabled(self) -> bool:
return self._enabled | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self):\n return self._get('enabled')",
"def Enabled(self):\n return self._get_attribute('enabled')",
"def getEnabled(self):\n if getattr(self, 'installedversion', None) != __version__ :\n return False\n return self.getField('enabled').get(self)",
"def enable... | [
"0.7746248",
"0.7719848",
"0.7535406",
"0.7435995",
"0.7432737",
"0.7399502",
"0.7389143",
"0.7389143",
"0.7389143",
"0.7389143",
"0.7389143",
"0.7389143",
"0.7389143",
"0.7389143",
"0.7359666",
"0.71243876",
"0.70244455",
"0.70244455",
"0.70244455",
"0.70244455",
"0.69624513... | 0.0 | -1 |
Sets the enabled of this ModelDeploymentConfig. | def enabled(self, enabled: bool):
self._enabled = enabled | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self, enabled):\n \n self._enabled = enabled",
"def enabled(self, enabled: ConfigNodePropertyBoolean):\n\n self._enabled = enabled",
"def enabled(self, enabled):\n\n self._enabled = enabled",
"def enabled(self, enabled):\n\n self._enabled = enabled",
"def set_... | [
"0.7248663",
"0.71387935",
"0.70724505",
"0.70724505",
"0.69929993",
"0.6833837",
"0.67233825",
"0.67026836",
"0.6563469",
"0.65600425",
"0.6413203",
"0.63482666",
"0.63482666",
"0.6344234",
"0.63182724",
"0.6228359",
"0.6227607",
"0.62253225",
"0.61653477",
"0.61653477",
"0.... | 0.68357074 | 6 |
Gets the istio of this ModelDeploymentConfig. | def istio(self) -> ModelDeploymentIstioConfig:
return self._istio | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def istio_config(self) -> Optional[pulumi.Input['IstioConfigArgs']]:\n return pulumi.get(self, \"istio_config\")",
"def istio(self, istio: ModelDeploymentIstioConfig):\n\n self._istio = istio",
"def istio(self) -> Optional[pulumi.Input['IstioServiceMeshArgs']]:\n return pulumi.get(self, \"... | [
"0.73593384",
"0.6531594",
"0.620108",
"0.5743052",
"0.5703557",
"0.5620045",
"0.55587363",
"0.5490922",
"0.5395375",
"0.53597784",
"0.5323701",
"0.5317941",
"0.5311393",
"0.5296685",
"0.52923477",
"0.5248192",
"0.52455664",
"0.5241475",
"0.52349424",
"0.52344584",
"0.5220209... | 0.89234275 | 0 |
Gets the namespace of this ModelDeploymentConfig. | def namespace(self) -> str:
return self._namespace | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_namespace(self) -> str:\n return self._namespace",
"def namespace (self) :\n\n return self.__namespace__",
"def namespace(self) -> str:\n return pulumi.get(self, \"namespace\")",
"def namespace(self):\n return self._namespace",
"def namespace(self) -> Optional[str]:\n ... | [
"0.762574",
"0.75126785",
"0.74409497",
"0.7383767",
"0.735147",
"0.735147",
"0.735147",
"0.73476845",
"0.71437764",
"0.71437764",
"0.71437764",
"0.71437764",
"0.71437764",
"0.6840388",
"0.6840388",
"0.6840388",
"0.6840388",
"0.6840388",
"0.6840388",
"0.6840388",
"0.6840388",... | 0.7394889 | 3 |
Gets the node_selector of this ModelDeploymentConfig. | def node_selector(self) -> Dict[str, str]:
return self._node_selector | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_selector(self) -> Optional[Mapping[str, str]]:\n return pulumi.get(self, \"node_selector\")",
"def node_selector(self) -> Optional[Mapping[str, str]]:\n return pulumi.get(self, \"node_selector\")",
"def node_selector(self) -> Optional[Mapping[str, str]]:\n return pulumi.get(self, ... | [
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.7283598",
"0.6511996",
"... | 0.6867125 | 20 |
Sets the node_selector of this ModelDeploymentConfig. | def node_selector(self, node_selector: Dict[str, str]):
self._node_selector = node_selector | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setNodeClassSelector(self, class_selecting_function: callable):\n self.node_class_selector = class_selecting_function",
"def node_topology(self, value: typing.Union[\"LabelSelector\", dict]):\n if isinstance(value, dict):\n value = typing.cast(\n LabelSelector,\n ... | [
"0.59218836",
"0.569872",
"0.5680826",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
"0.50933546",
... | 0.70624423 | 0 |
Gets the security of this ModelDeploymentConfig. | def security(self) -> ModelDeploymentSecurityConfig:
return self._security | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def security(self):\n return self._security",
"def getSecurity(self):\n return self.client.get(self.name +\"/_security\").getBodyData()",
"def security(self) -> pulumi.Output['outputs.ServiceSecurity']:\n return pulumi.get(self, \"security\")",
"def get_security(self):\n return self... | [
"0.72568935",
"0.6842479",
"0.68389845",
"0.6777885",
"0.67281944",
"0.67281944",
"0.65612465",
"0.6250893",
"0.60620743",
"0.6010349",
"0.58354753",
"0.57523096",
"0.57482284",
"0.57212514",
"0.5702481",
"0.5678222",
"0.5647934",
"0.5630482",
"0.5549222",
"0.55377376",
"0.55... | 0.89178824 | 0 |
Gets the toleration of this ModelDeploymentConfig. | def toleration(self) -> Dict[str, str]:
return self._toleration | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toleration_seconds(self) -> Optional[int]:\n return pulumi.get(self, \"toleration_seconds\")",
"def toleration_seconds(self) -> Optional[int]:\n return pulumi.get(self, \"toleration_seconds\")",
"def toleration_seconds(self) -> Optional[int]:\n return pulumi.get(self, \"toleration_seco... | [
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855",
"0.72057855"... | 0.7636541 | 0 |
Sets the toleration of this ModelDeploymentConfig. | def toleration(self, toleration: Dict[str, str]):
self._toleration = toleration | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toleration(self) -> Dict[str, str]:\n return self._toleration",
"def toleration_seconds(self) -> Optional[int]:\n return pulumi.get(self, \"toleration_seconds\")",
"def toleration_seconds(self) -> Optional[int]:\n return pulumi.get(self, \"toleration_seconds\")",
"def toleration_seco... | [
"0.6169692",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",
"0.59405327",... | 0.7666996 | 0 |
Creates and returns an argparse cmd line option parser. | def create_parser():
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_cli_parser() -> argparse.ArgumentParser:\n parser = argparse.ArgumentParser()\n parser.add_argument(\"config\", nargs=\"?\", help=\"path to yaml configuration file\")\n return parser",
"def command_line_argument_parser() -> argparse.ArgumentParser:\n parser = argparse.ArgumentParser(\n ... | [
"0.7847937",
"0.7658776",
"0.7658776",
"0.7504298",
"0.740726",
"0.7337485",
"0.73156756",
"0.72943306",
"0.7293867",
"0.72841084",
"0.72763413",
"0.7266336",
"0.72483706",
"0.72428226",
"0.72131354",
"0.7210605",
"0.7166211",
"0.71585286",
"0.7149656",
"0.7124617",
"0.711014... | 0.0 | -1 |
Setup an artifact directory for the currently running test. | def _test_path(self, request, artifact_dir):
self.test_path = artifact_dir / request.module.__name__ / request.node.name
self.test_path.mkdir(parents=True, exist_ok=True)
self.export_path = self.test_path / "sample_processed.nii.gz" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_build_tests(self):\n # Now copy the relative files\n self.cache_extra_test_sources(self.build_relpath)\n\n # Ensure the path exists since relying on a relative path at the\n # same level as the normal stage source path.\n mkdirp(self.install_test_root)",
"def setup(se... | [
"0.65177524",
"0.6446857",
"0.63140607",
"0.61522275",
"0.61379063",
"0.61324465",
"0.612271",
"0.60443467",
"0.60443467",
"0.60443467",
"0.60443467",
"0.60443467",
"0.60443467",
"0.60443467",
"0.60118425",
"0.60007656",
"0.59924597",
"0.59617454",
"0.59585047",
"0.5954149",
... | 0.7010285 | 0 |
Sets the rpn of this DynamicTableWidgetColumn. | def rpn(self, rpn):
self._rpn = rpn | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nr_s_cell_rsrp(self, nr_s_cell_rsrp):\n\n self._nr_s_cell_rsrp = nr_s_cell_rsrp",
"def rn(self, rn):\n\n self._rn = rn",
"def set_pno(self, pno):\n self.__pno = pno",
"def setNumber(self, n):\n VisualElement.setNumber(self, n)\n\n # the brush color is dependent of numbe... | [
"0.61400455",
"0.56139046",
"0.55392706",
"0.5126946",
"0.5112606",
"0.5012536",
"0.49668306",
"0.48220524",
"0.4806434",
"0.47947097",
"0.47929677",
"0.47631866",
"0.47568744",
"0.47054228",
"0.46911126",
"0.46482825",
"0.46482825",
"0.46482825",
"0.464452",
"0.46378294",
"0... | 0.67370915 | 1 |
Sets the data_point_name of this DynamicTableWidgetColumn. | def data_point_name(self, data_point_name):
self._data_point_name = data_point_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_column_name(self, name):\r\n self.column_name = name",
"def set_column_name(self, name):\r\n self.column_name = name",
"def _update_column_name(self, column, idx, old_name, name):\n dtype = self.dtype\n # Updating the names on the dtype should suffice\n dtype.names = ... | [
"0.7084593",
"0.7084593",
"0.63097394",
"0.58684134",
"0.5783344",
"0.5730215",
"0.57125103",
"0.57060236",
"0.5611937",
"0.5610305",
"0.55960715",
"0.5531384",
"0.550841",
"0.550841",
"0.5500735",
"0.5460207",
"0.5460207",
"0.5444228",
"0.5439889",
"0.54338294",
"0.5432422",... | 0.7908813 | 0 |
Sets the data_point_id of this DynamicTableWidgetColumn. | def data_point_id(self, data_point_id):
if data_point_id is None:
raise ValueError("Invalid value for `data_point_id`, must not be `None`") # noqa: E501
self._data_point_id = data_point_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_type_id(self, data_type_id):\n\n self._data_type_id = data_type_id",
"def data_point_name(self, data_point_name):\n\n self._data_point_name = data_point_name",
"def data_point(self, data_point):\n if data_point is None:\n raise ValueError(\"Invalid value for `data_point... | [
"0.6306773",
"0.6289872",
"0.60398036",
"0.567955",
"0.55859977",
"0.5466291",
"0.54122436",
"0.54117876",
"0.5370153",
"0.5280809",
"0.52618396",
"0.5229772",
"0.519907",
"0.51506186",
"0.510077",
"0.5077341",
"0.50605595",
"0.5051043",
"0.5036965",
"0.5032838",
"0.5017433",... | 0.7044603 | 0 |
Sets the column_name of this DynamicTableWidgetColumn. | def column_name(self, column_name):
if column_name is None:
raise ValueError("Invalid value for `column_name`, must not be `None`") # noqa: E501
self._column_name = column_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_column_name(self, name):\r\n self.column_name = name",
"def set_column_name(self, name):\r\n self.column_name = name",
"def _update_column_name(self, column, idx, old_name, name):\n dtype = self.dtype\n # Updating the names on the dtype should suffice\n dtype.names = ... | [
"0.80346173",
"0.80346173",
"0.69959134",
"0.68866915",
"0.63536376",
"0.63427436",
"0.61837643",
"0.6166585",
"0.6097896",
"0.6028902",
"0.6028902",
"0.6015229",
"0.5990336",
"0.5886396",
"0.5854206",
"0.5828526",
"0.5820368",
"0.57815975",
"0.577015",
"0.5706627",
"0.567518... | 0.7134694 | 3 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, DynamicTableWidgetColumn):
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.8456082",
"0.83912885",
"0.81436425",
"0.81406975",
"0.8131807",
"0.8093013",
"0.80912536",
"0.80912536",
"0.80912536",
"0.8084505",
"0.8084505",
"0.8075543",
"0.8075543",
"0.8065009"
] | 0.0 | -1 |
Initializes a new instance of the RelativePermeability class. | def __init__(self, swc=0.1, sor=0.05, kro0=0.9, no=2.0, krw0=0.4, nw=2.0):
self.kro0 = kro0
self.krw0 = krw0
self.no = no
self.nw = nw
self.swc = swc
self.sor = sor | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initRelativeRotation(self):\n self.__relRotationStartValue = self.rotation()",
"def __init__(self):\n self.last_reward_pos = 0\n super().__init__()\n self.TERRAIN_VARIANCE = 0.0\n self.stump_spacing = 4.0\n self.stump_height = 1.0\n self.my_init({'leg_length':... | [
"0.61717683",
"0.57806253",
"0.57694757",
"0.57405525",
"0.5689437",
"0.56517184",
"0.56517184",
"0.56517184",
"0.56509256",
"0.5604119",
"0.55202293",
"0.54802203",
"0.5470042",
"0.5467935",
"0.5442911",
"0.5437738",
"0.54315424",
"0.54315424",
"0.5423134",
"0.5422577",
"0.5... | 0.0 | -1 |
Calculates the derivative of oil relative permeability with respect to water saturation. | def dkrodsw(self, sw):
kro0, sor, swc, no = self.kro0, self.sor, self.swc, self.no
res = np.zeros_like(sw)
cond1 = np.logical_and(swc <= sw, sw <= 1 - sor)
res[cond1] = -no * kro0 / (1 - sor - swc) * ((1 - sw[cond1] - sor) / (1 - sor - swc)) ** (no - 1)
cond2 = np.logical_and(0.0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dilutionneeded(self) -> float:\n return self.stock*1.0/self.final",
"def additional_derivatives(self, increment_filter, k):\n ######################################################################\n # derivatives for saturated liquid at hot side outlet equation\n if self.subcoolin... | [
"0.6081613",
"0.58865535",
"0.58858573",
"0.5842878",
"0.5809702",
"0.57178324",
"0.57178324",
"0.5648343",
"0.56319827",
"0.5631791",
"0.5611426",
"0.5601093",
"0.55983686",
"0.55905855",
"0.5588818",
"0.55864584",
"0.5580596",
"0.55795497",
"0.5573813",
"0.5569897",
"0.5565... | 0.0 | -1 |
Calculates the derivative of water relative permeability with respect to water saturation. | def dkrwdsw(self, sw):
krw0, sor, swc, nw = self.krw0, self.sor, self.swc, self.nw
res = np.zeros_like(sw)
cond1 = np.logical_and(swc <= sw, sw <= 1 - sor)
res[cond1] = nw * krw0 / (1 - sor - swc) * ((sw[cond1] - swc) / (1 - sor - swc)) ** (nw - 1)
cond2 = np.logical_and(1 - sor ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_dew_point(temp, hum):\n return temp - (100 - hum) / 5",
"def rht_to_dp(temp, rh):\r\n # from https://en.wikipedia.org/wiki/Dew_point\r\n dp = temp - (0.36 * (100 - rh))\r\n # Check Calc\r\n # print(\"Temp: {} RH: {} DP: {}\".format(temp, rh, dp))\r\n return dp",
"def spread_... | [
"0.6401682",
"0.6266925",
"0.62476057",
"0.60990953",
"0.6098276",
"0.6066001",
"0.60121256",
"0.6009672",
"0.5907158",
"0.59057546",
"0.58686936",
"0.5859589",
"0.58301777",
"0.58301777",
"0.58067447",
"0.58039767",
"0.5797839",
"0.5795447",
"0.57914466",
"0.5733023",
"0.572... | 0.0 | -1 |
Generator to yield all FITS files in the file tree under the given root directory. | def gen_fits_file_paths (root_dir):
for file_path in gen_file_paths(root_dir):
if (validate_file_path(file_path, FITS_EXTENTS)):
yield file_path | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def iter_tree(root):\n\tfor file_rel in _iter_tree_next(os.path.abspath(root), '', {}):\n\t\tyield file_rel",
"def files_from_roots(roots, accept):\n for root in roots:\n if root is not None:\n yield from files_from_root(root, accept)",
"def walk(self):\n for _root, _dirs, files in ... | [
"0.67368406",
"0.6658123",
"0.6643633",
"0.64608306",
"0.6416231",
"0.6382932",
"0.6362723",
"0.6207558",
"0.6203765",
"0.61372983",
"0.6133054",
"0.6130965",
"0.6130724",
"0.6111604",
"0.6107284",
"0.6087074",
"0.60574275",
"0.6011582",
"0.59880304",
"0.59750485",
"0.5949156... | 0.75553167 | 0 |
Apply a list of transforms sequentially to a 3D image. Each transformation is assumed to be a 2Dtransform to be applied to each slice of the given 3D input separately. | def apply_transform_on_3d_image(image: torch.Tensor, transforms: List[Callable]) -> torch.Tensor:
for z in range(image.shape[0]):
pil = TF.to_pil_image(image[z])
for transform_fn in transforms:
pil = transform_fn(pil)
image[z] = TF.to_tensor(pil).squeeze()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compose_transforms(*transforms):\n from functools import reduce\n\n for transform in transforms:\n vg.shape.check(locals(), \"transform\", (4, 4))\n\n if len(transforms) == 0:\n return np.eye(4)\n\n return reduce(np.dot, reversed(transforms))",
"def _calculate_transforms(self):\n\n ... | [
"0.66806924",
"0.62133354",
"0.6106671",
"0.6023756",
"0.5950803",
"0.5926918",
"0.5923505",
"0.59177893",
"0.58677095",
"0.5795798",
"0.57652706",
"0.57614756",
"0.57291037",
"0.5717798",
"0.56562394",
"0.5625339",
"0.5610439",
"0.5610439",
"0.5610439",
"0.5605332",
"0.55966... | 0.7983703 | 0 |
Get a cell of the board by its row and col index | def get_game_cell(self, row, col):
try:
return GameCell.objects.get(game=self, row=row, col=col)
except GameCell.DoesNotExist:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cell(self, row, column):\n return self.sudoku_matrix[row][column]",
"def get_tile(self, row, col):\n # replace with your code\n return self.board[row][col]",
"def get_tile(self, row, col):\r\n # replace with your code\r\n return self._cells[row][col]",
"def get_tile... | [
"0.8076777",
"0.7877762",
"0.78676605",
"0.78485763",
"0.7842879",
"0.7838949",
"0.7734652",
"0.7732087",
"0.771919",
"0.7675502",
"0.76698405",
"0.7621545",
"0.7621545",
"0.7621545",
"0.76187515",
"0.75991696",
"0.75752115",
"0.7574864",
"0.7573161",
"0.75705254",
"0.7535643... | 0.73975605 | 28 |
Sends a 401 response that enables basic auth | def authenticate():
return Response(
'Could not verify your access level for that URL.\n'
'You have to login with proper credentials.', 401,
{'WWW-Authenticate': 'Basic realm="Login Required"'}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authenticate():\n return Response('Not Authorized', 401, {'WWW-Authenticate': 'Basic realm=\"api\"'})",
"def authenticate():\n return Response(\n '', 401, {'WWW-Authenticate': 'Basic realm=\"Login Required\"'}\n )",
"def authenticate():\n return Response(\n 'You have to login with pro... | [
"0.8093736",
"0.80926424",
"0.7958403",
"0.7852648",
"0.7843114",
"0.7824419",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
... | 0.7754693 | 28 |
get corresponding word from id. | def word_from_id(self, idx: int) -> str:
try:
word = self.id2word[idx]
except:
raise KeyError("invalid index to get corresponding word...")
return word | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_word(self, word_id):\n if word_id in self.id_to_word:\n return self.id_to_word[word_id]\n return constants.UNK_TOKEN",
"def id2word(self, word_id):\n\t\tif word_id not in self._id_to_word:\n\t\t\traise ValueError('Id not found in vocab: %d' % word_id)\n\t\treturn self._id_to_word[word_id]",
... | [
"0.81124896",
"0.794396",
"0.78165674",
"0.77378386",
"0.70942974",
"0.7088146",
"0.6958593",
"0.682073",
"0.6711972",
"0.6688768",
"0.65881",
"0.656974",
"0.6553607",
"0.6553607",
"0.6553607",
"0.6484586",
"0.6459638",
"0.6444154",
"0.635806",
"0.63087946",
"0.6300691",
"0... | 0.8064537 | 1 |
transform sentences to tensor. | def to_tensor(self, sents: List[List[str]], resource: str) -> torch.tensor:
sents_id = []
for s in sents:
s_id = [self.word2id.get(word, self.unk_id) for word in s]
sents_id.append(s_id)
sents_id, sents_len = self.pad_sents(sents_id, resource)
sents_tensor = torch... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tensorize(\n self,\n texts: Optional[List[List[str]]] = None,\n tokens: Optional[List[List[List[str]]]] = None,\n ):\n raise NotImplementedError",
"def _words_to_vec(self, sentence):\n return torch.FloatTensor([self._use_embeddings(word) for word in sentence])",
"def p... | [
"0.7054764",
"0.6688334",
"0.641932",
"0.631785",
"0.63082474",
"0.62856203",
"0.624926",
"0.62289137",
"0.62193066",
"0.6205708",
"0.6197757",
"0.6167233",
"0.60854447",
"0.6057436",
"0.6046669",
"0.60285246",
"0.6028165",
"0.60259783",
"0.60213816",
"0.60168207",
"0.6009275... | 0.5814289 | 48 |
Vectorizes the input, whether it is a query or the list of documents | def transform(self, raw_corpus, is_query=False):
X = super().transform(raw_corpus) if is_query else None
return self._bm25.transform(X, copy=False, is_query=is_query) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vectorize_documents(documents, model):\n document_vectors = []\n count = 0\n for document in documents:\n count += 1\n sentence_vectors = [vectorize_sentence(sentence, model) for sentence in document]\n document_vector = get_aggregate_vector(sentence_vectors)\n document_vec... | [
"0.6677435",
"0.6433104",
"0.64085007",
"0.63796824",
"0.6370989",
"0.6202067",
"0.607311",
"0.5958308",
"0.5853577",
"0.5809033",
"0.5787441",
"0.5772556",
"0.5771756",
"0.57711613",
"0.5737156",
"0.56982446",
"0.56458735",
"0.5606925",
"0.5567847",
"0.5565593",
"0.55565274"... | 0.0 | -1 |
Adds precision recall curve. | def add_pr_curve(self, tag, labels, predictions, global_step=None, num_thresholds=127, weights=None):
labels, predictions = make_np(labels), make_np(predictions)
raw_data = compute_curve(labels, predictions, num_thresholds, weights)
# compute_curve returns np.stack((tp, fp, tn, fn, precision, r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_precision_recall_curve(precisions, recalls):\n # No need to edit this code.\n plt.figure(figsize=(20, 20))\n plt.plot(recalls, precisions)\n plt.xlabel(\"Recall\")\n plt.ylabel(\"Precision\")\n plt.xlim([0.8, 1.0])\n plt.ylim([0.8, 1.0])\n plt.savefig(\"precision_recall_curve.png\"... | [
"0.7431388",
"0.7390981",
"0.7219811",
"0.71464664",
"0.7033254",
"0.69883484",
"0.6948041",
"0.6932226",
"0.6819897",
"0.67979974",
"0.6789197",
"0.67867815",
"0.6750729",
"0.6713534",
"0.6710004",
"0.6685975",
"0.66708595",
"0.66280144",
"0.6619672",
"0.6584389",
"0.6492209... | 0.68204963 | 8 |
Adds precision recall curve with raw data. | def add_pr_curve_raw(self, tag, true_positive_counts,
false_positive_counts,
true_negative_counts,
false_negative_counts,
precision,
recall, global_step=None, num_thresholds=127, weights=None):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def precision_recall(y_true, y_prob, ARGS):\n average_precision = average_precision_score(y_true, y_prob)\n if ARGS.graphs:\n precision, recall, _ = precision_recall_curve(y_true, y_prob)\n plt.style.use('ggplot')\n plt.clf()\n plt.plot(recall, precision,\n label='... | [
"0.69163513",
"0.6713957",
"0.665158",
"0.6614946",
"0.6576591",
"0.65259326",
"0.6472408",
"0.64498734",
"0.64461374",
"0.6431915",
"0.6369551",
"0.6354155",
"0.63472605",
"0.63444805",
"0.6325237",
"0.6301351",
"0.6285229",
"0.6278109",
"0.6222692",
"0.621889",
"0.6157926",... | 0.70612633 | 0 |
Return a string with yesterday in Brasilia, in format `fmt` (default %Y%m%d). | def yesterday_string(fmt='%Y-%m-%d'):
return (brasilia_time() - pd.Timedelta(days=1)).strftime(fmt) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def today_string(fmt='%Y-%m-%d'):\n return brasilia_time().strftime(fmt)",
"def yesterdayDate(self):\n yesterday = time.time() - 24*3600\n return time.strftime(\"%m/%d/%Y\", time.localtime(yesterday))",
"def yesterday():\n return datetime.today() - timedelta(1)",
"def get_yesterday_label(... | [
"0.7280156",
"0.69638133",
"0.64641535",
"0.64186466",
"0.63259715",
"0.6278824",
"0.61213946",
"0.6107499",
"0.5963965",
"0.5957628",
"0.5851372",
"0.5830164",
"0.5778446",
"0.57429695",
"0.5693867",
"0.56652516",
"0.56430566",
"0.56245947",
"0.5581208",
"0.5569494",
"0.5569... | 0.879635 | 0 |
Returns a list of files in AWS in a given `bucket` and with a given `prefix`. | def list_s3_files(bucket, prefix):
s3 = boto3.client('s3')
if type(prefix) != list:
prefix = [prefix]
# Loop over prefixes:
file_list = []
for p in prefix:
# Load one prefix:
response = s3.list_objects_v2(Bucket=bucket, Prefix=p)
if response['... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def s3_list_files(prefix, as_generator=False):\n return _do_list_files(S3_BUCKET, prefix, as_generator=as_generator)",
"def get_matching_s3_objects(bucket, prefix=\"\", suffix=\"\"):\n s3session = boto3.Session(profile_name='prod')\n s3 = s3session.client(\"s3\", \"eu-west-2\")\n #s3 = boto3.client(\... | [
"0.80411005",
"0.78875166",
"0.78565264",
"0.7788163",
"0.77700603",
"0.77011794",
"0.76052016",
"0.7573877",
"0.75565046",
"0.7507796",
"0.7484379",
"0.7480874",
"0.74718183",
"0.74661815",
"0.7401741",
"0.7399397",
"0.737712",
"0.7340036",
"0.72980314",
"0.71112466",
"0.706... | 0.8648939 | 0 |
Given a list of keyvalue pairs (dicts with keys 'key' and 'value'), find the entry that has the provided `key` and return its value. If no `key` is found, return None. It assumes that each `key` only appears one in `key_value_pair_list`, so the first appearance is returned. | def get_field(key_value_pair_list, key):
entry = list(filter(lambda d: d['key'] == key, key_value_pair_list))
if len(entry) == 0:
return None
return entry[0]['value'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_if_in_list(dict_list, value, key):\n if dict_list is None:\n return None\n return next((item for item in dict_list if item[key] == value), None)",
"def _search_list_of_dictionaries(key, value, list_of_dictionaries):\n\n for element in list_of_dictionaries:\n if element.g... | [
"0.77498347",
"0.7694401",
"0.7264894",
"0.6993837",
"0.6891407",
"0.6886596",
"0.67113864",
"0.6695556",
"0.6579917",
"0.65225273",
"0.6487375",
"0.6484319",
"0.6437833",
"0.63975996",
"0.6387842",
"0.63259655",
"0.6150988",
"0.6115288",
"0.60602343",
"0.6002148",
"0.5987141... | 0.7734562 | 1 |
Given a list of dicts containing keyvalue pairs `raw_data`, a list of relevant keys `key_list`, returns a dict where the keys are those in `key_list` and values are given by the values associated to each key. | def keyvalue_to_structure(raw_data, key_list):
structured_data = {}
for key in key_list:
structured_data[key] = get_field(raw_data, key)
return structured_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getCacheDictFromRawData( rawList ):\n\n res = [ ( ( name, sType ), status ) for name, sType, status in rawList ]\n return dict( res )",
"def read_data(raw_data: list):\r\n cleaned_data = {}\r\n for data_item in raw_data:\r\n clean_data_item = pre_process_string_data(data_item)\r\n if cl... | [
"0.6856996",
"0.6241946",
"0.6062382",
"0.60059196",
"0.5904237",
"0.5796858",
"0.57659364",
"0.5710683",
"0.57104087",
"0.56921834",
"0.5619064",
"0.55997026",
"0.55939627",
"0.55903715",
"0.55629",
"0.55482286",
"0.554821",
"0.5531115",
"0.552979",
"0.55254525",
"0.55045664... | 0.79145145 | 0 |
The (readonly) list of predicate constraints that will be applied to the query. These will be ANDed with all other constraints (including previously added predicates); that is, this constraint must be satisfied in addition to the other constraints to match a particular resource record. To update, use addpredicate(), re... | def predicates(self):
return list(self._preds) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def constraints(self):\n ans = self.execute(self.commands.get_constraints(self.db.name, self.name))\n return [Constraint(*tup) for tup in ans]",
"def add_constraints(self, constraints):\n for const in constraints:\n self.add_constraint(const.type, const.column, const.check_clause)... | [
"0.5996293",
"0.5911534",
"0.58726645",
"0.559806",
"0.5572256",
"0.5572256",
"0.5458986",
"0.5387312",
"0.5373653",
"0.5373653",
"0.53393495",
"0.5319146",
"0.5248752",
"0.51897603",
"0.5134124",
"0.51036614",
"0.507239",
"0.49703693",
"0.4966908",
"0.49667206",
"0.49509457"... | 0.5537198 | 6 |
Initialize the results. This constructor is not typically called by directly applications; rather an instance is obtained from calling a SIAQuery's execute(). | def __init__(self, url=None, version="1.0"):
dalquery.DALResults.__init__(self, url, "vaoreg", version) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, query_manager, settings, results):\n\n self.query_manager = query_manager\n self.settings = settings\n self._results = results",
"def __init__(self):\n self._results = {}\n self._logs = {}",
"def __init__(self, votable, url=None):\n dalquery.DALResul... | [
"0.73330534",
"0.67252207",
"0.6633237",
"0.6583252",
"0.65300393",
"0.6496056",
"0.64636374",
"0.63996696",
"0.630482",
"0.6288924",
"0.6288924",
"0.6244803",
"0.61925435",
"0.6190789",
"0.61769986",
"0.6175992",
"0.6172334",
"0.61547947",
"0.61489123",
"0.6089474",
"0.60857... | 0.66303545 | 3 |
The name of the organization responsible for providing this resource. | def publisher(self):
return self.get("publisher") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def organization_name(self):\n if self.organization is not None:\n return self.organization.name\n\n return ''",
"def org_urn(self):\n return f\"psc:org:{self.credentials.org_key}\"",
"def vpp_organization_name(self):\n if \"vppOrganizationName\" in self._prop_dict:\n ... | [
"0.8349789",
"0.73779655",
"0.735156",
"0.7306002",
"0.70362556",
"0.70268506",
"0.70173806",
"0.6985702",
"0.69368654",
"0.6933945",
"0.6933945",
"0.6871551",
"0.66951776",
"0.6692567",
"0.6664425",
"0.66636825",
"0.66589224",
"0.6657783",
"0.66488755",
"0.664743",
"0.664389... | 0.0 | -1 |
Wrapper around Tensorflow's sigmoid loss function. | def _sigmoid_loss(logits, targets):
loss_comp = tf.nn.sigmoid_cross_entropy_with_logits(logits, targets)
return tf.reduce_mean(loss_comp) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _tanh_sigmoid(tensor):\n return 2 * sigmoid(2 * tensor) - 1",
"def sigmoid(x):\n return 1 / (1 + exp(-x))",
"def sigmoid(x):\n return 1 / (1 + exp(-x))",
"def sigmoid(x):\n return 1.0/(1.0+exp(-x))",
"def hard_sigmoid(x):\r\n slope = 0.2\r\n shift = 0.5\r\n x = (x * slope) + shift\... | [
"0.7552401",
"0.7412986",
"0.7412986",
"0.73592955",
"0.7335161",
"0.73336905",
"0.73321855",
"0.732466",
"0.7324141",
"0.7321763",
"0.7321763",
"0.7321763",
"0.7321763",
"0.7321763",
"0.7321763",
"0.7319066",
"0.73125",
"0.73053765",
"0.7302326",
"0.7292092",
"0.72883993",
... | 0.73609614 | 3 |
Creates a random alphanumeric string. | def generate_random_alphanumeric(length):
return ''.join(random.SystemRandom().choice(
string.ascii_uppercase + string.digits) for _ in range(length)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_random_alphanumeric_string():\n return get_random_string(char_choice=string.ascii_letters + string.digits)",
"def generate_random_alphanumeric(length):\n return ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits) \\\n for _ in range(length))",
"def rand_st... | [
"0.86732787",
"0.83113265",
"0.8307362",
"0.8229641",
"0.81629497",
"0.80944306",
"0.80460924",
"0.8019047",
"0.79986304",
"0.7901666",
"0.78698933",
"0.7859822",
"0.78516495",
"0.7819369",
"0.77950186",
"0.77791196",
"0.77525777",
"0.7736204",
"0.77290034",
"0.77282655",
"0.... | 0.8183374 | 4 |
test if the user object is initialized properly | def test_init(self):
self.assertEqual(self.new_user.username,"Hamisi")
self.assertEqual(self.new_user.password,"python") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_init(self):\n pass",
"def test_init(self):\n self.assertTrue(self.new_user.profile.bio == \"Hi!\")",
"def test_custom_init(engine, User):\n init_called = False\n\n def verify_no_args(*args, **kwargs):\n nonlocal init_called\n init_called = True\n assert not arg... | [
"0.72497445",
"0.6859302",
"0.6813",
"0.6800215",
"0.67721444",
"0.67309105",
"0.67136073",
"0.67095095",
"0.67094713",
"0.66935647",
"0.6687679",
"0.6666677",
"0.66253877",
"0.65910554",
"0.65644383",
"0.65427506",
"0.6533544",
"0.65097684",
"0.6508211",
"0.6460324",
"0.6450... | 0.65170145 | 17 |
Unload a config entry. | async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):
unload_ok = all(
await asyncio.gather(
*[
hass.config_entries.async_forward_entry_unload(entry, component)
for component in PLATFORMS
]
)
)
if unload_ok:
has... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def async_unload_entry(hass, config_entry):\n unload_ok = await hass.config_entries.async_forward_entry_unload(\n config_entry, \"climate\"\n )\n return unload_ok",
"async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n hass.data.pop(DOMAIN)\n return True",
... | [
"0.697284",
"0.6888074",
"0.6779855",
"0.6747459",
"0.6689002",
"0.6657831",
"0.66162205",
"0.6603433",
"0.65925974",
"0.65595686",
"0.65411645",
"0.6507643",
"0.6507643",
"0.6507643",
"0.6507643",
"0.64977276",
"0.64931643",
"0.6486601",
"0.6486601",
"0.6486601",
"0.6486601"... | 0.6459733 | 27 |
Return string containing release version of current server instance | def version(self):
return self._call_txtrader_api('version', {}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version_string(self):\n return self.server_version",
"def get_version(self) -> str:\n return versioning.get_version()",
"def get_version():\n return \"0.0.1 (prerelease prototype)\"",
"def version(self) -> str:\n return pulumi.get(self, \"version\")",
"def version(self) -> str:\... | [
"0.8249188",
"0.77620035",
"0.7673283",
"0.7658133",
"0.7658133",
"0.7658133",
"0.7658133",
"0.7642531",
"0.76110405",
"0.75761527",
"0.7556418",
"0.7552011",
"0.7517335",
"0.7515393",
"0.7479874",
"0.74497455",
"0.74271965",
"0.7392945",
"0.73718995",
"0.73647004",
"0.736078... | 0.0 | -1 |
Return array of current live bar data for given symbol | def query_symbol_bars(self, symbol: str):
return self._call_txtrader_api('query_symbol_bars', {'symbol': symbol}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_new_bar(self, symbol):\n for b in self.symbol_data[symbol]:\n yield b",
"def get_latest_bar(self, symbol):\n raise NotImplementedError(\"Should implement get_latest_bar()\")",
"def get_latest_bar(self, symbol):\n try:\n bars_list = self.latest_symbol_data[sym... | [
"0.7491733",
"0.73126054",
"0.6721724",
"0.6323875",
"0.63184434",
"0.63081145",
"0.6233976",
"0.6122515",
"0.6047734",
"0.5982751",
"0.5952004",
"0.5902384",
"0.58850294",
"0.58838934",
"0.588301",
"0.5828121",
"0.57971776",
"0.5758928",
"0.5750594",
"0.56487286",
"0.5634231... | 0.6448475 | 3 |
Return dict containing current data for given symbol | def query_symbol(self, symbol: str):
return self._call_txtrader_api('query_symbol', {'symbol': symbol}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_data(self, symbol):\n # Collect stock market data\n self.data = self.get_stock_data(symbol)",
"def get_symbol_stat(self, symbol):\n df = self.df_all[symbol]\n close = self.latest_close(df)\n vol5, vol20 = self.mean_vol(df)\n hl5, hl20 = self.hl_wide(df)\n ... | [
"0.686223",
"0.628079",
"0.61919546",
"0.6143491",
"0.61288756",
"0.61282927",
"0.610933",
"0.6024141",
"0.6014283",
"0.5934005",
"0.5915996",
"0.591385",
"0.5903995",
"0.5857618",
"0.5838058",
"0.58328986",
"0.57766837",
"0.5772218",
"0.5770814",
"0.570201",
"0.5650206",
"... | 0.0 | -1 |
where A is the heap , i is the node,s position | def max_heapify(A, i):
# ensure to create copy of the list
l = 2 * i
r = (2 * i) + 1
if l <= len(A) and A[l] > A[i]:#base case
print(A[i])
largest = l
else:
largest = i
if r<=len(A) and A[r] > A[largest]:
largest = r
if largest != i:
A[i], A[largest] ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def heapify(self, A: list, i: int):\n left = 2*i\n right = (2*i) + 1\n heapIndex = i\n\n if self.isMax == True:\n #Max heap\n if left < self.size and A[left] > A[heapIndex]:\n heapIndex = left #New largest\n if right < self.size and A[righ... | [
"0.7667484",
"0.74626774",
"0.72679085",
"0.72679085",
"0.7087551",
"0.7084702",
"0.70643836",
"0.70138997",
"0.6980101",
"0.6980101",
"0.68655694",
"0.6850663",
"0.680598",
"0.67746925",
"0.6760717",
"0.67417765",
"0.6735979",
"0.6733177",
"0.6703024",
"0.66896546",
"0.66896... | 0.6983931 | 8 |
Inits the worker queue queue queue to pull tasks froms | def __init__(self, queue):
super(Worker, self).__init__()
self.queue = queue
logger.debug("Worker thread started.")
self.start() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self) -> None:\n self._queue = []",
"def __init__(self):\n self._queue_items = []",
"def __init__(self):\n self.queues=[]",
"def __init__(self):\n self.queue = []",
"def __init__(self):\n self.queue = []",
"def __init__(self):\n self.queue = []",
"... | [
"0.7294835",
"0.71965414",
"0.7189992",
"0.71878505",
"0.71878505",
"0.71878505",
"0.71878505",
"0.71878505",
"0.7129089",
"0.7129089",
"0.7114448",
"0.70389503",
"0.70159215",
"0.6862959",
"0.6786717",
"0.6777625",
"0.67557526",
"0.67404735",
"0.6721035",
"0.6663548",
"0.665... | 0.707693 | 11 |
Sets the platform_issuer_identifier of this Lti13PlatformConfigurationSchema. | def platform_issuer_identifier(self, platform_issuer_identifier):
if platform_issuer_identifier is None:
raise ValueError("Invalid value for `platform_issuer_identifier`, must not be `None`") # noqa: E501
self._platform_issuer_identifier = platform_issuer_identifier | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def certificate_issuer_id(self, certificate_issuer_id):\n\n self._certificate_issuer_id = certificate_issuer_id",
"def set_platform(identifier):\n global _PLATFORM\n _PLATFORM = identifier",
"def issuer(self, issuer: str):\n\n self._issuer = issuer",
"def set_issuer(self, claim=ISSUER):\n... | [
"0.57757616",
"0.5626168",
"0.5545848",
"0.5478986",
"0.5102608",
"0.5102608",
"0.5079386",
"0.49434862",
"0.49270862",
"0.49072292",
"0.48207834",
"0.4807461",
"0.47429463",
"0.47364354",
"0.46824875",
"0.4679182",
"0.4679182",
"0.465276",
"0.465276",
"0.4610446",
"0.4535927... | 0.75202304 | 0 |
Sets the json_web_key_set_url of this Lti13PlatformConfigurationSchema. | def json_web_key_set_url(self, json_web_key_set_url):
if json_web_key_set_url is None:
raise ValueError("Invalid value for `json_web_key_set_url`, must not be `None`") # noqa: E501
self._json_web_key_set_url = json_web_key_set_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_url(self, url):\n self.data['url'] = url",
"def webhook_url(self, webhook_url: \"str\"):\n self._attrs[\"webhookUrl\"] = webhook_url",
"def webhook_url(self, webhook_url: \"str\"):\n self._attrs[\"webhookUrl\"] = webhook_url",
"def set_url(self, url):\n if url is not None:... | [
"0.5713689",
"0.5443185",
"0.5443185",
"0.5296533",
"0.52926373",
"0.5280224",
"0.51618",
"0.5139608",
"0.5089611",
"0.504276",
"0.5024256",
"0.49816075",
"0.4947499",
"0.49429536",
"0.49323398",
"0.49079713",
"0.48721406",
"0.483608",
"0.48180696",
"0.48180696",
"0.48180696"... | 0.7526545 | 0 |
Sets the access_token_url of this Lti13PlatformConfigurationSchema. | def access_token_url(self, access_token_url):
self._access_token_url = access_token_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def access_token_url(self): # pragma: no cover\n raise NotImplementedError()",
"def set_access_token(self, access_token):\n self.access_token = access_token",
"def _set_access_token(self):\n integration_context = demisto.getIntegrationContext()\n access_token = integration_context.... | [
"0.6146128",
"0.59162",
"0.57824886",
"0.5715732",
"0.559881",
"0.5497365",
"0.5492418",
"0.54908866",
"0.54702973",
"0.54527855",
"0.54409385",
"0.534809",
"0.5281356",
"0.52707237",
"0.52381617",
"0.52235264",
"0.51850975",
"0.5151734",
"0.5134378",
"0.51271415",
"0.5127141... | 0.7570824 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, Lti13PlatformConfigurationSchema):
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 |
Test case for get_yaml_spec | def test_get_yaml_spec(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_yaml(self):\n\n # Check yml file can be loaded correctly\n with open(\"{}/app_spec.yml\".format(self.APP_PATH), mode='r',\n encoding=\"utf-8\", errors='ignore') as stream:\n # Load yaml file\n try:\n yaml_obj = yaml.load(stream) or {}\n ... | [
"0.720108",
"0.6667878",
"0.666558",
"0.6637124",
"0.65726227",
"0.65140647",
"0.6432463",
"0.6258166",
"0.6231463",
"0.6218904",
"0.62154543",
"0.62099606",
"0.616077",
"0.6138771",
"0.61270523",
"0.6066089",
"0.6057157",
"0.6036892",
"0.5995342",
"0.59881526",
"0.5983818",
... | 0.9471941 | 0 |
Represent this object as a humanreadable string. | def __str__(self):
return 'ThreadSide()' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return \"<%s: %s>\" % (self.__class__, self.describe())",
"def __str__(self):\n if self.__description:\n return self.__description\n return repr(self)",
"def __str__(self):\n return repr(self)",
"def __str__(self):\n return self.__repr__()",
... | [
"0.8284948",
"0.82021767",
"0.8111258",
"0.8076921",
"0.8076921",
"0.8076921",
"0.8076921",
"0.8076921",
"0.80468726",
"0.80468726",
"0.80468726",
"0.80468726",
"0.80338705",
"0.80305225",
"0.8029167",
"0.8029167",
"0.8029167",
"0.8029167",
"0.8029167",
"0.8029167",
"0.802916... | 0.0 | -1 |
Define a quaternion from a scalar and a vector. | def fromScalarVector(scalar, vector):
# TODO: Refactor for performance.
return Quaternion(scalar, vector[0], vector[1], vector[2]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __truediv__(self, scalar: float):\n if not (isinstance(scalar, float) or isinstance(scalar, int)):\n raise TypeError('scalar must be an scalar type (integer or float')\n return Quaternion(self.__real / scalar, self.__img / scalar)",
"def quaternion(self, name, q):\n R = self.R... | [
"0.7133237",
"0.6518745",
"0.6414434",
"0.62877125",
"0.62195396",
"0.6214457",
"0.61775213",
"0.6150256",
"0.6084935",
"0.60340214",
"0.6008273",
"0.5973503",
"0.5968865",
"0.59405196",
"0.5906974",
"0.58975935",
"0.5880232",
"0.5867035",
"0.5825415",
"0.5774804",
"0.5769357... | 0.7993571 | 0 |
Alternate way to represent a Quaternion as a string. | def str2(self):
signs = [ ('+' if f >= 0 else '-') for f in self.mVector ]
vals = [ abs(f) for f in self.mVector ]
return '%s %s %si %s %sj %s %sk' % (self.mScalar,
signs[0],
vals[0],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n struct_repr = \", \".join([\n \"w: \" + str(self.w),\n \"x: \" + str(self.x),\n \"y: \" + str(self.y),\n \"z: \" + str(self.z)\n ])\n\n return f\"Quaternion: [{struct_repr}]\"",
"def __repr__(self):\n ... | [
"0.7929075",
"0.78986",
"0.78152466",
"0.779675",
"0.6827798",
"0.65709585",
"0.6529083",
"0.6370175",
"0.62006086",
"0.60986626",
"0.604371",
"0.60427684",
"0.5984976",
"0.5971811",
"0.59285104",
"0.5860566",
"0.585897",
"0.5811058",
"0.5792019",
"0.5782677",
"0.5779781",
... | 0.53252774 | 89 |
Compare the quaternion to a sequence assumed to be in the form [ s, a, b, c ]. | def compare(self, seq):
return (len(seq) == 4 and
self.mScalar == seq[0] and self.mVector[0] == seq[1] and
self.mVector[1] == seq[2] and self.mVector[2] == seq[3]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_same_quaternion(q0, q1):\r\n q0 = numpy.array(q0)\r\n q1 = numpy.array(q1)\r\n return numpy.allclose(q0, q1) or numpy.allclose(q0, -q1)",
"def compare_quaternion_lists(new_quats, ref_quats, tol=0.05):\n nquats = len(ref_quats) # 3 for multiruby case\n\n # FIRST CHECK THAT NUMBER OF ORIENTA... | [
"0.701289",
"0.6702011",
"0.66151696",
"0.6574269",
"0.6413002",
"0.640514",
"0.639352",
"0.637099",
"0.6297816",
"0.6249902",
"0.6236715",
"0.6211948",
"0.62001437",
"0.6110477",
"0.6058457",
"0.6043909",
"0.5964082",
"0.5948619",
"0.5933436",
"0.59121567",
"0.58903444",
"... | 0.65602016 | 4 |
Return the quaternion which represents a rotation about the provided axis (vector) by angle (in radians). | def forRotation(axis, angle):
if round(axis.norm(),6) != 1.0:
raise ValueError('rotation axis must be a unit vector!')
half_angle = angle * 0.5
c = math.cos(half_angle)
s = math.sin(half_angle)
return Quaternion.fromScalarVector(c, axis.mults(s)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quaternion_about_axis(angle, axis):\r\n q = numpy.array([0.0, axis[0], axis[1], axis[2]])\r\n qlen = vector_norm(q)\r\n if qlen > _EPS:\r\n q *= math.sin(angle/2.0) / qlen\r\n q[0] = math.cos(angle/2.0)\r\n return q",
"def angle_axis_to_quaternion(axis, theta):\n if isinstance(axis, ... | [
"0.8500205",
"0.77302396",
"0.76151586",
"0.7502836",
"0.73836577",
"0.7337272",
"0.71935487",
"0.7090668",
"0.6999467",
"0.699738",
"0.697689",
"0.6937305",
"0.6935446",
"0.6909931",
"0.6908079",
"0.6890558",
"0.6887598",
"0.6869964",
"0.68644494",
"0.6851035",
"0.6843089",
... | 0.7678589 | 2 |
Parse tensorflow example type specifically assumed to be attention type. | def parse_attention_example(tf_example):
# specify features in attention example
features_map = {
'sequence_raw': tf.FixedLenFeature([], tf.string),
'label_raw': tf.FixedLenFeature([], tf.string),
'annotation_raw': tf.FixedLenFeature([], tf.string)}
# parse tf example for interna... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parser(record):\n\n record_spec = {\n \"inputs\": tf.VarLenFeature(tf.int64),\n \"type_id\": tf.FixedLenFeature([1], tf.int64),\n }\n\n # retrieve serialized example\n example = tf.parse_single_example(\n serialized=record,\n features=record_spec)\n\n inputs = example... | [
"0.702186",
"0.68152815",
"0.65691376",
"0.6548894",
"0.652319",
"0.64728075",
"0.63820565",
"0.63762957",
"0.6329155",
"0.62737125",
"0.6254255",
"0.62394196",
"0.6191641",
"0.6176916",
"0.617518",
"0.6149862",
"0.6147004",
"0.61226225",
"0.61059356",
"0.60900825",
"0.608023... | 0.73777807 | 0 |
Uses the function `tabulate` in the `tabulate` module to tabulate data. This function behaves almost identically, but exists because currently multiline cells that have ANSI colors break the formatting of the table grid. These issues can be tracked to assess the status of this bug and | def tabulate(*args, **kwargs):
import tabulate
def _align_column(strings, alignment, minwidth=0, has_invisible=True, enable_widechars=False, is_multiline=False):
strings, padfn = tabulate._align_column_choose_padfn(strings, alignment, has_invisible)
width_fn = tabulate._choose_width_fn(has_invi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _tabulate_data(\n self, headers, tabular_data, column_spacing=2, divider='-'\n ):\n max_lengths = [len(str(header)) for header in headers]\n for data_row in tabular_data:\n for column_index, item in enumerate(data_row):\n item = str(item).replace(self.color_pac... | [
"0.7088339",
"0.6978135",
"0.6624863",
"0.66101116",
"0.64337337",
"0.6296378",
"0.6178101",
"0.6161147",
"0.6129647",
"0.5999727",
"0.59977454",
"0.5966643",
"0.59426266",
"0.591177",
"0.57895845",
"0.57886475",
"0.5788452",
"0.5688371",
"0.56676173",
"0.5662694",
"0.5618614... | 0.6640957 | 2 |
humantargeted annotation for an attribute group definition (valid schema) Annotations provide for human and machinetargeted annotations of schema components. In the test the humantargeted annotation is provided for an attribute group definition. | def test_annotation00101m1_positive(mode, save_output, output_format):
assert_bindings(
schema="sunData/AGroupDef/annotation/annotation00101m/annotation00101m1.xsd",
instance="sunData/AGroupDef/annotation/annotation00101m/annotation00101m1_p.xml",
class_name="Root",
version="1.1",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testAttributes(self):\n ddict = {\n \"group\": {\"dataset\": 100, \"@group_attr1\": 10},\n \"dataset\": 200,\n \"@root_attr\": 11,\n \"dataset@dataset_attr\": \"12\",\n \"group@group_attr2\": 13,\n }\n with h5py.File(self.h5_fname, \"w... | [
"0.48045257",
"0.47527507",
"0.46500692",
"0.45840743",
"0.45827857",
"0.45792037",
"0.45550838",
"0.45430696",
"0.45336345",
"0.45252553",
"0.45150453",
"0.4494559",
"0.4481414",
"0.44803563",
"0.44782645",
"0.4474485",
"0.44481602",
"0.44457266",
"0.44386137",
"0.44293427",
... | 0.430654 | 44 |
Attribute names contain an uncased letter followed by upper or lower case letter. (valid schema) Declare an element with two attributes of type int. Name them using Unicode letter x01BB which is neither upper nor lower. The document AD_name00118_p.xml sets all the attributes. | def test_ad_name00118_ad_name00118_p(mode, save_output, output_format):
assert_bindings(
schema="sunData/AttrDecl/AD_name/AD_name00118/AD_name00118.xsd",
instance="sunData/AttrDecl/AD_name/AD_name00118/AD_name00118_p.xml",
class_name="Root",
version="1.1",
mode=mode,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attributeDecl(self, elem, name, type, defi, defaultValue, nameList):\n pass",
"def attribute_name(name: str) -> str:\n return text.snake_case(utils.safe_snake(name))",
"def _populate_oid_attid(self):\n self.hash_oid_name = {}\n res = self.search(expression=\"objectClass=attributeSch... | [
"0.60906386",
"0.5514183",
"0.54473317",
"0.54179615",
"0.5409737",
"0.53738445",
"0.53632426",
"0.5346854",
"0.5337795",
"0.53376436",
"0.53356",
"0.5334059",
"0.53318477",
"0.5326907",
"0.53014326",
"0.52921575",
"0.5283863",
"0.5283229",
"0.52701086",
"0.527007",
"0.523786... | 0.0 | -1 |
Attribute in schema with "unqualified" default form (valid schema) Attribute which has no explicitly declared form should be used in default for the schema form only. | def test_ad_name00101m2_positive(mode, save_output, output_format):
assert_bindings(
schema="sunData/AttrDecl/AD_name/AD_name00101m/AD_name00101m2.xsd",
instance="sunData/AttrDecl/AD_name/AD_name00101m/AD_name00101m2_p.xml",
class_name="Root",
version="1.1",
mode=mode,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_default_value(self):\n if self.has_default_value:\n if not self.is_valid_value(self.default):\n raise AttributeSchemaError(\n \"Default value '%s' is not compliant with the schema\"\n )",
"def visit_AttributeDeclaration(self, node):\... | [
"0.67507976",
"0.63597214",
"0.6233466",
"0.60499537",
"0.6009537",
"0.5979345",
"0.5880705",
"0.5879601",
"0.5793962",
"0.5752512",
"0.5577285",
"0.55582386",
"0.54731184",
"0.5467286",
"0.54608405",
"0.5448193",
"0.543501",
"0.54345286",
"0.5432146",
"0.5427023",
"0.5427023... | 0.0 | -1 |
Validation of the default value attribute (positive case). (valid schema) Define an elements with default value defined. Ensure that the value is validated. | def test_valueconstraint00101m1_positive(mode, save_output, output_format):
assert_bindings(
schema="sunData/ElemDecl/valueConstraint/valueConstraint00101m/valueConstraint00101m1.xsd",
instance="sunData/ElemDecl/valueConstraint/valueConstraint00101m/valueConstraint00101m1_p.xml",
class_name=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_default(self, value):\n return self.__validate(value, self.validate_default_element)",
"def validate_default_value(self):\n if self.has_default_value:\n if not self.is_valid_value(self.default):\n raise AttributeSchemaError(\n \"Default value '%... | [
"0.8507757",
"0.8470561",
"0.81975347",
"0.80863357",
"0.795475",
"0.6836314",
"0.6776188",
"0.66994894",
"0.6521447",
"0.64887613",
"0.6437644",
"0.64166105",
"0.6374723",
"0.6373732",
"0.63323414",
"0.63323414",
"0.63074255",
"0.62960786",
"0.62172174",
"0.6187249",
"0.6162... | 0.0 | -1 |
the root attribute is set (valid schema) Declare an element. Set ref="root". Check that the schema is valid. | def test_name00401m2_positive(mode, save_output, output_format):
assert_bindings(
schema="sunData/ElemDecl/name/name00401m/name00401m2.xsd",
instance="sunData/ElemDecl/name/name00401m/name00401m2_p.xml",
class_name="Root",
version="1.1",
mode=mode,
save_output=save_ou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_root(self, root):\n self.root = root\n if self.root is not None:\n correct_type(root, Tag)",
"def _parse_reference(self) -> Optional[bool]:\n ref = self.elem.get('ref')\n if ref is None:\n if 'name' in self.elem.attrib:\n return None\n ... | [
"0.57134974",
"0.5573445",
"0.5508112",
"0.5381217",
"0.5370098",
"0.52717286",
"0.5235441",
"0.5222155",
"0.5197293",
"0.51906615",
"0.51698226",
"0.5122267",
"0.5122267",
"0.50959295",
"0.50579214",
"0.50579214",
"0.50526786",
"0.50521934",
"0.5002401",
"0.4992792",
"0.4981... | 0.0 | -1 |
use abstarct explicitly set to false (valid schema) Declare an element with abstarct explicitly set to false. Try to use it in the xml document. | def test_abstract00201m2_positive(mode, save_output, output_format):
assert_bindings(
schema="sunData/ElemDecl/abstract/abstract00201m/abstract00201m2.xsd",
instance="sunData/ElemDecl/abstract/abstract00201m/abstract00201m2_p.xml",
class_name="Root",
version="1.1",
mode=mode,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def schema_xml(self, val):\n self.set_property('SchemaXml', val)",
"def elementDecl(self, name, type, content):\n pass",
"def test_can_import_xmlschema(self):\n self.assertEqual(xmlschema.__name__, 'xmlschema')",
"def handle_decl(self, decl):\n if verbose(): print(\"TIParser.handl... | [
"0.5793079",
"0.55984885",
"0.5311987",
"0.52827346",
"0.5240606",
"0.5223014",
"0.5218035",
"0.5150597",
"0.51424193",
"0.5092997",
"0.50842476",
"0.50565434",
"0.5056197",
"0.5033698",
"0.5020162",
"0.501546",
"0.4996654",
"0.4983131",
"0.49680603",
"0.49676806",
"0.4967490... | 0.0 | -1 |
An empty choice (valid schema) The XMLSchema specification allows an empty choice. | def test_compositor00202m1_positive(mode, save_output, output_format):
assert_bindings(
schema="sunData/MGroup/compositor/compositor00202m/compositor00202m1.xsd",
instance="sunData/MGroup/compositor/compositor00202m/compositor00202m1_p.xml",
class_name="A",
version="1.1",
mod... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_none_or_empty(self):\n self.assertEqual({}, SchemaConstraints(None).descriptor)\n self.assertEqual({}, SchemaConstraints({}).descriptor)",
"def form_SelectChoiceWithEmptyString(request):\n schema = schemaish.Structure()\n schema.add('mySelect', schemaish.String())\n options = [(''... | [
"0.6147264",
"0.6097019",
"0.6014706",
"0.5921128",
"0.5895563",
"0.58486307",
"0.5841788",
"0.5799617",
"0.5799323",
"0.5771033",
"0.5757073",
"0.57388675",
"0.5718346",
"0.5691903",
"0.56390774",
"0.56190705",
"0.5569991",
"0.5557642",
"0.54816025",
"0.5478979",
"0.5475258"... | 0.0 | -1 |
The auxiliary schema for targetNS00101m2.xsd (valid schema) Model group definitions are identified by their {name} and {target namespace}; model group identities must be unique within an XML Schema. | def test_targetns00101m1_positive_364(mode, save_output, output_format):
assert_bindings(
schema="sunData/MGroupDef/targetNS/targetNS00101m/targetNS00101m1.xsd",
instance="sunData/MGroupDef/targetNS/targetNS00101m/targetNS00101m1_p.xml",
class_name="A",
version="1.1",
mode=mo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_targetns00101m2_positive(mode, save_output, output_format):\n assert_bindings(\n schema=\"sunData/MGroupDef/targetNS/targetNS00101m/targetNS00101m2.xsd\",\n instance=\"sunData/MGroupDef/targetNS/targetNS00101m/targetNS00101m2_p.xml\",\n class_name=\"A\",\n version=\"1.1\",\n... | [
"0.60080636",
"0.5884627",
"0.5830589",
"0.5751199",
"0.5736475",
"0.5702672",
"0.56555605",
"0.5653968",
"0.56505585",
"0.5591947",
"0.5512425",
"0.54870266",
"0.54684675",
"0.5465125",
"0.54259014",
"0.5345723",
"0.53358227",
"0.5332221",
"0.5302892",
"0.5256885",
"0.525528... | 0.58843577 | 2 |
humantargeted annotation for a model group definition (valid schema) Annotations provide for human and machinetargeted annotations of schema components. In the test the humantargeted annotation is provided for a model group definition. | def test_annotation00101m1_positive_370(mode, save_output, output_format):
assert_bindings(
schema="sunData/MGroupDef/annotation/annotation00101m/annotation00101m1.xsd",
instance="sunData/MGroupDef/annotation/annotation00101m/annotation00101m1_p.xml",
class_name="Root",
version="1.1"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _annotations_to_targets(self, annotations):\n raise NotImplementedError('Implement this')",
"def create_auto_annotations(request): # post\n\n request_body_json = json.loads(request.body)\n usecase_list = request_body_json['usecase']\n fields_list = request_body_json['selected']\n report_ke... | [
"0.48650718",
"0.47291878",
"0.47170693",
"0.46955395",
"0.46853876",
"0.46793258",
"0.46711504",
"0.46676505",
"0.46554",
"0.46434897",
"0.46151263",
"0.45504093",
"0.4533214",
"0.450547",
"0.44990963",
"0.44840148",
"0.44811156",
"0.44811156",
"0.44811156",
"0.44811156",
"0... | 0.4556864 | 11 |
Return the Golden Section search intervals generated in an attempt to find a minima of a function `f` on the interval `[a, b]`. The returned list should have length `n+1`. Do not evaluate the function `f` more times than necessary. | def golden_section_search(f, a, b, n=10):
ret = [(a,b)]
t = (math.sqrt(5) - 1) / 2
x1 = a + ( 1 - t ) * ( b - a )
f1 = f(x1)
x2 = a + t * ( b - a )
f2 = f(x2)
for i in range(n):
print("f(x1): " + str(f1))
print("f(x2): " + str(f2))
if(f1 > f2):
a = x1
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def golden_section(f, a, b, niter=10):\n row = .5*(3-np.sqrt(5))\n for i in xrange(niter):\n a2 = a + row*(b-a)\n b2 = a + (1-row)*(b-a)\n if f(a2) < f(b2):\n b = b2\n else:\n a = a2\n return (a+b)/2.",
"def calculate_ranges(a, b):\n try:\n ran... | [
"0.6329586",
"0.6020874",
"0.5990635",
"0.5849826",
"0.5843419",
"0.58330715",
"0.58228695",
"0.5724933",
"0.56811446",
"0.56439203",
"0.5633781",
"0.56122917",
"0.5586647",
"0.555817",
"0.55441874",
"0.5519939",
"0.55169123",
"0.5500746",
"0.54819614",
"0.5433314",
"0.541163... | 0.7178021 | 0 |
Resets all parameters that require gradients with random values. | def reset_parameters(self, initializer=torch.nn.init.normal_):
for p in self.parameters():
if p.requires_grad:
initializer(p)
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_parameters(self):\n mu_range = 1 / math.sqrt(self.in_features)\n self.weight_mu.data.uniform_(-mu_range, mu_range)\n self.weight_sigma.data.fill_(\n self.std_init / math.sqrt(self.in_features)\n )\n self.bias_mu.data.uniform_(-mu_range, mu_range)\n sel... | [
"0.72770107",
"0.72427166",
"0.7005489",
"0.69567925",
"0.6948164",
"0.6948164",
"0.6948164",
"0.6872635",
"0.6871673",
"0.6869759",
"0.68502504",
"0.68300915",
"0.6824738",
"0.6790276",
"0.6781993",
"0.67492414",
"0.67147696",
"0.6698365",
"0.66959476",
"0.66921276",
"0.6683... | 0.7026628 | 2 |
Sets the precomp_replicated_bytes of this FileReplicationHistoricalStatsDetails. | def precomp_replicated_bytes(self, precomp_replicated_bytes):
if self._configuration.client_side_validation and precomp_replicated_bytes is None:
raise ValueError("Invalid value for `precomp_replicated_bytes`, must not be `None`") # noqa: E501
if (self._configuration.client_side_validation ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def before_revision(self, before_revision):\n\n self._before_revision = before_revision",
"def pre(self, pre):\n\n self._pre = pre",
"def preprocessing(self, preprocessing):\n\n self._preprocessing = preprocessing",
"def provenance_bytes(self, provenance_bytes):\n\n self._provenan... | [
"0.4812226",
"0.4696174",
"0.46938434",
"0.46342906",
"0.46007678",
"0.45794624",
"0.4521691",
"0.44717798",
"0.4453235",
"0.43636814",
"0.4354266",
"0.4350118",
"0.429258",
"0.429258",
"0.42868677",
"0.42697722",
"0.42318773",
"0.4198819",
"0.41936016",
"0.41798216",
"0.4174... | 0.7840059 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, FileReplicationHistoricalStatsDetails):
return False
return self.to_dict() == other.to_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):
if not isinstance(other, FileReplicationHistoricalStatsDetails):
return True
return self.to_dict() != other.to_dict() | {
"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.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
... | 0.0 | -1 |
Strip leading and trailing quotes. These are showing up in paths... | def _strip_quotes(file_arg):
return re.sub("^[\'\"]|[\'\"]$", "", file_arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_slashes(path):\n return path.strip(\"/\")",
"def _strip_quotes(self, val):\n logger.debug('Strip quotes')\n val = val.strip()\n if val.startswith('\"') and val.endswith('\"'):\n return val[1:-1]\n return val",
"def remove_quotes(fname_string):\n return fna... | [
"0.752908",
"0.7117587",
"0.7006015",
"0.6841814",
"0.6790144",
"0.6743677",
"0.66949815",
"0.6693213",
"0.66660595",
"0.6590412",
"0.65094054",
"0.6508445",
"0.6507446",
"0.64781123",
"0.6432203",
"0.6310331",
"0.62498695",
"0.62467265",
"0.62440187",
"0.62121254",
"0.621212... | 0.7534753 | 0 |
Read textbased table into pandas DataFrame. | def read_tsv(filename):
df = pd.read_csv(filename, delim_whitespace=True, index_col=0)
df = df.apply(pd.to_numeric, errors='coerce')
return df | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _parse_textfile(self):\n\n field_names = list(self.FIELD_NAME_TO_INDEX.keys())\n field_indices = list(self.FIELD_NAME_TO_INDEX.values())\n frame = pd.read_csv(\n self.filepath,\n header=None, # MAGIC file has no header line\n delimiter=self.DELIMITER,\n ... | [
"0.7135686",
"0.7020242",
"0.6998124",
"0.69880277",
"0.68076223",
"0.6629854",
"0.66210955",
"0.649607",
"0.6452033",
"0.6415384",
"0.6396149",
"0.63362044",
"0.632553",
"0.6295549",
"0.62919706",
"0.6255465",
"0.6218345",
"0.620832",
"0.6194558",
"0.61751133",
"0.61428046",... | 0.5594362 | 65 |
Validates if given email is in datastore | def existing_email(cls, email):
user_db = User.get_by('email', email)
if not user_db:
raise ValueError('This email is not in our database.')
return email | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_email(self, email):\n user = User.query.filter_by(email=email.data).first()\n if user:\n raise ValidationError('That email already exists. Please choose another email.')",
"def validate_email(self, email):\n user = User.query.filter_by(email=email.data).first()\n ... | [
"0.76136154",
"0.7584072",
"0.75018317",
"0.7501336",
"0.74121064",
"0.73762625",
"0.7372965",
"0.7372965",
"0.73476046",
"0.7302378",
"0.72870195",
"0.72830206",
"0.7272805",
"0.72634095",
"0.723179",
"0.708946",
"0.704849",
"0.70233923",
"0.7023309",
"0.70145637",
"0.698655... | 0.6863026 | 30 |
Validates if given email is not in datastore | def unique_email(cls, email):
user_db = User.get_by('email', email)
if user_db:
raise ValueError('Sorry, this email is already taken.')
return email | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_email(self, email):\n user = User.query.filter_by(email=email.data).first()\n if user is not None:\n raise ValidationError('Please use a different email address.')",
"def validate_email(self, email):\n user = User.query.filter_by(email=email.data).first()\n if ... | [
"0.75951844",
"0.7567208",
"0.7538368",
"0.7377326",
"0.7322111",
"0.7322111",
"0.7259972",
"0.72052616",
"0.71919775",
"0.71882176",
"0.718552",
"0.7154929",
"0.7154599",
"0.712782",
"0.7043857",
"0.6948428",
"0.6944776",
"0.6939844",
"0.6936924",
"0.6932434",
"0.68947333",
... | 0.64565605 | 69 |
Validates if given username is not in datastore | def unique_username(cls, username):
if not User.is_username_available(username):
raise ValueError('Sorry, this username is already taken.')
return username | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_username(self, username):\n user = User.query.filter_by(username=username.data).first()\n if user:\n # if user is not None\n raise ValidationError('That username is taken. Please choose a different one.')",
"def validate_username(self, username):\n user = U... | [
"0.7499018",
"0.7478376",
"0.7474419",
"0.73817515",
"0.7269879",
"0.7266904",
"0.7177009",
"0.7177009",
"0.71662205",
"0.71043396",
"0.7054381",
"0.70446044",
"0.70006406",
"0.6847589",
"0.68412524",
"0.68141866",
"0.6810836",
"0.6805868",
"0.6794138",
"0.6776669",
"0.674388... | 0.61379206 | 75 |
The two Nodes have the same values. | def assertNodesEqual(self, a, b):
self.assertEqual((a.version, a.address, a.service, a.properties),
(b.version, b.address, b.service, b.properties)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return type(self) == type(other) and self.node is other.node",
"def __eq__(self, other):\n return type(other) is type(self) and other._node is self._node",
"def __eq__(self, other):\n return type(other) is type(self) and other._node is self._node",
... | [
"0.7213265",
"0.7182185",
"0.7182185",
"0.7182185",
"0.7182185",
"0.7182185",
"0.71267587",
"0.7083831",
"0.691941",
"0.68549013",
"0.68464714",
"0.6840478",
"0.68232435",
"0.68067575",
"0.6793089",
"0.6793089",
"0.6780735",
"0.6716797",
"0.6716735",
"0.670972",
"0.66550934",... | 0.7111868 | 7 |
Build a word dictionary from the corpus, Keys of the dictionary are words, and values are zerobased IDs of these words. | def build_dict(min_word_freq=0, train_dir="", test_dir=""):
word_freq = collections.defaultdict(int)
files = os.listdir(train_dir)
for fi in files:
with open(os.path.join(train_dir, fi), "r") as f:
word_freq = word_count(f, word_freq)
files = os.listdir(test_dir)
for fi in files:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_dictionary(self, document):\n words = self._normalize_words(document.words)\n unique_words = frozenset(words)\n return dict((word, idx) for idx, word in enumerate(unique_words))",
"def _create_dictionary(self, document_set):\n words = self._normalize_words(document_set.wor... | [
"0.7025227",
"0.6982656",
"0.6917868",
"0.6911807",
"0.6816387",
"0.6710399",
"0.6700633",
"0.6672955",
"0.66090286",
"0.65390533",
"0.6450592",
"0.6445277",
"0.64271706",
"0.64236766",
"0.6396744",
"0.63763475",
"0.62978965",
"0.62864614",
"0.6279616",
"0.6276639",
"0.627340... | 0.60886174 | 36 |
Return a custom 404 error. | def page_not_found(e):
return 'Sorry, nothing at this URL.', 404 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def not_found():\n return HttpError(404)",
"def error_404(error):\n return '404 Error'",
"def error_404(error):\n return 'Bummer, there is nothing at this URL.'",
"def error_not_found(error):\n return 'No page here, dood. 404!', 404",
"def not_found(self, error):\n return jsonify({'error': 'NO... | [
"0.81159586",
"0.80410045",
"0.7738874",
"0.77369535",
"0.77182025",
"0.7689595",
"0.7670471",
"0.76112473",
"0.7602477",
"0.7570698",
"0.75528365",
"0.7545827",
"0.751882",
"0.74745256",
"0.7458403",
"0.7455682",
"0.74548143",
"0.74505144",
"0.7442062",
"0.7428278",
"0.74065... | 0.72672606 | 29 |
Set a callback for when the rotary encoder's switch is pressed. | def on_switch(self, callback):
self._switch_callback = callback | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_callback(self, key_name, callback):\n self.keymap[key_name] = callback",
"def on_set(self, callback):\n self._set_callback = callback if callable(callback) else _void",
"def on_set(self, callback):\n self._set_callback = callback if callable(callback) else _void",
"def enable_key... | [
"0.62581193",
"0.62121534",
"0.62121534",
"0.614167",
"0.6124694",
"0.60630757",
"0.60227925",
"0.6019048",
"0.58061117",
"0.5779323",
"0.57776827",
"0.5777581",
"0.5776363",
"0.57365084",
"0.56892884",
"0.5657797",
"0.5652042",
"0.56431395",
"0.56357205",
"0.56293815",
"0.55... | 0.7597443 | 0 |
Returns only the reads that have an overlap of over half with the given positions | def filter_reads(reads, positions):
filtered_reads = []
read_array = array(reads)
for position in positions:
low_position = position - 25
high_position = position + 25
p = []
for r in reads:
pos = int(float(r.get_position()))
if pos > low_position and pos < high_position:
p.append(r)
filtere... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def combine_reads(filtered_reads, positions):\n\n\tcombined_reads = []\n\ttrue_reads = []\n\n\tfor r in filtered_reads:\n\t\t# Find associated position\n\t\tr_position = float(r.get_position())\n\t\tdesired_start = -1\n\n\t\tfor p in positions:\n\t\t\tlow_position = p - 25\n\t\t\thigh_position = p + 25\n\t\t\tif r... | [
"0.63894904",
"0.60663515",
"0.59378105",
"0.5918895",
"0.5857219",
"0.58210874",
"0.5805148",
"0.5797497",
"0.5784452",
"0.5751779",
"0.56989217",
"0.5673764",
"0.5660021",
"0.5650327",
"0.5641948",
"0.5613235",
"0.56131387",
"0.55923104",
"0.5586586",
"0.55695796",
"0.55665... | 0.6637774 | 0 |
Create a new DataLoader. | def __init__(self, db,
relevant_classes=DocumentClass.default_relevant_set,
load_titles=True,
load_classifications=True,
overwrite=False,
allow_doc_dups=True):
logger.info( "Life-sci relevant classes: {}".format(relevant_class... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_DataLoader(self, **kwargs):\r\n return DataLoader(self, **kwargs)",
"def _create_data_loader(self, data, **kwargs):\n if data is None:\n return None\n\n # Set DataLoader config\n # NOTE: Not applicable if data is already a DataLoader\n config = {\n ... | [
"0.81105673",
"0.7693721",
"0.7643149",
"0.75349325",
"0.75101566",
"0.75064117",
"0.7484791",
"0.74758434",
"0.7352165",
"0.72638446",
"0.7233807",
"0.72294605",
"0.7157782",
"0.7120668",
"0.70949984",
"0.707078",
"0.7061692",
"0.70419717",
"0.7032926",
"0.7021908",
"0.69888... | 0.0 | -1 |
Yield successive nsized chunks from l. Via Stack Overflow. | def chunks(l, n):
for i in xrange(0, len(l), n):
yield (i+n, l[i:i+n] ) | {
"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(l, n):\n for i in range(0, len(l), 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 ... | [
"0.786792",
"0.7650786",
"0.75878096",
"0.75871515",
"0.75612396",
"0.7542564",
"0.75391674",
"0.7538657",
"0.7517814",
"0.7504253",
"0.7503683",
"0.75008893",
"0.74949455",
"0.74675655",
"0.74675655",
"0.7438879",
"0.7436639",
"0.73854053",
"0.73854053",
"0.73854053",
"0.738... | 0.0 | -1 |
Test CRUD delete with commit. | def test_delete_with_commit(self):
user = ExampleUserModel("foo", "foo@bar.com")
user.save()
user.delete(commit=True)
assert ExampleUserModel.get_by_id(user.id) is None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_delete(self):\n pass",
"def test_delete1(self):\n pass",
"def test_delete_run(self):\n pass",
"def test_delete_record(self):\n pass",
"def test_delete(self):\n # add a task\n self.add(title=\"Sample task doing\", description=\"for sample\", state=\"doing\"... | [
"0.8273376",
"0.79482067",
"0.7788463",
"0.7670387",
"0.7589929",
"0.74860066",
"0.7414003",
"0.7388728",
"0.7354013",
"0.7345498",
"0.7310654",
"0.72874385",
"0.7273798",
"0.72590613",
"0.7251899",
"0.7201028",
"0.71877617",
"0.71870315",
"0.716029",
"0.7154143",
"0.7154143"... | 0.7748436 | 3 |
Test CRUD delete without commit. | def test_delete_without_commit_cannot_access(self):
user = ExampleUserModel("foo", "foo@bar.com")
user.save()
user.delete(commit=False)
with pytest.raises(ObjectDeletedError):
ExampleUserModel.get_by_id(user.id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_delete(self):\n pass",
"def test_delete1(self):\n pass",
"def test_delete_run(self):\n pass",
"def test_delete_record(self):\n pass",
"def test_delete_records(self):\n pass",
"def test_delete(self):\n # add a task\n self.add(title=\"Sample task do... | [
"0.8636688",
"0.82122314",
"0.81331336",
"0.79560626",
"0.7838374",
"0.78205097",
"0.76689535",
"0.762658",
"0.7593096",
"0.7590377",
"0.75889784",
"0.7537773",
"0.7528754",
"0.7478493",
"0.7415832",
"0.74043655",
"0.73938614",
"0.73938614",
"0.73771113",
"0.7347605",
"0.7328... | 0.7309712 | 23 |
Test if input is a prime using RabinMiller algorithm, with k random witness attempts. False return means n is certainly a composite. True return value indicates n is probably a prime. False positive probability is reduced exponentially the larger k gets. This code was made by Sahand Saba. | def rabin_miller_is_prime(n, k=100):
def basic_is_prime(_n):
"""Basic check to see if input is a prime.
Returns False if input number is a composite with at least one term being one of the primes below 10.000.
Returns True if the number is a prime (can only be known if it is in the list of ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_prime(n, k=10):\n if n == 2 or n == 3:\n return True\n if not n & 1 or n < 2:\n return False\n m = n - 1\n s = 1\n d = m >> 1\n while not d & 1:\n s += 1\n d >>= 1\n for i in range(k):\n a = randint(2, n - 2)\n x = expmod(a, d, n)\n if x ... | [
"0.8110758",
"0.79908186",
"0.79130083",
"0.7909104",
"0.7909104",
"0.77761805",
"0.7720491",
"0.75487095",
"0.75360405",
"0.7501474",
"0.746658",
"0.7430015",
"0.73511577",
"0.73119026",
"0.7300581",
"0.7276713",
"0.72278035",
"0.72251815",
"0.72211033",
"0.7173536",
"0.7164... | 0.8241184 | 0 |
Sets the angle_tolerance of this DocumentsExportElementPostJsonBody. | def angle_tolerance(self, angle_tolerance):
self._angle_tolerance = angle_tolerance | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def angle(self, angle):\n\n self._angle = angle",
"def set_angle(self, angle=0.0):\n self.angle = angle",
"def setAngle(self, angle):\n self.vector.angle = angle",
"def wheel_angle(self, angle):\n self.angle = angle",
"def set_angle(self, angle):\n return self.bot_client.... | [
"0.57613266",
"0.56659716",
"0.5536142",
"0.5530315",
"0.54017866",
"0.5298467",
"0.5252281",
"0.5148786",
"0.51383173",
"0.5093075",
"0.5076683",
"0.50738686",
"0.5068721",
"0.5059531",
"0.5045733",
"0.50132596",
"0.4967059",
"0.4924914",
"0.48865482",
"0.4886268",
"0.487185... | 0.7602279 | 0 |
Sets the store_in_document of this DocumentsExportElementPostJsonBody. | def store_in_document(self, store_in_document):
self._store_in_document = store_in_document | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setStoreFile(self, storeFile):\n self._checkArgs({'storeFile': bool})\n self.storeFile = storeFile",
"def set_store(self, store):\n self.store = store",
"def document(self, document):\n\n self._document = document",
"def document(self, document):\n\n self._document = document",... | [
"0.55268943",
"0.54718363",
"0.51209795",
"0.51209795",
"0.49563563",
"0.49469218",
"0.49326265",
"0.48983654",
"0.48073986",
"0.47820392",
"0.47308668",
"0.46348506",
"0.4631009",
"0.45411158",
"0.4533391",
"0.4533391",
"0.45009947",
"0.44990593",
"0.44915253",
"0.44846585",
... | 0.7954336 | 0 |
Sets the max_facet_width of this DocumentsExportElementPostJsonBody. | def max_facet_width(self, max_facet_width):
self._max_facet_width = max_facet_width | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min_facet_width(self, min_facet_width):\n\n self._min_facet_width = min_facet_width",
"def referencesearchservlet_max_pages(self, referencesearchservlet_max_pages):\n\n self._referencesearchservlet_max_pages = referencesearchservlet_max_pages",
"def setmaxsize(self, maxsize):\n self.ma... | [
"0.5551907",
"0.5376599",
"0.5293317",
"0.51913655",
"0.51456285",
"0.51368225",
"0.5130548",
"0.5116452",
"0.5077239",
"0.5049245",
"0.50332874",
"0.50253046",
"0.5015854",
"0.50154495",
"0.50019133",
"0.500016",
"0.4999919",
"0.4997702",
"0.4997384",
"0.49711153",
"0.496432... | 0.81528175 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, DocumentsExportElementPostJsonBody):
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.84564555",
"0.8391999",
"0.8144653",
"0.81410354",
"0.81326365",
"0.8094085",
"0.80921024",
"0.80921024",
"0.80921024",
"0.8085453",
"0.8085453",
"0.807646",
"0.807646",
"0.806588"
] | 0.0 | -1 |
Returns True if we are the same node as the other one (logically, not by memory location). | def is_same_as(self, other) -> bool:
return self.x == other.x and self.y == other.y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return type(self) == type(other) and self.node is other.node",
"def __eq__(self, other):\n return type(other) is type(self) and other._node is self._node",
"def __eq__(self, other):\n return type(other) is type(self) and other._node is self._node",
... | [
"0.80353385",
"0.8010067",
"0.8010067",
"0.8010067",
"0.8010067",
"0.8010067",
"0.8000294",
"0.7771959",
"0.7662444",
"0.7601988",
"0.7599597",
"0.7465188",
"0.74591184",
"0.745814",
"0.74278575",
"0.7331914",
"0.73274285",
"0.72648454",
"0.72648454",
"0.72595894",
"0.7239108... | 0.73165685 | 17 |
Returns whether a node is on the edge. | def node_is_edge(self, node: MazeCell) -> bool:
return node.x == 0 or node.x == self._ncols - 1 or node.y == 0 or node.y == self._nrows - 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_edge(self, otherNode):\n\t\t\treturn otherNode in self.edges",
"def hasEdge(self, fromnode, tonode):\n fromnode = self.findNode(fromnode)\n tonode = self.findNode(tonode)\n\n return self.graph.edge_by_node(fromnode, tonode) is not None",
"def contains_edge(self, node, other_node):\... | [
"0.7755381",
"0.7466431",
"0.72280157",
"0.70976514",
"0.7089627",
"0.70792395",
"0.70711213",
"0.7045048",
"0.70255953",
"0.70142645",
"0.7005026",
"0.6991498",
"0.69344985",
"0.69069004",
"0.690148",
"0.68602717",
"0.67445236",
"0.6743571",
"0.67351705",
"0.6716346",
"0.671... | 0.78147566 | 0 |
Returns the node to the left of `n`, if there is one, otherwise None. | def get_node_left(self, n: MazeCell) -> MazeCell:
if n.x == 0:
return None
else:
return self.get_node(n.x - 1, n.y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def left(self, n):\n return n._left",
"def left_most_child(n):\n if n == None:\n return None\n while n.left:\n n = n.left\n return n",
"def left_child(self, n):\n\n if 2 * n + 1 >= len(self.heap):\n return None\n else:\n return 2 * n + 1",
"de... | [
"0.7885311",
"0.7572289",
"0.75684506",
"0.74985135",
"0.7072402",
"0.6991669",
"0.68990844",
"0.68052804",
"0.6749004",
"0.67295116",
"0.66946566",
"0.6601621",
"0.6599322",
"0.6595812",
"0.6553815",
"0.6514266",
"0.6505583",
"0.64957994",
"0.647463",
"0.64652777",
"0.646527... | 0.8413854 | 0 |
Returns a list of all path nodes. | def get_all_path_nodes(self) -> [MazeCell]:
return [node for node in self._nodes if not node.is_wall] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_nodes(self):\n return self._get_all_nodes()",
"def get_path_nodes(self, path):\n nodes = []\n for arc in path:\n start = self.arc_info[arc][\"start\"]\n destin = self.arc_info[arc][\"destin\"]\n nodes.append(start)\n nodes.append(destin... | [
"0.7490399",
"0.7379362",
"0.73755515",
"0.7349777",
"0.7329787",
"0.73277056",
"0.72728014",
"0.71893483",
"0.71674174",
"0.71435404",
"0.71217406",
"0.7106329",
"0.70994675",
"0.70994675",
"0.7096883",
"0.7096658",
"0.70647943",
"0.70647943",
"0.7014427",
"0.6989698",
"0.69... | 0.77256393 | 0 |
Hashes a pw using pbkdf2_sha512 | def hash_password(password):
return pbkdf2_sha512.encrypt(password) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash_pass(password, salt):\n return hashlib.pbkdf2_hmac('sha512', password.encode(), salt, 100000)",
"def Pbkdf2HmacSha512(password: Union[bytes, str],\n salt: Union[bytes, str],\n itr_num: int) -> bytes:\n return hashlib.pbkdf2_hmac(\"sha512\", AlgoU... | [
"0.8250623",
"0.7926698",
"0.7741797",
"0.7731923",
"0.7661552",
"0.7661552",
"0.7661552",
"0.7661271",
"0.76355845",
"0.7537183",
"0.7477136",
"0.7457909",
"0.73700863",
"0.72772074",
"0.72101563",
"0.7139594",
"0.7103149",
"0.6923511",
"0.6837319",
"0.6827516",
"0.66857564"... | 0.77911067 | 2 |
Checks that the password from user matches db password db pw is more encrypted than entered password | def check_hashed_password(password, hashed_password):
return pbkdf2_sha512.verify(password, hashed_password) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def correct_password(username, password, db):\n\tquery = db((db.User.username == username) & (db.User.password == password))\n\treturn query.count() > 0",
"def check_passwd(col_user, userid, passwd):\n the_user = col_user.find_one({\"user_id\": userid})\n if not the_user:\n return False\n\n hashe... | [
"0.7178174",
"0.7122871",
"0.71217775",
"0.7055005",
"0.70456296",
"0.702767",
"0.7015317",
"0.70118093",
"0.7011657",
"0.69946533",
"0.69824547",
"0.69824547",
"0.69798416",
"0.69711506",
"0.696436",
"0.6956102",
"0.69525224",
"0.69482136",
"0.6947069",
"0.69032127",
"0.6895... | 0.0 | -1 |
Convenience routine to save the configuration. | def saveConfig():
with open(_CONFIG_FNM, 'w') as configfile:
CONFIG_DICT.write(configfile,
space_around_delimiters=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save(self):\n file = open(self.path, 'w')\n self.config.write(file)\n file.close()",
"def save(self):\r\n with open(self.filename, 'wb') as configfile:\r\n self.write(configfile)",
"def save_config(self):\n config.save_config(self.config, self.config_file)",
... | [
"0.8632908",
"0.85268384",
"0.8513601",
"0.8352054",
"0.81851906",
"0.81244797",
"0.8122706",
"0.8107007",
"0.8071273",
"0.8056437",
"0.805046",
"0.80436164",
"0.8018225",
"0.79717416",
"0.7933187",
"0.791704",
"0.7879124",
"0.78515637",
"0.7845622",
"0.78438294",
"0.7833763"... | 0.7460159 | 39 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.