partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
valid | CoreDriver.create_community | Create a new community or update an existing one using the uuid.
:param token: A valid token for the user in question.
:type token: string
:param name: The community name.
:type name: string
:param description: (optional) The community description.
:type description: str... | pydas/drivers.py | def create_community(self, token, name, **kwargs):
"""
Create a new community or update an existing one using the uuid.
:param token: A valid token for the user in question.
:type token: string
:param name: The community name.
:type name: string
:param descriptio... | def create_community(self, token, name, **kwargs):
"""
Create a new community or update an existing one using the uuid.
:param token: A valid token for the user in question.
:type token: string
:param name: The community name.
:type name: string
:param descriptio... | [
"Create",
"a",
"new",
"community",
"or",
"update",
"an",
"existing",
"one",
"using",
"the",
"uuid",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L421-L454 | [
"def",
"create_community",
"(",
"self",
",",
"token",
",",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'name'",
"]",
"=",
"name",
"optional_keys",
... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.get_community_by_name | Get a community based on its name.
:param name: The name of the target community.
:type name: string
:param token: (optional) A valid token for the user in question.
:type token: None | string
:returns: The requested community.
:rtype: dict | pydas/drivers.py | def get_community_by_name(self, name, token=None):
"""
Get a community based on its name.
:param name: The name of the target community.
:type name: string
:param token: (optional) A valid token for the user in question.
:type token: None | string
:returns: The r... | def get_community_by_name(self, name, token=None):
"""
Get a community based on its name.
:param name: The name of the target community.
:type name: string
:param token: (optional) A valid token for the user in question.
:type token: None | string
:returns: The r... | [
"Get",
"a",
"community",
"based",
"on",
"its",
"name",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L456-L472 | [
"def",
"get_community_by_name",
"(",
"self",
",",
"name",
",",
"token",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'name'",
"]",
"=",
"name",
"if",
"token",
":",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"res... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.get_community_by_id | Get a community based on its id.
:param community_id: The id of the target community.
:type community_id: int | long
:param token: (optional) A valid token for the user in question.
:type token: None | string
:returns: The requested community.
:rtype: dict | pydas/drivers.py | def get_community_by_id(self, community_id, token=None):
"""
Get a community based on its id.
:param community_id: The id of the target community.
:type community_id: int | long
:param token: (optional) A valid token for the user in question.
:type token: None | string
... | def get_community_by_id(self, community_id, token=None):
"""
Get a community based on its id.
:param community_id: The id of the target community.
:type community_id: int | long
:param token: (optional) A valid token for the user in question.
:type token: None | string
... | [
"Get",
"a",
"community",
"based",
"on",
"its",
"id",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L474-L490 | [
"def",
"get_community_by_id",
"(",
"self",
",",
"community_id",
",",
"token",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'id'",
"]",
"=",
"community_id",
"if",
"token",
":",
"parameters",
"[",
"'token'",
"]",
"=",
"to... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.get_community_children | Get the non-recursive children of the passed in community_id.
:param community_id: The id of the requested community.
:type community_id: int | long
:param token: (optional) A valid token for the user in question.
:type token: None | string
:returns: List of the folders in the c... | pydas/drivers.py | def get_community_children(self, community_id, token=None):
"""
Get the non-recursive children of the passed in community_id.
:param community_id: The id of the requested community.
:type community_id: int | long
:param token: (optional) A valid token for the user in question.
... | def get_community_children(self, community_id, token=None):
"""
Get the non-recursive children of the passed in community_id.
:param community_id: The id of the requested community.
:type community_id: int | long
:param token: (optional) A valid token for the user in question.
... | [
"Get",
"the",
"non",
"-",
"recursive",
"children",
"of",
"the",
"passed",
"in",
"community_id",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L492-L508 | [
"def",
"get_community_children",
"(",
"self",
",",
"community_id",
",",
"token",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'id'",
"]",
"=",
"community_id",
"if",
"token",
":",
"parameters",
"[",
"'token'",
"]",
"=",
... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.list_communities | List all communities visible to a user.
:param token: (optional) A valid token for the user in question.
:type token: None | string
:returns: The list of communities.
:rtype: list[dict] | pydas/drivers.py | def list_communities(self, token=None):
"""
List all communities visible to a user.
:param token: (optional) A valid token for the user in question.
:type token: None | string
:returns: The list of communities.
:rtype: list[dict]
"""
parameters = dict()
... | def list_communities(self, token=None):
"""
List all communities visible to a user.
:param token: (optional) A valid token for the user in question.
:type token: None | string
:returns: The list of communities.
:rtype: list[dict]
"""
parameters = dict()
... | [
"List",
"all",
"communities",
"visible",
"to",
"a",
"user",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L510-L523 | [
"def",
"list_communities",
"(",
"self",
",",
"token",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"if",
"token",
":",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"response",
"=",
"self",
".",
"request",
"(",
"'midas.community.list'",
... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.folder_get | Get the attributes of the specified folder.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the requested folder.
:type folder_id: int | long
:returns: Dictionary of the folder attributes.
:rtype: dict | pydas/drivers.py | def folder_get(self, token, folder_id):
"""
Get the attributes of the specified folder.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the requested folder.
:type folder_id: int | long
:returns: Dictionary of... | def folder_get(self, token, folder_id):
"""
Get the attributes of the specified folder.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the requested folder.
:type folder_id: int | long
:returns: Dictionary of... | [
"Get",
"the",
"attributes",
"of",
"the",
"specified",
"folder",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L564-L579 | [
"def",
"folder_get",
"(",
"self",
",",
"token",
",",
"folder_id",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'id'",
"]",
"=",
"folder_id",
"response",
"=",
"self",
".",
"request",
... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.folder_children | Get the non-recursive children of the passed in folder_id.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the requested folder.
:type folder_id: int | long
:returns: Dictionary of two lists: 'folders' and 'items'.
:r... | pydas/drivers.py | def folder_children(self, token, folder_id):
"""
Get the non-recursive children of the passed in folder_id.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the requested folder.
:type folder_id: int | long
:re... | def folder_children(self, token, folder_id):
"""
Get the non-recursive children of the passed in folder_id.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the requested folder.
:type folder_id: int | long
:re... | [
"Get",
"the",
"non",
"-",
"recursive",
"children",
"of",
"the",
"passed",
"in",
"folder_id",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L581-L596 | [
"def",
"folder_children",
"(",
"self",
",",
"token",
",",
"folder_id",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'id'",
"]",
"=",
"folder_id",
"response",
"=",
"self",
".",
"reques... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.delete_folder | Delete the folder with the passed in folder_id.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the folder to be deleted.
:type folder_id: int | long
:returns: None.
:rtype: None | pydas/drivers.py | def delete_folder(self, token, folder_id):
"""
Delete the folder with the passed in folder_id.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the folder to be deleted.
:type folder_id: int | long
:returns: No... | def delete_folder(self, token, folder_id):
"""
Delete the folder with the passed in folder_id.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the folder to be deleted.
:type folder_id: int | long
:returns: No... | [
"Delete",
"the",
"folder",
"with",
"the",
"passed",
"in",
"folder_id",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L598-L613 | [
"def",
"delete_folder",
"(",
"self",
",",
"token",
",",
"folder_id",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'id'",
"]",
"=",
"folder_id",
"response",
"=",
"self",
".",
"request"... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.move_folder | Move a folder to the destination folder.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the folder to be moved.
:type folder_id: int | long
:param dest_folder_id: The id of destination (new parent) folder.
:type dest... | pydas/drivers.py | def move_folder(self, token, folder_id, dest_folder_id):
"""
Move a folder to the destination folder.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the folder to be moved.
:type folder_id: int | long
:param ... | def move_folder(self, token, folder_id, dest_folder_id):
"""
Move a folder to the destination folder.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the folder to be moved.
:type folder_id: int | long
:param ... | [
"Move",
"a",
"folder",
"to",
"the",
"destination",
"folder",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L615-L633 | [
"def",
"move_folder",
"(",
"self",
",",
"token",
",",
"folder_id",
",",
"dest_folder_id",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'id'",
"]",
"=",
"folder_id",
"parameters",
"[",
... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.create_item | Create an item to the server.
:param token: A valid token for the user in question.
:type token: string
:param name: The name of the item to be created.
:type name: string
:param parent_id: The id of the destination folder.
:type parent_id: int | long
:param desc... | pydas/drivers.py | def create_item(self, token, name, parent_id, **kwargs):
"""
Create an item to the server.
:param token: A valid token for the user in question.
:type token: string
:param name: The name of the item to be created.
:type name: string
:param parent_id: The id of th... | def create_item(self, token, name, parent_id, **kwargs):
"""
Create an item to the server.
:param token: A valid token for the user in question.
:type token: string
:param name: The name of the item to be created.
:type name: string
:param parent_id: The id of th... | [
"Create",
"an",
"item",
"to",
"the",
"server",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L635-L665 | [
"def",
"create_item",
"(",
"self",
",",
"token",
",",
"name",
",",
"parent_id",
",",
"*",
"*",
"kwargs",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'name'",
"]",
"=",
"name",
"p... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.item_get | Get the attributes of the specified item.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the requested item.
:type item_id: int | string
:returns: Dictionary of the item attributes.
:rtype: dict | pydas/drivers.py | def item_get(self, token, item_id):
"""
Get the attributes of the specified item.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the requested item.
:type item_id: int | string
:returns: Dictionary of the item ... | def item_get(self, token, item_id):
"""
Get the attributes of the specified item.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the requested item.
:type item_id: int | string
:returns: Dictionary of the item ... | [
"Get",
"the",
"attributes",
"of",
"the",
"specified",
"item",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L667-L682 | [
"def",
"item_get",
"(",
"self",
",",
"token",
",",
"item_id",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'id'",
"]",
"=",
"item_id",
"response",
"=",
"self",
".",
"request",
"(",
... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.download_item | Download an item to disk.
:param item_id: The id of the item to be downloaded.
:type item_id: int | long
:param token: (optional) The authentication token of the user
requesting the download.
:type token: None | string
:param revision: (optional) The revision of the ... | pydas/drivers.py | def download_item(self, item_id, token=None, revision=None):
"""
Download an item to disk.
:param item_id: The id of the item to be downloaded.
:type item_id: int | long
:param token: (optional) The authentication token of the user
requesting the download.
:t... | def download_item(self, item_id, token=None, revision=None):
"""
Download an item to disk.
:param item_id: The id of the item to be downloaded.
:type item_id: int | long
:param token: (optional) The authentication token of the user
requesting the download.
:t... | [
"Download",
"an",
"item",
"to",
"disk",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L684-L711 | [
"def",
"download_item",
"(",
"self",
",",
"item_id",
",",
"token",
"=",
"None",
",",
"revision",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'id'",
"]",
"=",
"item_id",
"if",
"token",
":",
"parameters",
"[",
"'token'... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.delete_item | Delete the item with the passed in item_id.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item to be deleted.
:type item_id: int | long
:returns: None.
:rtype: None | pydas/drivers.py | def delete_item(self, token, item_id):
"""
Delete the item with the passed in item_id.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item to be deleted.
:type item_id: int | long
:returns: None.
:r... | def delete_item(self, token, item_id):
"""
Delete the item with the passed in item_id.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item to be deleted.
:type item_id: int | long
:returns: None.
:r... | [
"Delete",
"the",
"item",
"with",
"the",
"passed",
"in",
"item_id",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L713-L728 | [
"def",
"delete_item",
"(",
"self",
",",
"token",
",",
"item_id",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'id'",
"]",
"=",
"item_id",
"response",
"=",
"self",
".",
"request",
"(... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.get_item_metadata | Get the metadata associated with an item.
:param item_id: The id of the item for which metadata will be returned
:type item_id: int | long
:param token: (optional) A valid token for the user in question.
:type token: None | string
:param revision: (optional) Revision of the item... | pydas/drivers.py | def get_item_metadata(self, item_id, token=None, revision=None):
"""
Get the metadata associated with an item.
:param item_id: The id of the item for which metadata will be returned
:type item_id: int | long
:param token: (optional) A valid token for the user in question.
... | def get_item_metadata(self, item_id, token=None, revision=None):
"""
Get the metadata associated with an item.
:param item_id: The id of the item for which metadata will be returned
:type item_id: int | long
:param token: (optional) A valid token for the user in question.
... | [
"Get",
"the",
"metadata",
"associated",
"with",
"an",
"item",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L730-L751 | [
"def",
"get_item_metadata",
"(",
"self",
",",
"item_id",
",",
"token",
"=",
"None",
",",
"revision",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'id'",
"]",
"=",
"item_id",
"if",
"token",
":",
"parameters",
"[",
"'to... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.set_item_metadata | Set the metadata associated with an item.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item for which metadata will be set.
:type item_id: int | long
:param element: The metadata element name.
:type element: stri... | pydas/drivers.py | def set_item_metadata(self, token, item_id, element, value,
qualifier=None):
"""
Set the metadata associated with an item.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item for which metadata wi... | def set_item_metadata(self, token, item_id, element, value,
qualifier=None):
"""
Set the metadata associated with an item.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item for which metadata wi... | [
"Set",
"the",
"metadata",
"associated",
"with",
"an",
"item",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L753-L780 | [
"def",
"set_item_metadata",
"(",
"self",
",",
"token",
",",
"item_id",
",",
"element",
",",
"value",
",",
"qualifier",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'itemI... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.share_item | Share an item to the destination folder.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item to be shared.
:type item_id: int | long
:param dest_folder_id: The id of destination folder where the item is
shared ... | pydas/drivers.py | def share_item(self, token, item_id, dest_folder_id):
"""
Share an item to the destination folder.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item to be shared.
:type item_id: int | long
:param dest_fol... | def share_item(self, token, item_id, dest_folder_id):
"""
Share an item to the destination folder.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item to be shared.
:type item_id: int | long
:param dest_fol... | [
"Share",
"an",
"item",
"to",
"the",
"destination",
"folder",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L782-L801 | [
"def",
"share_item",
"(",
"self",
",",
"token",
",",
"item_id",
",",
"dest_folder_id",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'id'",
"]",
"=",
"item_id",
"parameters",
"[",
"'ds... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.move_item | Move an item from the source folder to the destination folder.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item to be moved
:type item_id: int | long
:param src_folder_id: The id of source folder where the item is locat... | pydas/drivers.py | def move_item(self, token, item_id, src_folder_id, dest_folder_id):
"""
Move an item from the source folder to the destination folder.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item to be moved
:type item_id: ... | def move_item(self, token, item_id, src_folder_id, dest_folder_id):
"""
Move an item from the source folder to the destination folder.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item to be moved
:type item_id: ... | [
"Move",
"an",
"item",
"from",
"the",
"source",
"folder",
"to",
"the",
"destination",
"folder",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L803-L825 | [
"def",
"move_item",
"(",
"self",
",",
"token",
",",
"item_id",
",",
"src_folder_id",
",",
"dest_folder_id",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'id'",
"]",
"=",
"item_id",
"p... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.search_item_by_name | Return all items.
:param name: The name of the item to search by.
:type name: string
:param token: (optional) A valid token for the user in question.
:type token: None | string
:returns: A list of all items with the given name.
:rtype: list[dict] | pydas/drivers.py | def search_item_by_name(self, name, token=None):
"""
Return all items.
:param name: The name of the item to search by.
:type name: string
:param token: (optional) A valid token for the user in question.
:type token: None | string
:returns: A list of all items wit... | def search_item_by_name(self, name, token=None):
"""
Return all items.
:param name: The name of the item to search by.
:type name: string
:param token: (optional) A valid token for the user in question.
:type token: None | string
:returns: A list of all items wit... | [
"Return",
"all",
"items",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L827-L843 | [
"def",
"search_item_by_name",
"(",
"self",
",",
"name",
",",
"token",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'name'",
"]",
"=",
"name",
"if",
"token",
":",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"respo... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.search_item_by_name_and_folder | Return all items with a given name and parent folder id.
:param name: The name of the item to search by.
:type name: string
:param folder_id: The id of the parent folder to search by.
:type folder_id: int | long
:param token: (optional) A valid token for the user in question.
... | pydas/drivers.py | def search_item_by_name_and_folder(self, name, folder_id, token=None):
"""
Return all items with a given name and parent folder id.
:param name: The name of the item to search by.
:type name: string
:param folder_id: The id of the parent folder to search by.
:type folder... | def search_item_by_name_and_folder(self, name, folder_id, token=None):
"""
Return all items with a given name and parent folder id.
:param name: The name of the item to search by.
:type name: string
:param folder_id: The id of the parent folder to search by.
:type folder... | [
"Return",
"all",
"items",
"with",
"a",
"given",
"name",
"and",
"parent",
"folder",
"id",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L845-L864 | [
"def",
"search_item_by_name_and_folder",
"(",
"self",
",",
"name",
",",
"folder_id",
",",
"token",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'name'",
"]",
"=",
"name",
"parameters",
"[",
"'folderId'",
"]",
"=",
"folder... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.search_item_by_name_and_folder_name | Return all items with a given name and parent folder name.
:param name: The name of the item to search by.
:type name: string
:param folder_name: The name of the parent folder to search by.
:type folder_name: string
:param token: (optional) A valid token for the user in question... | pydas/drivers.py | def search_item_by_name_and_folder_name(self, name, folder_name,
token=None):
"""
Return all items with a given name and parent folder name.
:param name: The name of the item to search by.
:type name: string
:param folder_name: The nam... | def search_item_by_name_and_folder_name(self, name, folder_name,
token=None):
"""
Return all items with a given name and parent folder name.
:param name: The name of the item to search by.
:type name: string
:param folder_name: The nam... | [
"Return",
"all",
"items",
"with",
"a",
"given",
"name",
"and",
"parent",
"folder",
"name",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L866-L888 | [
"def",
"search_item_by_name_and_folder_name",
"(",
"self",
",",
"name",
",",
"folder_name",
",",
"token",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'name'",
"]",
"=",
"name",
"parameters",
"[",
"'folderName'",
"]",
"=",
... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.create_link | Create a link bitstream.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the folder in which to create a new item
that will contain the link. The new item will have the same name as
the URL unless an item name is supp... | pydas/drivers.py | def create_link(self, token, folder_id, url, **kwargs):
"""
Create a link bitstream.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the folder in which to create a new item
that will contain the link. The new ite... | def create_link(self, token, folder_id, url, **kwargs):
"""
Create a link bitstream.
:param token: A valid token for the user in question.
:type token: string
:param folder_id: The id of the folder in which to create a new item
that will contain the link. The new ite... | [
"Create",
"a",
"link",
"bitstream",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L890-L928 | [
"def",
"create_link",
"(",
"self",
",",
"token",
",",
"folder_id",
",",
"url",
",",
"*",
"*",
"kwargs",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'folderid'",
"]",
"=",
"folder_i... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.generate_upload_token | Generate a token to use for upload.
Midas Server uses a individual token for each upload. The token
corresponds to the file specified and that file only. Passing the MD5
checksum allows the server to determine if the file is already in the
asset store.
If :param:`checksum` is p... | pydas/drivers.py | def generate_upload_token(self, token, item_id, filename, checksum=None):
"""
Generate a token to use for upload.
Midas Server uses a individual token for each upload. The token
corresponds to the file specified and that file only. Passing the MD5
checksum allows the server to d... | def generate_upload_token(self, token, item_id, filename, checksum=None):
"""
Generate a token to use for upload.
Midas Server uses a individual token for each upload. The token
corresponds to the file specified and that file only. Passing the MD5
checksum allows the server to d... | [
"Generate",
"a",
"token",
"to",
"use",
"for",
"upload",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L930-L964 | [
"def",
"generate_upload_token",
"(",
"self",
",",
"token",
",",
"item_id",
",",
"filename",
",",
"checksum",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'itemid'",
"]",
... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.perform_upload | Upload a file into a given item (or just to the public folder if the
item is not specified.
:param upload_token: The upload token (returned by
generate_upload_token)
:type upload_token: string
:param filename: The upload filename. Also used as the path to the
fil... | pydas/drivers.py | def perform_upload(self, upload_token, filename, **kwargs):
"""
Upload a file into a given item (or just to the public folder if the
item is not specified.
:param upload_token: The upload token (returned by
generate_upload_token)
:type upload_token: string
:p... | def perform_upload(self, upload_token, filename, **kwargs):
"""
Upload a file into a given item (or just to the public folder if the
item is not specified.
:param upload_token: The upload token (returned by
generate_upload_token)
:type upload_token: string
:p... | [
"Upload",
"a",
"file",
"into",
"a",
"given",
"item",
"(",
"or",
"just",
"to",
"the",
"public",
"folder",
"if",
"the",
"item",
"is",
"not",
"specified",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L966-L1028 | [
"def",
"perform_upload",
"(",
"self",
",",
"upload_token",
",",
"filename",
",",
"*",
"*",
"kwargs",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'uploadtoken'",
"]",
"=",
"upload_token",
"parameters",
"[",
"'filename'",
"]",
"=",
"fi... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | CoreDriver.search | Get the resources corresponding to a given query.
:param search: The search criterion.
:type search: string
:param token: (optional) The credentials to use when searching.
:type token: None | string
:returns: Dictionary containing the search result. Notable is the
di... | pydas/drivers.py | def search(self, search, token=None):
"""
Get the resources corresponding to a given query.
:param search: The search criterion.
:type search: string
:param token: (optional) The credentials to use when searching.
:type token: None | string
:returns: Dictionary c... | def search(self, search, token=None):
"""
Get the resources corresponding to a given query.
:param search: The search criterion.
:type search: string
:param token: (optional) The credentials to use when searching.
:type token: None | string
:returns: Dictionary c... | [
"Get",
"the",
"resources",
"corresponding",
"to",
"a",
"given",
"query",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L1030-L1047 | [
"def",
"search",
"(",
"self",
",",
"search",
",",
"token",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'search'",
"]",
"=",
"search",
"if",
"token",
":",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"response",
... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | BatchmakeDriver.add_condor_dag | Add a Condor DAG to the given Batchmake task.
:param token: A valid token for the user in question.
:type token: string
:param batchmaketaskid: id of the Batchmake task for this DAG
:type batchmaketaskid: int | long
:param dagfilename: Filename of the DAG file
:type dagf... | pydas/drivers.py | def add_condor_dag(self, token, batchmaketaskid, dagfilename,
dagmanoutfilename):
"""
Add a Condor DAG to the given Batchmake task.
:param token: A valid token for the user in question.
:type token: string
:param batchmaketaskid: id of the Batchmake task f... | def add_condor_dag(self, token, batchmaketaskid, dagfilename,
dagmanoutfilename):
"""
Add a Condor DAG to the given Batchmake task.
:param token: A valid token for the user in question.
:type token: string
:param batchmaketaskid: id of the Batchmake task f... | [
"Add",
"a",
"Condor",
"DAG",
"to",
"the",
"given",
"Batchmake",
"task",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L1053-L1075 | [
"def",
"add_condor_dag",
"(",
"self",
",",
"token",
",",
"batchmaketaskid",
",",
"dagfilename",
",",
"dagmanoutfilename",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'batchmaketaskid'",
"]... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | BatchmakeDriver.add_condor_job | Add a Condor DAG job to the Condor DAG associated with this
Batchmake task
:param token: A valid token for the user in question.
:type token: string
:param batchmaketaskid: id of the Batchmake task for this DAG
:type batchmaketaskid: int | long
:param jobdefinitionfilena... | pydas/drivers.py | def add_condor_job(self, token, batchmaketaskid, jobdefinitionfilename,
outputfilename, errorfilename, logfilename,
postfilename):
"""
Add a Condor DAG job to the Condor DAG associated with this
Batchmake task
:param token: A valid token for... | def add_condor_job(self, token, batchmaketaskid, jobdefinitionfilename,
outputfilename, errorfilename, logfilename,
postfilename):
"""
Add a Condor DAG job to the Condor DAG associated with this
Batchmake task
:param token: A valid token for... | [
"Add",
"a",
"Condor",
"DAG",
"job",
"to",
"the",
"Condor",
"DAG",
"associated",
"with",
"this",
"Batchmake",
"task"
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L1077-L1111 | [
"def",
"add_condor_job",
"(",
"self",
",",
"token",
",",
"batchmaketaskid",
",",
"jobdefinitionfilename",
",",
"outputfilename",
",",
"errorfilename",
",",
"logfilename",
",",
"postfilename",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'to... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | DicomextractorDriver.extract_dicommetadata | Extract DICOM metadata from the given item
:param token: A valid token for the user in question.
:type token: string
:param item_id: id of the item to be extracted
:type item_id: int | long
:return: the item revision DAO
:rtype: dict | pydas/drivers.py | def extract_dicommetadata(self, token, item_id):
"""
Extract DICOM metadata from the given item
:param token: A valid token for the user in question.
:type token: string
:param item_id: id of the item to be extracted
:type item_id: int | long
:return: the item re... | def extract_dicommetadata(self, token, item_id):
"""
Extract DICOM metadata from the given item
:param token: A valid token for the user in question.
:type token: string
:param item_id: id of the item to be extracted
:type item_id: int | long
:return: the item re... | [
"Extract",
"DICOM",
"metadata",
"from",
"the",
"given",
"item"
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L1117-L1132 | [
"def",
"extract_dicommetadata",
"(",
"self",
",",
"token",
",",
"item_id",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'item'",
"]",
"=",
"item_id",
"response",
"=",
"self",
".",
"re... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | MultiFactorAuthenticationDriver.mfa_otp_login | Log in to get the real token using the temporary token and otp.
:param temp_token: The temporary token or id returned from normal login
:type temp_token: string
:param one_time_pass: The one-time pass to be sent to the underlying
multi-factor engine.
:type one_time_pass: str... | pydas/drivers.py | def mfa_otp_login(self, temp_token, one_time_pass):
"""
Log in to get the real token using the temporary token and otp.
:param temp_token: The temporary token or id returned from normal login
:type temp_token: string
:param one_time_pass: The one-time pass to be sent to the unde... | def mfa_otp_login(self, temp_token, one_time_pass):
"""
Log in to get the real token using the temporary token and otp.
:param temp_token: The temporary token or id returned from normal login
:type temp_token: string
:param one_time_pass: The one-time pass to be sent to the unde... | [
"Log",
"in",
"to",
"get",
"the",
"real",
"token",
"using",
"the",
"temporary",
"token",
"and",
"otp",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L1138-L1154 | [
"def",
"mfa_otp_login",
"(",
"self",
",",
"temp_token",
",",
"one_time_pass",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'mfaTokenId'",
"]",
"=",
"temp_token",
"parameters",
"[",
"'otp'",
"]",
"=",
"one_time_pass",
"response",
"=",
"s... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | ThumbnailCreatorDriver.create_big_thumbnail | Create a big thumbnail for the given bitstream with the given width.
It is used as the main image of the given item and shown in the item
view page.
:param token: A valid token for the user in question.
:type token: string
:param bitstream_id: The bitstream from which to create ... | pydas/drivers.py | def create_big_thumbnail(self, token, bitstream_id, item_id, width=575):
"""
Create a big thumbnail for the given bitstream with the given width.
It is used as the main image of the given item and shown in the item
view page.
:param token: A valid token for the user in question.... | def create_big_thumbnail(self, token, bitstream_id, item_id, width=575):
"""
Create a big thumbnail for the given bitstream with the given width.
It is used as the main image of the given item and shown in the item
view page.
:param token: A valid token for the user in question.... | [
"Create",
"a",
"big",
"thumbnail",
"for",
"the",
"given",
"bitstream",
"with",
"the",
"given",
"width",
".",
"It",
"is",
"used",
"as",
"the",
"main",
"image",
"of",
"the",
"given",
"item",
"and",
"shown",
"in",
"the",
"item",
"view",
"page",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L1160-L1185 | [
"def",
"create_big_thumbnail",
"(",
"self",
",",
"token",
",",
"bitstream_id",
",",
"item_id",
",",
"width",
"=",
"575",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'bitstreamId'",
"]"... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | ThumbnailCreatorDriver.create_small_thumbnail | Create a 100x100 small thumbnail for the given item. It is used for
preview purpose and displayed in the 'preview' and 'thumbnails'
sidebar sections.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The item on which to set the thumbnail.... | pydas/drivers.py | def create_small_thumbnail(self, token, item_id):
"""
Create a 100x100 small thumbnail for the given item. It is used for
preview purpose and displayed in the 'preview' and 'thumbnails'
sidebar sections.
:param token: A valid token for the user in question.
:type token: ... | def create_small_thumbnail(self, token, item_id):
"""
Create a 100x100 small thumbnail for the given item. It is used for
preview purpose and displayed in the 'preview' and 'thumbnails'
sidebar sections.
:param token: A valid token for the user in question.
:type token: ... | [
"Create",
"a",
"100x100",
"small",
"thumbnail",
"for",
"the",
"given",
"item",
".",
"It",
"is",
"used",
"for",
"preview",
"purpose",
"and",
"displayed",
"in",
"the",
"preview",
"and",
"thumbnails",
"sidebar",
"sections",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L1187-L1206 | [
"def",
"create_small_thumbnail",
"(",
"self",
",",
"token",
",",
"item_id",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'itemId'",
"]",
"=",
"item_id",
"response",
"=",
"self",
".",
... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | SolrDriver.solr_advanced_search | Search item metadata using Apache Solr.
:param query: The Apache Lucene search query.
:type query: string
:param token: (optional) A valid token for the user in question.
:type token: None | string
:param limit: (optional) The limit of the search.
:type limit: int | long... | pydas/drivers.py | def solr_advanced_search(self, query, token=None, limit=20):
"""
Search item metadata using Apache Solr.
:param query: The Apache Lucene search query.
:type query: string
:param token: (optional) A valid token for the user in question.
:type token: None | string
... | def solr_advanced_search(self, query, token=None, limit=20):
"""
Search item metadata using Apache Solr.
:param query: The Apache Lucene search query.
:type query: string
:param token: (optional) A valid token for the user in question.
:type token: None | string
... | [
"Search",
"item",
"metadata",
"using",
"Apache",
"Solr",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L1212-L1231 | [
"def",
"solr_advanced_search",
"(",
"self",
",",
"query",
",",
"token",
"=",
"None",
",",
"limit",
"=",
"20",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'query'",
"]",
"=",
"query",
"parameters",
"[",
"'limit'",
"]",
"=",
"limit... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | TrackerDriver.associate_item_with_scalar_data | Associate a result item with a particular scalar value.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of the item to associate with the scalar.
:type item_id: int | long
:param scalar_id: Scalar id with which to associate the it... | pydas/drivers.py | def associate_item_with_scalar_data(self, token, item_id, scalar_id,
label):
"""
Associate a result item with a particular scalar value.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of th... | def associate_item_with_scalar_data(self, token, item_id, scalar_id,
label):
"""
Associate a result item with a particular scalar value.
:param token: A valid token for the user in question.
:type token: string
:param item_id: The id of th... | [
"Associate",
"a",
"result",
"item",
"with",
"a",
"particular",
"scalar",
"value",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L1237-L1256 | [
"def",
"associate_item_with_scalar_data",
"(",
"self",
",",
"token",
",",
"item_id",
",",
"scalar_id",
",",
"label",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"parameters",
"[",
"'scalarIds'",
"]",
"=",
... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | TrackerDriver.create_submission | Associate a result item with a particular scalar value.
:param token: A valid token for the user in question.
:type token: string
:param uuid (optional) The uuid of the submission (must be unique)
:type uuid: string
:param name (optional) The name of the submission
:type... | pydas/drivers.py | def create_submission(self, token, **kwargs):
"""
Associate a result item with a particular scalar value.
:param token: A valid token for the user in question.
:type token: string
:param uuid (optional) The uuid of the submission (must be unique)
:type uuid: string
... | def create_submission(self, token, **kwargs):
"""
Associate a result item with a particular scalar value.
:param token: A valid token for the user in question.
:type token: string
:param uuid (optional) The uuid of the submission (must be unique)
:type uuid: string
... | [
"Associate",
"a",
"result",
"item",
"with",
"a",
"particular",
"scalar",
"value",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L1258-L1277 | [
"def",
"create_submission",
"(",
"self",
",",
"token",
",",
"*",
"*",
"kwargs",
")",
":",
"parameters",
"=",
"{",
"}",
"parameters",
"[",
"'token'",
"]",
"=",
"token",
"optional_keys",
"=",
"[",
"'uuid'",
",",
"'name'",
"]",
"for",
"key",
"in",
"option... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | TrackerDriver.add_scalar_data | Create a new scalar data point.
:param token: A valid token for the user in question.
:type token: string
:param community_id: The id of the community that owns the producer.
:type community_id: int | long
:param producer_display_name: The display name of the producer.
:... | pydas/drivers.py | def add_scalar_data(self, token, community_id, producer_display_name,
metric_name, producer_revision, submit_time, value,
**kwargs):
"""
Create a new scalar data point.
:param token: A valid token for the user in question.
:type token: str... | def add_scalar_data(self, token, community_id, producer_display_name,
metric_name, producer_revision, submit_time, value,
**kwargs):
"""
Create a new scalar data point.
:param token: A valid token for the user in question.
:type token: str... | [
"Create",
"a",
"new",
"scalar",
"data",
"point",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L1279-L1389 | [
"def",
"add_scalar_data",
"(",
"self",
",",
"token",
",",
"community_id",
",",
"producer_display_name",
",",
"metric_name",
",",
"producer_revision",
",",
"submit_time",
",",
"value",
",",
"*",
"*",
"kwargs",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"p... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | TrackerDriver.upload_json_results | Upload a JSON file containing numeric scoring results to be added as
scalars. File is parsed and then deleted from the server.
:param token: A valid token for the user in question.
:param filepath: The path to the JSON file.
:param community_id: The id of the community that owns the pro... | pydas/drivers.py | def upload_json_results(self, token, filepath, community_id,
producer_display_name, metric_name,
producer_revision, submit_time, **kwargs):
"""
Upload a JSON file containing numeric scoring results to be added as
scalars. File is parsed and... | def upload_json_results(self, token, filepath, community_id,
producer_display_name, metric_name,
producer_revision, submit_time, **kwargs):
"""
Upload a JSON file containing numeric scoring results to be added as
scalars. File is parsed and... | [
"Upload",
"a",
"JSON",
"file",
"containing",
"numeric",
"scoring",
"results",
"to",
"be",
"added",
"as",
"scalars",
".",
"File",
"is",
"parsed",
"and",
"then",
"deleted",
"from",
"the",
"server",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/drivers.py#L1391-L1470 | [
"def",
"upload_json_results",
"(",
"self",
",",
"token",
",",
"filepath",
",",
"community_id",
",",
"producer_display_name",
",",
"metric_name",
",",
"producer_revision",
",",
"submit_time",
",",
"*",
"*",
"kwargs",
")",
":",
"parameters",
"=",
"dict",
"(",
")... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | RevisionCollection.__get_rev | Obtain particular version of the doc at key. | revisions/core.py | def __get_rev(self, key, version, **kwa):
'''Obtain particular version of the doc at key.'''
if '_doc' in kwa:
doc = kwa['_doc']
else:
if type(version) is int:
if version == 0:
order = pymongo.ASCENDING
elif version == -1:
order = pymongo.DESCENDING
do... | def __get_rev(self, key, version, **kwa):
'''Obtain particular version of the doc at key.'''
if '_doc' in kwa:
doc = kwa['_doc']
else:
if type(version) is int:
if version == 0:
order = pymongo.ASCENDING
elif version == -1:
order = pymongo.DESCENDING
do... | [
"Obtain",
"particular",
"version",
"of",
"the",
"doc",
"at",
"key",
"."
] | prashnts/revisions | python | https://github.com/prashnts/revisions/blob/a3c65d068e09e717df5389e924686da540da6f12/revisions/core.py#L30-L50 | [
"def",
"__get_rev",
"(",
"self",
",",
"key",
",",
"version",
",",
"*",
"*",
"kwa",
")",
":",
"if",
"'_doc'",
"in",
"kwa",
":",
"doc",
"=",
"kwa",
"[",
"'_doc'",
"]",
"else",
":",
"if",
"type",
"(",
"version",
")",
"is",
"int",
":",
"if",
"versi... | a3c65d068e09e717df5389e924686da540da6f12 |
valid | RevisionCollection.__round_time | Round a datetime object to a multiple of a timedelta
dt : datetime.datetime object, default now. | revisions/core.py | def __round_time(self, dt):
"""Round a datetime object to a multiple of a timedelta
dt : datetime.datetime object, default now.
"""
round_to = self._resolution.total_seconds()
seconds = (dt - dt.min).seconds
rounding = (seconds + round_to / 2) // round_to * round_to
return dt + timedelta(0,... | def __round_time(self, dt):
"""Round a datetime object to a multiple of a timedelta
dt : datetime.datetime object, default now.
"""
round_to = self._resolution.total_seconds()
seconds = (dt - dt.min).seconds
rounding = (seconds + round_to / 2) // round_to * round_to
return dt + timedelta(0,... | [
"Round",
"a",
"datetime",
"object",
"to",
"a",
"multiple",
"of",
"a",
"timedelta",
"dt",
":",
"datetime",
".",
"datetime",
"object",
"default",
"now",
"."
] | prashnts/revisions | python | https://github.com/prashnts/revisions/blob/a3c65d068e09e717df5389e924686da540da6f12/revisions/core.py#L52-L59 | [
"def",
"__round_time",
"(",
"self",
",",
"dt",
")",
":",
"round_to",
"=",
"self",
".",
"_resolution",
".",
"total_seconds",
"(",
")",
"seconds",
"=",
"(",
"dt",
"-",
"dt",
".",
"min",
")",
".",
"seconds",
"rounding",
"=",
"(",
"seconds",
"+",
"round_... | a3c65d068e09e717df5389e924686da540da6f12 |
valid | RequestsMock._hashkey | Find a hash value for the linear combination of invocation methods. | revisions/core.py | def _hashkey(self, method, url, **kwa):
'''Find a hash value for the linear combination of invocation methods.
'''
to_hash = ''.join([str(method), str(url),
str(kwa.get('data', '')),
str(kwa.get('params', ''))
])
return hashlib.md5(to_hash.encode()).hexdigest() | def _hashkey(self, method, url, **kwa):
'''Find a hash value for the linear combination of invocation methods.
'''
to_hash = ''.join([str(method), str(url),
str(kwa.get('data', '')),
str(kwa.get('params', ''))
])
return hashlib.md5(to_hash.encode()).hexdigest() | [
"Find",
"a",
"hash",
"value",
"for",
"the",
"linear",
"combination",
"of",
"invocation",
"methods",
"."
] | prashnts/revisions | python | https://github.com/prashnts/revisions/blob/a3c65d068e09e717df5389e924686da540da6f12/revisions/core.py#L154-L161 | [
"def",
"_hashkey",
"(",
"self",
",",
"method",
",",
"url",
",",
"*",
"*",
"kwa",
")",
":",
"to_hash",
"=",
"''",
".",
"join",
"(",
"[",
"str",
"(",
"method",
")",
",",
"str",
"(",
"url",
")",
",",
"str",
"(",
"kwa",
".",
"get",
"(",
"'data'",... | a3c65d068e09e717df5389e924686da540da6f12 |
valid | Driver.setup | Connects to a Siemens S7 PLC.
Connects to a Siemens S7 using the Snap7 library.
See [the snap7 documentation](http://snap7.sourceforge.net/) for
supported models and more details.
It's not currently possible to query the device for available pins,
so `available_pins()` returns ... | ahio/drivers/snap7.py | def setup(self, address, rack=0, slot=1, port=102):
"""Connects to a Siemens S7 PLC.
Connects to a Siemens S7 using the Snap7 library.
See [the snap7 documentation](http://snap7.sourceforge.net/) for
supported models and more details.
It's not currently possible to query the de... | def setup(self, address, rack=0, slot=1, port=102):
"""Connects to a Siemens S7 PLC.
Connects to a Siemens S7 using the Snap7 library.
See [the snap7 documentation](http://snap7.sourceforge.net/) for
supported models and more details.
It's not currently possible to query the de... | [
"Connects",
"to",
"a",
"Siemens",
"S7",
"PLC",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/drivers/snap7.py#L65-L110 | [
"def",
"setup",
"(",
"self",
",",
"address",
",",
"rack",
"=",
"0",
",",
"slot",
"=",
"1",
",",
"port",
"=",
"102",
")",
":",
"rack",
"=",
"int",
"(",
"rack",
")",
"slot",
"=",
"int",
"(",
"slot",
")",
"port",
"=",
"int",
"(",
"port",
")",
... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | Driver.setup | Connects to an Arduino UNO on serial port `port`.
@throw RuntimeError can't connect to Arduino | ahio/drivers/arduino.py | def setup(self, port):
"""Connects to an Arduino UNO on serial port `port`.
@throw RuntimeError can't connect to Arduino
"""
port = str(port)
# timeout is used by all I/O operations
self._serial = serial.Serial(port, 115200, timeout=2)
time.sleep(2) # time to Ar... | def setup(self, port):
"""Connects to an Arduino UNO on serial port `port`.
@throw RuntimeError can't connect to Arduino
"""
port = str(port)
# timeout is used by all I/O operations
self._serial = serial.Serial(port, 115200, timeout=2)
time.sleep(2) # time to Ar... | [
"Connects",
"to",
"an",
"Arduino",
"UNO",
"on",
"serial",
"port",
"port",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/drivers/arduino.py#L50-L70 | [
"def",
"setup",
"(",
"self",
",",
"port",
")",
":",
"port",
"=",
"str",
"(",
"port",
")",
"# timeout is used by all I/O operations",
"self",
".",
"_serial",
"=",
"serial",
".",
"Serial",
"(",
"port",
",",
"115200",
",",
"timeout",
"=",
"2",
")",
"time",
... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | Cluster.block_resource_fitnesses | Returns a map of nodename to average fitness value for this block.
Assumes that required resources have been checked on all nodes. | idiotic/cluster.py | def block_resource_fitnesses(self, block: block.Block):
"""Returns a map of nodename to average fitness value for this block.
Assumes that required resources have been checked on all nodes."""
# Short-circuit! My algorithm is terrible, so it doesn't work well for the edge case where
# t... | def block_resource_fitnesses(self, block: block.Block):
"""Returns a map of nodename to average fitness value for this block.
Assumes that required resources have been checked on all nodes."""
# Short-circuit! My algorithm is terrible, so it doesn't work well for the edge case where
# t... | [
"Returns",
"a",
"map",
"of",
"nodename",
"to",
"average",
"fitness",
"value",
"for",
"this",
"block",
".",
"Assumes",
"that",
"required",
"resources",
"have",
"been",
"checked",
"on",
"all",
"nodes",
"."
] | idiotic/idiotic | python | https://github.com/idiotic/idiotic/blob/283b2919356c0735e43d1b42526c54fc7babf7d6/idiotic/cluster.py#L168-L221 | [
"def",
"block_resource_fitnesses",
"(",
"self",
",",
"block",
":",
"block",
".",
"Block",
")",
":",
"# Short-circuit! My algorithm is terrible, so it doesn't work well for the edge case where",
"# the block has no requirements",
"if",
"not",
"block",
".",
"resources",
":",
"r... | 283b2919356c0735e43d1b42526c54fc7babf7d6 |
valid | available_drivers | Returns a list of available drivers names. | ahio/drivers/__init__.py | def available_drivers():
"""Returns a list of available drivers names.
"""
global __modules
global __available
if type(__modules) is not list:
__modules = list(__modules)
if not __available:
__available = [d.ahioDriverInfo.NAME
for d in __modules
... | def available_drivers():
"""Returns a list of available drivers names.
"""
global __modules
global __available
if type(__modules) is not list:
__modules = list(__modules)
if not __available:
__available = [d.ahioDriverInfo.NAME
for d in __modules
... | [
"Returns",
"a",
"list",
"of",
"available",
"drivers",
"names",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/drivers/__init__.py#L78-L92 | [
"def",
"available_drivers",
"(",
")",
":",
"global",
"__modules",
"global",
"__available",
"if",
"type",
"(",
"__modules",
")",
"is",
"not",
"list",
":",
"__modules",
"=",
"list",
"(",
"__modules",
")",
"if",
"not",
"__available",
":",
"__available",
"=",
... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | __load_driver | Tries to load the driver named @arg name.
A driver is considered valid if it has a ahioDriverInfo object. It should
however implement all APIs described in `ahio.abstract_driver`, as they'll
be needed to use the driver.
@returns the driver package, or False if it failed. | ahio/drivers/__init__.py | def __load_driver(name):
"""Tries to load the driver named @arg name.
A driver is considered valid if it has a ahioDriverInfo object. It should
however implement all APIs described in `ahio.abstract_driver`, as they'll
be needed to use the driver.
@returns the driver package, or False if it failed... | def __load_driver(name):
"""Tries to load the driver named @arg name.
A driver is considered valid if it has a ahioDriverInfo object. It should
however implement all APIs described in `ahio.abstract_driver`, as they'll
be needed to use the driver.
@returns the driver package, or False if it failed... | [
"Tries",
"to",
"load",
"the",
"driver",
"named",
"@arg",
"name",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/drivers/__init__.py#L121-L139 | [
"def",
"__load_driver",
"(",
"name",
")",
":",
"global",
"__count",
"try",
":",
"dname",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"name",
")",
".",
"replace",
"(",
"'.py'",
",",
"''",
")",
"mod_name",
"=",
"'ahio.drivers.%s%d'",
"%",
"(",
"dname",... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | __locate_driver_named | Searchs __modules for a driver named @arg name.
@returns the package for driver @arg name or None if one can't be found. | ahio/drivers/__init__.py | def __locate_driver_named(name):
"""Searchs __modules for a driver named @arg name.
@returns the package for driver @arg name or None if one can't be found.
"""
global __modules
if type(__modules) is not list:
__modules = list(__modules)
ms = [d for d in __modules if d.ahioDriverInfo.... | def __locate_driver_named(name):
"""Searchs __modules for a driver named @arg name.
@returns the package for driver @arg name or None if one can't be found.
"""
global __modules
if type(__modules) is not list:
__modules = list(__modules)
ms = [d for d in __modules if d.ahioDriverInfo.... | [
"Searchs",
"__modules",
"for",
"a",
"driver",
"named",
"@arg",
"name",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/drivers/__init__.py#L142-L155 | [
"def",
"__locate_driver_named",
"(",
"name",
")",
":",
"global",
"__modules",
"if",
"type",
"(",
"__modules",
")",
"is",
"not",
"list",
":",
"__modules",
"=",
"list",
"(",
"__modules",
")",
"ms",
"=",
"[",
"d",
"for",
"d",
"in",
"__modules",
"if",
"d",... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | AbstractDriver.map_pin | Maps a pin number to a physical device pin.
To make it easy to change drivers without having to refactor a lot of
code, this library does not use the names set by the driver to identify
a pin. This function will map a number, that will be used by other
functions, to a physical pin repre... | ahio/abstract_driver.py | def map_pin(self, abstract_pin_id, physical_pin_id):
"""Maps a pin number to a physical device pin.
To make it easy to change drivers without having to refactor a lot of
code, this library does not use the names set by the driver to identify
a pin. This function will map a number, that ... | def map_pin(self, abstract_pin_id, physical_pin_id):
"""Maps a pin number to a physical device pin.
To make it easy to change drivers without having to refactor a lot of
code, this library does not use the names set by the driver to identify
a pin. This function will map a number, that ... | [
"Maps",
"a",
"pin",
"number",
"to",
"a",
"physical",
"device",
"pin",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/abstract_driver.py#L91-L115 | [
"def",
"map_pin",
"(",
"self",
",",
"abstract_pin_id",
",",
"physical_pin_id",
")",
":",
"if",
"physical_pin_id",
":",
"self",
".",
"_pin_mapping",
"[",
"abstract_pin_id",
"]",
"=",
"physical_pin_id",
"else",
":",
"self",
".",
"_pin_mapping",
".",
"pop",
"(",
... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | AbstractDriver.set_pin_interpolation | Interpolates input and output values for `pin`.
Changes the output and input of `AbstractDriver.read` and
`AbstractDriver.write` functions to use a value in range
(`read_min`, `read_max`) or (`write_min`, `write_max`) instead of the
values returned by `available_pins` (analog only). The... | ahio/abstract_driver.py | def set_pin_interpolation(self,
pin,
read_min,
read_max,
write_min,
write_max):
"""Interpolates input and output values for `pin`.
Changes the output and... | def set_pin_interpolation(self,
pin,
read_min,
read_max,
write_min,
write_max):
"""Interpolates input and output values for `pin`.
Changes the output and... | [
"Interpolates",
"input",
"and",
"output",
"values",
"for",
"pin",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/abstract_driver.py#L130-L181 | [
"def",
"set_pin_interpolation",
"(",
"self",
",",
"pin",
",",
"read_min",
",",
"read_max",
",",
"write_min",
",",
"write_max",
")",
":",
"if",
"type",
"(",
"pin",
")",
"is",
"list",
":",
"# I don't like breaking calls in multiple lines",
"args",
"=",
"(",
"rea... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | AbstractDriver.set_pin_direction | Sets pin `pin` to `direction`.
The pin should support the requested mode. Calling this function
on a unmapped pin does nothing. Calling it with a unsupported direction
throws RuntimeError.
If you're developing a driver, you should implement
_set_pin_direction(self, pin, directi... | ahio/abstract_driver.py | def set_pin_direction(self, pin, direction):
"""Sets pin `pin` to `direction`.
The pin should support the requested mode. Calling this function
on a unmapped pin does nothing. Calling it with a unsupported direction
throws RuntimeError.
If you're developing a driver, you should... | def set_pin_direction(self, pin, direction):
"""Sets pin `pin` to `direction`.
The pin should support the requested mode. Calling this function
on a unmapped pin does nothing. Calling it with a unsupported direction
throws RuntimeError.
If you're developing a driver, you should... | [
"Sets",
"pin",
"pin",
"to",
"direction",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/abstract_driver.py#L183-L209 | [
"def",
"set_pin_direction",
"(",
"self",
",",
"pin",
",",
"direction",
")",
":",
"if",
"type",
"(",
"pin",
")",
"is",
"list",
":",
"for",
"p",
"in",
"pin",
":",
"self",
".",
"set_pin_direction",
"(",
"p",
",",
"direction",
")",
"return",
"pin_id",
"=... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | AbstractDriver.pin_direction | Gets the `ahio.Direction` this pin was set to.
If you're developing a driver, implement _pin_direction(self, pin)
@arg pin the pin you want to see the mode
@returns the `ahio.Direction` the pin is set to
@throw KeyError if pin isn't mapped. | ahio/abstract_driver.py | def pin_direction(self, pin):
"""Gets the `ahio.Direction` this pin was set to.
If you're developing a driver, implement _pin_direction(self, pin)
@arg pin the pin you want to see the mode
@returns the `ahio.Direction` the pin is set to
@throw KeyError if pin isn't mapped.
... | def pin_direction(self, pin):
"""Gets the `ahio.Direction` this pin was set to.
If you're developing a driver, implement _pin_direction(self, pin)
@arg pin the pin you want to see the mode
@returns the `ahio.Direction` the pin is set to
@throw KeyError if pin isn't mapped.
... | [
"Gets",
"the",
"ahio",
".",
"Direction",
"this",
"pin",
"was",
"set",
"to",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/abstract_driver.py#L211-L228 | [
"def",
"pin_direction",
"(",
"self",
",",
"pin",
")",
":",
"if",
"type",
"(",
"pin",
")",
"is",
"list",
":",
"return",
"[",
"self",
".",
"pin_direction",
"(",
"p",
")",
"for",
"p",
"in",
"pin",
"]",
"pin_id",
"=",
"self",
".",
"_pin_mapping",
".",
... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | AbstractDriver.set_pin_type | Sets pin `pin` to `type`.
The pin should support the requested mode. Calling this function
on a unmapped pin does nothing. Calling it with a unsupported mode
throws RuntimeError.
If you're developing a driver, you should implement
_set_pin_type(self, pin, ptype) where `pin` wil... | ahio/abstract_driver.py | def set_pin_type(self, pin, ptype):
"""Sets pin `pin` to `type`.
The pin should support the requested mode. Calling this function
on a unmapped pin does nothing. Calling it with a unsupported mode
throws RuntimeError.
If you're developing a driver, you should implement
... | def set_pin_type(self, pin, ptype):
"""Sets pin `pin` to `type`.
The pin should support the requested mode. Calling this function
on a unmapped pin does nothing. Calling it with a unsupported mode
throws RuntimeError.
If you're developing a driver, you should implement
... | [
"Sets",
"pin",
"pin",
"to",
"type",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/abstract_driver.py#L230-L258 | [
"def",
"set_pin_type",
"(",
"self",
",",
"pin",
",",
"ptype",
")",
":",
"if",
"type",
"(",
"pin",
")",
"is",
"list",
":",
"for",
"p",
"in",
"pin",
":",
"self",
".",
"set_pin_type",
"(",
"p",
",",
"ptype",
")",
"return",
"pin_id",
"=",
"self",
"."... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | AbstractDriver.pin_type | Gets the `ahio.PortType` this pin was set to.
If you're developing a driver, implement _pin_type(self, pin)
@arg pin the pin you want to see the mode
@returns the `ahio.PortType` the pin is set to
@throw KeyError if pin isn't mapped. | ahio/abstract_driver.py | def pin_type(self, pin):
"""Gets the `ahio.PortType` this pin was set to.
If you're developing a driver, implement _pin_type(self, pin)
@arg pin the pin you want to see the mode
@returns the `ahio.PortType` the pin is set to
@throw KeyError if pin isn't mapped.
"""
... | def pin_type(self, pin):
"""Gets the `ahio.PortType` this pin was set to.
If you're developing a driver, implement _pin_type(self, pin)
@arg pin the pin you want to see the mode
@returns the `ahio.PortType` the pin is set to
@throw KeyError if pin isn't mapped.
"""
... | [
"Gets",
"the",
"ahio",
".",
"PortType",
"this",
"pin",
"was",
"set",
"to",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/abstract_driver.py#L260-L277 | [
"def",
"pin_type",
"(",
"self",
",",
"pin",
")",
":",
"if",
"type",
"(",
"pin",
")",
"is",
"list",
":",
"return",
"[",
"self",
".",
"pin_type",
"(",
"p",
")",
"for",
"p",
"in",
"pin",
"]",
"pin_id",
"=",
"self",
".",
"_pin_mapping",
".",
"get",
... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | AbstractDriver.write | Sets the output to the given value.
Sets `pin` output to given value. If the pin is in INPUT mode, do
nothing. If it's an analog pin, value should be in write_range.
If it's not in the allowed range, it will be clamped. If pin is in
digital mode, value can be `ahio.LogicValue` if `pwm` ... | ahio/abstract_driver.py | def write(self, pin, value, pwm=False):
"""Sets the output to the given value.
Sets `pin` output to given value. If the pin is in INPUT mode, do
nothing. If it's an analog pin, value should be in write_range.
If it's not in the allowed range, it will be clamped. If pin is in
dig... | def write(self, pin, value, pwm=False):
"""Sets the output to the given value.
Sets `pin` output to given value. If the pin is in INPUT mode, do
nothing. If it's an analog pin, value should be in write_range.
If it's not in the allowed range, it will be clamped. If pin is in
dig... | [
"Sets",
"the",
"output",
"to",
"the",
"given",
"value",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/abstract_driver.py#L279-L320 | [
"def",
"write",
"(",
"self",
",",
"pin",
",",
"value",
",",
"pwm",
"=",
"False",
")",
":",
"if",
"type",
"(",
"pin",
")",
"is",
"list",
":",
"for",
"p",
"in",
"pin",
":",
"self",
".",
"write",
"(",
"p",
",",
"value",
",",
"pwm",
")",
"return"... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | AbstractDriver.read | Reads value from pin `pin`.
Returns the value read from pin `pin`. If it's an analog pin, returns
a number in analog.input_range. If it's digital, returns
`ahio.LogicValue`.
If you're developing a driver, implement _read(self, pin)
@arg pin the pin to read from
@return... | ahio/abstract_driver.py | def read(self, pin):
"""Reads value from pin `pin`.
Returns the value read from pin `pin`. If it's an analog pin, returns
a number in analog.input_range. If it's digital, returns
`ahio.LogicValue`.
If you're developing a driver, implement _read(self, pin)
@arg pin the ... | def read(self, pin):
"""Reads value from pin `pin`.
Returns the value read from pin `pin`. If it's an analog pin, returns
a number in analog.input_range. If it's digital, returns
`ahio.LogicValue`.
If you're developing a driver, implement _read(self, pin)
@arg pin the ... | [
"Reads",
"value",
"from",
"pin",
"pin",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/abstract_driver.py#L322-L348 | [
"def",
"read",
"(",
"self",
",",
"pin",
")",
":",
"if",
"type",
"(",
"pin",
")",
"is",
"list",
":",
"return",
"[",
"self",
".",
"read",
"(",
"p",
")",
"for",
"p",
"in",
"pin",
"]",
"pin_id",
"=",
"self",
".",
"_pin_mapping",
".",
"get",
"(",
... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | AbstractDriver.set_analog_reference | Sets the analog reference to `reference`
If the driver supports per pin reference setting, set pin to the
desired reference. If not, passing None means set to all, which is the
default in most hardware. If only per pin reference is supported and
pin is None, raise RuntimeError.
... | ahio/abstract_driver.py | def set_analog_reference(self, reference, pin=None):
"""Sets the analog reference to `reference`
If the driver supports per pin reference setting, set pin to the
desired reference. If not, passing None means set to all, which is the
default in most hardware. If only per pin reference is... | def set_analog_reference(self, reference, pin=None):
"""Sets the analog reference to `reference`
If the driver supports per pin reference setting, set pin to the
desired reference. If not, passing None means set to all, which is the
default in most hardware. If only per pin reference is... | [
"Sets",
"the",
"analog",
"reference",
"to",
"reference"
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/abstract_driver.py#L360-L388 | [
"def",
"set_analog_reference",
"(",
"self",
",",
"reference",
",",
"pin",
"=",
"None",
")",
":",
"if",
"pin",
"is",
"None",
":",
"self",
".",
"_set_analog_reference",
"(",
"reference",
",",
"None",
")",
"else",
":",
"pin_id",
"=",
"self",
".",
"_pin_mapp... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | AbstractDriver.analog_reference | Returns the analog reference.
If the driver supports per pin analog reference setting, returns the
reference for pin `pin`. If pin is None, returns the global analog
reference. If only per pin reference is supported and pin is None,
raise RuntimeError.
If you're developing a dr... | ahio/abstract_driver.py | def analog_reference(self, pin=None):
"""Returns the analog reference.
If the driver supports per pin analog reference setting, returns the
reference for pin `pin`. If pin is None, returns the global analog
reference. If only per pin reference is supported and pin is None,
raise... | def analog_reference(self, pin=None):
"""Returns the analog reference.
If the driver supports per pin analog reference setting, returns the
reference for pin `pin`. If pin is None, returns the global analog
reference. If only per pin reference is supported and pin is None,
raise... | [
"Returns",
"the",
"analog",
"reference",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/abstract_driver.py#L390-L416 | [
"def",
"analog_reference",
"(",
"self",
",",
"pin",
"=",
"None",
")",
":",
"if",
"pin",
"is",
"None",
":",
"return",
"self",
".",
"_analog_reference",
"(",
"None",
")",
"else",
":",
"pin_id",
"=",
"self",
".",
"_pin_mapping",
".",
"get",
"(",
"pin",
... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | AbstractDriver.set_pwm_frequency | Sets PWM frequency, if supported by hardware
If the driver supports per pin frequency setting, set pin to the
desired frequency. If not, passing None means set to all. If only per
pin frequency is supported and pin is None, raise RuntimeError.
If you're developing a driver, implement
... | ahio/abstract_driver.py | def set_pwm_frequency(self, frequency, pin=None):
"""Sets PWM frequency, if supported by hardware
If the driver supports per pin frequency setting, set pin to the
desired frequency. If not, passing None means set to all. If only per
pin frequency is supported and pin is None, raise Runt... | def set_pwm_frequency(self, frequency, pin=None):
"""Sets PWM frequency, if supported by hardware
If the driver supports per pin frequency setting, set pin to the
desired frequency. If not, passing None means set to all. If only per
pin frequency is supported and pin is None, raise Runt... | [
"Sets",
"PWM",
"frequency",
"if",
"supported",
"by",
"hardware"
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/abstract_driver.py#L418-L444 | [
"def",
"set_pwm_frequency",
"(",
"self",
",",
"frequency",
",",
"pin",
"=",
"None",
")",
":",
"if",
"pin",
"is",
"None",
":",
"self",
".",
"_set_pwm_frequency",
"(",
"frequency",
",",
"None",
")",
"else",
":",
"pin_id",
"=",
"self",
".",
"_pin_mapping",
... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | Pushover.notify | priority (-2 -1 0 1 2)
sound (bike,bugle,cashregister,classical,cosmic,falling,gamelan,
incoming,intermission,magic,mechanical,pianobar,siren,spacealarm,
tugboat,alien,climb,persistent,echo,updown,none) | pushover/pushover.py | def notify(self, message, title="", **kwargs):
"""
priority (-2 -1 0 1 2)
sound (bike,bugle,cashregister,classical,cosmic,falling,gamelan,
incoming,intermission,magic,mechanical,pianobar,siren,spacealarm,
tugboat,alien,climb,persistent,echo,updown,none)
"""
... | def notify(self, message, title="", **kwargs):
"""
priority (-2 -1 0 1 2)
sound (bike,bugle,cashregister,classical,cosmic,falling,gamelan,
incoming,intermission,magic,mechanical,pianobar,siren,spacealarm,
tugboat,alien,climb,persistent,echo,updown,none)
"""
... | [
"priority",
"(",
"-",
"2",
"-",
"1",
"0",
"1",
"2",
")",
"sound",
"(",
"bike",
"bugle",
"cashregister",
"classical",
"cosmic",
"falling",
"gamelan",
"incoming",
"intermission",
"magic",
"mechanical",
"pianobar",
"siren",
"spacealarm",
"tugboat",
"alien",
"clim... | ccoder64/pushover-python | python | https://github.com/ccoder64/pushover-python/blob/6be770ecb7d269169718c02c14d9ba35fa0c8715/pushover/pushover.py#L45-L77 | [
"def",
"notify",
"(",
"self",
",",
"message",
",",
"title",
"=",
"\"\"",
",",
"*",
"*",
"kwargs",
")",
":",
"logger",
".",
"info",
"(",
"\"pushover notify title:{0} message:{1}\"",
".",
"format",
"(",
"title",
",",
"message",
")",
")",
"try",
":",
"data"... | 6be770ecb7d269169718c02c14d9ba35fa0c8715 |
valid | SIRode | Integrate SIR epidemic model
Simulate a very basic deterministic SIR system.
:param 2x1 numpy array y0: initial conditions
:param Ntimestep length numpy array time: Vector of time points that \
solution is returned at
:param float beta: transmission rate
:param float gamma: recovery rate
... | pyda/utilities/epiODElib.py | def SIRode(y0, time, beta, gamma):
"""Integrate SIR epidemic model
Simulate a very basic deterministic SIR system.
:param 2x1 numpy array y0: initial conditions
:param Ntimestep length numpy array time: Vector of time points that \
solution is returned at
:param float beta: transmission rate
... | def SIRode(y0, time, beta, gamma):
"""Integrate SIR epidemic model
Simulate a very basic deterministic SIR system.
:param 2x1 numpy array y0: initial conditions
:param Ntimestep length numpy array time: Vector of time points that \
solution is returned at
:param float beta: transmission rate
... | [
"Integrate",
"SIR",
"epidemic",
"model"
] | hickmank/pyda | python | https://github.com/hickmank/pyda/blob/7a2f04bd752e9c75bc8dcd2a45b21ff549736fa6/pyda/utilities/epiODElib.py#L14-L31 | [
"def",
"SIRode",
"(",
"y0",
",",
"time",
",",
"beta",
",",
"gamma",
")",
":",
"Xsim",
"=",
"rk4",
"(",
"SIR_D",
",",
"y0",
",",
"time",
",",
"args",
"=",
"(",
"beta",
",",
"gamma",
",",
")",
")",
"Xsim",
"=",
"Xsim",
".",
"transpose",
"(",
")... | 7a2f04bd752e9c75bc8dcd2a45b21ff549736fa6 |
valid | Communicator.url | Return the URL of the server.
:returns: URL of the server
:rtype: string | pydas/core.py | def url(self):
"""
Return the URL of the server.
:returns: URL of the server
:rtype: string
"""
if len(self.drivers) > 0:
return self.drivers[0].url
else:
return self._url | def url(self):
"""
Return the URL of the server.
:returns: URL of the server
:rtype: string
"""
if len(self.drivers) > 0:
return self.drivers[0].url
else:
return self._url | [
"Return",
"the",
"URL",
"of",
"the",
"server",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/core.py#L86-L96 | [
"def",
"url",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"drivers",
")",
">",
"0",
":",
"return",
"self",
".",
"drivers",
"[",
"0",
"]",
".",
"url",
"else",
":",
"return",
"self",
".",
"_url"
] | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | guess_array_memory_usage | Returns an estimate for the maximum amount of memory to be consumed by numpy arrays. | lib/pyBamTools/util/__init__.py | def guess_array_memory_usage( bam_readers, dtype, use_strand=False ):
"""Returns an estimate for the maximum amount of memory to be consumed by numpy arrays."""
ARRAY_COUNT = 5
if not isinstance( bam_readers, list ):
bam_readers = [ bam_readers ]
if isinstance( dtype, basestring ):
dtype... | def guess_array_memory_usage( bam_readers, dtype, use_strand=False ):
"""Returns an estimate for the maximum amount of memory to be consumed by numpy arrays."""
ARRAY_COUNT = 5
if not isinstance( bam_readers, list ):
bam_readers = [ bam_readers ]
if isinstance( dtype, basestring ):
dtype... | [
"Returns",
"an",
"estimate",
"for",
"the",
"maximum",
"amount",
"of",
"memory",
"to",
"be",
"consumed",
"by",
"numpy",
"arrays",
"."
] | blankenberg/pyBamTools | python | https://github.com/blankenberg/pyBamTools/blob/db47fda8e07a6924fa8fe678b59ab31aaaa38d19/lib/pyBamTools/util/__init__.py#L64-L96 | [
"def",
"guess_array_memory_usage",
"(",
"bam_readers",
",",
"dtype",
",",
"use_strand",
"=",
"False",
")",
":",
"ARRAY_COUNT",
"=",
"5",
"if",
"not",
"isinstance",
"(",
"bam_readers",
",",
"list",
")",
":",
"bam_readers",
"=",
"[",
"bam_readers",
"]",
"if",
... | db47fda8e07a6924fa8fe678b59ab31aaaa38d19 |
valid | pi_version | Detect the version of the Raspberry Pi. Returns either 1, 2 or
None depending on if it's a Raspberry Pi 1 (model A, B, A+, B+),
Raspberry Pi 2 (model B+), or not a Raspberry Pi.
https://github.com/adafruit/Adafruit_Python_GPIO/blob/master/Adafruit_GPIO/Platform.py | ahio/drivers/raspberry.py | def pi_version():
"""Detect the version of the Raspberry Pi. Returns either 1, 2 or
None depending on if it's a Raspberry Pi 1 (model A, B, A+, B+),
Raspberry Pi 2 (model B+), or not a Raspberry Pi.
https://github.com/adafruit/Adafruit_Python_GPIO/blob/master/Adafruit_GPIO/Platform.py
"""
if no... | def pi_version():
"""Detect the version of the Raspberry Pi. Returns either 1, 2 or
None depending on if it's a Raspberry Pi 1 (model A, B, A+, B+),
Raspberry Pi 2 (model B+), or not a Raspberry Pi.
https://github.com/adafruit/Adafruit_Python_GPIO/blob/master/Adafruit_GPIO/Platform.py
"""
if no... | [
"Detect",
"the",
"version",
"of",
"the",
"Raspberry",
"Pi",
".",
"Returns",
"either",
"1",
"2",
"or",
"None",
"depending",
"on",
"if",
"it",
"s",
"a",
"Raspberry",
"Pi",
"1",
"(",
"model",
"A",
"B",
"A",
"+",
"B",
"+",
")",
"Raspberry",
"Pi",
"2",
... | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/drivers/raspberry.py#L31-L62 | [
"def",
"pi_version",
"(",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"'/proc/cpuinfo'",
")",
":",
"return",
"None",
"# Check /proc/cpuinfo for the Hardware field value.",
"# 2708 is pi 1",
"# 2709 is pi 2",
"# Anything else is not a pi.",
"with",
"ope... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | system | commands.getoutput() replacement that also works on windows.
Code mostly copied from zc.buildout. | createcoverage/script.py | def system(command, input=None):
"""commands.getoutput() replacement that also works on windows.
Code mostly copied from zc.buildout.
"""
logger.debug("Executing command: %s", command)
p = subprocess.Popen(command,
shell=True,
stdin=subprocess.PIPE... | def system(command, input=None):
"""commands.getoutput() replacement that also works on windows.
Code mostly copied from zc.buildout.
"""
logger.debug("Executing command: %s", command)
p = subprocess.Popen(command,
shell=True,
stdin=subprocess.PIPE... | [
"commands",
".",
"getoutput",
"()",
"replacement",
"that",
"also",
"works",
"on",
"windows",
"."
] | reinout/createcoverage | python | https://github.com/reinout/createcoverage/blob/8062cf77bcaf74fe902917a2661c3f1e02aac36c/createcoverage/script.py#L13-L35 | [
"def",
"system",
"(",
"command",
",",
"input",
"=",
"None",
")",
":",
"logger",
".",
"debug",
"(",
"\"Executing command: %s\"",
",",
"command",
")",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"command",
",",
"shell",
"=",
"True",
",",
"stdin",
"=",
"su... | 8062cf77bcaf74fe902917a2661c3f1e02aac36c |
valid | main | Create coverage reports and open them in the browser. | createcoverage/script.py | def main():
"""Create coverage reports and open them in the browser."""
usage = "Usage: %prog PATH_TO_PACKAGE"
parser = optparse.OptionParser(usage=usage)
parser.add_option(
"-v", "--verbose",
action="store_true", dest="verbose", default=False,
help="Show debug output")
parse... | def main():
"""Create coverage reports and open them in the browser."""
usage = "Usage: %prog PATH_TO_PACKAGE"
parser = optparse.OptionParser(usage=usage)
parser.add_option(
"-v", "--verbose",
action="store_true", dest="verbose", default=False,
help="Show debug output")
parse... | [
"Create",
"coverage",
"reports",
"and",
"open",
"them",
"in",
"the",
"browser",
"."
] | reinout/createcoverage | python | https://github.com/reinout/createcoverage/blob/8062cf77bcaf74fe902917a2661c3f1e02aac36c/createcoverage/script.py#L38-L94 | [
"def",
"main",
"(",
")",
":",
"usage",
"=",
"\"Usage: %prog PATH_TO_PACKAGE\"",
"parser",
"=",
"optparse",
".",
"OptionParser",
"(",
"usage",
"=",
"usage",
")",
"parser",
".",
"add_option",
"(",
"\"-v\"",
",",
"\"--verbose\"",
",",
"action",
"=",
"\"store_true... | 8062cf77bcaf74fe902917a2661c3f1e02aac36c |
valid | Driver.setup | Start a Modbus server.
The following classes are available with their respective named
parameters:
ModbusTcpClient
host: The host to connect to (default 127.0.0.1)
port: The modbus port to connect to (default 502)
source_address: The source address t... | ahio/drivers/modbus.py | def setup(
self,
configuration="ModbusSerialClient(method='rtu',port='/dev/cu.usbmodem14101',baudrate=9600)"
):
"""Start a Modbus server.
The following classes are available with their respective named
parameters:
ModbusTcpClient
host: Th... | def setup(
self,
configuration="ModbusSerialClient(method='rtu',port='/dev/cu.usbmodem14101',baudrate=9600)"
):
"""Start a Modbus server.
The following classes are available with their respective named
parameters:
ModbusTcpClient
host: Th... | [
"Start",
"a",
"Modbus",
"server",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/drivers/modbus.py#L45-L92 | [
"def",
"setup",
"(",
"self",
",",
"configuration",
"=",
"\"ModbusSerialClient(method='rtu',port='/dev/cu.usbmodem14101',baudrate=9600)\"",
")",
":",
"from",
"pymodbus3",
".",
"client",
".",
"sync",
"import",
"ModbusSerialClient",
",",
"ModbusUdpClient",
",",
"ModbusTcpClien... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | Driver.setup | Connects to server at `address`:`port`.
Connects to a TCP server listening at `address`:`port` that implements
the protocol described in the file "Generic TCP I:O Protocol.md"
@arg address IP or address to connect to.
@arg port port to connect to.
@throw RuntimeError if connec... | ahio/drivers/generic_tcp_io.py | def setup(self, address, port):
"""Connects to server at `address`:`port`.
Connects to a TCP server listening at `address`:`port` that implements
the protocol described in the file "Generic TCP I:O Protocol.md"
@arg address IP or address to connect to.
@arg port port to connect... | def setup(self, address, port):
"""Connects to server at `address`:`port`.
Connects to a TCP server listening at `address`:`port` that implements
the protocol described in the file "Generic TCP I:O Protocol.md"
@arg address IP or address to connect to.
@arg port port to connect... | [
"Connects",
"to",
"server",
"at",
"address",
":",
"port",
"."
] | acristoffers/ahio | python | https://github.com/acristoffers/ahio/blob/5d47f1697c173bd1cbdeac930546f97ad8570a38/ahio/drivers/generic_tcp_io.py#L46-L66 | [
"def",
"setup",
"(",
"self",
",",
"address",
",",
"port",
")",
":",
"address",
"=",
"str",
"(",
"address",
")",
"port",
"=",
"int",
"(",
"port",
")",
"self",
".",
"_socket",
"=",
"socket",
".",
"socket",
"(",
")",
"self",
".",
"_socket",
".",
"co... | 5d47f1697c173bd1cbdeac930546f97ad8570a38 |
valid | get_exception_from_status_and_error_codes | Return an exception given status and error codes.
:param status_code: HTTP status code.
:type status_code: None | int
:param error_code: Midas Server error code.
:type error_code: None | int
:param value: Message to display.
:type value: string
:returns: Exception.
:rtype : pydas.except... | pydas/exceptions.py | def get_exception_from_status_and_error_codes(status_code, error_code, value):
"""
Return an exception given status and error codes.
:param status_code: HTTP status code.
:type status_code: None | int
:param error_code: Midas Server error code.
:type error_code: None | int
:param value: Mes... | def get_exception_from_status_and_error_codes(status_code, error_code, value):
"""
Return an exception given status and error codes.
:param status_code: HTTP status code.
:type status_code: None | int
:param error_code: Midas Server error code.
:type error_code: None | int
:param value: Mes... | [
"Return",
"an",
"exception",
"given",
"status",
"and",
"error",
"codes",
"."
] | midasplatform/pydas | python | https://github.com/midasplatform/pydas/blob/e5f9e96e754fb2dc5da187b05e4abc77a9b2affd/pydas/exceptions.py#L147-L190 | [
"def",
"get_exception_from_status_and_error_codes",
"(",
"status_code",
",",
"error_code",
",",
"value",
")",
":",
"if",
"status_code",
"==",
"requests",
".",
"codes",
".",
"bad_request",
":",
"exception",
"=",
"BadRequest",
"(",
"value",
")",
"elif",
"status_code... | e5f9e96e754fb2dc5da187b05e4abc77a9b2affd |
valid | PyMata.analog_read | Retrieve the last analog data value received for the specified pin.
:param pin: Selected pin
:return: The last value entered into the analog response table. | PyMata/pymata.py | def analog_read(self, pin):
"""
Retrieve the last analog data value received for the specified pin.
:param pin: Selected pin
:return: The last value entered into the analog response table.
"""
with self.data_lock:
data = self._command_handler.analog_response... | def analog_read(self, pin):
"""
Retrieve the last analog data value received for the specified pin.
:param pin: Selected pin
:return: The last value entered into the analog response table.
"""
with self.data_lock:
data = self._command_handler.analog_response... | [
"Retrieve",
"the",
"last",
"analog",
"data",
"value",
"received",
"for",
"the",
"specified",
"pin",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L223-L233 | [
"def",
"analog_read",
"(",
"self",
",",
"pin",
")",
":",
"with",
"self",
".",
"data_lock",
":",
"data",
"=",
"self",
".",
"_command_handler",
".",
"analog_response_table",
"[",
"pin",
"]",
"[",
"self",
".",
"_command_handler",
".",
"RESPONSE_TABLE_PIN_DATA_VAL... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.analog_write | Set the specified pin to the specified value.
:param pin: Pin number
:param value: Pin value
:return: No return value | PyMata/pymata.py | def analog_write(self, pin, value):
"""
Set the specified pin to the specified value.
:param pin: Pin number
:param value: Pin value
:return: No return value
"""
if self._command_handler.ANALOG_MESSAGE + pin < 0xf0:
command = [self._command_handler... | def analog_write(self, pin, value):
"""
Set the specified pin to the specified value.
:param pin: Pin number
:param value: Pin value
:return: No return value
"""
if self._command_handler.ANALOG_MESSAGE + pin < 0xf0:
command = [self._command_handler... | [
"Set",
"the",
"specified",
"pin",
"to",
"the",
"specified",
"value",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L235-L250 | [
"def",
"analog_write",
"(",
"self",
",",
"pin",
",",
"value",
")",
":",
"if",
"self",
".",
"_command_handler",
".",
"ANALOG_MESSAGE",
"+",
"pin",
"<",
"0xf0",
":",
"command",
"=",
"[",
"self",
".",
"_command_handler",
".",
"ANALOG_MESSAGE",
"+",
"pin",
"... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.close | This method will close the transport (serial port) and exit
:return: No return value, but sys.exit(0) is called. | PyMata/pymata.py | def close(self):
"""
This method will close the transport (serial port) and exit
:return: No return value, but sys.exit(0) is called.
"""
self._command_handler.system_reset()
self._command_handler.stop()
self.transport.stop()
self.transport.close()
... | def close(self):
"""
This method will close the transport (serial port) and exit
:return: No return value, but sys.exit(0) is called.
"""
self._command_handler.system_reset()
self._command_handler.stop()
self.transport.stop()
self.transport.close()
... | [
"This",
"method",
"will",
"close",
"the",
"transport",
"(",
"serial",
"port",
")",
"and",
"exit",
":",
"return",
":",
"No",
"return",
"value",
"but",
"sys",
".",
"exit",
"(",
"0",
")",
"is",
"called",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L261-L275 | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"_command_handler",
".",
"system_reset",
"(",
")",
"self",
".",
"_command_handler",
".",
"stop",
"(",
")",
"self",
".",
"transport",
".",
"stop",
"(",
")",
"self",
".",
"transport",
".",
"close",
"(",... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.digital_read | Retrieve the last digital data value received for the specified pin.
NOTE: This command will return values for digital, pwm, etc, pin types
:param pin: Selected pin
:return: The last value entered into the digital response table. | PyMata/pymata.py | def digital_read(self, pin):
"""
Retrieve the last digital data value received for the specified pin.
NOTE: This command will return values for digital, pwm, etc, pin types
:param pin: Selected pin
:return: The last value entered into the digital response table.
"""
... | def digital_read(self, pin):
"""
Retrieve the last digital data value received for the specified pin.
NOTE: This command will return values for digital, pwm, etc, pin types
:param pin: Selected pin
:return: The last value entered into the digital response table.
"""
... | [
"Retrieve",
"the",
"last",
"digital",
"data",
"value",
"received",
"for",
"the",
"specified",
"pin",
".",
"NOTE",
":",
"This",
"command",
"will",
"return",
"values",
"for",
"digital",
"pwm",
"etc",
"pin",
"types"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L278-L290 | [
"def",
"digital_read",
"(",
"self",
",",
"pin",
")",
":",
"with",
"self",
".",
"data_lock",
":",
"data",
"=",
"self",
".",
"_command_handler",
".",
"digital_response_table",
"[",
"pin",
"]",
"[",
"self",
".",
"_command_handler",
".",
"RESPONSE_TABLE_PIN_DATA_V... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.digital_write | Set the specified pin to the specified value.
:param pin: pin number
:param value: pin value
:return: No return value | PyMata/pymata.py | def digital_write(self, pin, value):
"""
Set the specified pin to the specified value.
:param pin: pin number
:param value: pin value
:return: No return value
"""
# The command value is not a fixed value, but needs to be calculated using the
# pin's por... | def digital_write(self, pin, value):
"""
Set the specified pin to the specified value.
:param pin: pin number
:param value: pin value
:return: No return value
"""
# The command value is not a fixed value, but needs to be calculated using the
# pin's por... | [
"Set",
"the",
"specified",
"pin",
"to",
"the",
"specified",
"value",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L293-L322 | [
"def",
"digital_write",
"(",
"self",
",",
"pin",
",",
"value",
")",
":",
"# The command value is not a fixed value, but needs to be calculated using the",
"# pin's port number",
"#",
"#",
"port",
"=",
"pin",
"//",
"8",
"calculated_command",
"=",
"self",
".",
"_command_h... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.disable_analog_reporting | Disables analog reporting for a single analog pin.
:param pin: Analog pin number. For example for A0, the number is 0.
:return: No return value | PyMata/pymata.py | def disable_analog_reporting(self, pin):
"""
Disables analog reporting for a single analog pin.
:param pin: Analog pin number. For example for A0, the number is 0.
:return: No return value
"""
command = [self._command_handler.REPORT_ANALOG + pin, self.REPORTING_DISABLE]... | def disable_analog_reporting(self, pin):
"""
Disables analog reporting for a single analog pin.
:param pin: Analog pin number. For example for A0, the number is 0.
:return: No return value
"""
command = [self._command_handler.REPORT_ANALOG + pin, self.REPORTING_DISABLE]... | [
"Disables",
"analog",
"reporting",
"for",
"a",
"single",
"analog",
"pin",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L325-L334 | [
"def",
"disable_analog_reporting",
"(",
"self",
",",
"pin",
")",
":",
"command",
"=",
"[",
"self",
".",
"_command_handler",
".",
"REPORT_ANALOG",
"+",
"pin",
",",
"self",
".",
"REPORTING_DISABLE",
"]",
"self",
".",
"_command_handler",
".",
"send_command",
"(",... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.disable_digital_reporting | Disables digital reporting. By turning reporting off for this pin, reporting
is disabled for all 8 bits in the "port" -
:param pin: Pin and all pins for this port
:return: No return value | PyMata/pymata.py | def disable_digital_reporting(self, pin):
"""
Disables digital reporting. By turning reporting off for this pin, reporting
is disabled for all 8 bits in the "port" -
:param pin: Pin and all pins for this port
:return: No return value
"""
port = pin // 8
... | def disable_digital_reporting(self, pin):
"""
Disables digital reporting. By turning reporting off for this pin, reporting
is disabled for all 8 bits in the "port" -
:param pin: Pin and all pins for this port
:return: No return value
"""
port = pin // 8
... | [
"Disables",
"digital",
"reporting",
".",
"By",
"turning",
"reporting",
"off",
"for",
"this",
"pin",
"reporting",
"is",
"disabled",
"for",
"all",
"8",
"bits",
"in",
"the",
"port",
"-"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L337-L348 | [
"def",
"disable_digital_reporting",
"(",
"self",
",",
"pin",
")",
":",
"port",
"=",
"pin",
"//",
"8",
"command",
"=",
"[",
"self",
".",
"_command_handler",
".",
"REPORT_DIGITAL",
"+",
"port",
",",
"self",
".",
"REPORTING_DISABLE",
"]",
"self",
".",
"_comma... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.enable_analog_reporting | Enables analog reporting. By turning reporting on for a single pin.
:param pin: Analog pin number. For example for A0, the number is 0.
:return: No return value | PyMata/pymata.py | def enable_analog_reporting(self, pin):
"""
Enables analog reporting. By turning reporting on for a single pin.
:param pin: Analog pin number. For example for A0, the number is 0.
:return: No return value
"""
command = [self._command_handler.REPORT_ANALOG + pin, self.RE... | def enable_analog_reporting(self, pin):
"""
Enables analog reporting. By turning reporting on for a single pin.
:param pin: Analog pin number. For example for A0, the number is 0.
:return: No return value
"""
command = [self._command_handler.REPORT_ANALOG + pin, self.RE... | [
"Enables",
"analog",
"reporting",
".",
"By",
"turning",
"reporting",
"on",
"for",
"a",
"single",
"pin",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L351-L360 | [
"def",
"enable_analog_reporting",
"(",
"self",
",",
"pin",
")",
":",
"command",
"=",
"[",
"self",
".",
"_command_handler",
".",
"REPORT_ANALOG",
"+",
"pin",
",",
"self",
".",
"REPORTING_ENABLE",
"]",
"self",
".",
"_command_handler",
".",
"send_command",
"(",
... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.enable_digital_reporting | Enables digital reporting. By turning reporting on for all 8 bits in the "port" -
this is part of Firmata's protocol specification.
:param pin: Pin and all pins for this port
:return: No return value | PyMata/pymata.py | def enable_digital_reporting(self, pin):
"""
Enables digital reporting. By turning reporting on for all 8 bits in the "port" -
this is part of Firmata's protocol specification.
:param pin: Pin and all pins for this port
:return: No return value
"""
port = pin //... | def enable_digital_reporting(self, pin):
"""
Enables digital reporting. By turning reporting on for all 8 bits in the "port" -
this is part of Firmata's protocol specification.
:param pin: Pin and all pins for this port
:return: No return value
"""
port = pin //... | [
"Enables",
"digital",
"reporting",
".",
"By",
"turning",
"reporting",
"on",
"for",
"all",
"8",
"bits",
"in",
"the",
"port",
"-",
"this",
"is",
"part",
"of",
"Firmata",
"s",
"protocol",
"specification",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L363-L374 | [
"def",
"enable_digital_reporting",
"(",
"self",
",",
"pin",
")",
":",
"port",
"=",
"pin",
"//",
"8",
"command",
"=",
"[",
"self",
".",
"_command_handler",
".",
"REPORT_DIGITAL",
"+",
"port",
",",
"self",
".",
"REPORTING_ENABLE",
"]",
"self",
".",
"_command... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.encoder_config | This command enables the rotary encoder (2 pin + ground) and will
enable encoder reporting.
NOTE: This command is not currently part of standard arduino firmata, but is provided for legacy
support of CodeShield on an Arduino UNO.
Encoder data is retrieved by performing a digital_read f... | PyMata/pymata.py | def encoder_config(self, pin_a, pin_b, cb=None):
"""
This command enables the rotary encoder (2 pin + ground) and will
enable encoder reporting.
NOTE: This command is not currently part of standard arduino firmata, but is provided for legacy
support of CodeShield on an Arduino U... | def encoder_config(self, pin_a, pin_b, cb=None):
"""
This command enables the rotary encoder (2 pin + ground) and will
enable encoder reporting.
NOTE: This command is not currently part of standard arduino firmata, but is provided for legacy
support of CodeShield on an Arduino U... | [
"This",
"command",
"enables",
"the",
"rotary",
"encoder",
"(",
"2",
"pin",
"+",
"ground",
")",
"and",
"will",
"enable",
"encoder",
"reporting",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L377-L406 | [
"def",
"encoder_config",
"(",
"self",
",",
"pin_a",
",",
"pin_b",
",",
"cb",
"=",
"None",
")",
":",
"data",
"=",
"[",
"pin_a",
",",
"pin_b",
"]",
"self",
".",
"_command_handler",
".",
"digital_response_table",
"[",
"pin_a",
"]",
"[",
"self",
".",
"_com... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.extended_analog | This method will send an extended data analog output command to the selected pin
:param pin: 0 - 127
:param data: 0 - 0xfffff | PyMata/pymata.py | def extended_analog(self, pin, data):
"""
This method will send an extended data analog output command to the selected pin
:param pin: 0 - 127
:param data: 0 - 0xfffff
"""
analog_data = [pin, data & 0x7f, (data >> 7) & 0x7f, (data >> 14) & 0x7f]
self._command_ha... | def extended_analog(self, pin, data):
"""
This method will send an extended data analog output command to the selected pin
:param pin: 0 - 127
:param data: 0 - 0xfffff
"""
analog_data = [pin, data & 0x7f, (data >> 7) & 0x7f, (data >> 14) & 0x7f]
self._command_ha... | [
"This",
"method",
"will",
"send",
"an",
"extended",
"data",
"analog",
"output",
"command",
"to",
"the",
"selected",
"pin"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L409-L418 | [
"def",
"extended_analog",
"(",
"self",
",",
"pin",
",",
"data",
")",
":",
"analog_data",
"=",
"[",
"pin",
",",
"data",
"&",
"0x7f",
",",
"(",
"data",
">>",
"7",
")",
"&",
"0x7f",
",",
"(",
"data",
">>",
"14",
")",
"&",
"0x7f",
"]",
"self",
".",... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.get_pin_state_query_results | This method returns the results of a previous call to pin_state_query() and then resets
the pin state query data to None
:return: Raw pin state query data | PyMata/pymata.py | def get_pin_state_query_results(self):
"""
This method returns the results of a previous call to pin_state_query() and then resets
the pin state query data to None
:return: Raw pin state query data
"""
r_data = self._command_handler.last_pin_query_results
self._c... | def get_pin_state_query_results(self):
"""
This method returns the results of a previous call to pin_state_query() and then resets
the pin state query data to None
:return: Raw pin state query data
"""
r_data = self._command_handler.last_pin_query_results
self._c... | [
"This",
"method",
"returns",
"the",
"results",
"of",
"a",
"previous",
"call",
"to",
"pin_state_query",
"()",
"and",
"then",
"resets",
"the",
"pin",
"state",
"query",
"data",
"to",
"None"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L499-L508 | [
"def",
"get_pin_state_query_results",
"(",
"self",
")",
":",
"r_data",
"=",
"self",
".",
"_command_handler",
".",
"last_pin_query_results",
"self",
".",
"_command_handler",
".",
"last_pin_query_results",
"=",
"[",
"]",
"return",
"r_data"
] | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.get_stepper_version | Get the stepper library version number.
:param timeout: specify a time to allow arduino to process and return a version
:return: the stepper version number if it was set. | PyMata/pymata.py | def get_stepper_version(self, timeout=20):
"""
Get the stepper library version number.
:param timeout: specify a time to allow arduino to process and return a version
:return: the stepper version number if it was set.
"""
# get current time
start_time = time.tim... | def get_stepper_version(self, timeout=20):
"""
Get the stepper library version number.
:param timeout: specify a time to allow arduino to process and return a version
:return: the stepper version number if it was set.
"""
# get current time
start_time = time.tim... | [
"Get",
"the",
"stepper",
"library",
"version",
"number",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L534-L555 | [
"def",
"get_stepper_version",
"(",
"self",
",",
"timeout",
"=",
"20",
")",
":",
"# get current time",
"start_time",
"=",
"time",
".",
"time",
"(",
")",
"# wait for up to 20 seconds for a successful capability query to occur",
"while",
"self",
".",
"_command_handler",
".... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.i2c_config | NOTE: THIS METHOD MUST BE CALLED BEFORE ANY I2C REQUEST IS MADE
This method initializes Firmata for I2c operations.
It allows setting of a read time delay amount, and to optionally track
the pins as I2C in the appropriate response table.
To track pins: Set the pin_type to ANALOG or DIGIT... | PyMata/pymata.py | def i2c_config(self, read_delay_time=0, pin_type=None, clk_pin=0, data_pin=0):
"""
NOTE: THIS METHOD MUST BE CALLED BEFORE ANY I2C REQUEST IS MADE
This method initializes Firmata for I2c operations.
It allows setting of a read time delay amount, and to optionally track
the pins a... | def i2c_config(self, read_delay_time=0, pin_type=None, clk_pin=0, data_pin=0):
"""
NOTE: THIS METHOD MUST BE CALLED BEFORE ANY I2C REQUEST IS MADE
This method initializes Firmata for I2c operations.
It allows setting of a read time delay amount, and to optionally track
the pins a... | [
"NOTE",
":",
"THIS",
"METHOD",
"MUST",
"BE",
"CALLED",
"BEFORE",
"ANY",
"I2C",
"REQUEST",
"IS",
"MADE",
"This",
"method",
"initializes",
"Firmata",
"for",
"I2c",
"operations",
".",
"It",
"allows",
"setting",
"of",
"a",
"read",
"time",
"delay",
"amount",
"a... | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L558-L591 | [
"def",
"i2c_config",
"(",
"self",
",",
"read_delay_time",
"=",
"0",
",",
"pin_type",
"=",
"None",
",",
"clk_pin",
"=",
"0",
",",
"data_pin",
"=",
"0",
")",
":",
"data",
"=",
"[",
"read_delay_time",
"&",
"0x7f",
",",
"(",
"read_delay_time",
">>",
"7",
... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.i2c_read | This method requests the read of an i2c device. Results are retrieved by a call to
i2c_get_read_data().
If a callback method is provided, when data is received from the device it will be sent to the callback method
:param address: i2c device address
:param register: register number (ca... | PyMata/pymata.py | def i2c_read(self, address, register, number_of_bytes, read_type, cb=None):
"""
This method requests the read of an i2c device. Results are retrieved by a call to
i2c_get_read_data().
If a callback method is provided, when data is received from the device it will be sent to the callback ... | def i2c_read(self, address, register, number_of_bytes, read_type, cb=None):
"""
This method requests the read of an i2c device. Results are retrieved by a call to
i2c_get_read_data().
If a callback method is provided, when data is received from the device it will be sent to the callback ... | [
"This",
"method",
"requests",
"the",
"read",
"of",
"an",
"i2c",
"device",
".",
"Results",
"are",
"retrieved",
"by",
"a",
"call",
"to",
"i2c_get_read_data",
"()",
".",
"If",
"a",
"callback",
"method",
"is",
"provided",
"when",
"data",
"is",
"received",
"fro... | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L594-L616 | [
"def",
"i2c_read",
"(",
"self",
",",
"address",
",",
"register",
",",
"number_of_bytes",
",",
"read_type",
",",
"cb",
"=",
"None",
")",
":",
"data",
"=",
"[",
"address",
",",
"read_type",
",",
"register",
"&",
"0x7f",
",",
"(",
"register",
">>",
"7",
... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.i2c_write | Write data to an i2c device.
:param address: i2c device address
:param args: A variable number of bytes to be sent to the device | PyMata/pymata.py | def i2c_write(self, address, *args):
"""
Write data to an i2c device.
:param address: i2c device address
:param args: A variable number of bytes to be sent to the device
"""
data = [address, self.I2C_WRITE]
for item in args:
data.append(item & 0x7f)
... | def i2c_write(self, address, *args):
"""
Write data to an i2c device.
:param address: i2c device address
:param args: A variable number of bytes to be sent to the device
"""
data = [address, self.I2C_WRITE]
for item in args:
data.append(item & 0x7f)
... | [
"Write",
"data",
"to",
"an",
"i2c",
"device",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L619-L631 | [
"def",
"i2c_write",
"(",
"self",
",",
"address",
",",
"*",
"args",
")",
":",
"data",
"=",
"[",
"address",
",",
"self",
".",
"I2C_WRITE",
"]",
"for",
"item",
"in",
"args",
":",
"data",
".",
"append",
"(",
"item",
"&",
"0x7f",
")",
"data",
".",
"ap... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.i2c_stop_reading | This method stops an I2C_READ_CONTINUOUSLY operation for the i2c device address specified.
:param address: address of i2c device | PyMata/pymata.py | def i2c_stop_reading(self, address):
"""
This method stops an I2C_READ_CONTINUOUSLY operation for the i2c device address specified.
:param address: address of i2c device
"""
data = [address, self.I2C_STOP_READING]
self._command_handler.send_sysex(self._command_handler.I2... | def i2c_stop_reading(self, address):
"""
This method stops an I2C_READ_CONTINUOUSLY operation for the i2c device address specified.
:param address: address of i2c device
"""
data = [address, self.I2C_STOP_READING]
self._command_handler.send_sysex(self._command_handler.I2... | [
"This",
"method",
"stops",
"an",
"I2C_READ_CONTINUOUSLY",
"operation",
"for",
"the",
"i2c",
"device",
"address",
"specified",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L634-L641 | [
"def",
"i2c_stop_reading",
"(",
"self",
",",
"address",
")",
":",
"data",
"=",
"[",
"address",
",",
"self",
".",
"I2C_STOP_READING",
"]",
"self",
".",
"_command_handler",
".",
"send_sysex",
"(",
"self",
".",
"_command_handler",
".",
"I2C_REQUEST",
",",
"data... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.i2c_get_read_data | This method retrieves the i2c read data as the result of an i2c_read() command.
:param address: i2c device address
:return: raw data read from device | PyMata/pymata.py | def i2c_get_read_data(self, address):
"""
This method retrieves the i2c read data as the result of an i2c_read() command.
:param address: i2c device address
:return: raw data read from device
"""
if address in self._command_handler.i2c_map:
map_entry = self.... | def i2c_get_read_data(self, address):
"""
This method retrieves the i2c read data as the result of an i2c_read() command.
:param address: i2c device address
:return: raw data read from device
"""
if address in self._command_handler.i2c_map:
map_entry = self.... | [
"This",
"method",
"retrieves",
"the",
"i2c",
"read",
"data",
"as",
"the",
"result",
"of",
"an",
"i2c_read",
"()",
"command",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L644-L654 | [
"def",
"i2c_get_read_data",
"(",
"self",
",",
"address",
")",
":",
"if",
"address",
"in",
"self",
".",
"_command_handler",
".",
"i2c_map",
":",
"map_entry",
"=",
"self",
".",
"_command_handler",
".",
"i2c_map",
"[",
"address",
"]",
"return",
"map_entry",
"["... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.pin_state_query | This method issues a pin state query command. Data returned is retrieved via
a call to get_pin_state_query_results()
:param pin: pin number | PyMata/pymata.py | def pin_state_query(self, pin):
"""
This method issues a pin state query command. Data returned is retrieved via
a call to get_pin_state_query_results()
:param pin: pin number
"""
self._command_handler.send_sysex(self._command_handler.PIN_STATE_QUERY, [pin]) | def pin_state_query(self, pin):
"""
This method issues a pin state query command. Data returned is retrieved via
a call to get_pin_state_query_results()
:param pin: pin number
"""
self._command_handler.send_sysex(self._command_handler.PIN_STATE_QUERY, [pin]) | [
"This",
"method",
"issues",
"a",
"pin",
"state",
"query",
"command",
".",
"Data",
"returned",
"is",
"retrieved",
"via",
"a",
"call",
"to",
"get_pin_state_query_results",
"()",
":",
"param",
"pin",
":",
"pin",
"number"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L657-L663 | [
"def",
"pin_state_query",
"(",
"self",
",",
"pin",
")",
":",
"self",
".",
"_command_handler",
".",
"send_sysex",
"(",
"self",
".",
"_command_handler",
".",
"PIN_STATE_QUERY",
",",
"[",
"pin",
"]",
")"
] | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.play_tone | This method will call the Tone library for the selected pin.
If the tone command is set to TONE_TONE, then the specified tone will be played.
Else, if the tone command is TONE_NO_TONE, then any currently playing tone will be disabled.
It is intended for a future release of Arduino Firmata
... | PyMata/pymata.py | def play_tone(self, pin, tone_command, frequency, duration):
"""
This method will call the Tone library for the selected pin.
If the tone command is set to TONE_TONE, then the specified tone will be played.
Else, if the tone command is TONE_NO_TONE, then any currently playing tone will b... | def play_tone(self, pin, tone_command, frequency, duration):
"""
This method will call the Tone library for the selected pin.
If the tone command is set to TONE_TONE, then the specified tone will be played.
Else, if the tone command is TONE_NO_TONE, then any currently playing tone will b... | [
"This",
"method",
"will",
"call",
"the",
"Tone",
"library",
"for",
"the",
"selected",
"pin",
".",
"If",
"the",
"tone",
"command",
"is",
"set",
"to",
"TONE_TONE",
"then",
"the",
"specified",
"tone",
"will",
"be",
"played",
".",
"Else",
"if",
"the",
"tone"... | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L666-L698 | [
"def",
"play_tone",
"(",
"self",
",",
"pin",
",",
"tone_command",
",",
"frequency",
",",
"duration",
")",
":",
"# convert the integer values to bytes",
"if",
"tone_command",
"==",
"self",
".",
"TONE_TONE",
":",
"# duration is specified",
"if",
"duration",
":",
"da... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.refresh_report_version | This method will query firmata for the report version.
Retrieve the report version via a call to get_firmata_version() | PyMata/pymata.py | def refresh_report_version(self):
"""
This method will query firmata for the report version.
Retrieve the report version via a call to get_firmata_version()
"""
command = [self._command_handler.REPORT_VERSION]
self._command_handler.send_command(command) | def refresh_report_version(self):
"""
This method will query firmata for the report version.
Retrieve the report version via a call to get_firmata_version()
"""
command = [self._command_handler.REPORT_VERSION]
self._command_handler.send_command(command) | [
"This",
"method",
"will",
"query",
"firmata",
"for",
"the",
"report",
"version",
".",
"Retrieve",
"the",
"report",
"version",
"via",
"a",
"call",
"to",
"get_firmata_version",
"()"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L701-L707 | [
"def",
"refresh_report_version",
"(",
"self",
")",
":",
"command",
"=",
"[",
"self",
".",
"_command_handler",
".",
"REPORT_VERSION",
"]",
"self",
".",
"_command_handler",
".",
"send_command",
"(",
"command",
")"
] | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.reset | This command sends a reset message to the Arduino. The response tables will be reinitialized
:return: No return value. | PyMata/pymata.py | def reset(self):
"""
This command sends a reset message to the Arduino. The response tables will be reinitialized
:return: No return value.
"""
# set all output pins to a value of 0
for pin in range(0, self._command_handler.total_pins_discovered):
if self._com... | def reset(self):
"""
This command sends a reset message to the Arduino. The response tables will be reinitialized
:return: No return value.
"""
# set all output pins to a value of 0
for pin in range(0, self._command_handler.total_pins_discovered):
if self._com... | [
"This",
"command",
"sends",
"a",
"reset",
"message",
"to",
"the",
"Arduino",
".",
"The",
"response",
"tables",
"will",
"be",
"reinitialized",
":",
"return",
":",
"No",
"return",
"value",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L718-L737 | [
"def",
"reset",
"(",
"self",
")",
":",
"# set all output pins to a value of 0",
"for",
"pin",
"in",
"range",
"(",
"0",
",",
"self",
".",
"_command_handler",
".",
"total_pins_discovered",
")",
":",
"if",
"self",
".",
"_command_handler",
".",
"digital_response_table... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.set_analog_latch | This method "arms" an analog pin for its data to be latched and saved in the latching table
If a callback method is provided, when latching criteria is achieved, the callback function is called
with latching data notification. In that case, the latching table is not updated.
:param pin: Analog ... | PyMata/pymata.py | def set_analog_latch(self, pin, threshold_type, threshold_value, cb=None):
"""
This method "arms" an analog pin for its data to be latched and saved in the latching table
If a callback method is provided, when latching criteria is achieved, the callback function is called
with latching d... | def set_analog_latch(self, pin, threshold_type, threshold_value, cb=None):
"""
This method "arms" an analog pin for its data to be latched and saved in the latching table
If a callback method is provided, when latching criteria is achieved, the callback function is called
with latching d... | [
"This",
"method",
"arms",
"an",
"analog",
"pin",
"for",
"its",
"data",
"to",
"be",
"latched",
"and",
"saved",
"in",
"the",
"latching",
"table",
"If",
"a",
"callback",
"method",
"is",
"provided",
"when",
"latching",
"criteria",
"is",
"achieved",
"the",
"cal... | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L740-L761 | [
"def",
"set_analog_latch",
"(",
"self",
",",
"pin",
",",
"threshold_type",
",",
"threshold_value",
",",
"cb",
"=",
"None",
")",
":",
"if",
"self",
".",
"ANALOG_LATCH_GT",
"<=",
"threshold_type",
"<=",
"self",
".",
"ANALOG_LATCH_LTE",
":",
"if",
"0",
"<=",
... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.set_digital_latch | This method "arms" a digital pin for its data to be latched and saved in the latching table
If a callback method is provided, when latching criteria is achieved, the callback function is called
with latching data notification. In that case, the latching table is not updated.
:param pin: Digital... | PyMata/pymata.py | def set_digital_latch(self, pin, threshold_type, cb=None):
"""
This method "arms" a digital pin for its data to be latched and saved in the latching table
If a callback method is provided, when latching criteria is achieved, the callback function is called
with latching data notification... | def set_digital_latch(self, pin, threshold_type, cb=None):
"""
This method "arms" a digital pin for its data to be latched and saved in the latching table
If a callback method is provided, when latching criteria is achieved, the callback function is called
with latching data notification... | [
"This",
"method",
"arms",
"a",
"digital",
"pin",
"for",
"its",
"data",
"to",
"be",
"latched",
"and",
"saved",
"in",
"the",
"latching",
"table",
"If",
"a",
"callback",
"method",
"is",
"provided",
"when",
"latching",
"criteria",
"is",
"achieved",
"the",
"cal... | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L764-L782 | [
"def",
"set_digital_latch",
"(",
"self",
",",
"pin",
",",
"threshold_type",
",",
"cb",
"=",
"None",
")",
":",
"if",
"0",
"<=",
"threshold_type",
"<=",
"1",
":",
"self",
".",
"_command_handler",
".",
"set_digital_latch",
"(",
"pin",
",",
"threshold_type",
"... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.set_pin_mode | This method sets a pin to the desired pin mode for the pin_type.
It automatically enables data reporting.
NOTE: DO NOT CALL THIS METHOD FOR I2C. See i2c_config().
:param pin: Pin number (for analog use the analog number, for example A4: use 4)
:param mode: INPUT, OUTPUT, PWM, PULLUP
... | PyMata/pymata.py | def set_pin_mode(self, pin, mode, pin_type, cb=None):
"""
This method sets a pin to the desired pin mode for the pin_type.
It automatically enables data reporting.
NOTE: DO NOT CALL THIS METHOD FOR I2C. See i2c_config().
:param pin: Pin number (for analog use the analog number, ... | def set_pin_mode(self, pin, mode, pin_type, cb=None):
"""
This method sets a pin to the desired pin mode for the pin_type.
It automatically enables data reporting.
NOTE: DO NOT CALL THIS METHOD FOR I2C. See i2c_config().
:param pin: Pin number (for analog use the analog number, ... | [
"This",
"method",
"sets",
"a",
"pin",
"to",
"the",
"desired",
"pin",
"mode",
"for",
"the",
"pin_type",
".",
"It",
"automatically",
"enables",
"data",
"reporting",
".",
"NOTE",
":",
"DO",
"NOT",
"CALL",
"THIS",
"METHOD",
"FOR",
"I2C",
".",
"See",
"i2c_con... | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L785-L827 | [
"def",
"set_pin_mode",
"(",
"self",
",",
"pin",
",",
"mode",
",",
"pin_type",
",",
"cb",
"=",
"None",
")",
":",
"command",
"=",
"[",
"self",
".",
"_command_handler",
".",
"SET_PIN_MODE",
",",
"pin",
",",
"mode",
"]",
"self",
".",
"_command_handler",
".... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.set_sampling_interval | This method sends the desired sampling interval to Firmata.
Note: Standard Firmata will ignore any interval less than 10 milliseconds
:param interval: Integer value for desired sampling interval in milliseconds
:return: No return value. | PyMata/pymata.py | def set_sampling_interval(self, interval):
"""
This method sends the desired sampling interval to Firmata.
Note: Standard Firmata will ignore any interval less than 10 milliseconds
:param interval: Integer value for desired sampling interval in milliseconds
:return: No return ... | def set_sampling_interval(self, interval):
"""
This method sends the desired sampling interval to Firmata.
Note: Standard Firmata will ignore any interval less than 10 milliseconds
:param interval: Integer value for desired sampling interval in milliseconds
:return: No return ... | [
"This",
"method",
"sends",
"the",
"desired",
"sampling",
"interval",
"to",
"Firmata",
".",
"Note",
":",
"Standard",
"Firmata",
"will",
"ignore",
"any",
"interval",
"less",
"than",
"10",
"milliseconds"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L830-L840 | [
"def",
"set_sampling_interval",
"(",
"self",
",",
"interval",
")",
":",
"data",
"=",
"[",
"interval",
"&",
"0x7f",
",",
"(",
"interval",
">>",
"7",
")",
"&",
"0x7f",
"]",
"self",
".",
"_command_handler",
".",
"send_sysex",
"(",
"self",
".",
"_command_han... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.servo_config | Configure a pin as a servo pin. Set pulse min, max in ms.
:param pin: Servo Pin.
:param min_pulse: Min pulse width in ms.
:param max_pulse: Max pulse width in ms.
:return: No return value | PyMata/pymata.py | def servo_config(self, pin, min_pulse=544, max_pulse=2400):
"""
Configure a pin as a servo pin. Set pulse min, max in ms.
:param pin: Servo Pin.
:param min_pulse: Min pulse width in ms.
:param max_pulse: Max pulse width in ms.
:return: No return value
"""
... | def servo_config(self, pin, min_pulse=544, max_pulse=2400):
"""
Configure a pin as a servo pin. Set pulse min, max in ms.
:param pin: Servo Pin.
:param min_pulse: Min pulse width in ms.
:param max_pulse: Max pulse width in ms.
:return: No return value
"""
... | [
"Configure",
"a",
"pin",
"as",
"a",
"servo",
"pin",
".",
"Set",
"pulse",
"min",
"max",
"in",
"ms",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L843-L859 | [
"def",
"servo_config",
"(",
"self",
",",
"pin",
",",
"min_pulse",
"=",
"544",
",",
"max_pulse",
"=",
"2400",
")",
":",
"self",
".",
"set_pin_mode",
"(",
"pin",
",",
"self",
".",
"SERVO",
",",
"self",
".",
"OUTPUT",
")",
"command",
"=",
"[",
"pin",
... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.sonar_config | Configure the pins,ping interval and maximum distance for an HC-SR04 type device.
Single pin configuration may be used. To do so, set both the trigger and echo pins to the same value.
Up to a maximum of 6 SONAR devices is supported
If the maximum is exceeded a message is sent to the console and ... | PyMata/pymata.py | def sonar_config(self, trigger_pin, echo_pin, cb=None, ping_interval=50, max_distance=200):
"""
Configure the pins,ping interval and maximum distance for an HC-SR04 type device.
Single pin configuration may be used. To do so, set both the trigger and echo pins to the same value.
Up to a ... | def sonar_config(self, trigger_pin, echo_pin, cb=None, ping_interval=50, max_distance=200):
"""
Configure the pins,ping interval and maximum distance for an HC-SR04 type device.
Single pin configuration may be used. To do so, set both the trigger and echo pins to the same value.
Up to a ... | [
"Configure",
"the",
"pins",
"ping",
"interval",
"and",
"maximum",
"distance",
"for",
"an",
"HC",
"-",
"SR04",
"type",
"device",
".",
"Single",
"pin",
"configuration",
"may",
"be",
"used",
".",
"To",
"do",
"so",
"set",
"both",
"the",
"trigger",
"and",
"ec... | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L862-L897 | [
"def",
"sonar_config",
"(",
"self",
",",
"trigger_pin",
",",
"echo_pin",
",",
"cb",
"=",
"None",
",",
"ping_interval",
"=",
"50",
",",
"max_distance",
"=",
"200",
")",
":",
"if",
"max_distance",
">",
"200",
":",
"max_distance",
"=",
"200",
"max_distance_ls... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.stepper_config | Configure stepper motor prior to operation.
:param steps_per_revolution: number of steps per motor revolution
:param stepper_pins: a list of control pin numbers - either 4 or 2 | PyMata/pymata.py | def stepper_config(self, steps_per_revolution, stepper_pins):
"""
Configure stepper motor prior to operation.
:param steps_per_revolution: number of steps per motor revolution
:param stepper_pins: a list of control pin numbers - either 4 or 2
"""
data = [self.STEPPER_CO... | def stepper_config(self, steps_per_revolution, stepper_pins):
"""
Configure stepper motor prior to operation.
:param steps_per_revolution: number of steps per motor revolution
:param stepper_pins: a list of control pin numbers - either 4 or 2
"""
data = [self.STEPPER_CO... | [
"Configure",
"stepper",
"motor",
"prior",
"to",
"operation",
"."
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L900-L911 | [
"def",
"stepper_config",
"(",
"self",
",",
"steps_per_revolution",
",",
"stepper_pins",
")",
":",
"data",
"=",
"[",
"self",
".",
"STEPPER_CONFIGURE",
",",
"steps_per_revolution",
"&",
"0x7f",
",",
"(",
"steps_per_revolution",
">>",
"7",
")",
"&",
"0x7f",
"]",
... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.stepper_step | Move a stepper motor for the number of steps at the specified speed
:param motor_speed: 21 bits of data to set motor speed
:param number_of_steps: 14 bits for number of steps & direction
positive is forward, negative is reverse | PyMata/pymata.py | def stepper_step(self, motor_speed, number_of_steps):
"""
Move a stepper motor for the number of steps at the specified speed
:param motor_speed: 21 bits of data to set motor speed
:param number_of_steps: 14 bits for number of steps & direction
positive ... | def stepper_step(self, motor_speed, number_of_steps):
"""
Move a stepper motor for the number of steps at the specified speed
:param motor_speed: 21 bits of data to set motor speed
:param number_of_steps: 14 bits for number of steps & direction
positive ... | [
"Move",
"a",
"stepper",
"motor",
"for",
"the",
"number",
"of",
"steps",
"at",
"the",
"specified",
"speed"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L914-L930 | [
"def",
"stepper_step",
"(",
"self",
",",
"motor_speed",
",",
"number_of_steps",
")",
":",
"if",
"number_of_steps",
">",
"0",
":",
"direction",
"=",
"1",
"else",
":",
"direction",
"=",
"0",
"abs_number_of_steps",
"=",
"abs",
"(",
"number_of_steps",
")",
"data... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMata.stepper_request_library_version | Request the stepper library version from the Arduino.
To retrieve the version after this command is called, call
get_stepper_version | PyMata/pymata.py | def stepper_request_library_version(self):
"""
Request the stepper library version from the Arduino.
To retrieve the version after this command is called, call
get_stepper_version
"""
data = [self.STEPPER_LIBRARY_VERSION]
self._command_handler.send_sysex(self._com... | def stepper_request_library_version(self):
"""
Request the stepper library version from the Arduino.
To retrieve the version after this command is called, call
get_stepper_version
"""
data = [self.STEPPER_LIBRARY_VERSION]
self._command_handler.send_sysex(self._com... | [
"Request",
"the",
"stepper",
"library",
"version",
"from",
"the",
"Arduino",
".",
"To",
"retrieve",
"the",
"version",
"after",
"this",
"command",
"is",
"called",
"call",
"get_stepper_version"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata.py#L933-L940 | [
"def",
"stepper_request_library_version",
"(",
"self",
")",
":",
"data",
"=",
"[",
"self",
".",
"STEPPER_LIBRARY_VERSION",
"]",
"self",
".",
"_command_handler",
".",
"send_sysex",
"(",
"self",
".",
"_command_handler",
".",
"STEPPER_DATA",
",",
"data",
")"
] | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMataSerial.open | open the serial port using the configuration data
returns a reference to this instance | PyMata/pymata_serial.py | def open(self, verbose):
"""
open the serial port using the configuration data
returns a reference to this instance
"""
# open a serial port
if verbose:
print('\nOpening Arduino Serial port %s ' % self.port_id)
try:
# in case the port is ... | def open(self, verbose):
"""
open the serial port using the configuration data
returns a reference to this instance
"""
# open a serial port
if verbose:
print('\nOpening Arduino Serial port %s ' % self.port_id)
try:
# in case the port is ... | [
"open",
"the",
"serial",
"port",
"using",
"the",
"configuration",
"data",
"returns",
"a",
"reference",
"to",
"this",
"instance"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata_serial.py#L67-L88 | [
"def",
"open",
"(",
"self",
",",
"verbose",
")",
":",
"# open a serial port",
"if",
"verbose",
":",
"print",
"(",
"'\\nOpening Arduino Serial port %s '",
"%",
"self",
".",
"port_id",
")",
"try",
":",
"# in case the port is already open, let's close it and then",
"# reop... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMataSerial.write | write the data to the serial port
return: None | PyMata/pymata_serial.py | def write(self, data):
"""
write the data to the serial port
return: None
"""
if sys.version_info[0] < 3:
self.arduino.write(data)
else:
self.arduino.write(bytes([ord(data)])) | def write(self, data):
"""
write the data to the serial port
return: None
"""
if sys.version_info[0] < 3:
self.arduino.write(data)
else:
self.arduino.write(bytes([ord(data)])) | [
"write",
"the",
"data",
"to",
"the",
"serial",
"port",
"return",
":",
"None"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata_serial.py#L100-L108 | [
"def",
"write",
"(",
"self",
",",
"data",
")",
":",
"if",
"sys",
".",
"version_info",
"[",
"0",
"]",
"<",
"3",
":",
"self",
".",
"arduino",
".",
"write",
"(",
"data",
")",
"else",
":",
"self",
".",
"arduino",
".",
"write",
"(",
"bytes",
"(",
"[... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | PyMataSerial.run | This method continually runs. If an incoming character is available on the serial port
it is read and placed on the _command_deque
@return: Never Returns | PyMata/pymata_serial.py | def run(self):
"""
This method continually runs. If an incoming character is available on the serial port
it is read and placed on the _command_deque
@return: Never Returns
"""
while not self.is_stopped():
# we can get an OSError: [Errno9] Bad file descriptor ... | def run(self):
"""
This method continually runs. If an incoming character is available on the serial port
it is read and placed on the _command_deque
@return: Never Returns
"""
while not self.is_stopped():
# we can get an OSError: [Errno9] Bad file descriptor ... | [
"This",
"method",
"continually",
"runs",
".",
"If",
"an",
"incoming",
"character",
"is",
"available",
"on",
"the",
"serial",
"port",
"it",
"is",
"read",
"and",
"placed",
"on",
"the",
"_command_deque"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/PyMata/pymata_serial.py#L111-L130 | [
"def",
"run",
"(",
"self",
")",
":",
"while",
"not",
"self",
".",
"is_stopped",
"(",
")",
":",
"# we can get an OSError: [Errno9] Bad file descriptor when shutting down",
"# just ignore it",
"try",
":",
"if",
"self",
".",
"arduino",
".",
"inWaiting",
"(",
")",
":"... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
valid | BiColorDisplayController.set_blink_rate | Set the user's desired blink rate (0 - 3)
@param b: blink rate | examples/i2c/pymata_i2c_write/bicolor_display_controller.py | def set_blink_rate(self, b):
"""
Set the user's desired blink rate (0 - 3)
@param b: blink rate
"""
if b > 3:
b = 0 # turn off if not sure
self.firmata.i2c_write(self.board_address,
(self.HT16K33_BLINK_CMD | self.HT16K33_BLINK_D... | def set_blink_rate(self, b):
"""
Set the user's desired blink rate (0 - 3)
@param b: blink rate
"""
if b > 3:
b = 0 # turn off if not sure
self.firmata.i2c_write(self.board_address,
(self.HT16K33_BLINK_CMD | self.HT16K33_BLINK_D... | [
"Set",
"the",
"user",
"s",
"desired",
"blink",
"rate",
"(",
"0",
"-",
"3",
")"
] | MrYsLab/PyMata | python | https://github.com/MrYsLab/PyMata/blob/7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429/examples/i2c/pymata_i2c_write/bicolor_display_controller.py#L96-L104 | [
"def",
"set_blink_rate",
"(",
"self",
",",
"b",
")",
":",
"if",
"b",
">",
"3",
":",
"b",
"=",
"0",
"# turn off if not sure",
"self",
".",
"firmata",
".",
"i2c_write",
"(",
"self",
".",
"board_address",
",",
"(",
"self",
".",
"HT16K33_BLINK_CMD",
"|",
"... | 7e0ec34670b5a0d3d6b74bcbe4f3808c845cc429 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.