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 |
|---|---|---|---|---|---|---|
Gets the action of this Lifecycle. The action to perform. Currently only delete is supported | def action(self):
return self._action | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_action(self):\n return self.__action",
"def get_action(self):\n return self.current_action",
"def action(self):\n return self._get_field(\"action\")",
"def action(self) -> Optional[str]:\n return pulumi.get(self, \"action\")",
"def action(self) -> Optional[str]:\n ... | [
"0.7956197",
"0.7459488",
"0.7432588",
"0.7238182",
"0.7238182",
"0.7238182",
"0.7208887",
"0.71846193",
"0.71716344",
"0.71587044",
"0.7045301",
"0.70392245",
"0.6941939",
"0.6926468",
"0.68683374",
"0.6690194",
"0.6672939",
"0.6605948",
"0.65702957",
"0.64770836",
"0.645596... | 0.7538712 | 5 |
Sets the action of this Lifecycle. The action to perform. Currently only delete is supported | def action(self, action):
allowed_values = ["DELETE", "NONE"]
if action not in allowed_values:
raise ValueError(
"Invalid value for `action` ({0}), must be one of {1}"
.format(action, allowed_values)
)
self._action = action | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_action(self, action):\n self._action = action\n return self",
"def setAction(self, action):\n self.action = action\n return self",
"def set_action(self, action):\n self.action = action",
"def set_action(self, action):\n self.action = action",
"def set_actio... | [
"0.798209",
"0.7937381",
"0.78521293",
"0.78521293",
"0.77787465",
"0.7659929",
"0.7434554",
"0.7401559",
"0.73724025",
"0.7369807",
"0.72310543",
"0.72310543",
"0.72310543",
"0.72310543",
"0.72310543",
"0.72310543",
"0.70674974",
"0.699461",
"0.6960725",
"0.6901665",
"0.6726... | 0.7996904 | 0 |
Gets the type of this Lifecycle. Determine when to delete the job and associated files. RETRIEVAL means delete directly after retrieving the PDF file. When the file has not been retrieved before the action time, it will be deleted regardless. Time means, delete on specific time, regardless of whether it has been proces... | def type(self):
return self._type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ExpireType(self):\n if self.force_auto_sync:\n self.get('ExpireType')\n return self._ExpireType",
"def delete_time(self) -> str:\n return pulumi.get(self, \"delete_time\")",
"def delete_time(self) -> str:\n return pulumi.get(self, \"delete_time\")",
"def deleted_tim... | [
"0.5974232",
"0.54896796",
"0.54896796",
"0.51819205",
"0.5125803",
"0.49722493",
"0.4905789",
"0.4882752",
"0.47758582",
"0.47730514",
"0.47563097",
"0.4699075",
"0.46979105",
"0.4691771",
"0.4682157",
"0.4674297",
"0.4623792",
"0.46149534",
"0.46005246",
"0.4593693",
"0.458... | 0.4375041 | 85 |
Sets the type of this Lifecycle. Determine when to delete the job and associated files. RETRIEVAL means delete directly after retrieving the PDF file. When the file has not been retrieved before the action time, it will be deleted regardless. Time means, delete on specific time, regardless of whether it has been proces... | def type(self, type):
allowed_values = ["RETRIEVAL", "TIME"]
if type not in allowed_values:
raise ValueError(
"Invalid value for `type` ({0}), must be one of {1}"
.format(type, allowed_values)
)
self._type = type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__, *,\n duration: pulumi.Input[str],\n object_type: pulumi.Input[str]):\n pulumi.set(__self__, \"duration\", duration)\n pulumi.set(__self__, \"object_type\", 'AbsoluteDeleteOption')",
"def ExpireType(self):\n if self.force_auto_sync:\n ... | [
"0.55426234",
"0.54422",
"0.54303664",
"0.5243352",
"0.5130753",
"0.51242626",
"0.49633163",
"0.49580863",
"0.4862699",
"0.4837523",
"0.48264766",
"0.47609124",
"0.47609124",
"0.47589472",
"0.47226307",
"0.4716207",
"0.4709835",
"0.46772438",
"0.46732327",
"0.46732327",
"0.46... | 0.5637675 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
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.7961088",
"0.7961088",
"0.79433626",
"0.79303336",
"0.7926563",
"0.7897525",
"0.78826123",
"0.78826123",
"0.78806067",
"0.7872423",
"0.7868354",
"0.78668815",
"0.7825702",
"0.7819993",
"0.78162885",
"0.78078854",
"0.78068... | 0.79670393 | 45 |
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 |
initialize a player and associated symbol. | def __init__(
self,
symbol: int,
lr: float = 0.2,
exp_rate: float = 0.4,
discount_factor: float = 0.1,
) -> None:
self.symbol = symbol
self.lr = lr
self.exp_rate = exp_rate
self.discount_factor = discount_factor
self.states: Dict[str, f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, player_name):\n self._player_name = player_name\n self._hand = Deck() \n self._coder = Deck()",
"def __init__(self, player):\n\t\tself.player = player",
"def __init__(self, symbol, row, col, player, king):\n self.symbol = symbol\n self.row = row\n ... | [
"0.7044783",
"0.6994902",
"0.6952127",
"0.6900736",
"0.69004774",
"0.68714845",
"0.6831614",
"0.67411584",
"0.6740048",
"0.67184275",
"0.66184455",
"0.65796345",
"0.6571856",
"0.65473825",
"0.6523081",
"0.64922744",
"0.6482463",
"0.647235",
"0.6465849",
"0.6444604",
"0.643477... | 0.0 | -1 |
add move to front of the list. | def update_move_history(self, board_hash: str) -> None:
self.moves_taken.insert(0, board_hash) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_front(self, item):\n\n self.items.insert(0, item)",
"def addFront(self, item, clock):\n temp = Node2Way(item, clock)\n temp.setPrevious(self._front)\n \n if self._size == 0:\n self._rear = temp\n else:\n self._front.setNext(temp)\n ... | [
"0.74281985",
"0.7051179",
"0.6917639",
"0.68836725",
"0.6876215",
"0.6802277",
"0.67820287",
"0.67804265",
"0.672873",
"0.66930217",
"0.66753036",
"0.66617584",
"0.6631564",
"0.6548123",
"0.63872343",
"0.6376272",
"0.6376272",
"0.62471837",
"0.6227319",
"0.6203899",
"0.61776... | 0.0 | -1 |
Insert prefix into current tree. | def insert_suffix(self, prefix, idx):
parent_pos = self.path_to_matching_prefix(prefix)[-1]
has_inserted = False
for child_pos in self.children(parent_pos):
if child_pos.element()._label[0] == prefix[0]:
# Intermediate node is added between parent and child.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insert(self, prefix: str):\n leaf = self.root\n for level in range(len(prefix)):\n letter = prefix[level]\n\n # if current character is not present\n if letter not in leaf.children:\n leaf.children[letter] = self.get_node()\n leaf = leaf.... | [
"0.824454",
"0.6702643",
"0.6659329",
"0.65441847",
"0.65267813",
"0.6520331",
"0.64193934",
"0.6335701",
"0.6227362",
"0.6089401",
"0.6089401",
"0.60877794",
"0.60377556",
"0.6022887",
"0.6006063",
"0.59953064",
"0.5995097",
"0.59828734",
"0.5922838",
"0.59098965",
"0.590850... | 0.5517972 | 76 |
Calculate the great circle distance between two points on the earth (specified in decimal degrees) by default, between the center of the earh and anypoint | def haversine( coordsA, coordsB = {'lat': 0, 'long': 0} ) -> int:
# convert decimal degrees to radians
if type( coordsA ) == dict:
[lat1, lon1] = [coordsA['lat'], coordsA['long']]
elif type( coordsA ) == str:
[lat1, lon1] = coordsA.split(",")
elif type( coordsA ) == list:
[lat1,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long... | [
"0.76905084",
"0.72814983",
"0.7257619",
"0.7141139",
"0.71320075",
"0.6970445",
"0.69449705",
"0.6929295",
"0.6892779",
"0.6889518",
"0.68526417",
"0.68168545",
"0.6815274",
"0.68049467",
"0.67489856",
"0.6743163",
"0.67333126",
"0.6712626",
"0.66993904",
"0.66911364",
"0.66... | 0.0 | -1 |
Creates a new catalog based on information provided in the request. | def create_catalog_v0(self, create_catalog_request, **kwargs):
# type: (CreateCatalogRequest_f3cdf8bb, **Any) -> Union[ApiResponse, object, BadRequestError_a8ac8b44, CatalogDetails_912693fa, Error_d660d58]
operation_name = "create_catalog_v0"
params = locals()
for key, val in six.iterite... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def catalog_create(self, args):\n try:\n if args.id and self.server.connect_ermrest(args.id).exists():\n print(\"Catalog already exists\")\n return\n owner = args.owner if args.owner else None\n catalog = self.server.create_ermrest_catalog(args.... | [
"0.7075962",
"0.66169626",
"0.65908253",
"0.6559741",
"0.6491398",
"0.6491398",
"0.6491398",
"0.6474749",
"0.64458245",
"0.63912857",
"0.6327027",
"0.6295636",
"0.624926",
"0.61907876",
"0.6131978",
"0.61135054",
"0.60304767",
"0.60023105",
"0.60003024",
"0.5982443",
"0.59681... | 0.6687406 | 1 |
Lists all the subscriptions for a vendor/subscriber depending on the query parameter. | def list_subscriptions_for_development_events_v0(self, vendor_id, **kwargs):
# type: (str, **Any) -> Union[ApiResponse, object, BadRequestError_a8ac8b44, ListSubscriptionsResponse_c033036c, Error_d660d58]
operation_name = "list_subscriptions_for_development_events_v0"
params = locals()
f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getAllSubscriptions(self):\n return self.request(\n \"getAllSubscriptions\",\n )",
"def get_all_subscriptions(cls, **kwargs):\n return Subscription.query.filter(**kwargs).all()",
"def get_subscriptions(self):\n url = '{}/v2/subscriptions'.format(self.url)\n r =... | [
"0.68718314",
"0.64479876",
"0.63930523",
"0.6370241",
"0.6262095",
"0.6189397",
"0.61583257",
"0.61445445",
"0.6092694",
"0.60551304",
"0.6022969",
"0.59707063",
"0.5958804",
"0.59293044",
"0.5877195",
"0.5875781",
"0.58724755",
"0.5828251",
"0.5802563",
"0.57452756",
"0.574... | 0.6165321 | 6 |
Get the list of inskill products for the vendor. | def get_isp_list_for_vendor_v1(self, vendor_id, **kwargs):
# type: (str, **Any) -> Union[ApiResponse, object, Error_fbe913d9, BadRequestError_f854b05, ListInSkillProductResponse_505e7307]
operation_name = "get_isp_list_for_vendor_v1"
params = locals()
for key, val in six.iteritems(params... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_products(self):\n url = self.base_url\n # TODO add filtering support when holvi api supports it\n obdata = self.connection.make_get(url)\n return ProductList(obdata, self)",
"def products(self):\n return list(Product.select())",
"def get_products(self):\n retu... | [
"0.6733137",
"0.6547819",
"0.65187454",
"0.648127",
"0.63539016",
"0.6321409",
"0.6284851",
"0.62413895",
"0.62055516",
"0.61503416",
"0.6140966",
"0.61330837",
"0.6085362",
"0.6000095",
"0.5997312",
"0.59685934",
"0.5965533",
"0.592143",
"0.5869935",
"0.58443815",
"0.5842674... | 0.66241527 | 1 |
Resets the entitlement(s) of the Product for the current user. | def reset_entitlement_for_product_v1(self, product_id, stage, **kwargs):
# type: (str, str, **Any) -> Union[ApiResponse, object, Error_fbe913d9, BadRequestError_f854b05]
operation_name = "reset_entitlement_for_product_v1"
params = locals()
for key, val in six.iteritems(params['kwargs']):... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_user(self):\n\n if self.resin.auth.is_logged_in():\n self.wipe_application()\n self.resin.models.key.base_request.request(\n 'user__has__public_key', 'DELETE',\n endpoint=self.resin.settings.get('pine_endpoint'), login=True\n )",
"de... | [
"0.56585646",
"0.54697764",
"0.52775943",
"0.52775943",
"0.51205343",
"0.5110504",
"0.5110504",
"0.5086956",
"0.5080355",
"0.5080355",
"0.5065258",
"0.5040448",
"0.5031072",
"0.5013237",
"0.49968353",
"0.49950162",
"0.4991405",
"0.49880537",
"0.49675336",
"0.49537265",
"0.491... | 0.60211426 | 0 |
Returns the inskill product definition for given productId. | def get_isp_definition_v1(self, product_id, stage, **kwargs):
# type: (str, str, **Any) -> Union[ApiResponse, object, InSkillProductDefinitionResponse_4aa468ff, Error_fbe913d9, BadRequestError_f854b05]
operation_name = "get_isp_definition_v1"
params = locals()
for key, val in six.iterite... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_product_by_id(productId): # noqa: E501\n return 'do some magic!'",
"def _product_spec_by_id(self, product_id):\n if not isinstance(product_id, int):\n raise TypeError(\"Product ID should be integer\")\n\n for product_group in self.db:\n for db_id in self.db[product... | [
"0.6464672",
"0.612124",
"0.605774",
"0.6039397",
"0.5857793",
"0.58464456",
"0.5832984",
"0.57331824",
"0.5726266",
"0.5706458",
"0.56913775",
"0.56698745",
"0.56065446",
"0.55776674",
"0.55651134",
"0.5551204",
"0.5525478",
"0.5506871",
"0.55012226",
"0.54999846",
"0.546534... | 0.6508556 | 0 |
Updates inskill product definition for given productId. Only development stage supported. | def update_isp_for_product_v1(self, product_id, stage, update_in_skill_product_request, **kwargs):
# type: (str, str, UpdateInSkillProductRequest_ee975cf1, **Any) -> Union[ApiResponse, object, Error_fbe913d9, BadRequestError_f854b05]
operation_name = "update_isp_for_product_v1"
params = locals()... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_product_form(productId, name=None, status=None): # noqa: E501\n return 'do some magic!'",
"def associate_isp_with_skill_v1(self, product_id, skill_id, **kwargs):\n # type: (str, str, **Any) -> Union[ApiResponse, object, Error_fbe913d9, BadRequestError_f854b05]\n operation_name = \"as... | [
"0.61609936",
"0.61382127",
"0.6079622",
"0.6055985",
"0.6021867",
"0.5917009",
"0.5853831",
"0.578811",
"0.5721086",
"0.5692899",
"0.56461924",
"0.5592242",
"0.5513153",
"0.54926187",
"0.54778296",
"0.54778296",
"0.547739",
"0.54153234",
"0.5413967",
"0.539913",
"0.5369796",... | 0.7032969 | 0 |
Create a new version of catalog entity for the given catalogId. | def create_interaction_model_catalog_version_v1(self, catalog_id, catalog, **kwargs):
# type: (str, VersionData_af79e8d3, **Any) -> Union[ApiResponse, object, StandardizedError_f5106a89, BadRequestError_f854b05]
operation_name = "create_interaction_model_catalog_version_v1"
params = locals()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_catalog(self, catalog_form, *args, **kwargs):\n # Implemented from kitosid template for -\n # osid.resource.BinAdminSession.update_bin\n if catalog_form.is_for_update():\n return self.update_catalog(catalog_form, *args, **kwargs)\n else:\n return self.crea... | [
"0.63733524",
"0.60968757",
"0.59381574",
"0.5849364",
"0.5631473",
"0.56290007",
"0.5573641",
"0.541416",
"0.5320255",
"0.5284916",
"0.51846284",
"0.5158538",
"0.5151632",
"0.5151632",
"0.5151632",
"0.5143142",
"0.50983435",
"0.5016219",
"0.5011444",
"0.48950619",
"0.4868419... | 0.64581627 | 0 |
Create a new version of catalog within the given catalogId. | def create_interaction_model_catalog_v1(self, catalog, **kwargs):
# type: (DefinitionData_ccdbb3c2, **Any) -> Union[ApiResponse, object, StandardizedError_f5106a89, BadRequestError_f854b05, CatalogResponse_2f6fe800]
operation_name = "create_interaction_model_catalog_v1"
params = locals()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_interaction_model_catalog_version_v1(self, catalog_id, catalog, **kwargs):\n # type: (str, VersionData_af79e8d3, **Any) -> Union[ApiResponse, object, StandardizedError_f5106a89, BadRequestError_f854b05]\n operation_name = \"create_interaction_model_catalog_version_v1\"\n params = lo... | [
"0.67172396",
"0.66241366",
"0.6411221",
"0.61139303",
"0.60931635",
"0.60772866",
"0.59919316",
"0.58426154",
"0.56691957",
"0.5585019",
"0.55460954",
"0.54605365",
"0.54605365",
"0.54605365",
"0.5314542",
"0.5303763",
"0.5287909",
"0.52464443",
"0.52163446",
"0.5205255",
"0... | 0.5686495 | 8 |
Get the job definition for a given jobId. | def get_job_definition_for_interaction_model_v1(self, job_id, **kwargs):
# type: (str, **Any) -> Union[ApiResponse, object, JobDefinition_ee5db797, StandardizedError_f5106a89, BadRequestError_f854b05]
operation_name = "get_job_definition_for_interaction_model_v1"
params = locals()
for ke... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getJob(appName, jobId):\n jobs = db.getJobs(jobId=jobId)\n job = None if len(jobs) == 0 else jobs[0]\n k3job = dispatcher.getJob(int(jobId))\n\n if job == None:\n return returnError(\"Job ID, %s, does not exist\" % jobId, 404)\n\n thisjob = dict(job, url=dispatcher.getSandboxURL(jobId))\n ... | [
"0.6733971",
"0.66941005",
"0.6649771",
"0.6326726",
"0.6157881",
"0.61231804",
"0.6093605",
"0.603794",
"0.599705",
"0.5994838",
"0.5956366",
"0.5933748",
"0.5930244",
"0.59101045",
"0.58962494",
"0.583849",
"0.5829483",
"0.5825037",
"0.58040255",
"0.5797566",
"0.57620466",
... | 0.61414254 | 5 |
Get the client credentials for the skill. | def get_skill_credentials_v1(self, skill_id, **kwargs):
# type: (str, **Any) -> Union[ApiResponse, object, SkillCredentials_a0f29ab1, StandardizedError_f5106a89]
operation_name = "get_skill_credentials_v1"
params = locals()
for key, val in six.iteritems(params['kwargs']):
par... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_credentials():\n store = Storage(CREDENTIAL_PATH)\n credentials = store.get()\n if not credentials or credentials.invalid:\n flow = client.flow_from_clientsecrets(CLIENT_SECRET_FILE, SCOPES)\n flow.user_agent = APPLICATION_NAME\n credentials = tools.run_flow(flow, store, None)... | [
"0.71183974",
"0.7040505",
"0.6986467",
"0.6819112",
"0.6801401",
"0.6746724",
"0.6698499",
"0.66541725",
"0.6647859",
"0.66109496",
"0.66101664",
"0.65356505",
"0.65211594",
"0.6521077",
"0.6515439",
"0.65115696",
"0.650605",
"0.6496887",
"0.6481387",
"0.6481387",
"0.6475491... | 0.640914 | 29 |
Retrieves the current state of the experiment. | def get_experiment_state_v1(self, skill_id, experiment_id, **kwargs):
# type: (str, str, **Any) -> Union[ApiResponse, object, GetExperimentStateResponse_5152b250, StandardizedError_f5106a89, BadRequestError_f854b05]
operation_name = "get_experiment_state_v1"
params = locals()
for key, va... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_state(self):\n return self.env.sim.get_state()",
"def get_state(self):\r\n return self.currentObservation",
"def get_state(self):\n return self._env.get_state()",
"def get_state(self):\n return self.controller.get_state()",
"def get_current_state(self):\n return s... | [
"0.7910478",
"0.7819327",
"0.7671146",
"0.7528611",
"0.7400455",
"0.73742145",
"0.73703474",
"0.73513436",
"0.73513436",
"0.7308571",
"0.7299559",
"0.72972345",
"0.7290986",
"0.7290986",
"0.7290986",
"0.7290986",
"0.7290986",
"0.7290986",
"0.7290986",
"0.7290986",
"0.7290986"... | 0.0 | -1 |
The Intent Request History API provides customers with the aggregated and anonymized transcription of user speech data and intent request details for their skills. | def get_utterance_data_v1(self, skill_id, stage, **kwargs):
# type: (str, str, **Any) -> Union[ApiResponse, object, StandardizedError_f5106a89, BadRequestError_f854b05, IntentRequests_35db15c7]
operation_name = "get_utterance_data_v1"
params = locals()
for key, val in six.iteritems(param... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_intent(request, session):\n\n intent_name = request['intent']['name']\n \n # process the intents\n if intent_name == \"AMAZON.HelpIntent\":\n return get_help_response()\n \n elif intent_name == \"AMAZON.StopIntent\":\n return get_stop_response()\n \n elif intent_name ==... | [
"0.5975745",
"0.59443635",
"0.59332824",
"0.5906917",
"0.5881811",
"0.585539",
"0.5846313",
"0.57516015",
"0.57354033",
"0.57280463",
"0.5706581",
"0.5704124",
"0.5685997",
"0.56387645",
"0.56266946",
"0.5604843",
"0.5600372",
"0.5581917",
"0.55706596",
"0.5558074",
"0.553673... | 0.52278984 | 42 |
This is a synchronous API that invokes the Lambda or third party HTTPS endpoint for a given skill. A successful response will contain information related to what endpoint was called, payload sent to and received from the endpoint. In cases where requests to this API results in an error, the response will contain an err... | def invoke_skill_v1(self, skill_id, invoke_skill_request, **kwargs):
# type: (str, InvokeSkillRequest_8cf8aff9, **Any) -> Union[ApiResponse, object, InvokeSkillResponse_6f32f451, StandardizedError_f5106a89, BadRequestError_f854b05]
operation_name = "invoke_skill_v1"
params = locals()
for... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skill_information():\r\n\r\n client = boto3.client('iot-data', region_name='us-west-2')\r\n\r\n session_attributes = {}\r\n card_title = \"Welcome\"\r\n should_end_session = True\r\n reprompt_text = None\r\n\r\n if(is_online()):\r\n speech_output = \"The coffee machine is offline.\"\r\... | [
"0.5912909",
"0.5896748",
"0.57591367",
"0.57437086",
"0.57308966",
"0.5649424",
"0.56391555",
"0.5612456",
"0.55630434",
"0.55491686",
"0.54284877",
"0.5363396",
"0.53060114",
"0.5269332",
"0.5248049",
"0.5243671",
"0.52119356",
"0.5210129",
"0.5205348",
"0.5204494",
"0.5195... | 0.6131731 | 0 |
Create a new NLU annotation set for a skill which will generate a new annotationId. This is an API that creates a new NLU annotation set with properties and returns the annotationId. | def create_nlu_annotation_set_v1(self, skill_id, create_nlu_annotation_set_request, **kwargs):
# type: (str, CreateNLUAnnotationSetRequest_16b1430c, **Any) -> Union[ApiResponse, object, Error_fbe913d9, BadRequestError_f854b05, CreateNLUAnnotationSetResponse_b069cada]
operation_name = "create_nlu_annotat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_annotations_for_nlu_annotation_sets_v1(self, skill_id, annotation_id, accept, **kwargs):\n # type: (str, str, str, **Any) -> Union[ApiResponse, object, Error_fbe913d9, BadRequestError_f854b05]\n operation_name = \"get_annotations_for_nlu_annotation_sets_v1\"\n params = locals()\n ... | [
"0.5991934",
"0.58785355",
"0.5876992",
"0.5777781",
"0.52043295",
"0.5172357",
"0.51515406",
"0.5148755",
"0.51152873",
"0.5086618",
"0.4977804",
"0.48819813",
"0.48653534",
"0.4863833",
"0.4863833",
"0.47762877",
"0.47746676",
"0.47074908",
"0.4689013",
"0.46825206",
"0.467... | 0.7526162 | 0 |
Get the rollback status of a skill given an associated rollbackRequestId. Use ~latest in place of rollbackRequestId to get the latest rollback status. | def get_rollback_for_skill_v1(self, skill_id, rollback_request_id, **kwargs):
# type: (str, str, **Any) -> Union[ApiResponse, object, StandardizedError_f5106a89, BadRequestError_f854b05, RollbackRequestStatus_71665366]
operation_name = "get_rollback_for_skill_v1"
params = locals()
for ke... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rollback_skill_v1(self, skill_id, create_rollback_request, **kwargs):\n # type: (str, CreateRollbackRequest_e7747a32, **Any) -> Union[ApiResponse, object, CreateRollbackResponse_5a2e8250, StandardizedError_f5106a89, BadRequestError_f854b05]\n operation_name = \"rollback_skill_v1\"\n params... | [
"0.6188353",
"0.5348794",
"0.50636834",
"0.49248162",
"0.4864631",
"0.4824027",
"0.4814775",
"0.4814775",
"0.4810125",
"0.47206628",
"0.46720722",
"0.4601886",
"0.4582974",
"0.45225385",
"0.4521484",
"0.45111957",
"0.44771323",
"0.44711003",
"0.44195473",
"0.44100633",
"0.440... | 0.719928 | 0 |
Get the list of inskill products for the skillId. | def get_isp_list_for_skill_id_v1(self, skill_id, stage, **kwargs):
# type: (str, str, **Any) -> Union[ApiResponse, object, Error_fbe913d9, BadRequestError_f854b05, ListInSkillProductResponse_505e7307]
operation_name = "get_isp_list_for_skill_id_v1"
params = locals()
for key, val in six.i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_products(self):\n return [item.code for item in self._products]",
"def list_products(self):\n url = self.base_url\n # TODO add filtering support when holvi api supports it\n obdata = self.connection.make_get(url)\n return ProductList(obdata, self)",
"def list_products... | [
"0.59632087",
"0.59197265",
"0.590533",
"0.5828244",
"0.57245255",
"0.5663034",
"0.56141776",
"0.55580974",
"0.55575114",
"0.5537327",
"0.553261",
"0.55187964",
"0.5504587",
"0.54901576",
"0.54774684",
"0.54679954",
"0.54339874",
"0.5425092",
"0.5394326",
"0.53756917",
"0.536... | 0.70336187 | 0 |
Gets the `InteractionModel` for the skill in the given stage. The path params skillId, stage and locale are required. | def get_interaction_model_v1(self, skill_id, stage_v2, locale, **kwargs):
# type: (str, str, str, **Any) -> Union[ApiResponse, object, StandardizedError_f5106a89, BadRequestError_f854b05, InteractionModelData_487fc9ea]
operation_name = "get_interaction_model_v1"
params = locals()
for key... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_interaction_model_metadata_v1(self, skill_id, stage_v2, locale, **kwargs):\n # type: (str, str, str, **Any) -> Union[ApiResponse, object, StandardizedError_f5106a89, BadRequestError_f854b05]\n operation_name = \"get_interaction_model_metadata_v1\"\n params = locals()\n for key, ... | [
"0.5837195",
"0.5794024",
"0.556514",
"0.5178054",
"0.51161706",
"0.4783202",
"0.47309718",
"0.4666063",
"0.46613026",
"0.46403983",
"0.45909518",
"0.4589444",
"0.4541329",
"0.45185766",
"0.4510075",
"0.4501116",
"0.44332525",
"0.436137",
"0.43485343",
"0.4298251",
"0.4294916... | 0.6707876 | 0 |
Gets the specified version `InteractionModel` of a skill for the vendor. Use `~current` as version parameter to get the current version model. | def get_interaction_model_version_v1(self, skill_id, stage_v2, locale, version, **kwargs):
# type: (str, str, str, str, **Any) -> Union[ApiResponse, object, StandardizedError_f5106a89, BadRequestError_f854b05, InteractionModelData_487fc9ea]
operation_name = "get_interaction_model_version_v1"
par... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetModelVersion(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n raise NotImplementedError('Method not implemented!')",
"def get_version():\n global __model\n return __model.__version__",
"def model(self):\n ... | [
"0.609386",
"0.60471684",
"0.59729415",
"0.5941532",
"0.57474136",
"0.5744456",
"0.5716244",
"0.5673265",
"0.5659888",
"0.55117637",
"0.5506471",
"0.5478209",
"0.5478209",
"0.5478209",
"0.5478209",
"0.5478209",
"0.5478209",
"0.5478209",
"0.5478209",
"0.5478209",
"0.5478209",
... | 0.63348377 | 0 |
Returns the skill manifest for given skillId and stage. | def get_skill_manifest_v1(self, skill_id, stage_v2, **kwargs):
# type: (str, str, **Any) -> Union[ApiResponse, object, SkillManifestEnvelope_fc0e823b, StandardizedError_f5106a89, BadRequestError_f854b05]
operation_name = "get_skill_manifest_v1"
params = locals()
for key, val in six.iteri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_skill_manifest_v1(self, skill_id, stage_v2, update_skill_request, **kwargs):\n # type: (str, str, SkillManifestEnvelope_fc0e823b, **Any) -> Union[ApiResponse, object, StandardizedError_f5106a89, BadRequestError_f854b05]\n operation_name = \"update_skill_manifest_v1\"\n params = loca... | [
"0.58649564",
"0.5746228",
"0.5555346",
"0.54651296",
"0.5207292",
"0.51761097",
"0.510083",
"0.50791603",
"0.49944592",
"0.48343024",
"0.4796685",
"0.47939762",
"0.4792742",
"0.47889155",
"0.47459278",
"0.47426957",
"0.47282284",
"0.47118324",
"0.46940255",
"0.4669653",
"0.4... | 0.7073502 | 0 |
Invokes the Lambda or third party HTTPS endpoint for the given skill against a given stage. This is a synchronous API that invokes the Lambda or third party HTTPS endpoint for a given skill. A successful response will contain information related to what endpoint was called, payload sent to and received from the endpoin... | def invoke_skill_end_point_v2(self, skill_id, stage, **kwargs):
# type: (str, str, **Any) -> Union[ApiResponse, object, BadRequestError_765e0ac6, InvocationsApiResponse_3d7e3234, Error_ea6c1a5a]
operation_name = "invoke_skill_end_point_v2"
params = locals()
for key, val in six.iteritems(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def invoke_skill_v1(self, skill_id, invoke_skill_request, **kwargs):\n # type: (str, InvokeSkillRequest_8cf8aff9, **Any) -> Union[ApiResponse, object, InvokeSkillResponse_6f32f451, StandardizedError_f5106a89, BadRequestError_f854b05]\n operation_name = \"invoke_skill_v1\"\n params = locals()\n... | [
"0.5358969",
"0.5293235",
"0.528769",
"0.50172585",
"0.49989742",
"0.49976173",
"0.49679202",
"0.49613965",
"0.48948103",
"0.48303246",
"0.47997808",
"0.4771908",
"0.4771333",
"0.47675943",
"0.47169495",
"0.47111094",
"0.47069886",
"0.47030997",
"0.46804383",
"0.46728724",
"0... | 0.70120853 | 0 |
Issues a PATCH to the specified uri, passing the supplied body | def fusion_api_generic_patch(self, body, uri, api=None, headers=None):
if api:
headers = self.fusion_client._set_req_api_version(api=api)
elif not headers:
headers = self.fusion_client._headers
uri = 'https://%s%s' % (self.fusion_client._host, uri)
return self.fus... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patch(self, url, body=None, headers=None):\n return self._request('PATCH', url, body, headers)",
"def fusion_api_patch_fabric(self, uri, body, api=None, headers=None):\n return self.fabric.patch(uri, body, api, headers)",
"def patch(self, path, body):\n url = urljoin(self.api_endpo... | [
"0.77083725",
"0.7659384",
"0.7624684",
"0.75942343",
"0.73600644",
"0.7331018",
"0.7139078",
"0.6876234",
"0.6847816",
"0.6767257",
"0.6766447",
"0.67284626",
"0.66456074",
"0.656354",
"0.65493995",
"0.65445983",
"0.6524909",
"0.6506091",
"0.64907485",
"0.64639413",
"0.64432... | 0.73655456 | 4 |
Takes a list of dictionaries and returns the (first) dictionary that contains the given key value pair | def fusion_api_get_dict_from_list(self, listofDict, key, value):
for d in listofDict:
if d[key] == value:
return d
return {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(list_of_dict, key, value):\n return filter(lambda dictionary: dictionary[key] == value, list_of_dict)",
"def _search_list_of_dictionaries(key, value, list_of_dictionaries):\n\n for element in list_of_dictionaries:\n if element.get(key) == value:\n return element\n ... | [
"0.74982864",
"0.7346386",
"0.6997044",
"0.67986053",
"0.6752747",
"0.6747529",
"0.671175",
"0.66192144",
"0.6596726",
"0.6574854",
"0.64542264",
"0.6324983",
"0.6310137",
"0.6189611",
"0.61807764",
"0.61573076",
"0.6144855",
"0.60709363",
"0.60579413",
"0.6054688",
"0.602998... | 0.7208419 | 2 |
Compares the entire response body (json dict) with the previously created expected (dict). Only the items in the expected are evaluated. Extra items in the response are ignored except in the case of a list [] type. Lists are verified to have the same number of items. When originally written, this function would fail on... | def fusion_api_validate_response_follow(self, expected, response, uriCache={}, wordy=False, depth=0,
disable_dict_sorting=False,
disable_list_sorting=False,
called_by_logged=False):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_process_resp(self, resp, expected_fields=None):\n\n if resp.status_code != LenovoRestClient.RESP_CODE_OK:\n raise cexc.NOSRestHTTPError(http_code=resp.status_code,\n http_reason=resp.reason, http_op=resp.request.method,\n url=resp.url, http_res... | [
"0.6131817",
"0.6061034",
"0.6018319",
"0.59335274",
"0.5933225",
"0.5876628",
"0.58536416",
"0.5803603",
"0.57731",
"0.57661444",
"0.5750166",
"0.5725003",
"0.57075226",
"0.5703737",
"0.56503505",
"0.56431496",
"0.5613102",
"0.56036854",
"0.55543786",
"0.554258",
"0.55344665... | 0.6059691 | 2 |
Updates the specified trap forwarding destination. The trap destination associated with the given id will be updated if a trap destination with that id already exists. [Example] ${resp} = Fusion Api Update Appliance Trap Destination | | | | | def fusion_api_update_appliance_trap_destination(self, body, id, api=None, headers=None): # pylint: disable=W0622
return self.trap.put(body=body, id=id, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fusion_api_add_or_update_appliance_trap_destination(self, body=None, id=None, api=None, headers=None): # pylint: disable=W0622\n return self.trap.create(body=body, id=id, api=api, headers=headers)",
"def fusion_api_edit_appliance_snmpv3_trap_destination(self, body=None, id=None, api=None, headers... | [
"0.6613562",
"0.6590284",
"0.5745858",
"0.5331495",
"0.5328401",
"0.532052",
"0.5276687",
"0.5275363",
"0.51345956",
"0.5115327",
"0.50964355",
"0.5036326",
"0.50140005",
"0.49928546",
"0.4823668",
"0.47933242",
"0.47568846",
"0.47446564",
"0.47323117",
"0.46850047",
"0.46842... | 0.74026597 | 0 |
Gets a default or paginated collection of Connections [Arguments] | def fusion_api_get_connections(self, uri=None, param='', api=None, headers=None):
return self.conn.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_connections(self, id, connection_name, **args):\n return self.request(id + \"/\" + connection_name, args)",
"def get_connections(self, id, connection_name, **args):\n return self.request(\n \"{0}/{1}/{2}\".format(self.version, id, connection_name), args\n )",
"def get_al... | [
"0.6931733",
"0.663533",
"0.65736204",
"0.65408987",
"0.6520295",
"0.6483001",
"0.6483001",
"0.6461461",
"0.6389838",
"0.623619",
"0.6185604",
"0.60714126",
"0.60550255",
"0.5961917",
"0.5955461",
"0.5941752",
"0.5908974",
"0.58920044",
"0.5880017",
"0.58781475",
"0.5866742",... | 0.5358474 | 39 |
Issues a PATCH request to a drive enclosure. See RESTAPI docs for valid request bodies [Arguments] | def fusion_api_patch_drive_enclosure(self, body, uri, api=None, headers=None):
return self.drive_enclosure.patch(body, uri, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patch(self, *args, **kwargs):\n self.request(\"patch\", *args, **kwargs)",
"def client_patch(self, path, data=None, content_type=client.MULTIPART_CONTENT, follow=False, **extra):\r\n\r\n data = data or {}\r\n response = super(client.Client, self).patch(path, data=data, content_type=content_type,... | [
"0.69250757",
"0.6663205",
"0.6662519",
"0.664325",
"0.65036833",
"0.6449954",
"0.64494",
"0.6431868",
"0.6422519",
"0.6397085",
"0.639598",
"0.63724047",
"0.63440573",
"0.6308826",
"0.62631166",
"0.6232683",
"0.6213324",
"0.6213324",
"0.6213324",
"0.6213324",
"0.6213324",
... | 0.6808087 | 1 |
Issues a PATCH request to an enclosure. See RESTAPI docs for valid request bodies [Arguments] | def fusion_api_patch_enclosure(self, body, uri, api=None, headers=None, etag=None):
return self.enclosure.patch(body, uri, api, headers, etag) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patch(self, *args, **kwargs):\n self.request(\"patch\", *args, **kwargs)",
"def patch(self, url, body=None, headers=None):\n return self._request('PATCH', url, body, headers)",
"def httpPatch(self, url='', data='', params={}, headers={}):\n\n return self.httpRequest('PATCH', url, data,... | [
"0.7322979",
"0.68914396",
"0.68123513",
"0.6810135",
"0.67109245",
"0.6618471",
"0.660938",
"0.65981245",
"0.65977496",
"0.6591905",
"0.6591386",
"0.6590417",
"0.65834326",
"0.6566933",
"0.6551695",
"0.6551422",
"0.652787",
"0.6520931",
"0.65115",
"0.6510823",
"0.6449295",
... | 0.71574557 | 1 |
Patch a fabric based on uri provided [Arguments] | def fusion_api_patch_fabric(self, uri, body, api=None, headers=None):
return self.fabric.patch(uri, body, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fusion_api_edit_fabric_manager(self, body, uri, api=None, headers=None):\n return self.fabricmanager.put(body=body, uri=uri, api=api, headers=headers)",
"def patch(self, *args, **kwargs):\n self.request(\"patch\", *args, **kwargs)",
"def patch(self, uri, data=None, **kwargs):\n ret... | [
"0.6105052",
"0.59244967",
"0.5895854",
"0.568877",
"0.56826943",
"0.56228423",
"0.5620909",
"0.55593264",
"0.55578506",
"0.5538882",
"0.55009985",
"0.54826397",
"0.54781485",
"0.54612875",
"0.5444421",
"0.54081976",
"0.5402439",
"0.5346956",
"0.5307811",
"0.53018963",
"0.529... | 0.70708567 | 0 |
Returns all the free fragments in a IPv4 Range. [Arguments] | def fusion_api_get_ipv4_range_free_fragments(self, uri, api=None, headers=None):
return self.ipv4range.get(uri=uri, api=api, headers=headers, param='/free-fragments') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fusion_api_get_ipv4_range_allocated_fragments(self, uri, api=None, headers=None):\n return self.ipv4range.get(uri=uri, api=api, headers=headers, param='/allocated-fragments')",
"def fusion_api_get_vmac_range_free_fragments(self, uri, api=None, headers=None):\n return self.vmacrange.get(... | [
"0.72713524",
"0.68684775",
"0.68349123",
"0.67930484",
"0.672236",
"0.65734833",
"0.64969206",
"0.6338586",
"0.6236195",
"0.57705426",
"0.5738103",
"0.5639637",
"0.5541575",
"0.549044",
"0.5446197",
"0.5423923",
"0.53578913",
"0.5311482",
"0.52758336",
"0.52411574",
"0.52273... | 0.79109085 | 0 |
Fetches the current configuration for which metrics are being relayed. [Example] ${resp} = Fusion Api Get Metrics Configuration | | | def fusion_api_get_metrics_configuration(self, api=None, headers=None):
return self.metrics.get(api=api, headers=headers, param='/configuration') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_config(req):\n #try:\n # user_id = req.user\n #except KeyError as e:\n # msg = req.get_error_msg(e)\n # return send_error_response(msg)\n try:\n config = tools_config_get_config(req)\n except Exception:\n raise http_exc.HTTPClientError()\n else:\n retur... | [
"0.66372234",
"0.6462638",
"0.6452565",
"0.6445916",
"0.6443163",
"0.6286106",
"0.6253097",
"0.62112087",
"0.61938095",
"0.6167818",
"0.6142554",
"0.6061876",
"0.6059525",
"0.6024392",
"0.6022809",
"0.59841913",
"0.5945762",
"0.5941983",
"0.59398097",
"0.5911986",
"0.5910538"... | 0.70904857 | 0 |
Refreshes a SAS Interconnect using the PATCH http verb. [Arguments] | def fusion_api_refresh_sas_interconnect(self, body=None, uri=None, param='', api=None, headers=None):
param = "/refreshState%s" % param
return self.sasics.patch(body=body, uri=uri, param=param, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fusion_api_patch_sas_interconnect(self, body=None, uri=None, api=None, headers=None):\n return self.sasics.patch(body=body, uri=uri, api=api, headers=headers)",
"def fusion_api_patch_interconnect(self, body, uri, param='', api=None, headers=None):\n return self.ic.patch(body=body, uri=u... | [
"0.6675101",
"0.627341",
"0.6237193",
"0.6141386",
"0.6027831",
"0.5904484",
"0.58985615",
"0.5815906",
"0.5799898",
"0.57866615",
"0.5774356",
"0.5731663",
"0.5718279",
"0.57136154",
"0.5711923",
"0.5688395",
"0.55969775",
"0.5579017",
"0.55683225",
"0.55654866",
"0.5550302"... | 0.65348923 | 1 |
Issues a PATCH request. See RESTAPI docs for valid request bodies [Arguments] | def fusion_api_patch_server_hardware(self, body, uri, api=None, headers=None):
return self.sh.patch(body, uri, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patch(self, *args, **kwargs):\n self.request(\"patch\", *args, **kwargs)",
"def patch(self, url, body=None, headers=None):\n return self._request('PATCH', url, body, headers)",
"def patch(self, url_or_path, *args, **kwargs):\n return self.request.patch(url_or_path, *args, **kwargs).jso... | [
"0.7938083",
"0.7449449",
"0.742562",
"0.7417484",
"0.7357582",
"0.7285772",
"0.7233902",
"0.719851",
"0.71922064",
"0.71890086",
"0.7187706",
"0.7187706",
"0.7187706",
"0.7187706",
"0.7187706",
"0.7187706",
"0.7187706",
"0.7187706",
"0.7187706",
"0.7187706",
"0.7187706",
"... | 0.0 | -1 |
Send a POST rest call to the HAL Test Webapp on Fusion | def hal_api_perform_post_action(self, fusion_ip, action=None, parameters=None, retries=5):
url = "https://" + fusion_ip + \
"/perm/rest/tbird/pemOperation"
# Build Payload and initialize
data = {"PemOperation": "performAction",
"ActionName": "",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_post_method(self):\n self.getPage('/', method='POST')\n self.assertStatus('200 OK')\n self.assertHeader('Content-Type', 'application/json')",
"def test_post(self):\n return self.doRequest(self.url, method=\"POST\", body=self.input)",
"def test_post(self):\n client = ... | [
"0.7195425",
"0.702145",
"0.69609934",
"0.69108003",
"0.6867677",
"0.6861576",
"0.67064506",
"0.666035",
"0.66593635",
"0.66006505",
"0.65784454",
"0.65768015",
"0.6563718",
"0.6562291",
"0.6559118",
"0.65375435",
"0.65372556",
"0.65215045",
"0.65138274",
"0.6511443",
"0.6489... | 0.0 | -1 |
Gets a Deployment Manager. [Arguments] | def fusion_api_get_deployment_manager(self, uri=None, param='', api=None, headers=None):
return self.dep_mgr.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_manager(api_version=None):\n from manager import get_keystone_manager\n return get_keystone_manager(get_local_endpoint(), get_admin_token(),\n api_version)",
"def GetManager(self):\r\n\r\n return self.manager",
"def get_manager():\n return __manager__",
... | [
"0.6725439",
"0.64918023",
"0.62597597",
"0.6233775",
"0.61700165",
"0.6023853",
"0.58021766",
"0.57533944",
"0.57072103",
"0.5679756",
"0.5606789",
"0.5581873",
"0.55539227",
"0.5527742",
"0.55214655",
"0.5490343",
"0.54241663",
"0.53941226",
"0.53548354",
"0.5341178",
"0.53... | 0.7509083 | 0 |
Gets a Hypervisor cluster profile. [Arguments] | def fusion_api_get_hypervisor_cluster_profile(self, uri=None, param='', api=None, headers=None):
return self.cluster_profile.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cluster(self, profile):\n if self._value.has_option(profile, 'cluster'):\n if self._value.has_option(profile, 'cluster'):\n cluster = self._value.get(profile, 'cluster')\n self.logger.info(\"Connecting to: %s cluster\" % cluster)\n else:\n ... | [
"0.71974623",
"0.645041",
"0.6425894",
"0.6204044",
"0.6123612",
"0.60758156",
"0.6050714",
"0.59964824",
"0.59913784",
"0.59863085",
"0.5854982",
"0.5842499",
"0.58419126",
"0.57995874",
"0.57753825",
"0.5745835",
"0.57405496",
"0.5696487",
"0.56512314",
"0.56255156",
"0.561... | 0.80410475 | 0 |
Issues a PATCH request. See RESTAPI docs for valid request bodies [Arguments] | def fusion_api_patch_rack_manager(self, body, uri, api=None, headers=None):
return self.rackmanager.patch(body=body, uri=uri, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patch(self, *args, **kwargs):\n self.request(\"patch\", *args, **kwargs)",
"def patch(self, url, body=None, headers=None):\n return self._request('PATCH', url, body, headers)",
"def patch(self, url_or_path, *args, **kwargs):\n return self.request.patch(url_or_path, *args, **kwargs).jso... | [
"0.7937596",
"0.7447879",
"0.7425883",
"0.7416192",
"0.7356485",
"0.72845966",
"0.7232765",
"0.71977687",
"0.7190924",
"0.71888465",
"0.7187323",
"0.7187323",
"0.7187323",
"0.7187323",
"0.7187323",
"0.7187323",
"0.7187323",
"0.7187323",
"0.7187323",
"0.7187323",
"0.7187323",
... | 0.0 | -1 |
Get the value of the ADDONSPATH variable. | def get_cached_addon_path():
settingspath = get_cached_setting_path()
if not settingspath:
logger.error("#SETTINGSPATH# resolution required but was not found")
return
return os.path.join(settingspath, "Addons") + "\\" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_abs_path(self, value):\n return os.path.abspath(os.path.expanduser(os.path.expandvars(value)))",
"def location(self):\n\n p = os.path.abspath(__file__)\n pathSP = os.path.split(p)\n return pathSP",
"def _GetSystemPath():\n return encoding_util.GetEncodedValue(os.environ, \"PATH... | [
"0.6033623",
"0.5921134",
"0.58051646",
"0.5630593",
"0.5581429",
"0.5525819",
"0.55247533",
"0.5490318",
"0.5476768",
"0.54625976",
"0.54127926",
"0.53831667",
"0.5338885",
"0.5338132",
"0.53280693",
"0.53262985",
"0.52948344",
"0.5281537",
"0.52779865",
"0.52707076",
"0.526... | 0.5957791 | 1 |
Yield successive nsized chunks from lst. | def chunks(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i + n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chunks(self, lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]",
"def chunks(lst: list, n: int):\n for i in range(0, len(lst), n):\n yield lst[i : i + n]",
"def chunks(lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]",
"de... | [
"0.83071756",
"0.81939614",
"0.81910837",
"0.81910837",
"0.8190213",
"0.81267184",
"0.81218547",
"0.81218547",
"0.80773693",
"0.80526286",
"0.80526286",
"0.80526286",
"0.80526286",
"0.80526286",
"0.80042696",
"0.7871678",
"0.7845623",
"0.7828392",
"0.7827006",
"0.78138447",
"... | 0.80533457 | 21 |
Method to creates an City object using POST | def post_state_city(state_id):
if not request.get_json():
return make_response(jsonify({"error": "Not a JSON"}), 400)
if storage.get("State", state_id) is None:
abort(404)
if 'name' not in request.get_json():
return make_response(jsonify({"error": "Missing name"}), 400)
obj = re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_city(state_id=None):\n jreq = request.get_json(silent=True)\n state = storage.get(State, state_id)\n\n if state is None:\n abort(404)\n if jreq is None:\n abort(400, 'Not a JSON')\n if 'name' not in jreq:\n abort(400, 'Missing name')\n new_city = City(**jreq)\n ne... | [
"0.79649186",
"0.79572505",
"0.7762739",
"0.7654357",
"0.73793656",
"0.7293891",
"0.6985512",
"0.68425363",
"0.66014796",
"0.64874905",
"0.64441365",
"0.64099985",
"0.6333697",
"0.6226037",
"0.6224602",
"0.6222621",
"0.62019914",
"0.60947216",
"0.6058716",
"0.6040446",
"0.603... | 0.7480158 | 4 |
Retrieve an even spread of indices for an array/Series. This allows us to access representative samples from across the corpus. | def get_spread(array, n):
end = len(array) - 1
spread = np.ceil(np.linspace(0, end, n)).astype(int)
indices = np.unique(spread)
try:
return array[indices]
except KeyError:
return array.iloc[indices] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def master_ndindex(self): # itermaster_indices(self):\n return itertools_product(\n *[range(*r) for r in self.location]\n ) # TODO check",
"def get_odd_indices(items):\n\n result = []\n\n for i in range(len(items)):\n if i % 2 != 0:\n result.append(items[i])\n ... | [
"0.5990912",
"0.586502",
"0.57603425",
"0.5759859",
"0.5582475",
"0.54895645",
"0.54612243",
"0.54612243",
"0.5399744",
"0.5368337",
"0.5368337",
"0.5365263",
"0.5364654",
"0.53515476",
"0.53500444",
"0.53310245",
"0.5315511",
"0.5313844",
"0.53134716",
"0.5305348",
"0.528973... | 0.56984794 | 4 |
Check that the format of ``X`` is a column vector of single nonnegative values, representing each observation of performance. For example ``[[0]; [0]; [1]; [1]]``. | def _check_input(self, X):
symbols = np.concatenate(X)
if len(symbols) == 1: # not enough data
raise ValueError("expected at least 1 observation "
"but none found.")
elif (symbols < 0).any(): # contains negative integers
raise ValueErr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_data_type_column_data(X):\n if type(X) is not numpy.ndarray:\n raise TypeError(\"X should be type numpy.ndarray\")\n\n if len(X.shape) == 2 and X.shape[1] > 1:\n raise TypeError(\"X should have a single column.\")",
"def _validate_X(X):\n return X if not isinstance(X, pd.DataFram... | [
"0.68836063",
"0.66894436",
"0.6302034",
"0.6250377",
"0.61786705",
"0.61228245",
"0.60884136",
"0.6060105",
"0.6032114",
"0.60302985",
"0.6027103",
"0.60228115",
"0.602003",
"0.60032636",
"0.58549327",
"0.5782543",
"0.57701117",
"0.57576823",
"0.57034236",
"0.5665207",
"0.56... | 0.6482836 | 2 |
Validate if the passed argument looks like a valid url. | def is_valid_url(url: str) -> bool:
try:
result = urlparse(url)
return all([result.scheme, result.netloc])
except ValueError:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_url(value):\n\n valid = validators.url(value)\n if valid != True:\n return False",
"def check_url(value):\n\n valid = validators.url(value)\n if valid is not True:\n return False",
"def validate_url(self):\n pass",
"def validate_url(ctx, param, value):\n try:\n ... | [
"0.8343673",
"0.8324227",
"0.83120877",
"0.8292005",
"0.8033375",
"0.7874858",
"0.78653574",
"0.78576237",
"0.78355736",
"0.77103376",
"0.766898",
"0.7654561",
"0.76491636",
"0.76035684",
"0.75911057",
"0.755884",
"0.7558228",
"0.75480825",
"0.7546638",
"0.7536757",
"0.752520... | 0.6924069 | 64 |
Check that creating an account works with privileged access | def test_r1t10(capsys):
helper(
capsys=capsys,
terminal_input=['login', 'agent', 'createacct', '1234567', 'accountName1', 'logout', 'no'],
intput_valid_accounts=['1234568'],
expected_tail_of_terminal_output=['Thank you for using Quinterac, have a nice day!'],
expected_output... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_if_not_created_authenticated_permissions(self):\r\n payload = {\r\n \"email\": \"t@t.pl\",\r\n \"password\": \"password\",\r\n \"name\": \"asdasd\",\r\n \"is_superuser\": False,\r\n }\r\n\r\n res = self.client_authenticated.post(reverse(CREA... | [
"0.69334227",
"0.657401",
"0.653778",
"0.65368503",
"0.6505535",
"0.6459696",
"0.63727415",
"0.63524723",
"0.6324572",
"0.6307633",
"0.6254503",
"0.62484324",
"0.6223447",
"0.6181628",
"0.6158007",
"0.61456215",
"0.61443484",
"0.6139977",
"0.613374",
"0.61093897",
"0.60702944... | 0.0 | -1 |
This method returns the reward of a particular state | def reward_func(self, state):
if abs(state['theta']) < 1:
return 2.0
elif abs(state['theta']) < 3:
return 0.0
elif abs(state['theta']) > 30:
return -100.0
return -2.0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reward(self,\n state: float) -> float:\n raise NotImplementedError",
"def get_reward(self, state, action, next_state):\n assert action in self.get_possible_actions(\n state), \"cannot do action %s from state %s\" % (action, state)\n x, y = self.__state_to_xy(next... | [
"0.8314272",
"0.8240575",
"0.82223743",
"0.8161263",
"0.8149699",
"0.8095069",
"0.8067136",
"0.8055836",
"0.7923237",
"0.7907485",
"0.7823275",
"0.78065765",
"0.77908105",
"0.77655923",
"0.7738718",
"0.77146447",
"0.7702389",
"0.76473874",
"0.7635467",
"0.7619942",
"0.7616541... | 0.7740652 | 14 |
Returns a list of filenames found in a directory | def files_in_dir(path):
return os.listdir(path) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_files_in_dir(dir: str):\n\n file_list = [f\"{dir}/{file}\" for file in listdir(dir) if isfile(join(dir, file))]\n\n return file_list",
"def GetFilesInDirectory(dir_path):\n\treturn [f for f in os.listdir(dir_path) if os.path.isfile(os.path.join(dir_path,f))]",
"def list_files_into_directory(direc... | [
"0.8131805",
"0.8108138",
"0.8034345",
"0.79521066",
"0.7903706",
"0.7899298",
"0.7884386",
"0.7879142",
"0.78716534",
"0.78543764",
"0.7830999",
"0.77942765",
"0.7782874",
"0.77438194",
"0.7679967",
"0.7658643",
"0.76420903",
"0.7634723",
"0.7630502",
"0.7629579",
"0.7621057... | 0.7984331 | 3 |
associates an instance of ChildAccount to this Account | def add_child(self, child_account):
self._children.append(child_account) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_account(self):\n Credential.account_list.append(self)",
"def add(self, account):\n if isinstance(account, Account) and account not in self.account:\n self.account.append(account)",
"def put_account(self, account):\n \n pass",
"def account(self, account):\n\n ... | [
"0.6679163",
"0.6542428",
"0.6518352",
"0.64333874",
"0.64333874",
"0.64333874",
"0.64333874",
"0.6373562",
"0.63151264",
"0.62300396",
"0.6036437",
"0.6035886",
"0.599156",
"0.59576416",
"0.59400326",
"0.59400326",
"0.5933551",
"0.5873395",
"0.5868553",
"0.58684623",
"0.5868... | 0.6822193 | 0 |
This function renames columns of a pandas dataframe It converts column names to snake case if rename_dict is not passed. | def cleanup_column_names(df, rename_dict={}, do_inplace=True):
if not rename_dict:
return df.rename(columns={col: col.lower().replace(' ', '_')
for col in df.columns.values.tolist()},
inplace=do_inplace)
else:
return df.rename(columns=re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def col_rename(col_dict, df_con_rename):\n\n for ex, nex in col_dict.items():\n df_con_rename = df_con_rename.withColumnRenamed(ex, nex)\n return df_con_rename",
"def lowercase_all_column_names(df:DataFrame)->DataFrame:\n for col in df.columns:\n df = df.withColumnRenamed(col, col.lower())... | [
"0.73472214",
"0.71769214",
"0.712079",
"0.7030749",
"0.6953978",
"0.6815323",
"0.6753903",
"0.6625544",
"0.6609549",
"0.6517022",
"0.6508362",
"0.64940655",
"0.6339",
"0.62789905",
"0.6255128",
"0.6241007",
"0.6222985",
"0.6205978",
"0.6147987",
"0.61346877",
"0.6118897",
... | 0.82928956 | 0 |
Calculate the total area of the elements on this cell, including cell references and arrays. | def area(self, by_spec=False):
if by_spec:
cell_area = {}
for element in itertools.chain(self.polygons, self.paths, self.references):
element_area = element.area(True)
for ll in element_area.keys():
if ll in cell_area:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getArea(self):\r\n return np.sum(self.array[:])",
"def total_area(self):\n return numpy.prod([r[1] - r[0] for r in self.range_])",
"def area(self, by_spec=False):\n if by_spec:\n cell_area = {}\n for element in self.elements:\n element_area = elemen... | [
"0.77725315",
"0.7599504",
"0.75269383",
"0.7497039",
"0.74537677",
"0.74429333",
"0.7378315",
"0.72832215",
"0.72520405",
"0.72520405",
"0.72520405",
"0.72520405",
"0.7251096",
"0.72318023",
"0.72269714",
"0.72177047",
"0.72038364",
"0.7172168",
"0.7172168",
"0.7172168",
"0.... | 0.71954083 | 17 |
Return the set of layers in this cell. Returns | def get_layers(self):
layers = set()
for element in itertools.chain(self.polygons, self.paths):
layers.update(element.layers)
for reference in self.references:
layers.update(reference.ref_cell.get_layers())
for label in self.labels:
layers.add(label.la... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def layers(self):\n return self['layers']",
"def layers(self):\r\n return self._flc.layers",
"def getLayers(self):\n return self.__layers",
"def get_layers(self):\n layers = set()\n for element in self.elements:\n if isinstance(element, PolygonSet):\n ... | [
"0.84161794",
"0.82297456",
"0.81984156",
"0.8153201",
"0.7760602",
"0.76984745",
"0.7670736",
"0.72703713",
"0.72165895",
"0.70526385",
"0.7021822",
"0.6928826",
"0.6922886",
"0.6842713",
"0.6831845",
"0.6688635",
"0.66676366",
"0.6658537",
"0.653411",
"0.64305663",
"0.63962... | 0.80953765 | 4 |
Calculate the bounding box for this cell. Returns | def get_bounding_box(self):
deps_still_valid = all(ref._bb_valid for ref in self.get_dependencies(True))
cached_bbox_still_valid = self._bb_valid and deps_still_valid
if not cached_bbox_still_valid:
bb = numpy.array(((1e300, 1e300), (-1e300, -1e300)))
all_polygons = []
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def boundingBox(self):\n minx, miny, maxx, maxy = self.substrates.bounds\n return pcbnew.BOX2I(\n pcbnew.VECTOR2I(int(minx), int(miny)),\n pcbnew.VECTOR2I(int(maxx - minx), int(maxy - miny)))",
"def bounding_box(self):\n if self.bbox is None:\n self.bbox = bo... | [
"0.8207344",
"0.81806314",
"0.81806314",
"0.81616205",
"0.81508523",
"0.79829717",
"0.7957958",
"0.7862182",
"0.78247416",
"0.7819618",
"0.7802205",
"0.779639",
"0.77903897",
"0.77657527",
"0.77332604",
"0.77099425",
"0.7704747",
"0.7704747",
"0.769051",
"0.7675328",
"0.76556... | 0.7544387 | 28 |
Return a set of the cells included in this cell as references. | def get_dependencies(self, recursive=False):
dependencies = set()
for reference in self.references:
if isinstance(reference.ref_cell, Cell):
if recursive:
dependencies.update(reference.ref_cell.get_dependencies(True))
dependencies.add(refer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def references(self) -> \"IterableList[Reference]\":\n return Reference.list_items(self)",
"def get_references(self):\n\n return self._refs",
"def get_references(self):\n return self._references",
"def referencing_nodes(self):\n\n return self._referencing_nodes",
"def refere... | [
"0.6819724",
"0.6730786",
"0.6708101",
"0.66307276",
"0.65374833",
"0.64513767",
"0.64364344",
"0.6364836",
"0.6364836",
"0.6356147",
"0.6325696",
"0.6325696",
"0.62790745",
"0.62559783",
"0.62235403",
"0.62235177",
"0.6222344",
"0.6185836",
"0.6093392",
"0.602159",
"0.601182... | 0.6488647 | 5 |
Gets the id of this SubscriptionProductRetirement. A unique identifier for the object. | def id(self):
return self._id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self) -> pulumi.Output[str]:\n return pulumi.get(self... | [
"0.7453236",
"0.7453236",
"0.7453236",
"0.7453236",
"0.70733815",
"0.6746917",
"0.6697227",
"0.6697227",
"0.66862226",
"0.66862226",
"0.66862226",
"0.66862226",
"0.66862226",
"0.66862226",
"0.6684057",
"0.66782755",
"0.66718966",
"0.66718966",
"0.66718966",
"0.66718966",
"0.6... | 0.0 | -1 |
Sets the id of this SubscriptionProductRetirement. A unique identifier for the object. | def id(self, id):
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product_id(self, product_id):\n self._product_id = product_id",
"def product_id(self, product_id):\n\n self._product_id = product_id",
"def product_id(self, product_id):\n\n self._product_id = product_id",
"def set_id(self, id):\n self.__id = id",
"def set_id(self, id_):\n\n... | [
"0.6687188",
"0.65710616",
"0.65710616",
"0.65566206",
"0.65250146",
"0.64017624",
"0.64017624",
"0.64017624",
"0.64017624",
"0.64017624",
"0.63562167",
"0.63235307",
"0.63213336",
"0.63213336",
"0.63213336",
"0.63213336",
"0.63213336",
"0.63213336",
"0.63213336",
"0.63213336",... | 0.0 | -1 |
Gets the linked_space_id of this SubscriptionProductRetirement. The ID of the space this object belongs to. | def linked_space_id(self):
return self._linked_space_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_subscription_id(self):\n return self.instance_metadata.subscription_id",
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._... | [
"0.5639911",
"0.5487876",
"0.5487876",
"0.5487876",
"0.5487876",
"0.53018355",
"0.52775943",
"0.52646273",
"0.51881564",
"0.5121563",
"0.5112025",
"0.5101079",
"0.5073609",
"0.5073609",
"0.5073609",
"0.5073609",
"0.5073609",
"0.5073609",
"0.5060274",
"0.5060274",
"0.50597024"... | 0.7217349 | 2 |
Gets the product of this SubscriptionProductRetirement. | def product(self):
return self._product | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getProduct(self, *args):\n return _libsbml.Reaction_getProduct(self, *args)",
"def get_card_product(self):\n\n return self.card_product",
"def product(self, product_id):\r\n return products.Product(self, product_id)",
"def get(self, product_id):\n\n return product.get_single_p... | [
"0.71919554",
"0.7168041",
"0.70292336",
"0.6978669",
"0.69453955",
"0.6790158",
"0.65579",
"0.6556982",
"0.6439483",
"0.642651",
"0.642651",
"0.642651",
"0.642651",
"0.64097875",
"0.6401133",
"0.6386566",
"0.6296203",
"0.629263",
"0.62489635",
"0.6159131",
"0.6152622",
"0.... | 0.73504794 | 2 |
Gets the respect_terminiation_periods_enabled of this SubscriptionProductRetirement. | def respect_terminiation_periods_enabled(self):
return self._respect_terminiation_periods_enabled | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def respect_terminiation_periods_enabled(self, respect_terminiation_periods_enabled):\n\n self._respect_terminiation_periods_enabled = respect_terminiation_periods_enabled",
"def evaluation_periods(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"evaluation_periods\")",
"def eval... | [
"0.74990064",
"0.59558636",
"0.59558636",
"0.59558636",
"0.59558636",
"0.59558636",
"0.59558636",
"0.59558636",
"0.59558636",
"0.59558636",
"0.59558636",
"0.59558636",
"0.59558636",
"0.52868",
"0.52440816",
"0.51808107",
"0.51157266",
"0.51113236",
"0.50006104",
"0.49916717",
... | 0.7897476 | 0 |
Gets the target_product of this SubscriptionProductRetirement. | def target_product(self):
return self._target_product | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def target_for_product(self, product):\n for target, products in self._products_by_target.items():\n if product in products:\n return target\n return None",
"def getTarget(self):\n return self._target",
"def getTarget(self):\n\n return self._target",
"def target_resource(self)... | [
"0.679874",
"0.65475947",
"0.65354234",
"0.6525121",
"0.6492427",
"0.6492427",
"0.6492427",
"0.638465",
"0.6314479",
"0.616897",
"0.61486644",
"0.61486644",
"0.61486644",
"0.61486644",
"0.6129035",
"0.60792124",
"0.6019437",
"0.6019437",
"0.6019437",
"0.6019437",
"0.60076684"... | 0.8075166 | 0 |
Gets the version of this SubscriptionProductRetirement. The version is used for optimistic locking and incremented whenever the object is updated. | def version(self):
return self._version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product_version(self):\n return self._product_version",
"def get_product_version(self):\n\t\treturn call_sdk_function('PrlSrvInfo_GetProductVersion', self.handle)",
"def get_product_version(self):\n return self.get_attr('product_version')",
"def get_product_version(self):\n\t\treturn call_s... | [
"0.7609071",
"0.7556369",
"0.7447159",
"0.7211711",
"0.7078787",
"0.7065332",
"0.7065332",
"0.6965987",
"0.6928433",
"0.6927428",
"0.69248474",
"0.68874663",
"0.6880073",
"0.6839752",
"0.68232965",
"0.67877114",
"0.67861766",
"0.67816305",
"0.67618465",
"0.6750636",
"0.673643... | 0.67298514 | 30 |
Sets the version of this SubscriptionProductRetirement. The version is used for optimistic locking and incremented whenever the object is updated. | def version(self, version):
self._version = version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product_version(self, product_version):\n\n self._product_version = product_version",
"def version(self, version):\n \n self._version = version",
"def version(self, version):\n self._version = version",
"def version(self, version):\n self._version = version",
"def ver... | [
"0.7180803",
"0.6708293",
"0.6647392",
"0.6647392",
"0.6574128",
"0.6495684",
"0.64354223",
"0.64354223",
"0.6300998",
"0.62922347",
"0.6192053",
"0.6126061",
"0.60471845",
"0.60471845",
"0.60471845",
"0.60225743",
"0.5944241",
"0.59408695",
"0.59389913",
"0.5929401",
"0.5891... | 0.6649448 | 15 |
Returns df with dtype set for structure without any column filter. | def meta_df(self):
return NotImplemented | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_df_all_types():\n return pd.DataFrame({\n 'intcol': [1, 2],\n 'strcol': ['three', 'four'],\n 'floatcol': [5.0, 6.0],\n 'boolcol': [True, False],\n 'datetimecol': [\n np.datetime64('2020-01-01'), np.datetime64('2020-01-02')],\n })",
"def set_dtypes(df):... | [
"0.6611793",
"0.6518844",
"0.6439829",
"0.620935",
"0.61962974",
"0.6109263",
"0.5990738",
"0.5988264",
"0.59865373",
"0.5986267",
"0.5910748",
"0.5909542",
"0.5873334",
"0.58664733",
"0.5857477",
"0.58217114",
"0.5814661",
"0.5797066",
"0.57949156",
"0.57742786",
"0.5751437"... | 0.0 | -1 |
Get Product based on name. | def show(self, title):
return Product.query.filter_by(title=title).first() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_product(cls, product_id):\n return Product.query.get(product_id)",
"def get_products_by_name(name: str = '') -> List[Product]:\n products = []\n for p in get_market().products.values():\n if not name or p.name == name:\n products.append(p)\n return products",
"def sear... | [
"0.7238149",
"0.7212795",
"0.72054875",
"0.71924907",
"0.71586484",
"0.7007384",
"0.6974032",
"0.68805",
"0.6826333",
"0.68231606",
"0.67831254",
"0.6731516",
"0.66950774",
"0.66819346",
"0.66207284",
"0.6595219",
"0.65523624",
"0.65501523",
"0.6533631",
"0.65288424",
"0.6504... | 0.5911903 | 74 |
Calculate mean of role/token embeddings for a node. | def _mean_vec(self, node) -> Tuple[np.array, int]:
tokens = [t for t in chain(node.token, ("RoleId_%d" % role for role in node.roles))
if t in self.emb]
if not tokens:
return None, 0
return np.mean([self.emb[t] for t in tokens], axis=0), len(tokens) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_mean(self):\n # load_in_all_parameters(self.save_directory, self.auto_encoder)\n for i, data_row in enumerate(self.X_train_naive):\n input_nn = data_row\n if torch.cuda.is_available():\n input_nn = Variable(torch.Tensor(np.asarray(input_nn).reshape(1, ... | [
"0.6682953",
"0.6198933",
"0.6104026",
"0.61020845",
"0.606138",
"0.59226686",
"0.59124076",
"0.5786445",
"0.5759134",
"0.57552254",
"0.57463694",
"0.5732782",
"0.572047",
"0.57162076",
"0.5711725",
"0.5707686",
"0.5694124",
"0.56877744",
"0.5685827",
"0.567916",
"0.567916",
... | 0.7650001 | 0 |
Calculate mean of role/token embeddings for nodes and their children in a UAST. | def _mean_vecs(self, root) -> Tuple[Dict[int, np.array], Dict[int, np.array]]:
node_vecs = {0: self._mean_vec(root)}
child_vecs = {}
parent_vecs = {0: None}
n_nodes = 1 # incremented in accoradance with node_iterator
for node, node_idx in node_iterator(root):
node_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _mean_vec(self, node) -> Tuple[np.array, int]:\n tokens = [t for t in chain(node.token, (\"RoleId_%d\" % role for role in node.roles))\n if t in self.emb]\n if not tokens:\n return None, 0\n return np.mean([self.emb[t] for t in tokens], axis=0), len(tokens)",
... | [
"0.6652418",
"0.6104074",
"0.60613614",
"0.58062",
"0.57312095",
"0.55728334",
"0.5552793",
"0.5548033",
"0.55363387",
"0.5521133",
"0.55169815",
"0.549175",
"0.54699457",
"0.5461554",
"0.5455657",
"0.5437836",
"0.5394639",
"0.5368514",
"0.53438914",
"0.53310144",
"0.5312195"... | 0.6019041 | 3 |
Remove all objects that are no longer alive. | def clean(self):
filtered_items = {}
for name, ls in self.items.items():
filtered_ls = []
for i in ls:
if i.alive():
filtered_ls.append(i)
else:
self.del_item(i)
filtered_items[name] = filtered_ls... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def purge_dead(self):\n if self.live == None:\n return\n\n remove = []\n\n for s in self.streams:\n if not s.remote_location in self.live:\n remove.append(s)\n\n while len(remove) > 0:\n s = remove.pop()\n del s",
"def clear_g... | [
"0.72169393",
"0.7131462",
"0.710511",
"0.7069617",
"0.698678",
"0.69787264",
"0.69597036",
"0.69319737",
"0.68848646",
"0.67965287",
"0.67901033",
"0.67546594",
"0.66708785",
"0.66639525",
"0.66491336",
"0.66485494",
"0.6599556",
"0.6585536",
"0.65660405",
"0.6546759",
"0.65... | 0.62263244 | 44 |
Set the locale for fake data This sets the locale for all calls to the ``Faker`` keyword and ``${faker}`` variable. The default is en_US For a list of supported locales see | def set_faker_locale(self, locale):
try:
self._faker = faker.Faker(locale)
except AttributeError:
raise Exception(f"Unknown locale for fake data: '{locale}'") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setLocale(self, value):\n return self._set(locale=value)",
"def set_locale_de():\n try:\n if platform.system() == \"Windows\":\n locale.setlocale(locale.LC_ALL, \"German\")\n else:\n locale.setlocale(locale.LC_ALL, \"de_DE.utf8\")\n except locale.Error:\n ... | [
"0.6244255",
"0.623005",
"0.62105423",
"0.62015533",
"0.6130801",
"0.60855186",
"0.6064039",
"0.587886",
"0.5830364",
"0.5727264",
"0.5697302",
"0.5605824",
"0.5514231",
"0.543558",
"0.5397802",
"0.5365363",
"0.5353766",
"0.5340136",
"0.52725",
"0.52648044",
"0.52474874",
"... | 0.7908526 | 0 |
Navigates to the Home tab of Salesforce Setup | def go_to_setup_home(self):
url = self.cumulusci.org.lightning_base_url
self.selenium.go_to(url + "/lightning/setup/SetupOneHome/home")
self.wait_until_loading_is_complete() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _go_to_page(self):\n self.salesforce.go_to_setup_home()\n self.eda.wait_for_new_window(\"Home | Salesforce\")\n self.selenium.switch_window(\"Home | Salesforce\")\n self.salesforce.wait_until_loading_is_complete()",
"def home(self):\n self.goto(0, 0)",
"def go_home(self):... | [
"0.8230737",
"0.71648955",
"0.70775753",
"0.70246947",
"0.7019923",
"0.7007859",
"0.67817223",
"0.67309695",
"0.6720572",
"0.6715987",
"0.6700127",
"0.6590666",
"0.65675294",
"0.6565556",
"0.65384",
"0.65323144",
"0.630954",
"0.6259082",
"0.62556046",
"0.6235437",
"0.6228942"... | 0.7788175 | 1 |
r""" Close connection and cursor. | def close(connection, cursor):
cursor.close()
connection.close() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close(self):\n if self.cursor:\n self.cursor.close()\n if self.conn:\n self.conn.close()",
"def close_connection(self):\n self.cursor.close()\n self.connection.close()",
"def close(cursor, conn):\n cursor.close()\n conn.close()",
"def __clos... | [
"0.83350396",
"0.83227044",
"0.8266605",
"0.8200751",
"0.81766593",
"0.79859394",
"0.7881802",
"0.7783966",
"0.77768856",
"0.77637964",
"0.7759937",
"0.7715322",
"0.7711181",
"0.77009636",
"0.7679163",
"0.76544863",
"0.76360935",
"0.7625238",
"0.7625238",
"0.7625238",
"0.7615... | 0.835283 | 0 |
return number of outgoing edges incident to vertex u in the graph. For directed graph, optional parameter counts incoming edges | def degree(self, u, outgoing=False):
return NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def edge_count(self):\n total = sum(len(self._outgoing[v]) for v in self._outgoing)\n # for undirected graphs, make sure not to double-count edges\n return total if self.is_directed() else total // 2",
"def get_number_of_edges(self, where_to=OUTGOING):\n\n if not self._directed:\n ... | [
"0.68358546",
"0.6561279",
"0.6446544",
"0.64447254",
"0.6333673",
"0.6319609",
"0.6301107",
"0.62222815",
"0.6184934",
"0.61087424",
"0.60796434",
"0.60392433",
"0.6002174",
"0.5998038",
"0.5997388",
"0.5966773",
"0.59325117",
"0.59113735",
"0.5895486",
"0.58712155",
"0.5815... | 0.0 | -1 |
Compute bounding boxes from masks. | def extract_bboxes(mask):
boxes = np.zeros([mask.shape[-1], 4], dtype=np.int32)
for i in range(mask.shape[-1]):
m = mask[:, :, i]
# Bounding box.
horizontal_indicies = np.where(np.any(m, axis=0))[0]
vertical_indicies = np.where(np.any(m, axis=1))[0]
if horizontal_indicies... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_bboxes(mask):\r\n boxes = np.zeros([mask.shape[-1], 4], dtype=np.int32)\r\n for i in range(mask.shape[-1]):\r\n m = mask[:, :, i]\r\n # Bounding box.\r\n horizontal_indicies = np.where(np.any(m, axis=0))[0]\r\n vertical_indicies = np.where(np.any(m, axis=1))[0]\r\n ... | [
"0.7847686",
"0.7822384",
"0.7725646",
"0.74624574",
"0.7325698",
"0.73178643",
"0.7166094",
"0.7036856",
"0.70279956",
"0.6984062",
"0.6840271",
"0.6769655",
"0.6768261",
"0.66790813",
"0.66393876",
"0.66106874",
"0.6608748",
"0.65870476",
"0.65523195",
"0.64979154",
"0.6494... | 0.7814012 | 2 |
Calculates IoU of the given box with the array of the given boxes. | def compute_iou(box, boxes, box_area, boxes_area):
# Calculate intersection areas
y1 = np.maximum(box[0], boxes[:, 0])
y2 = np.minimum(box[2], boxes[:, 2])
x1 = np.maximum(box[1], boxes[:, 1])
x2 = np.minimum(box[3], boxes[:, 3])
intersection = np.maximum(x2 - x1, 0) * np.maximum(y2 - y1, 0)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_iou(box, boxes):\n # Calculate intersection areas\n iou = [box.intersection(b).area / box.union(b).area for b in boxes]\n\n return np.array(iou, dtype=np.float32)",
"def compute_iou(box, boxes, box_area, boxes_area):\n # Calculate intersection areas\n x1 = np.maximum(box[0], boxes[:, 0... | [
"0.8233654",
"0.8128509",
"0.80252707",
"0.79859704",
"0.7928408",
"0.77582073",
"0.77385104",
"0.77119327",
"0.7706524",
"0.7639222",
"0.7638932",
"0.7638932",
"0.76373506",
"0.76087755",
"0.76022065",
"0.76022065",
"0.75603807",
"0.7515975",
"0.72115165",
"0.7174434",
"0.71... | 0.8116598 | 4 |
Computes IoU overlaps between two sets of boxes. | def compute_overlaps(boxes1, boxes2):
# Areas of anchors and GT boxes
area1 = (boxes1[:, 2] - boxes1[:, 0]) * (boxes1[:, 3] - boxes1[:, 1])
area2 = (boxes2[:, 2] - boxes2[:, 0]) * (boxes2[:, 3] - boxes2[:, 1])
# Compute overlaps to generate matrix [boxes1 count, boxes2 count]
# Each cell contains t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bbox_overlaps(bboxes1, bboxes2, mode='iou'):\n\n from icv.data.core.bbox import BBox\n assert mode in ['iou', 'iof']\n\n bboxes1 = np.array([np.array(b.bbox) if isinstance(b,BBox) else b for b in bboxes1])\n bboxes2 = np.array([np.array(b.bbox) if isinstance(b,BBox) else b for b in bboxes2])\n\n ... | [
"0.7990127",
"0.78907293",
"0.76871777",
"0.76614314",
"0.7659915",
"0.7565243",
"0.7565243",
"0.75390357",
"0.75383925",
"0.7536965",
"0.75360364",
"0.75193775",
"0.74758565",
"0.74505776",
"0.7442953",
"0.74426675",
"0.7352126",
"0.73306423",
"0.7320014",
"0.73066556",
"0.7... | 0.8171749 | 2 |
Computes IoU overlaps between two sets of masks. | def compute_overlaps_masks(masks1, masks2):
# If either set of masks is empty return empty result
if masks1.shape[-1] == 0 or masks2.shape[-1] == 0:
return np.zeros((masks1.shape[-1], masks2.shape[-1]))
# flatten masks and compute their areas
masks1 = np.reshape(masks1 > .5, (-1, masks1.sha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_overlaps(boxes1, boxes2):\n # Areas of anchors and GT boxes\n area1 = (boxes1[:, 2] - boxes1[:, 0]) * (boxes1[:, 3] - boxes1[:, 1])\n area2 = (boxes2[:, 2] - boxes2[:, 0]) * (boxes2[:, 3] - boxes2[:, 1])\n\n # Compute overlaps to generate matrix [boxes1 count, boxes2 count]\n # Each cell... | [
"0.7274957",
"0.7274957",
"0.7274957",
"0.71368843",
"0.7078123",
"0.690092",
"0.68660337",
"0.684559",
"0.68321913",
"0.68063563",
"0.67350006",
"0.67350006",
"0.66618323",
"0.65612245",
"0.65596884",
"0.6539915",
"0.6460802",
"0.645651",
"0.64440256",
"0.6385012",
"0.634447... | 0.75193983 | 0 |
Performs nonmaximum suppression and returns indices of kept boxes. | def non_max_suppression(boxes, scores, threshold):
assert boxes.shape[0] > 0
if boxes.dtype.kind != "f":
boxes = boxes.astype(np.float32)
# Compute box areas
y1 = boxes[:, 0]
x1 = boxes[:, 1]
y2 = boxes[:, 2]
x2 = boxes[:, 3]
area = (y2 - y1) * (x2 - x1)
# Get indicies of b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def non_maximum_suppression(boxes):\n\n boxes = sorted(boxes, key=lambda box: box[2]-box[0], reverse=True)\n nms_boxes = []\n overlap_threshold = 0.5\n\n for box in boxes:\n if not any([overlap_between(box, nms_box) > overlap_threshold for nms_box in nms_boxes]):\n nms_boxes.append(bo... | [
"0.70608395",
"0.69983155",
"0.6976223",
"0.67720497",
"0.67435426",
"0.6703019",
"0.6653769",
"0.66231835",
"0.654032",
"0.65133655",
"0.64524907",
"0.6440792",
"0.6414008",
"0.6377664",
"0.63635045",
"0.6159006",
"0.6144057",
"0.6129111",
"0.6109921",
"0.60739964",
"0.60683... | 0.7059315 | 1 |
Load instance masks for the given image. Different datasets use different ways to store masks. Override this method to load instance masks and return them in the form of am array of binary masks of shape [height, width, instances]. | def load_mask(self, image_id):
# Override this function to load a mask from your dataset.
# Otherwise, it returns an empty mask.
logging.warning("You are using the default load_mask(), maybe you need to define your own one.")
mask = np.empty([0, 0, 0])
class_ids = np.empty([0], n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_mask(self, image_id):\n # If not a vesicle dataset image, delegate to parent class.\n image_info = self.image_info[image_id]\n if image_info[\"source\"] != \"vesicle\":\n return super(self.__class__, self).load_mask(image_id)\n\n # Convert polygons to a bitmap mask o... | [
"0.7869282",
"0.786701",
"0.7807325",
"0.75356114",
"0.7487194",
"0.74836934",
"0.74011266",
"0.7394974",
"0.7351115",
"0.7336745",
"0.7290065",
"0.72642833",
"0.7250822",
"0.7201328",
"0.71151125",
"0.7102441",
"0.7093331",
"0.6974475",
"0.69341886",
"0.6813359",
"0.6783459"... | 0.72100884 | 13 |
Resizes a mask using the given scale and padding. Typically, you get the scale and padding from resize_image() to ensure both, the image and the mask, are resized consistently. | def resize_mask(mask, scale, padding, crop=None):
# Suppress warning from scipy 0.13.0, the output shape of zoom() is
# calculated with round() instead of int()
with warnings.catch_warnings():
warnings.simplefilter("ignore")
mask = scipy.ndimage.zoom(mask, zoom=[scale, scale, 1], order=0)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resize_mask(mask, scale, padding):\n h, w = mask.shape[:2]\n mask = scipy.ndimage.zoom(mask, zoom=[scale, scale, 1], order=0)\n mask = np.pad(mask, padding, mode='constant', constant_values=0)\n return mask",
"def fixed_scale(im, inst_masks, mask, boxes, classes, target_h, target_w):\n h, w, c... | [
"0.7886953",
"0.6024971",
"0.601013",
"0.59956163",
"0.59815747",
"0.5902877",
"0.5891884",
"0.5891884",
"0.5866327",
"0.5845942",
"0.5541372",
"0.55336607",
"0.55139524",
"0.5509066",
"0.5439005",
"0.54368395",
"0.5432924",
"0.5407946",
"0.54037696",
"0.5389475",
"0.53850484... | 0.75246656 | 1 |
It's common to have tensors larger than the available data and pad with zeros. This function removes rows that are all zeros. | def trim_zeros(x):
assert len(x.shape) == 2
return x[~np.all(x == 0, axis=1)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_padded_rows(data, labels, n_dimensions):\n labels = np.repeat(labels, data.shape[1])\n data = data.reshape(-1, n_dimensions)\n added_rows = np.where(np.all(data == 0, axis=1))\n data = data[~added_rows[0]]\n labels = labels[~added_rows[0]]\n\n return data, labels",
"def pad_zeros(x):... | [
"0.68312913",
"0.6651325",
"0.66369396",
"0.6633322",
"0.655796",
"0.6550293",
"0.63369226",
"0.624033",
"0.6205929",
"0.6150306",
"0.6146983",
"0.61401784",
"0.60737085",
"0.6045232",
"0.6019735",
"0.6008516",
"0.5989949",
"0.59858364",
"0.59858364",
"0.59816563",
"0.5967632... | 0.65694565 | 4 |
Compute Average Precision at a set IoU threshold (default 0.5). | def compute_ap(gt_boxes, gt_class_ids, gt_masks,
pred_boxes, pred_class_ids, pred_scores, pred_masks,
iou_threshold):
# Get matches and overlaps
gt_match, pred_match, overlaps = compute_matches(
gt_boxes, gt_class_ids, gt_masks,
pred_boxes, pred_class_ids, pred_scor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def average_precision(tp,fp,npos):\r\n \r\n fp = np.cumsum(fp)\r\n tp = np.cumsum(tp)\r\n rec = tp / float(npos)\r\n # avoid divide by zero in case the first detection matches a difficult\r\n # ground truth\r\n prec = tp / np.maximum(tp + fp, np.finfo(np.float64).eps)\r\n \r\n # comp... | [
"0.6656932",
"0.6422307",
"0.6382818",
"0.61385274",
"0.6118089",
"0.610859",
"0.6033307",
"0.6023982",
"0.59936446",
"0.59702045",
"0.5968957",
"0.59669405",
"0.5953504",
"0.59431374",
"0.59431374",
"0.5923731",
"0.59229136",
"0.59229136",
"0.5917313",
"0.5913685",
"0.590186... | 0.5755965 | 33 |
Compute the recall at the given IoU threshold. It's an indication of how many GT boxes were found by the given prediction boxes. | def compute_recall(pred_boxes, gt_boxes, iou):
# Measure overlaps
overlaps = compute_overlaps(pred_boxes, gt_boxes)
iou_max = np.max(overlaps, axis=1)
iou_argmax = np.argmax(overlaps, axis=1)
positive_ids = np.where(iou_max >= iou)[0]
matched_gt_boxes = iou_argmax[positive_ids]
recall = len... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def evaluate_recall(self, candidate_boxes=None, thresholds=None,\n area='all', limit=None):\n # Record max overlap value for each gt box\n # Return vector of overlap values\n areas = {'all': 0, 'small': 1, 'medium': 2, 'large': 3,\n '96-128': 4, '128-256': 5, '256-512': 6,... | [
"0.62621534",
"0.61025965",
"0.60362554",
"0.5993026",
"0.5992019",
"0.598062",
"0.59323263",
"0.59282094",
"0.5892321",
"0.5827981",
"0.5823096",
"0.58173424",
"0.5814973",
"0.5813788",
"0.5794595",
"0.5781545",
"0.5735283",
"0.5735052",
"0.57166195",
"0.5709846",
"0.5678209... | 0.76745695 | 0 |
Converts boxes from normalized coordinates to pixel coordinates. | def denorm_boxes(boxes, shape):
h, w = shape
scale = np.array([h - 1, w - 1, h - 1, w - 1])
shift = np.array([0, 0, 1, 1])
return np.around(np.multiply(boxes, scale) + shift).astype(np.int32) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _to_image_coords(self, boxes, height, width):\n box_coords = np.zeros_like(boxes)\n box_coords[:, 0] = boxes[:, 0] * height\n box_coords[:, 1] = boxes[:, 1] * width\n box_coords[:, 2] = boxes[:, 2] * height\n box_coords[:, 3] = boxes[:, 3] * width\n \n return bo... | [
"0.75712496",
"0.70867115",
"0.6775384",
"0.67204654",
"0.660275",
"0.6589974",
"0.6581208",
"0.654033",
"0.6539582",
"0.6535337",
"0.6491841",
"0.64614946",
"0.64540744",
"0.64395887",
"0.64245975",
"0.64113736",
"0.6410515",
"0.6381608",
"0.63608825",
"0.6334851",
"0.629560... | 0.0 | -1 |
Computes the area of the polygon formed by the two borders of the cells | def area(sx, dx):
#make the polygon from the coordinates dataframes
polsx = sx
polsx = polsx.reset_index(drop = True)
polsx.columns = ["x","y"]
poldx = dx
poldx = poldx.reset_index(drop = True)
poldx.columns = ["x","y"]
#sometimes Polygon takes the wrong order from the dataframe so i rev... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def polygon_area(x, y):\n return 0.5 * np.abs(np.dot(x, np.roll(y, 1)) - np.dot(y, np.roll(x, 1)))",
"def polygon_area_2d(polygon):\r\n return geometry.gmPolygonArea(polygon)",
"def polygon_area(nodes, edges):\n # extract the (x, y) coordinates of the boundary nodes in the order\n x = []\n y = [... | [
"0.7552802",
"0.7258244",
"0.7185722",
"0.717917",
"0.7128212",
"0.7111392",
"0.7071247",
"0.7070617",
"0.7019341",
"0.7001358",
"0.6988815",
"0.6931913",
"0.6912602",
"0.6905599",
"0.6905145",
"0.6893624",
"0.6893624",
"0.6893216",
"0.68896395",
"0.68792206",
"0.6866619",
... | 0.6524727 | 54 |
Formats the date taken from the log file in order to align with the sql date format YMD | def format_date(test_date):
split_date = test_date.split()
split_date[0] = split_date[0].split('/')
return ''.join(
[split_date[0][2], split_date[0][0], split_date[0][1]]
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reformat_date(mdy_date_string):\n date = mdy_date_string.split('/')\n return f\"{date[2]}-{date[0]}-{date[1]}\" # difficult to read",
"def format_date(self, data):\n return '%s/%s' % (data.month, data.day)",
"def test_format_date(self):\n assert BaseTSVWriter.format_date(FIXED_DATE) == ... | [
"0.6511338",
"0.64542186",
"0.6451588",
"0.6371941",
"0.63189375",
"0.62899065",
"0.626468",
"0.62239367",
"0.6207798",
"0.62021685",
"0.6146992",
"0.61419857",
"0.6121732",
"0.6037092",
"0.6026142",
"0.60041934",
"0.5999904",
"0.5974926",
"0.5921738",
"0.5880304",
"0.5861925... | 0.56192946 | 43 |
Returns the transport used by the client instance. | def transport(self) -> PublisherServiceTransport:
return self._client.transport | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transport(self):\n return self._transport",
"def transport(self) -> TraceServiceTransport:\n return self._client.transport",
"def transport(self) -> ServiceControllerTransport:\n return self._client.transport",
"def transport(self) -> MetadataServiceTransport:\n return self._c... | [
"0.82946277",
"0.7887542",
"0.773594",
"0.773068",
"0.76806635",
"0.7674273",
"0.76357967",
"0.7558095",
"0.7551682",
"0.75303864",
"0.74958986",
"0.7488142",
"0.7436853",
"0.7368433",
"0.73340607",
"0.721926",
"0.7109823",
"0.7102308",
"0.68808985",
"0.68144",
"0.6671675",
... | 0.7423566 | 13 |
Converts given value to long if possible, otherwise None is returned. | def field_to_long(value):
if isinstance(value, (int, long)):
return long(value)
elif isinstance(value, basestring):
return bytes_to_long(from_hex(value))
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_long_int(val):\n return long(val) if six.PY2 else int(val)",
"def to_long(x):\n if isinstance(x, long):\n return x\n elif isinstance(x, int):\n return long(x)\n else:\n return bytes_to_long(to_bytes(x))",
"def getLong(t, swipl):\n i = c_long()\n if swipl.PL_get_long(... | [
"0.74933696",
"0.715573",
"0.67231256",
"0.6618173",
"0.6471894",
"0.6345347",
"0.6273417",
"0.6199922",
"0.6176904",
"0.6092171",
"0.6039979",
"0.59916466",
"0.5962227",
"0.59519756",
"0.59280604",
"0.58702356",
"0.5813299",
"0.57505965",
"0.57384586",
"0.57117707",
"0.57028... | 0.8211291 | 0 |
return next larger sparse number | def next_sparse(sparse_number):
# print("sparse_number 0b{0:b}".format(sparse_number))
# Edge case. Handle explicitly for clarity
if sparse_number == 0:
return 1
power_max = twos_power_max(sparse_number)
for power in range(0, power_max):
# print("power", power)
if is_zero... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_sparse_incremental(sparse_number):\n\n\n # limit is arbitrary in Python\n # http://stackoverflow.com/questions/5470693/python-number-limit\n limit = 2 ** 32\n for possible_sparse in range(sparse_number + 1, limit):\n if is_sparse(possible_sparse):\n return possible_sparse\n ... | [
"0.7672728",
"0.61580247",
"0.61358225",
"0.60774994",
"0.59932333",
"0.58844113",
"0.58825076",
"0.58825076",
"0.5832039",
"0.5826069",
"0.56333584",
"0.56146306",
"0.55914325",
"0.55845207",
"0.55805635",
"0.55033994",
"0.5497962",
"0.5486491",
"0.547879",
"0.5476193",
"0.5... | 0.74779063 | 1 |
return next larger sparse number | def next_sparse_incremental(sparse_number):
# limit is arbitrary in Python
# http://stackoverflow.com/questions/5470693/python-number-limit
limit = 2 ** 32
for possible_sparse in range(sparse_number + 1, limit):
if is_sparse(possible_sparse):
return possible_sparse
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_sparse(sparse_number):\n\n # print(\"sparse_number 0b{0:b}\".format(sparse_number))\n\n # Edge case. Handle explicitly for clarity\n if sparse_number == 0:\n return 1\n\n power_max = twos_power_max(sparse_number)\n\n for power in range(0, power_max):\n # print(\"power\", power... | [
"0.7477969",
"0.61573946",
"0.613509",
"0.60775334",
"0.5992545",
"0.58828956",
"0.588183",
"0.588183",
"0.5831891",
"0.5825192",
"0.56328684",
"0.56140053",
"0.559014",
"0.5583566",
"0.5578744",
"0.55031174",
"0.5497666",
"0.548524",
"0.5477917",
"0.5475614",
"0.5440766",
... | 0.7672149 | 0 |
return True if number binary digit 1s have no adjacent 1s. | def is_sparse(number):
if number == 0:
return True
if number == 1:
# edge case. List explicitly for clarity. Define to be True
return True
else:
bits = bits_list(number)
# start power_of_2 at 1 so previous_bit index won't be out of list range
for power_of_2 i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def onlyonepositive(a):\n nbr = 0\n for e in a:\n if e >= 0: \n nbr += 1\n if nbr>1: return False\n return nbr==1",
"def count_ones(value):\n return bin(value).count('1')",
"def __nonzero__(self):\n for e in self:\n if e != 0:\n return T... | [
"0.6595635",
"0.6540053",
"0.6482591",
"0.63950247",
"0.63907003",
"0.6204543",
"0.61807245",
"0.6171981",
"0.61649305",
"0.6097352",
"0.6066647",
"0.60572785",
"0.6053024",
"0.60443586",
"0.6039504",
"0.60368466",
"0.6022546",
"0.6005996",
"0.5991123",
"0.59874594",
"0.59751... | 0.6741046 | 0 |
return highest power of two in number | def twos_power_max(number):
bits = bits_list(number)
return len(bits) - 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_power2(num):\n return 2 ** int(np.ceil(np.log2(num)))",
"def _find_nearest_power_of_two(x):\n\n return 1 << (x - 1).bit_length()",
"def _nearest_bigger_power_of_two(x: int) -> int:\n y = 2\n while y < x:\n y *= 2\n return y",
"def _next_power_of_two(self, n):\n if n == 0... | [
"0.7722803",
"0.77092505",
"0.7696812",
"0.75224876",
"0.7414126",
"0.7350261",
"0.72898906",
"0.72811985",
"0.7175145",
"0.7173635",
"0.7150411",
"0.71332145",
"0.71239346",
"0.71106535",
"0.7095859",
"0.7025772",
"0.7020954",
"0.69823575",
"0.69276136",
"0.6903265",
"0.6882... | 0.78875387 | 0 |
Adds two Reco objects, returns a Reco object. | def addReco(obj1,obj2):
px = obj1.px + obj2.px
py = obj1.py + obj2.py
pz = obj1.pz + obj2.pz
E = obj1.E + obj2.E
return Reco(px,py,pz,E) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __add__(self, other):\n new = self.__class__()\n new.extend(self)\n new.extend(other)\n return new",
"def __radd__(self, other):\n return self.runtime.add(self, other)",
"def __add__(self, other):\n return self.add(other)",
"def __radd__(self, other):\n\n ... | [
"0.6708373",
"0.6588393",
"0.6587373",
"0.6527081",
"0.6519195",
"0.6519195",
"0.6518886",
"0.65113086",
"0.6482993",
"0.6482993",
"0.6482993",
"0.6482993",
"0.6482993",
"0.6482993",
"0.6482993",
"0.6479999",
"0.6457409",
"0.6420922",
"0.6420922",
"0.6419211",
"0.6409279",
... | 0.7727639 | 0 |
Generates authentication headers required by bitcoin_com | def get_headers(self) -> Dict[str, str]:
header_dict = self.generate_auth_dict()
return {
"Authorization": "Basic " + header_dict["signature"],
"Content-Type": 'application/json',
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getHeaders():\n userid = rhev_settings.USERNAME\n passwd = rhev_settings.PASSWORD\n # base64.encodestring adds trailing \\n. \n auth = base64.encodestring(\"%s:%s\" % (userid, passwd)).rstrip(\"\\n\")\n headers = {\"Content-Type\": \"application/xml\",\n \"Accept\": \"applica... | [
"0.7698527",
"0.7321881",
"0.731975",
"0.7242912",
"0.7227",
"0.7122539",
"0.71201617",
"0.711637",
"0.7112385",
"0.7055011",
"0.70260453",
"0.69531006",
"0.69452506",
"0.6907244",
"0.6905155",
"0.6896297",
"0.6872004",
"0.68131626",
"0.68109024",
"0.6805357",
"0.67865443",
... | 0.7026986 | 10 |
Write a JSON dictionary (with formatting) to a file. | def write_json(fd, data, indent=DEFAULT_JSON_INDENT):
print(json.dumps(data, indent=indent), file=fd) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _write_json(fname, dictionary, overwrite=False, verbose=False):\n if op.exists(fname) and not overwrite:\n raise FileExistsError(f'\"{fname}\" already exists. '\n 'Please set overwrite to True.')\n\n json_output = json.dumps(dictionary, indent=4)\n with open(fname, ... | [
"0.8473659",
"0.8349206",
"0.8287237",
"0.8284883",
"0.8232919",
"0.8181084",
"0.8142443",
"0.7959556",
"0.7923507",
"0.7899531",
"0.7847865",
"0.7776783",
"0.7734701",
"0.7602273",
"0.759944",
"0.7568202",
"0.7562128",
"0.7525241",
"0.75060785",
"0.7493676",
"0.74867713",
... | 0.7724335 | 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.