repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
mitsei/dlkit
dlkit/json_/resource/sessions.py
ResourceAgentSession.get_resource_by_agent
def get_resource_by_agent(self, agent_id): """Gets the ``Resource`` associated with the given agent. arg: agent_id (osid.id.Id): ``Id`` of the ``Agent`` return: (osid.resource.Resource) - associated resource raise: NotFound - ``agent_id`` is not found raise: NullArgument - ...
python
def get_resource_by_agent(self, agent_id): """Gets the ``Resource`` associated with the given agent. arg: agent_id (osid.id.Id): ``Id`` of the ``Agent`` return: (osid.resource.Resource) - associated resource raise: NotFound - ``agent_id`` is not found raise: NullArgument - ...
[ "def", "get_resource_by_agent", "(", "self", ",", "agent_id", ")", ":", "collection", "=", "JSONClientValidated", "(", "'resource'", ",", "collection", "=", "'Resource'", ",", "runtime", "=", "self", ".", "_runtime", ")", "result", "=", "collection", ".", "fin...
Gets the ``Resource`` associated with the given agent. arg: agent_id (osid.id.Id): ``Id`` of the ``Agent`` return: (osid.resource.Resource) - associated resource raise: NotFound - ``agent_id`` is not found raise: NullArgument - ``agent_id`` is ``null`` raise: OperationFail...
[ "Gets", "the", "Resource", "associated", "with", "the", "given", "agent", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L1785-L1806
mitsei/dlkit
dlkit/json_/resource/sessions.py
ResourceAgentSession.get_agent_ids_by_resource
def get_agent_ids_by_resource(self, resource_id): """Gets the list of ``Agent`` ``Ids`` mapped to a ``Resource``. arg: resource_id (osid.id.Id): ``Id`` of a ``Resource`` return: (osid.id.IdList) - list of agent ``Ids`` raise: NotFound - ``resource_id`` is not found raise: ...
python
def get_agent_ids_by_resource(self, resource_id): """Gets the list of ``Agent`` ``Ids`` mapped to a ``Resource``. arg: resource_id (osid.id.Id): ``Id`` of a ``Resource`` return: (osid.id.IdList) - list of agent ``Ids`` raise: NotFound - ``resource_id`` is not found raise: ...
[ "def", "get_agent_ids_by_resource", "(", "self", ",", "resource_id", ")", ":", "collection", "=", "JSONClientValidated", "(", "'resource'", ",", "collection", "=", "'Resource'", ",", "runtime", "=", "self", ".", "_runtime", ")", "resource", "=", "collection", "....
Gets the list of ``Agent`` ``Ids`` mapped to a ``Resource``. arg: resource_id (osid.id.Id): ``Id`` of a ``Resource`` return: (osid.id.IdList) - list of agent ``Ids`` raise: NotFound - ``resource_id`` is not found raise: NullArgument - ``resource_id`` is ``null`` raise: Op...
[ "Gets", "the", "list", "of", "Agent", "Ids", "mapped", "to", "a", "Resource", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L1809-L1831
mitsei/dlkit
dlkit/json_/resource/sessions.py
ResourceAgentSession.get_agents_by_resource
def get_agents_by_resource(self, resource_id): """Gets the list of ``Agents`` mapped to a ``Resource``. arg: resource_id (osid.id.Id): ``Id`` of a ``Resource`` return: (osid.authentication.AgentList) - list of agents raise: NotFound - ``resource_id`` is not found raise: Nul...
python
def get_agents_by_resource(self, resource_id): """Gets the list of ``Agents`` mapped to a ``Resource``. arg: resource_id (osid.id.Id): ``Id`` of a ``Resource`` return: (osid.authentication.AgentList) - list of agents raise: NotFound - ``resource_id`` is not found raise: Nul...
[ "def", "get_agents_by_resource", "(", "self", ",", "resource_id", ")", ":", "agent_list", "=", "[", "]", "for", "agent_id", "in", "self", ".", "get_agent_ids_by_resource", "(", "resource_id", ")", ":", "agent_list", ".", "append", "(", "Agent", "(", "agent_id"...
Gets the list of ``Agents`` mapped to a ``Resource``. arg: resource_id (osid.id.Id): ``Id`` of a ``Resource`` return: (osid.authentication.AgentList) - list of agents raise: NotFound - ``resource_id`` is not found raise: NullArgument - ``resource_id`` is ``null`` raise: Op...
[ "Gets", "the", "list", "of", "Agents", "mapped", "to", "a", "Resource", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L1834-L1849
mitsei/dlkit
dlkit/json_/resource/sessions.py
ResourceAgentAssignmentSession.assign_agent_to_resource
def assign_agent_to_resource(self, agent_id, resource_id): """Adds an existing ``Agent`` to a ``Resource``. arg: agent_id (osid.id.Id): the ``Id`` of the ``Agent`` arg: resource_id (osid.id.Id): the ``Id`` of the ``Resource`` raise: AlreadyExists - ``agent_id`` is already assigne...
python
def assign_agent_to_resource(self, agent_id, resource_id): """Adds an existing ``Agent`` to a ``Resource``. arg: agent_id (osid.id.Id): the ``Id`` of the ``Agent`` arg: resource_id (osid.id.Id): the ``Id`` of the ``Resource`` raise: AlreadyExists - ``agent_id`` is already assigne...
[ "def", "assign_agent_to_resource", "(", "self", ",", "agent_id", ",", "resource_id", ")", ":", "# Should check for existence of Agent? We may mever manage them.", "collection", "=", "JSONClientValidated", "(", "'resource'", ",", "collection", "=", "'Resource'", ",", "runtim...
Adds an existing ``Agent`` to a ``Resource``. arg: agent_id (osid.id.Id): the ``Id`` of the ``Agent`` arg: resource_id (osid.id.Id): the ``Id`` of the ``Resource`` raise: AlreadyExists - ``agent_id`` is already assigned to ``resource_id`` raise: NotFound - ``agen...
[ "Adds", "an", "existing", "Agent", "to", "a", "Resource", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L1939-L1971
mitsei/dlkit
dlkit/json_/resource/sessions.py
ResourceAgentAssignmentSession.unassign_agent_from_resource
def unassign_agent_from_resource(self, agent_id, resource_id): """Removes an ``Agent`` from a ``Resource``. arg: agent_id (osid.id.Id): the ``Id`` of the ``Agent`` arg: resource_id (osid.id.Id): the ``Id`` of the ``Resource`` raise: NotFound - ``agent_id`` or ``resource_id`` not ...
python
def unassign_agent_from_resource(self, agent_id, resource_id): """Removes an ``Agent`` from a ``Resource``. arg: agent_id (osid.id.Id): the ``Id`` of the ``Agent`` arg: resource_id (osid.id.Id): the ``Id`` of the ``Resource`` raise: NotFound - ``agent_id`` or ``resource_id`` not ...
[ "def", "unassign_agent_from_resource", "(", "self", ",", "agent_id", ",", "resource_id", ")", ":", "collection", "=", "JSONClientValidated", "(", "'resource'", ",", "collection", "=", "'Resource'", ",", "runtime", "=", "self", ".", "_runtime", ")", "resource", "...
Removes an ``Agent`` from a ``Resource``. arg: agent_id (osid.id.Id): the ``Id`` of the ``Agent`` arg: resource_id (osid.id.Id): the ``Id`` of the ``Resource`` raise: NotFound - ``agent_id`` or ``resource_id`` not found or ``agent_id`` not assigned to ``resource_id`` ...
[ "Removes", "an", "Agent", "from", "a", "Resource", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L1974-L1997
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinQuerySession.get_bins_by_query
def get_bins_by_query(self, bin_query): """Gets a list of ``Bins`` matching the given bin query. arg: bin_query (osid.resource.BinQuery): the bin query return: (osid.resource.BinList) - the returned ``BinList`` raise: NullArgument - ``bin_query`` is ``null`` raise: Operatio...
python
def get_bins_by_query(self, bin_query): """Gets a list of ``Bins`` matching the given bin query. arg: bin_query (osid.resource.BinQuery): the bin query return: (osid.resource.BinList) - the returned ``BinList`` raise: NullArgument - ``bin_query`` is ``null`` raise: Operatio...
[ "def", "get_bins_by_query", "(", "self", ",", "bin_query", ")", ":", "# Implemented from template for", "# osid.resource.BinQuerySession.get_bins_by_query_template", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_session", ...
Gets a list of ``Bins`` matching the given bin query. arg: bin_query (osid.resource.BinQuery): the bin query return: (osid.resource.BinList) - the returned ``BinList`` raise: NullArgument - ``bin_query`` is ``null`` raise: OperationFailed - unable to complete request raise:...
[ "Gets", "a", "list", "of", "Bins", "matching", "the", "given", "bin", "query", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L2327-L2349
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinAdminSession.can_create_bin_with_record_types
def can_create_bin_with_record_types(self, bin_record_types): """Tests if this user can create a single ``Bin`` using the desired record types. While ``ResourceManager.getBinRecordTypes()`` can be used to examine which records are supported, this method tests which record(s) are require...
python
def can_create_bin_with_record_types(self, bin_record_types): """Tests if this user can create a single ``Bin`` using the desired record types. While ``ResourceManager.getBinRecordTypes()`` can be used to examine which records are supported, this method tests which record(s) are require...
[ "def", "can_create_bin_with_record_types", "(", "self", ",", "bin_record_types", ")", ":", "# Implemented from template for", "# osid.resource.BinAdminSession.can_create_bin_with_record_types", "# NOTE: It is expected that real authentication hints will be", "# handled in a service adapter abo...
Tests if this user can create a single ``Bin`` using the desired record types. While ``ResourceManager.getBinRecordTypes()`` can be used to examine which records are supported, this method tests which record(s) are required for creating a specific ``Bin``. Providing an empty array tests...
[ "Tests", "if", "this", "user", "can", "create", "a", "single", "Bin", "using", "the", "desired", "record", "types", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L2415-L2438
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinAdminSession.update_bin
def update_bin(self, bin_form): """Updates an existing bin. arg: bin_form (osid.resource.BinForm): the form containing the elements to be updated raise: IllegalState - ``bin_form`` already used in an update transaction raise: InvalidArgument - the fo...
python
def update_bin(self, bin_form): """Updates an existing bin. arg: bin_form (osid.resource.BinForm): the form containing the elements to be updated raise: IllegalState - ``bin_form`` already used in an update transaction raise: InvalidArgument - the fo...
[ "def", "update_bin", "(", "self", ",", "bin_form", ")", ":", "# Implemented from template for", "# osid.resource.BinAdminSession.update_bin_template", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_session", ".", "updat...
Updates an existing bin. arg: bin_form (osid.resource.BinForm): the form containing the elements to be updated raise: IllegalState - ``bin_form`` already used in an update transaction raise: InvalidArgument - the form contains an invalid value raise:...
[ "Updates", "an", "existing", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L2577-L2616
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinAdminSession.alias_bin
def alias_bin(self, bin_id, alias_id): """Adds an ``Id`` to a ``Bin`` for the purpose of creating compatibility. The primary ``Id`` of the ``Bin`` is determined by the provider. The new ``Id`` performs as an alias to the primary ``Id``. If the alias is a pointer to another bin, it is re...
python
def alias_bin(self, bin_id, alias_id): """Adds an ``Id`` to a ``Bin`` for the purpose of creating compatibility. The primary ``Id`` of the ``Bin`` is determined by the provider. The new ``Id`` performs as an alias to the primary ``Id``. If the alias is a pointer to another bin, it is re...
[ "def", "alias_bin", "(", "self", ",", "bin_id", ",", "alias_id", ")", ":", "# Implemented from template for", "# osid.resource.BinLookupSession.alias_bin_template", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_session...
Adds an ``Id`` to a ``Bin`` for the purpose of creating compatibility. The primary ``Id`` of the ``Bin`` is determined by the provider. The new ``Id`` performs as an alias to the primary ``Id``. If the alias is a pointer to another bin, it is reassigned to the given bin ``Id``. ...
[ "Adds", "an", "Id", "to", "a", "Bin", "for", "the", "purpose", "of", "creating", "compatibility", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L2688-L2710
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchySession.get_root_bins
def get_root_bins(self): """Gets the root bins in the bin hierarchy. A node with no parents is an orphan. While all bin ``Ids`` are known to the hierarchy, an orphan does not appear in the hierarchy unless explicitly added as a root node or child of another node. return...
python
def get_root_bins(self): """Gets the root bins in the bin hierarchy. A node with no parents is an orphan. While all bin ``Ids`` are known to the hierarchy, an orphan does not appear in the hierarchy unless explicitly added as a root node or child of another node. return...
[ "def", "get_root_bins", "(", "self", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchySession.get_root_bins", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_session", ".", "get_root_catalogs", "("...
Gets the root bins in the bin hierarchy. A node with no parents is an orphan. While all bin ``Ids`` are known to the hierarchy, an orphan does not appear in the hierarchy unless explicitly added as a root node or child of another node. return: (osid.resource.BinList) - the root...
[ "Gets", "the", "root", "bins", "in", "the", "bin", "hierarchy", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L2862-L2882
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchySession.has_parent_bins
def has_parent_bins(self, bin_id): """Tests if the ``Bin`` has any parents. arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if the bin has parents, ``false`` otherwise raise: NotFound - ``bin_id`` is not found raise: NullArgument -...
python
def has_parent_bins(self, bin_id): """Tests if the ``Bin`` has any parents. arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if the bin has parents, ``false`` otherwise raise: NotFound - ``bin_id`` is not found raise: NullArgument -...
[ "def", "has_parent_bins", "(", "self", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchySession.has_parent_bins", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_session", ".", "ha...
Tests if the ``Bin`` has any parents. arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if the bin has parents, ``false`` otherwise raise: NotFound - ``bin_id`` is not found raise: NullArgument - ``bin_id`` is ``null`` raise: Operat...
[ "Tests", "if", "the", "Bin", "has", "any", "parents", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L2887-L2904
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchySession.is_parent_of_bin
def is_parent_of_bin(self, id_, bin_id): """Tests if an ``Id`` is a direct parent of a bin. arg: id (osid.id.Id): an ``Id`` arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if this ``id`` is a parent of ``bin_id,`` ``false`` otherwise ...
python
def is_parent_of_bin(self, id_, bin_id): """Tests if an ``Id`` is a direct parent of a bin. arg: id (osid.id.Id): an ``Id`` arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if this ``id`` is a parent of ``bin_id,`` ``false`` otherwise ...
[ "def", "is_parent_of_bin", "(", "self", ",", "id_", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchySession.is_parent_of_bin", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_sess...
Tests if an ``Id`` is a direct parent of a bin. arg: id (osid.id.Id): an ``Id`` arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if this ``id`` is a parent of ``bin_id,`` ``false`` otherwise raise: NotFound - ``bin_id`` is not found ...
[ "Tests", "if", "an", "Id", "is", "a", "direct", "parent", "of", "a", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L2907-L2926
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchySession.get_parent_bin_ids
def get_parent_bin_ids(self, bin_id): """Gets the parent ``Ids`` of the given bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (osid.id.IdList) - the parent ``Ids`` of the bin raise: NotFound - ``bin_id`` is not found raise: NullArgument - ``bin_id`` is ``null`` ...
python
def get_parent_bin_ids(self, bin_id): """Gets the parent ``Ids`` of the given bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (osid.id.IdList) - the parent ``Ids`` of the bin raise: NotFound - ``bin_id`` is not found raise: NullArgument - ``bin_id`` is ``null`` ...
[ "def", "get_parent_bin_ids", "(", "self", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchySession.get_parent_bin_ids", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_session", ".",...
Gets the parent ``Ids`` of the given bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (osid.id.IdList) - the parent ``Ids`` of the bin raise: NotFound - ``bin_id`` is not found raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed - unable to comple...
[ "Gets", "the", "parent", "Ids", "of", "the", "given", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L2929-L2945
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchySession.get_parent_bins
def get_parent_bins(self, bin_id): """Gets the parents of the given bin. arg: bin_id (osid.id.Id): the ``Id`` to query return: (osid.resource.BinList) - the parents of the bin raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` raise:...
python
def get_parent_bins(self, bin_id): """Gets the parents of the given bin. arg: bin_id (osid.id.Id): the ``Id`` to query return: (osid.resource.BinList) - the parents of the bin raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` raise:...
[ "def", "get_parent_bins", "(", "self", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchySession.get_parent_bins", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_session", ".", "ge...
Gets the parents of the given bin. arg: bin_id (osid.id.Id): the ``Id`` to query return: (osid.resource.BinList) - the parents of the bin raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed - unable to complete request...
[ "Gets", "the", "parents", "of", "the", "given", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L2948-L2967
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchySession.is_ancestor_of_bin
def is_ancestor_of_bin(self, id_, bin_id): """Tests if an ``Id`` is an ancestor of a bin. arg: id (osid.id.Id): an ``Id`` arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if this ``id`` is an ancestor of ``bin_id,`` ``false`` otherwise ...
python
def is_ancestor_of_bin(self, id_, bin_id): """Tests if an ``Id`` is an ancestor of a bin. arg: id (osid.id.Id): an ``Id`` arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if this ``id`` is an ancestor of ``bin_id,`` ``false`` otherwise ...
[ "def", "is_ancestor_of_bin", "(", "self", ",", "id_", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchySession.is_ancestor_of_bin", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_...
Tests if an ``Id`` is an ancestor of a bin. arg: id (osid.id.Id): an ``Id`` arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if this ``id`` is an ancestor of ``bin_id,`` ``false`` otherwise raise: NotFound - ``bin_id`` is not found ...
[ "Tests", "if", "an", "Id", "is", "an", "ancestor", "of", "a", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L2970-L2989
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchySession.has_child_bins
def has_child_bins(self, bin_id): """Tests if a bin has any children. arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if the ``bin_id`` has children, ``false`` otherwise raise: NotFound - ``bin_id`` not found raise: NullArgument - ...
python
def has_child_bins(self, bin_id): """Tests if a bin has any children. arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if the ``bin_id`` has children, ``false`` otherwise raise: NotFound - ``bin_id`` not found raise: NullArgument - ...
[ "def", "has_child_bins", "(", "self", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchySession.has_child_bins", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_session", ".", "has_...
Tests if a bin has any children. arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if the ``bin_id`` has children, ``false`` otherwise raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` raise: Operat...
[ "Tests", "if", "a", "bin", "has", "any", "children", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L2992-L3009
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchySession.is_child_of_bin
def is_child_of_bin(self, id_, bin_id): """Tests if a bin is a direct child of another. arg: id (osid.id.Id): an ``Id`` arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if the ``id`` is a child of ``bin_id,`` ``false`` otherwise r...
python
def is_child_of_bin(self, id_, bin_id): """Tests if a bin is a direct child of another. arg: id (osid.id.Id): an ``Id`` arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if the ``id`` is a child of ``bin_id,`` ``false`` otherwise r...
[ "def", "is_child_of_bin", "(", "self", ",", "id_", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchySession.is_child_of_bin", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_sessio...
Tests if a bin is a direct child of another. arg: id (osid.id.Id): an ``Id`` arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if the ``id`` is a child of ``bin_id,`` ``false`` otherwise raise: NotFound - ``bin_id`` is not found r...
[ "Tests", "if", "a", "bin", "is", "a", "direct", "child", "of", "another", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L3012-L3031
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchySession.get_child_bin_ids
def get_child_bin_ids(self, bin_id): """Gets the child ``Ids`` of the given bin. arg: bin_id (osid.id.Id): the ``Id`` to query return: (osid.id.IdList) - the children of the bin raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` rais...
python
def get_child_bin_ids(self, bin_id): """Gets the child ``Ids`` of the given bin. arg: bin_id (osid.id.Id): the ``Id`` to query return: (osid.id.IdList) - the children of the bin raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` rais...
[ "def", "get_child_bin_ids", "(", "self", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchySession.get_child_bin_ids", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_session", ".", ...
Gets the child ``Ids`` of the given bin. arg: bin_id (osid.id.Id): the ``Id`` to query return: (osid.id.IdList) - the children of the bin raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed - unable to complete request...
[ "Gets", "the", "child", "Ids", "of", "the", "given", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L3034-L3050
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchySession.get_child_bins
def get_child_bins(self, bin_id): """Gets the children of the given bin. arg: bin_id (osid.id.Id): the ``Id`` to query return: (osid.resource.BinList) - the children of the bin raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` raise...
python
def get_child_bins(self, bin_id): """Gets the children of the given bin. arg: bin_id (osid.id.Id): the ``Id`` to query return: (osid.resource.BinList) - the children of the bin raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` raise...
[ "def", "get_child_bins", "(", "self", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchySession.get_child_bins", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_session", ".", "get_...
Gets the children of the given bin. arg: bin_id (osid.id.Id): the ``Id`` to query return: (osid.resource.BinList) - the children of the bin raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed - unable to complete reque...
[ "Gets", "the", "children", "of", "the", "given", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L3053-L3072
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchySession.is_descendant_of_bin
def is_descendant_of_bin(self, id_, bin_id): """Tests if an ``Id`` is a descendant of a bin. arg: id (osid.id.Id): an ``Id`` arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if the ``id`` is a descendant of the ``bin_id,`` ``false`` other...
python
def is_descendant_of_bin(self, id_, bin_id): """Tests if an ``Id`` is a descendant of a bin. arg: id (osid.id.Id): an ``Id`` arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if the ``id`` is a descendant of the ``bin_id,`` ``false`` other...
[ "def", "is_descendant_of_bin", "(", "self", ",", "id_", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchySession.is_descendant_of_bin", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_cata...
Tests if an ``Id`` is a descendant of a bin. arg: id (osid.id.Id): an ``Id`` arg: bin_id (osid.id.Id): the ``Id`` of a bin return: (boolean) - ``true`` if the ``id`` is a descendant of the ``bin_id,`` ``false`` otherwise raise: NotFound - ``bin_id`` is not found ...
[ "Tests", "if", "an", "Id", "is", "a", "descendant", "of", "a", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L3075-L3094
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchySession.get_bin_nodes
def get_bin_nodes(self, bin_id, ancestor_levels, descendant_levels, include_siblings): """Gets a portion of the hierarchy for the given bin. arg: bin_id (osid.id.Id): the ``Id`` to query arg: ancestor_levels (cardinal): the maximum number of ancestor levels to include. A v...
python
def get_bin_nodes(self, bin_id, ancestor_levels, descendant_levels, include_siblings): """Gets a portion of the hierarchy for the given bin. arg: bin_id (osid.id.Id): the ``Id`` to query arg: ancestor_levels (cardinal): the maximum number of ancestor levels to include. A v...
[ "def", "get_bin_nodes", "(", "self", ",", "bin_id", ",", "ancestor_levels", ",", "descendant_levels", ",", "include_siblings", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchySession.get_bin_nodes", "return", "objects", ".", "BinNode", "(", "self",...
Gets a portion of the hierarchy for the given bin. arg: bin_id (osid.id.Id): the ``Id`` to query arg: ancestor_levels (cardinal): the maximum number of ancestor levels to include. A value of 0 returns no parents in the node. arg: descendant_levels (cardi...
[ "Gets", "a", "portion", "of", "the", "hierarchy", "for", "the", "given", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L3133-L3160
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchyDesignSession.add_root_bin
def add_root_bin(self, bin_id): """Adds a root bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin raise: AlreadyExists - ``bin_id`` is already in hierarchy raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed -...
python
def add_root_bin(self, bin_id): """Adds a root bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin raise: AlreadyExists - ``bin_id`` is already in hierarchy raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed -...
[ "def", "add_root_bin", "(", "self", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchyDesignSession.add_root_bin_template", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_session", "...
Adds a root bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin raise: AlreadyExists - ``bin_id`` is already in hierarchy raise: NotFound - ``bin_id`` not found raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed - unable to complete request raise: ...
[ "Adds", "a", "root", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L3245-L3261
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchyDesignSession.remove_root_bin
def remove_root_bin(self, bin_id): """Removes a root bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin raise: NotFound - ``bin_id`` not a root raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed - unable to complete request raise: PermissionDenied...
python
def remove_root_bin(self, bin_id): """Removes a root bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin raise: NotFound - ``bin_id`` not a root raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed - unable to complete request raise: PermissionDenied...
[ "def", "remove_root_bin", "(", "self", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchyDesignSession.remove_root_bin_template", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_session...
Removes a root bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin raise: NotFound - ``bin_id`` not a root raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed - unable to complete request raise: PermissionDenied - authorization failure *compliance: ...
[ "Removes", "a", "root", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L3264-L3279
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchyDesignSession.add_child_bin
def add_child_bin(self, bin_id, child_id): """Adds a child to a bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin arg: child_id (osid.id.Id): the ``Id`` of the new child raise: AlreadyExists - ``bin_id`` is already a parent of ``child_id`` raise: NotFoun...
python
def add_child_bin(self, bin_id, child_id): """Adds a child to a bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin arg: child_id (osid.id.Id): the ``Id`` of the new child raise: AlreadyExists - ``bin_id`` is already a parent of ``child_id`` raise: NotFoun...
[ "def", "add_child_bin", "(", "self", ",", "bin_id", ",", "child_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchyDesignSession.add_child_bin_template", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", ...
Adds a child to a bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin arg: child_id (osid.id.Id): the ``Id`` of the new child raise: AlreadyExists - ``bin_id`` is already a parent of ``child_id`` raise: NotFound - ``bin_id`` or ``child_id`` not found raise...
[ "Adds", "a", "child", "to", "a", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L3282-L3300
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchyDesignSession.remove_child_bin
def remove_child_bin(self, bin_id, child_id): """Removes a child from a bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin arg: child_id (osid.id.Id): the ``Id`` of the new child raise: NotFound - ``bin_id`` not a parent of ``child_id`` raise: NullArgument - ``bin_id`` o...
python
def remove_child_bin(self, bin_id, child_id): """Removes a child from a bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin arg: child_id (osid.id.Id): the ``Id`` of the new child raise: NotFound - ``bin_id`` not a parent of ``child_id`` raise: NullArgument - ``bin_id`` o...
[ "def", "remove_child_bin", "(", "self", ",", "bin_id", ",", "child_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchyDesignSession.remove_child_bin_template", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", "...
Removes a child from a bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin arg: child_id (osid.id.Id): the ``Id`` of the new child raise: NotFound - ``bin_id`` not a parent of ``child_id`` raise: NullArgument - ``bin_id`` or ``child_id`` is ``null`` raise: OperationFaile...
[ "Removes", "a", "child", "from", "a", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L3303-L3319
mitsei/dlkit
dlkit/json_/resource/sessions.py
BinHierarchyDesignSession.remove_child_bins
def remove_child_bins(self, bin_id): """Removes all children from a bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin raise: NotFound - ``bin_id`` not in hierarchy raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed - unable to complete request rai...
python
def remove_child_bins(self, bin_id): """Removes all children from a bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin raise: NotFound - ``bin_id`` not in hierarchy raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed - unable to complete request rai...
[ "def", "remove_child_bins", "(", "self", ",", "bin_id", ")", ":", "# Implemented from template for", "# osid.resource.BinHierarchyDesignSession.remove_child_bin_template", "if", "self", ".", "_catalog_session", "is", "not", "None", ":", "return", "self", ".", "_catalog_sess...
Removes all children from a bin. arg: bin_id (osid.id.Id): the ``Id`` of a bin raise: NotFound - ``bin_id`` not in hierarchy raise: NullArgument - ``bin_id`` is ``null`` raise: OperationFailed - unable to complete request raise: PermissionDenied - authorization failure ...
[ "Removes", "all", "children", "from", "a", "bin", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/sessions.py#L3322-L3337
immstudios/nxtools
nxtools/caspar/caspar.py
CasparCG.connect
def connect(self): """Create connection to CasparCG Server""" try: self.connection = telnetlib.Telnet(self.host, self.port, timeout=self.timeout) except Exception: log_traceback() return False return True
python
def connect(self): """Create connection to CasparCG Server""" try: self.connection = telnetlib.Telnet(self.host, self.port, timeout=self.timeout) except Exception: log_traceback() return False return True
[ "def", "connect", "(", "self", ")", ":", "try", ":", "self", ".", "connection", "=", "telnetlib", ".", "Telnet", "(", "self", ".", "host", ",", "self", ".", "port", ",", "timeout", "=", "self", ".", "timeout", ")", "except", "Exception", ":", "log_tr...
Create connection to CasparCG Server
[ "Create", "connection", "to", "CasparCG", "Server" ]
train
https://github.com/immstudios/nxtools/blob/8c30213c61aec460c648d5e9ae7ce79dfb7b4b9a/nxtools/caspar/caspar.py#L45-L52
immstudios/nxtools
nxtools/caspar/caspar.py
CasparCG.query
def query(self, query, **kwargs): """Send AMCP command""" if not self.connection: if not self.connect(): return CasparResponse(500, "Unable to connect CasparCG server") query = query.strip() if kwargs.get("verbose", True): if not query.startswith(...
python
def query(self, query, **kwargs): """Send AMCP command""" if not self.connection: if not self.connect(): return CasparResponse(500, "Unable to connect CasparCG server") query = query.strip() if kwargs.get("verbose", True): if not query.startswith(...
[ "def", "query", "(", "self", ",", "query", ",", "*", "*", "kwargs", ")", ":", "if", "not", "self", ".", "connection", ":", "if", "not", "self", ".", "connect", "(", ")", ":", "return", "CasparResponse", "(", "500", ",", "\"Unable to connect CasparCG serv...
Send AMCP command
[ "Send", "AMCP", "command" ]
train
https://github.com/immstudios/nxtools/blob/8c30213c61aec460c648d5e9ae7ce79dfb7b4b9a/nxtools/caspar/caspar.py#L54-L100
chop-dbhi/varify
varify/migrations/0004_remove_sample_as_queryable.py
Migration.forwards
def forwards(self, orm): "Write your forwards methods here." orm['avocado.DataConcept'].objects.filter(name='Sample')\ .update(queryable=False)
python
def forwards(self, orm): "Write your forwards methods here." orm['avocado.DataConcept'].objects.filter(name='Sample')\ .update(queryable=False)
[ "def", "forwards", "(", "self", ",", "orm", ")", ":", "orm", "[", "'avocado.DataConcept'", "]", ".", "objects", ".", "filter", "(", "name", "=", "'Sample'", ")", ".", "update", "(", "queryable", "=", "False", ")" ]
Write your forwards methods here.
[ "Write", "your", "forwards", "methods", "here", "." ]
train
https://github.com/chop-dbhi/varify/blob/5dc721e49ed9bd3582f4b117785fdd1a8b6ba777/varify/migrations/0004_remove_sample_as_queryable.py#L9-L12
chop-dbhi/varify
varify/migrations/0004_remove_sample_as_queryable.py
Migration.backwards
def backwards(self, orm): "Write your backwards methods here." orm['avocado.DataConcept'].objects.filter(name='Sample')\ .update(queryable=True)
python
def backwards(self, orm): "Write your backwards methods here." orm['avocado.DataConcept'].objects.filter(name='Sample')\ .update(queryable=True)
[ "def", "backwards", "(", "self", ",", "orm", ")", ":", "orm", "[", "'avocado.DataConcept'", "]", ".", "objects", ".", "filter", "(", "name", "=", "'Sample'", ")", ".", "update", "(", "queryable", "=", "True", ")" ]
Write your backwards methods here.
[ "Write", "your", "backwards", "methods", "here", "." ]
train
https://github.com/chop-dbhi/varify/blob/5dc721e49ed9bd3582f4b117785fdd1a8b6ba777/varify/migrations/0004_remove_sample_as_queryable.py#L14-L17
mitsei/dlkit
dlkit/json_/types.py
NoneType.get_type_data
def get_type_data(self, name): """Return dictionary representation of type.""" try: return { 'authority': 'DLKIT.MIT.EDU', 'namespace': 'NoneType', 'identifier': name, 'domain': 'Generic Types', 'display_name': s...
python
def get_type_data(self, name): """Return dictionary representation of type.""" try: return { 'authority': 'DLKIT.MIT.EDU', 'namespace': 'NoneType', 'identifier': name, 'domain': 'Generic Types', 'display_name': s...
[ "def", "get_type_data", "(", "self", ",", "name", ")", ":", "try", ":", "return", "{", "'authority'", ":", "'DLKIT.MIT.EDU'", ",", "'namespace'", ":", "'NoneType'", ",", "'identifier'", ":", "name", ",", "'domain'", ":", "'Generic Types'", ",", "'display_name'...
Return dictionary representation of type.
[ "Return", "dictionary", "representation", "of", "type", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/types.py#L23-L37
mitsei/dlkit
dlkit/json_/types.py
Genus.get_type_data
def get_type_data(self, name): """Return dictionary representation of type.""" try: return { 'authority': 'DLKIT.MIT.EDU', 'namespace': 'GenusType', 'identifier': name, 'domain': 'Generic Types', 'display_name': ...
python
def get_type_data(self, name): """Return dictionary representation of type.""" try: return { 'authority': 'DLKIT.MIT.EDU', 'namespace': 'GenusType', 'identifier': name, 'domain': 'Generic Types', 'display_name': ...
[ "def", "get_type_data", "(", "self", ",", "name", ")", ":", "try", ":", "return", "{", "'authority'", ":", "'DLKIT.MIT.EDU'", ",", "'namespace'", ":", "'GenusType'", ",", "'identifier'", ":", "name", ",", "'domain'", ":", "'Generic Types'", ",", "'display_name...
Return dictionary representation of type.
[ "Return", "dictionary", "representation", "of", "type", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/types.py#L53-L67
mitsei/dlkit
dlkit/json_/types.py
Relationship.get_type_data
def get_type_data(self, name): """Return dictionary representation of type.""" try: return { 'authority': 'DLKIT', 'namespace': 'relationship.Relationship', 'identifier': name.lower(), 'domain': 'Generic Types', ...
python
def get_type_data(self, name): """Return dictionary representation of type.""" try: return { 'authority': 'DLKIT', 'namespace': 'relationship.Relationship', 'identifier': name.lower(), 'domain': 'Generic Types', ...
[ "def", "get_type_data", "(", "self", ",", "name", ")", ":", "try", ":", "return", "{", "'authority'", ":", "'DLKIT'", ",", "'namespace'", ":", "'relationship.Relationship'", ",", "'identifier'", ":", "name", ".", "lower", "(", ")", ",", "'domain'", ":", "'...
Return dictionary representation of type.
[ "Return", "dictionary", "representation", "of", "type", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/types.py#L109-L122
jason-weirather/py-seq-tools
seqtools/statistics/__init__.py
average
def average(arr): """average of the values, must have more than 0 entries. :param arr: list of numbers :type arr: number[] a number array :return: average :rtype: float """ if len(arr) == 0: sys.stderr.write("ERROR: no content in array to take average\n") sys.exit() if len(arr) == 1: return a...
python
def average(arr): """average of the values, must have more than 0 entries. :param arr: list of numbers :type arr: number[] a number array :return: average :rtype: float """ if len(arr) == 0: sys.stderr.write("ERROR: no content in array to take average\n") sys.exit() if len(arr) == 1: return a...
[ "def", "average", "(", "arr", ")", ":", "if", "len", "(", "arr", ")", "==", "0", ":", "sys", ".", "stderr", ".", "write", "(", "\"ERROR: no content in array to take average\\n\"", ")", "sys", ".", "exit", "(", ")", "if", "len", "(", "arr", ")", "==", ...
average of the values, must have more than 0 entries. :param arr: list of numbers :type arr: number[] a number array :return: average :rtype: float
[ "average", "of", "the", "values", "must", "have", "more", "than", "0", "entries", "." ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/statistics/__init__.py#L9-L22
jason-weirather/py-seq-tools
seqtools/statistics/__init__.py
median
def median(arr): """median of the values, must have more than 0 entries. :param arr: list of numbers :type arr: number[] a number array :return: median :rtype: float """ if len(arr) == 0: sys.stderr.write("ERROR: no content in array to take average\n") sys.exit() if len(arr) == 1: return arr[0...
python
def median(arr): """median of the values, must have more than 0 entries. :param arr: list of numbers :type arr: number[] a number array :return: median :rtype: float """ if len(arr) == 0: sys.stderr.write("ERROR: no content in array to take average\n") sys.exit() if len(arr) == 1: return arr[0...
[ "def", "median", "(", "arr", ")", ":", "if", "len", "(", "arr", ")", "==", "0", ":", "sys", ".", "stderr", ".", "write", "(", "\"ERROR: no content in array to take average\\n\"", ")", "sys", ".", "exit", "(", ")", "if", "len", "(", "arr", ")", "==", ...
median of the values, must have more than 0 entries. :param arr: list of numbers :type arr: number[] a number array :return: median :rtype: float
[ "median", "of", "the", "values", "must", "have", "more", "than", "0", "entries", "." ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/statistics/__init__.py#L24-L41
jason-weirather/py-seq-tools
seqtools/statistics/__init__.py
variance
def variance(arr): """variance of the values, must have 2 or more entries. :param arr: list of numbers :type arr: number[] a number array :return: variance :rtype: float """ avg = average(arr) return sum([(float(x)-avg)**2 for x in arr])/float(len(arr)-1)
python
def variance(arr): """variance of the values, must have 2 or more entries. :param arr: list of numbers :type arr: number[] a number array :return: variance :rtype: float """ avg = average(arr) return sum([(float(x)-avg)**2 for x in arr])/float(len(arr)-1)
[ "def", "variance", "(", "arr", ")", ":", "avg", "=", "average", "(", "arr", ")", "return", "sum", "(", "[", "(", "float", "(", "x", ")", "-", "avg", ")", "**", "2", "for", "x", "in", "arr", "]", ")", "/", "float", "(", "len", "(", "arr", ")...
variance of the values, must have 2 or more entries. :param arr: list of numbers :type arr: number[] a number array :return: variance :rtype: float
[ "variance", "of", "the", "values", "must", "have", "2", "or", "more", "entries", "." ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/statistics/__init__.py#L54-L64
jason-weirather/py-seq-tools
seqtools/statistics/__init__.py
N50
def N50(arr): """N50 often used in assessing denovo assembly. :param arr: list of numbers :type arr: number[] a number array :return: N50 :rtype: float """ if len(arr) == 0: sys.stderr.write("ERROR: no content in array to take N50\n") sys.exit() tot = sum(arr) half = float(tot)/float(2) cu...
python
def N50(arr): """N50 often used in assessing denovo assembly. :param arr: list of numbers :type arr: number[] a number array :return: N50 :rtype: float """ if len(arr) == 0: sys.stderr.write("ERROR: no content in array to take N50\n") sys.exit() tot = sum(arr) half = float(tot)/float(2) cu...
[ "def", "N50", "(", "arr", ")", ":", "if", "len", "(", "arr", ")", "==", "0", ":", "sys", ".", "stderr", ".", "write", "(", "\"ERROR: no content in array to take N50\\n\"", ")", "sys", ".", "exit", "(", ")", "tot", "=", "sum", "(", "arr", ")", "half",...
N50 often used in assessing denovo assembly. :param arr: list of numbers :type arr: number[] a number array :return: N50 :rtype: float
[ "N50", "often", "used", "in", "assessing", "denovo", "assembly", "." ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/statistics/__init__.py#L66-L86
jason-weirather/py-seq-tools
seqtools/basics.py
is_uuid4
def is_uuid4(instr): """A validator to confirm a string is indeed a UUID4 :param instr: input string that may be uuid4 :type instr: String :return: true if it is in UUID4 format :rtype: bool """ v = instr.strip().replace('-','').lower() if len(v) != 32: return False if not re.match('^[0-9a-f]+$',v): ...
python
def is_uuid4(instr): """A validator to confirm a string is indeed a UUID4 :param instr: input string that may be uuid4 :type instr: String :return: true if it is in UUID4 format :rtype: bool """ v = instr.strip().replace('-','').lower() if len(v) != 32: return False if not re.match('^[0-9a-f]+$',v): ...
[ "def", "is_uuid4", "(", "instr", ")", ":", "v", "=", "instr", ".", "strip", "(", ")", ".", "replace", "(", "'-'", ",", "''", ")", ".", "lower", "(", ")", "if", "len", "(", "v", ")", "!=", "32", ":", "return", "False", "if", "not", "re", ".", ...
A validator to confirm a string is indeed a UUID4 :param instr: input string that may be uuid4 :type instr: String :return: true if it is in UUID4 format :rtype: bool
[ "A", "validator", "to", "confirm", "a", "string", "is", "indeed", "a", "UUID4" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/basics.py#L5-L18
mitsei/dlkit
dlkit/services/learning.py
LearningManager._set_objective_bank_view
def _set_objective_bank_view(self, session): """Sets the underlying objective_bank view to match current view""" if self._objective_bank_view == COMPARATIVE: try: session.use_comparative_objective_bank_view() except AttributeError: pass els...
python
def _set_objective_bank_view(self, session): """Sets the underlying objective_bank view to match current view""" if self._objective_bank_view == COMPARATIVE: try: session.use_comparative_objective_bank_view() except AttributeError: pass els...
[ "def", "_set_objective_bank_view", "(", "self", ",", "session", ")", ":", "if", "self", ".", "_objective_bank_view", "==", "COMPARATIVE", ":", "try", ":", "session", ".", "use_comparative_objective_bank_view", "(", ")", "except", "AttributeError", ":", "pass", "el...
Sets the underlying objective_bank view to match current view
[ "Sets", "the", "underlying", "objective_bank", "view", "to", "match", "current", "view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L256-L267
mitsei/dlkit
dlkit/services/learning.py
LearningManager.use_comparative_objective_bank_view
def use_comparative_objective_bank_view(self): """Pass through to provider ObjectiveObjectiveBankSession.use_comparative_objective_bank_view""" self._objective_bank_view = COMPARATIVE # self._get_provider_session('objective_objective_bank_session') # To make sure the session is tracked f...
python
def use_comparative_objective_bank_view(self): """Pass through to provider ObjectiveObjectiveBankSession.use_comparative_objective_bank_view""" self._objective_bank_view = COMPARATIVE # self._get_provider_session('objective_objective_bank_session') # To make sure the session is tracked f...
[ "def", "use_comparative_objective_bank_view", "(", "self", ")", ":", "self", ".", "_objective_bank_view", "=", "COMPARATIVE", "# self._get_provider_session('objective_objective_bank_session') # To make sure the session is tracked", "for", "session", "in", "self", ".", "_get_provide...
Pass through to provider ObjectiveObjectiveBankSession.use_comparative_objective_bank_view
[ "Pass", "through", "to", "provider", "ObjectiveObjectiveBankSession", ".", "use_comparative_objective_bank_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L650-L658
mitsei/dlkit
dlkit/services/learning.py
LearningManager.use_plenary_objective_bank_view
def use_plenary_objective_bank_view(self): """Pass through to provider ObjectiveObjectiveBankSession.use_plenary_objective_bank_view""" self._objective_bank_view = PLENARY # self._get_provider_session('objective_objective_bank_session') # To make sure the session is tracked for session i...
python
def use_plenary_objective_bank_view(self): """Pass through to provider ObjectiveObjectiveBankSession.use_plenary_objective_bank_view""" self._objective_bank_view = PLENARY # self._get_provider_session('objective_objective_bank_session') # To make sure the session is tracked for session i...
[ "def", "use_plenary_objective_bank_view", "(", "self", ")", ":", "self", ".", "_objective_bank_view", "=", "PLENARY", "# self._get_provider_session('objective_objective_bank_session') # To make sure the session is tracked", "for", "session", "in", "self", ".", "_get_provider_sessio...
Pass through to provider ObjectiveObjectiveBankSession.use_plenary_objective_bank_view
[ "Pass", "through", "to", "provider", "ObjectiveObjectiveBankSession", ".", "use_plenary_objective_bank_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L660-L668
mitsei/dlkit
dlkit/services/learning.py
LearningManager.get_objective_banks_by_activity
def get_objective_banks_by_activity(self, *args, **kwargs): """Pass through to provider ActivityObjectiveBankSession.get_objective_banks_by_activity""" # Implemented from kitosid template for - # osid.resource.ResourceBinSession.get_bins_by_resource catalogs = self._get_provider_session(...
python
def get_objective_banks_by_activity(self, *args, **kwargs): """Pass through to provider ActivityObjectiveBankSession.get_objective_banks_by_activity""" # Implemented from kitosid template for - # osid.resource.ResourceBinSession.get_bins_by_resource catalogs = self._get_provider_session(...
[ "def", "get_objective_banks_by_activity", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceBinSession.get_bins_by_resource", "catalogs", "=", "self", ".", "_get_provider_session", "(", "'...
Pass through to provider ActivityObjectiveBankSession.get_objective_banks_by_activity
[ "Pass", "through", "to", "provider", "ActivityObjectiveBankSession", ".", "get_objective_banks_by_activity" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L790-L798
mitsei/dlkit
dlkit/services/learning.py
LearningManager.get_objective_banks
def get_objective_banks(self): """Pass through to provider ObjectiveBankLookupSession.get_objective_banks""" # Implemented from kitosid template for - # osid.resource.BinLookupSession.get_bins_template catalogs = self._get_provider_session('objective_bank_lookup_session').get_objective_b...
python
def get_objective_banks(self): """Pass through to provider ObjectiveBankLookupSession.get_objective_banks""" # Implemented from kitosid template for - # osid.resource.BinLookupSession.get_bins_template catalogs = self._get_provider_session('objective_bank_lookup_session').get_objective_b...
[ "def", "get_objective_banks", "(", "self", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.BinLookupSession.get_bins_template", "catalogs", "=", "self", ".", "_get_provider_session", "(", "'objective_bank_lookup_session'", ")", ".", "get_objective_banks", ...
Pass through to provider ObjectiveBankLookupSession.get_objective_banks
[ "Pass", "through", "to", "provider", "ObjectiveBankLookupSession", ".", "get_objective_banks" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L936-L944
mitsei/dlkit
dlkit/services/learning.py
LearningManager.create_objective_bank
def create_objective_bank(self, *args, **kwargs): """Pass through to provider ObjectiveBankAdminSession.create_objective_bank""" # Implemented from kitosid template for - # osid.resource.BinAdminSession.create_bin return ObjectiveBank( self._provider_manager, self...
python
def create_objective_bank(self, *args, **kwargs): """Pass through to provider ObjectiveBankAdminSession.create_objective_bank""" # Implemented from kitosid template for - # osid.resource.BinAdminSession.create_bin return ObjectiveBank( self._provider_manager, self...
[ "def", "create_objective_bank", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.BinAdminSession.create_bin", "return", "ObjectiveBank", "(", "self", ".", "_provider_manager", ",", "self", "....
Pass through to provider ObjectiveBankAdminSession.create_objective_bank
[ "Pass", "through", "to", "provider", "ObjectiveBankAdminSession", ".", "create_objective_bank" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L968-L976
mitsei/dlkit
dlkit/services/learning.py
LearningManager.get_objective_bank_form
def get_objective_bank_form(self, *args, **kwargs): """Pass through to provider ObjectiveBankAdminSession.get_objective_bank_form_for_update""" # Implemented from kitosid template for - # osid.resource.BinAdminSession.get_bin_form_for_update_template # This method might be a bit sketchy....
python
def get_objective_bank_form(self, *args, **kwargs): """Pass through to provider ObjectiveBankAdminSession.get_objective_bank_form_for_update""" # Implemented from kitosid template for - # osid.resource.BinAdminSession.get_bin_form_for_update_template # This method might be a bit sketchy....
[ "def", "get_objective_bank_form", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.BinAdminSession.get_bin_form_for_update_template", "# This method might be a bit sketchy. Time will tell.", "if", "isins...
Pass through to provider ObjectiveBankAdminSession.get_objective_bank_form_for_update
[ "Pass", "through", "to", "provider", "ObjectiveBankAdminSession", ".", "get_objective_bank_form_for_update" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L990-L998
mitsei/dlkit
dlkit/services/learning.py
LearningManager.save_objective_bank
def save_objective_bank(self, objective_bank_form, *args, **kwargs): """Pass through to provider ObjectiveBankAdminSession.update_objective_bank""" # Implemented from kitosid template for - # osid.resource.BinAdminSession.update_bin if objective_bank_form.is_for_update(): ret...
python
def save_objective_bank(self, objective_bank_form, *args, **kwargs): """Pass through to provider ObjectiveBankAdminSession.update_objective_bank""" # Implemented from kitosid template for - # osid.resource.BinAdminSession.update_bin if objective_bank_form.is_for_update(): ret...
[ "def", "save_objective_bank", "(", "self", ",", "objective_bank_form", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.BinAdminSession.update_bin", "if", "objective_bank_form", ".", "is_for_update", "(", "...
Pass through to provider ObjectiveBankAdminSession.update_objective_bank
[ "Pass", "through", "to", "provider", "ObjectiveBankAdminSession", ".", "update_objective_bank" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L1011-L1018
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank._set_objective_bank_view
def _set_objective_bank_view(self, session): """Sets the underlying objective_bank view to match current view""" if self._objective_bank_view == FEDERATED: try: session.use_federated_objective_bank_view() except AttributeError: pass else: ...
python
def _set_objective_bank_view(self, session): """Sets the underlying objective_bank view to match current view""" if self._objective_bank_view == FEDERATED: try: session.use_federated_objective_bank_view() except AttributeError: pass else: ...
[ "def", "_set_objective_bank_view", "(", "self", ",", "session", ")", ":", "if", "self", ".", "_objective_bank_view", "==", "FEDERATED", ":", "try", ":", "session", ".", "use_federated_objective_bank_view", "(", ")", "except", "AttributeError", ":", "pass", "else",...
Sets the underlying objective_bank view to match current view
[ "Sets", "the", "underlying", "objective_bank", "view", "to", "match", "current", "view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L1410-L1421
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.use_comparative_objective_view
def use_comparative_objective_view(self): """Pass through to provider ObjectiveLookupSession.use_comparative_objective_view""" self._object_views['objective'] = COMPARATIVE # self._get_provider_session('objective_lookup_session') # To make sure the session is tracked for session in self....
python
def use_comparative_objective_view(self): """Pass through to provider ObjectiveLookupSession.use_comparative_objective_view""" self._object_views['objective'] = COMPARATIVE # self._get_provider_session('objective_lookup_session') # To make sure the session is tracked for session in self....
[ "def", "use_comparative_objective_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'objective'", "]", "=", "COMPARATIVE", "# self._get_provider_session('objective_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self", ".", "_...
Pass through to provider ObjectiveLookupSession.use_comparative_objective_view
[ "Pass", "through", "to", "provider", "ObjectiveLookupSession", ".", "use_comparative_objective_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L1545-L1553
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.use_plenary_objective_view
def use_plenary_objective_view(self): """Pass through to provider ObjectiveLookupSession.use_plenary_objective_view""" self._object_views['objective'] = PLENARY # self._get_provider_session('objective_lookup_session') # To make sure the session is tracked for session in self._get_provide...
python
def use_plenary_objective_view(self): """Pass through to provider ObjectiveLookupSession.use_plenary_objective_view""" self._object_views['objective'] = PLENARY # self._get_provider_session('objective_lookup_session') # To make sure the session is tracked for session in self._get_provide...
[ "def", "use_plenary_objective_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'objective'", "]", "=", "PLENARY", "# self._get_provider_session('objective_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self", ".", "_get_prov...
Pass through to provider ObjectiveLookupSession.use_plenary_objective_view
[ "Pass", "through", "to", "provider", "ObjectiveLookupSession", ".", "use_plenary_objective_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L1555-L1563
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.use_federated_objective_bank_view
def use_federated_objective_bank_view(self): """Pass through to provider ObjectiveLookupSession.use_federated_objective_bank_view""" self._objective_bank_view = FEDERATED # self._get_provider_session('objective_lookup_session') # To make sure the session is tracked for session in self._g...
python
def use_federated_objective_bank_view(self): """Pass through to provider ObjectiveLookupSession.use_federated_objective_bank_view""" self._objective_bank_view = FEDERATED # self._get_provider_session('objective_lookup_session') # To make sure the session is tracked for session in self._g...
[ "def", "use_federated_objective_bank_view", "(", "self", ")", ":", "self", ".", "_objective_bank_view", "=", "FEDERATED", "# self._get_provider_session('objective_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self", ".", "_get_provider_sessions",...
Pass through to provider ObjectiveLookupSession.use_federated_objective_bank_view
[ "Pass", "through", "to", "provider", "ObjectiveLookupSession", ".", "use_federated_objective_bank_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L1565-L1573
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.use_isolated_objective_bank_view
def use_isolated_objective_bank_view(self): """Pass through to provider ObjectiveLookupSession.use_isolated_objective_bank_view""" self._objective_bank_view = ISOLATED # self._get_provider_session('objective_lookup_session') # To make sure the session is tracked for session in self._get_...
python
def use_isolated_objective_bank_view(self): """Pass through to provider ObjectiveLookupSession.use_isolated_objective_bank_view""" self._objective_bank_view = ISOLATED # self._get_provider_session('objective_lookup_session') # To make sure the session is tracked for session in self._get_...
[ "def", "use_isolated_objective_bank_view", "(", "self", ")", ":", "self", ".", "_objective_bank_view", "=", "ISOLATED", "# self._get_provider_session('objective_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self", ".", "_get_provider_sessions", ...
Pass through to provider ObjectiveLookupSession.use_isolated_objective_bank_view
[ "Pass", "through", "to", "provider", "ObjectiveLookupSession", ".", "use_isolated_objective_bank_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L1575-L1583
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.get_objective_form
def get_objective_form(self, *args, **kwargs): """Pass through to provider ObjectiveAdminSession.get_objective_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a bit sketchy. Time will te...
python
def get_objective_form(self, *args, **kwargs): """Pass through to provider ObjectiveAdminSession.get_objective_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a bit sketchy. Time will te...
[ "def", "get_objective_form", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.get_resource_form_for_update", "# This method might be a bit sketchy. Time will tell.", "if", "isinstanc...
Pass through to provider ObjectiveAdminSession.get_objective_form_for_update
[ "Pass", "through", "to", "provider", "ObjectiveAdminSession", ".", "get_objective_form_for_update" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L1683-L1691
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.save_objective
def save_objective(self, objective_form, *args, **kwargs): """Pass through to provider ObjectiveAdminSession.update_objective""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if objective_form.is_for_update(): return self.updat...
python
def save_objective(self, objective_form, *args, **kwargs): """Pass through to provider ObjectiveAdminSession.update_objective""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if objective_form.is_for_update(): return self.updat...
[ "def", "save_objective", "(", "self", ",", "objective_form", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.update_resource", "if", "objective_form", ".", "is_for_update", "(", ")", ...
Pass through to provider ObjectiveAdminSession.update_objective
[ "Pass", "through", "to", "provider", "ObjectiveAdminSession", ".", "update_objective" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L1705-L1712
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.use_comparative_activity_view
def use_comparative_activity_view(self): """Pass through to provider ActivityLookupSession.use_comparative_activity_view""" self._object_views['activity'] = COMPARATIVE # self._get_provider_session('activity_lookup_session') # To make sure the session is tracked for session in self._get_...
python
def use_comparative_activity_view(self): """Pass through to provider ActivityLookupSession.use_comparative_activity_view""" self._object_views['activity'] = COMPARATIVE # self._get_provider_session('activity_lookup_session') # To make sure the session is tracked for session in self._get_...
[ "def", "use_comparative_activity_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'activity'", "]", "=", "COMPARATIVE", "# self._get_provider_session('activity_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self", ".", "_get...
Pass through to provider ActivityLookupSession.use_comparative_activity_view
[ "Pass", "through", "to", "provider", "ActivityLookupSession", ".", "use_comparative_activity_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L1976-L1984
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.use_plenary_activity_view
def use_plenary_activity_view(self): """Pass through to provider ActivityLookupSession.use_plenary_activity_view""" self._object_views['activity'] = PLENARY # self._get_provider_session('activity_lookup_session') # To make sure the session is tracked for session in self._get_provider_ses...
python
def use_plenary_activity_view(self): """Pass through to provider ActivityLookupSession.use_plenary_activity_view""" self._object_views['activity'] = PLENARY # self._get_provider_session('activity_lookup_session') # To make sure the session is tracked for session in self._get_provider_ses...
[ "def", "use_plenary_activity_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'activity'", "]", "=", "PLENARY", "# self._get_provider_session('activity_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self", ".", "_get_provide...
Pass through to provider ActivityLookupSession.use_plenary_activity_view
[ "Pass", "through", "to", "provider", "ActivityLookupSession", ".", "use_plenary_activity_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L1986-L1994
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.get_activity_form
def get_activity_form(self, *args, **kwargs): """Pass through to provider ActivityAdminSession.get_activity_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a bit sketchy. Time will tell....
python
def get_activity_form(self, *args, **kwargs): """Pass through to provider ActivityAdminSession.get_activity_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a bit sketchy. Time will tell....
[ "def", "get_activity_form", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.get_resource_form_for_update", "# This method might be a bit sketchy. Time will tell.", "if", "isinstance...
Pass through to provider ActivityAdminSession.get_activity_form_for_update
[ "Pass", "through", "to", "provider", "ActivityAdminSession", ".", "get_activity_form_for_update" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L2114-L2122
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.save_activity
def save_activity(self, activity_form, *args, **kwargs): """Pass through to provider ActivityAdminSession.update_activity""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if activity_form.is_for_update(): return self.update_act...
python
def save_activity(self, activity_form, *args, **kwargs): """Pass through to provider ActivityAdminSession.update_activity""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if activity_form.is_for_update(): return self.update_act...
[ "def", "save_activity", "(", "self", ",", "activity_form", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.update_resource", "if", "activity_form", ".", "is_for_update", "(", ")", ":...
Pass through to provider ActivityAdminSession.update_activity
[ "Pass", "through", "to", "provider", "ActivityAdminSession", ".", "update_activity" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L2136-L2143
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.use_comparative_proficiency_view
def use_comparative_proficiency_view(self): """Pass through to provider ProficiencyLookupSession.use_comparative_proficiency_view""" self._object_views['proficiency'] = COMPARATIVE # self._get_provider_session('proficiency_lookup_session') # To make sure the session is tracked for sessio...
python
def use_comparative_proficiency_view(self): """Pass through to provider ProficiencyLookupSession.use_comparative_proficiency_view""" self._object_views['proficiency'] = COMPARATIVE # self._get_provider_session('proficiency_lookup_session') # To make sure the session is tracked for sessio...
[ "def", "use_comparative_proficiency_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'proficiency'", "]", "=", "COMPARATIVE", "# self._get_provider_session('proficiency_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self", "."...
Pass through to provider ProficiencyLookupSession.use_comparative_proficiency_view
[ "Pass", "through", "to", "provider", "ProficiencyLookupSession", ".", "use_comparative_proficiency_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L2177-L2185
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.use_plenary_proficiency_view
def use_plenary_proficiency_view(self): """Pass through to provider ProficiencyLookupSession.use_plenary_proficiency_view""" self._object_views['proficiency'] = PLENARY # self._get_provider_session('proficiency_lookup_session') # To make sure the session is tracked for session in self._g...
python
def use_plenary_proficiency_view(self): """Pass through to provider ProficiencyLookupSession.use_plenary_proficiency_view""" self._object_views['proficiency'] = PLENARY # self._get_provider_session('proficiency_lookup_session') # To make sure the session is tracked for session in self._g...
[ "def", "use_plenary_proficiency_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'proficiency'", "]", "=", "PLENARY", "# self._get_provider_session('proficiency_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self", ".", "_ge...
Pass through to provider ProficiencyLookupSession.use_plenary_proficiency_view
[ "Pass", "through", "to", "provider", "ProficiencyLookupSession", ".", "use_plenary_proficiency_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L2187-L2195
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.get_proficiency_form
def get_proficiency_form(self, *args, **kwargs): """Pass through to provider ProficiencyAdminSession.get_proficiency_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a bit sketchy. Time w...
python
def get_proficiency_form(self, *args, **kwargs): """Pass through to provider ProficiencyAdminSession.get_proficiency_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a bit sketchy. Time w...
[ "def", "get_proficiency_form", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.get_resource_form_for_update", "# This method might be a bit sketchy. Time will tell.", "if", "isinsta...
Pass through to provider ProficiencyAdminSession.get_proficiency_form_for_update
[ "Pass", "through", "to", "provider", "ProficiencyAdminSession", ".", "get_proficiency_form_for_update" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L2373-L2381
mitsei/dlkit
dlkit/services/learning.py
ObjectiveBank.save_proficiency
def save_proficiency(self, proficiency_form, *args, **kwargs): """Pass through to provider ProficiencyAdminSession.update_proficiency""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if proficiency_form.is_for_update(): return ...
python
def save_proficiency(self, proficiency_form, *args, **kwargs): """Pass through to provider ProficiencyAdminSession.update_proficiency""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if proficiency_form.is_for_update(): return ...
[ "def", "save_proficiency", "(", "self", ",", "proficiency_form", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.update_resource", "if", "proficiency_form", ".", "is_for_update", "(", ...
Pass through to provider ProficiencyAdminSession.update_proficiency
[ "Pass", "through", "to", "provider", "ProficiencyAdminSession", ".", "update_proficiency" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/learning.py#L2395-L2402
mitsei/dlkit
dlkit/json_/repository/searches.py
AssetSearchResults.get_assets
def get_assets(self): """Gets the asset list resulting from a search. return: (osid.repository.AssetList) - the asset list raise: IllegalState - the list has already been retrieved *compliance: mandatory -- This method must be implemented.* """ if self.retrieved: ...
python
def get_assets(self): """Gets the asset list resulting from a search. return: (osid.repository.AssetList) - the asset list raise: IllegalState - the list has already been retrieved *compliance: mandatory -- This method must be implemented.* """ if self.retrieved: ...
[ "def", "get_assets", "(", "self", ")", ":", "if", "self", ".", "retrieved", ":", "raise", "errors", ".", "IllegalState", "(", "'List has already been retrieved.'", ")", "self", ".", "retrieved", "=", "True", "return", "objects", ".", "AssetList", "(", "self", ...
Gets the asset list resulting from a search. return: (osid.repository.AssetList) - the asset list raise: IllegalState - the list has already been retrieved *compliance: mandatory -- This method must be implemented.*
[ "Gets", "the", "asset", "list", "resulting", "from", "a", "search", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/repository/searches.py#L95-L106
mitsei/dlkit
dlkit/json_/repository/searches.py
CompositionSearchResults.get_compositions
def get_compositions(self): """Gets the composition list resulting from a search. return: (osid.repository.CompositionList) - the composition list raise: IllegalState - the list has already been retrieved *compliance: mandatory -- This method must be implemented.* """ ...
python
def get_compositions(self): """Gets the composition list resulting from a search. return: (osid.repository.CompositionList) - the composition list raise: IllegalState - the list has already been retrieved *compliance: mandatory -- This method must be implemented.* """ ...
[ "def", "get_compositions", "(", "self", ")", ":", "if", "self", ".", "retrieved", ":", "raise", "errors", ".", "IllegalState", "(", "'List has already been retrieved.'", ")", "self", ".", "retrieved", "=", "True", "return", "objects", ".", "CompositionList", "("...
Gets the composition list resulting from a search. return: (osid.repository.CompositionList) - the composition list raise: IllegalState - the list has already been retrieved *compliance: mandatory -- This method must be implemented.*
[ "Gets", "the", "composition", "list", "resulting", "from", "a", "search", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/repository/searches.py#L218-L229
mitsei/dlkit
dlkit/json_/repository/searches.py
RepositorySearchResults.get_repositories
def get_repositories(self): """Gets the repository list resulting from the search. return: (osid.repository.RepositoryList) - the repository list raise: IllegalState - the list has already been retrieved *compliance: mandatory -- This method must be implemented.* """ i...
python
def get_repositories(self): """Gets the repository list resulting from the search. return: (osid.repository.RepositoryList) - the repository list raise: IllegalState - the list has already been retrieved *compliance: mandatory -- This method must be implemented.* """ i...
[ "def", "get_repositories", "(", "self", ")", ":", "if", "self", ".", "retrieved", ":", "raise", "errors", ".", "IllegalState", "(", "'List has already been retrieved.'", ")", "self", ".", "retrieved", "=", "True", "return", "objects", ".", "RepositoryList", "(",...
Gets the repository list resulting from the search. return: (osid.repository.RepositoryList) - the repository list raise: IllegalState - the list has already been retrieved *compliance: mandatory -- This method must be implemented.*
[ "Gets", "the", "repository", "list", "resulting", "from", "the", "search", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/repository/searches.py#L342-L353
mitsei/dlkit
dlkit/handcar/osid/sessions.py
OsidSession._init_object
def _init_object(self, catalog_id, proxy, runtime, cat_name, cat_class): """Initialize this object as an OsidObject....do we need this?? From the Mongo learning impl, but seems unnecessary for Handcar""" self._catalog_identifier = None self._init_proxy_and_runtime(proxy, runtime) ...
python
def _init_object(self, catalog_id, proxy, runtime, cat_name, cat_class): """Initialize this object as an OsidObject....do we need this?? From the Mongo learning impl, but seems unnecessary for Handcar""" self._catalog_identifier = None self._init_proxy_and_runtime(proxy, runtime) ...
[ "def", "_init_object", "(", "self", ",", "catalog_id", ",", "proxy", ",", "runtime", ",", "cat_name", ",", "cat_class", ")", ":", "self", ".", "_catalog_identifier", "=", "None", "self", ".", "_init_proxy_and_runtime", "(", "proxy", ",", "runtime", ")", "sel...
Initialize this object as an OsidObject....do we need this?? From the Mongo learning impl, but seems unnecessary for Handcar
[ "Initialize", "this", "object", "as", "an", "OsidObject", "....", "do", "we", "need", "this??", "From", "the", "Mongo", "learning", "impl", "but", "seems", "unnecessary", "for", "Handcar" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/sessions.py#L101-L109
mitsei/dlkit
dlkit/handcar/osid/sessions.py
OsidSession.is_authenticated
def is_authenticated(self): """Tests if an agent is authenticated to this session. return: (boolean) - true if valid authentication credentials exist, false otherwise compliance: mandatory - This method must be implemented. """ if self._proxy is None: ...
python
def is_authenticated(self): """Tests if an agent is authenticated to this session. return: (boolean) - true if valid authentication credentials exist, false otherwise compliance: mandatory - This method must be implemented. """ if self._proxy is None: ...
[ "def", "is_authenticated", "(", "self", ")", ":", "if", "self", ".", "_proxy", "is", "None", ":", "return", "False", "elif", "self", ".", "_proxy", ".", "has_authentication", "(", ")", ":", "return", "self", ".", "_proxy", ".", "get_authentication", "(", ...
Tests if an agent is authenticated to this session. return: (boolean) - true if valid authentication credentials exist, false otherwise compliance: mandatory - This method must be implemented.
[ "Tests", "if", "an", "agent", "is", "authenticated", "to", "this", "session", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/sessions.py#L231-L244
mitsei/dlkit
dlkit/handcar/osid/sessions.py
OsidSession.get_effective_agent_id
def get_effective_agent_id(self): """Gets the Id of the effective agent in use by this session. If is_authenticated() is true, then the effective agent may be the same as the agent returned by get_authenticated_agent(). If is_authenticated() is false, then the effective agent may be a ...
python
def get_effective_agent_id(self): """Gets the Id of the effective agent in use by this session. If is_authenticated() is true, then the effective agent may be the same as the agent returned by get_authenticated_agent(). If is_authenticated() is false, then the effective agent may be a ...
[ "def", "get_effective_agent_id", "(", "self", ")", ":", "if", "self", ".", "is_authenticated", "(", ")", ":", "return", "self", ".", "_proxy", ".", "get_authentication", "(", ")", ".", "get_agent_id", "(", ")", "elif", "self", ".", "_proxy", "is", "not", ...
Gets the Id of the effective agent in use by this session. If is_authenticated() is true, then the effective agent may be the same as the agent returned by get_authenticated_agent(). If is_authenticated() is false, then the effective agent may be a default agent used for authorization by...
[ "Gets", "the", "Id", "of", "the", "effective", "agent", "in", "use", "by", "this", "session", ".", "If", "is_authenticated", "()", "is", "true", "then", "the", "effective", "agent", "may", "be", "the", "same", "as", "the", "agent", "returned", "by", "get...
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/sessions.py#L275-L293
mitsei/dlkit
dlkit/handcar/osid/sessions.py
OsidSession.get_effective_agent
def get_effective_agent(self): """Gets the effective agent in use by this session. If is_authenticated() is true, then the effective agent may be the same as the agent returned by get_authenticated_agent(). If is_authenticated() is false, then the effective agent may be a default...
python
def get_effective_agent(self): """Gets the effective agent in use by this session. If is_authenticated() is true, then the effective agent may be the same as the agent returned by get_authenticated_agent(). If is_authenticated() is false, then the effective agent may be a default...
[ "def", "get_effective_agent", "(", "self", ")", ":", "if", "self", ".", "_proxy", "is", "not", "None", "and", "self", ".", "_proxy", ".", "has_authentication", "(", ")", ":", "return", "self", ".", "_proxy", ".", "get_authentication", "(", ")", ".", "get...
Gets the effective agent in use by this session. If is_authenticated() is true, then the effective agent may be the same as the agent returned by get_authenticated_agent(). If is_authenticated() is false, then the effective agent may be a default agent used for authorization by an unknwo...
[ "Gets", "the", "effective", "agent", "in", "use", "by", "this", "session", ".", "If", "is_authenticated", "()", "is", "true", "then", "the", "effective", "agent", "may", "be", "the", "same", "as", "the", "agent", "returned", "by", "get_authenticated_agent", ...
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/sessions.py#L295-L316
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetLookupSession.can_lookup_assets
def can_lookup_assets(self): """Tests if this user can perform ``Asset`` lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a ``PermissionDenied``. This is intended as a h...
python
def can_lookup_assets(self): """Tests if this user can perform ``Asset`` lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a ``PermissionDenied``. This is intended as a h...
[ "def", "can_lookup_assets", "(", "self", ")", ":", "url_path", "=", "construct_url", "(", "'authorization'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ")", "return", "self", ".", "_get_request", "(", "url_path", ")", "[", "'assetHints'", "]", "[", ...
Tests if this user can perform ``Asset`` lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a ``PermissionDenied``. This is intended as a hint to an application that may opt not t...
[ "Tests", "if", "this", "user", "can", "perform", "Asset", "lookups", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L115-L133
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetLookupSession.get_asset
def get_asset(self, asset_id=None): """Gets the ``Asset`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``Asset`` may have a different ``Id`` than requested, such as the case where a duplicate ``Id`` was as...
python
def get_asset(self, asset_id=None): """Gets the ``Asset`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``Asset`` may have a different ``Id`` than requested, such as the case where a duplicate ``Id`` was as...
[ "def", "get_asset", "(", "self", ",", "asset_id", "=", "None", ")", ":", "if", "asset_id", "is", "None", ":", "raise", "NullArgument", "(", ")", "url_path", "=", "construct_url", "(", "'assets'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ",", "...
Gets the ``Asset`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``Asset`` may have a different ``Id`` than requested, such as the case where a duplicate ``Id`` was assigned to an ``Asset`` and retained for compati...
[ "Gets", "the", "Asset", "specified", "by", "its", "Id", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L188-L213
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetLookupSession.get_assets_by_ids
def get_assets_by_ids(self, asset_ids=None): """Gets an ``AssetList`` corresponding to the given ``IdList``. In plenary mode, the returned list contains all of the assets specified in the ``Id`` list, in the order of the list, including duplicates, or an error results if an ``Id`` in th...
python
def get_assets_by_ids(self, asset_ids=None): """Gets an ``AssetList`` corresponding to the given ``IdList``. In plenary mode, the returned list contains all of the assets specified in the ``Id`` list, in the order of the list, including duplicates, or an error results if an ``Id`` in th...
[ "def", "get_assets_by_ids", "(", "self", ",", "asset_ids", "=", "None", ")", ":", "if", "asset_ids", "is", "None", ":", "raise", "NullArgument", "(", ")", "assets", "=", "[", "]", "for", "i", "in", "asset_ids", ":", "asset", "=", "None", "url_path", "=...
Gets an ``AssetList`` corresponding to the given ``IdList``. In plenary mode, the returned list contains all of the assets specified in the ``Id`` list, in the order of the list, including duplicates, or an error results if an ``Id`` in the supplied list is not found or inaccessible. Ot...
[ "Gets", "an", "AssetList", "corresponding", "to", "the", "given", "IdList", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L215-L257
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetLookupSession.get_assets_by_genus_type
def get_assets_by_genus_type(self, asset_genus_type=None): """Gets an ``AssetList`` corresponding to the given asset genus ``Type`` which does not include assets of types derived from the specified ``Type``. In plenary mode, the returned list contains all known assets or an error result...
python
def get_assets_by_genus_type(self, asset_genus_type=None): """Gets an ``AssetList`` corresponding to the given asset genus ``Type`` which does not include assets of types derived from the specified ``Type``. In plenary mode, the returned list contains all known assets or an error result...
[ "def", "get_assets_by_genus_type", "(", "self", ",", "asset_genus_type", "=", "None", ")", ":", "if", "asset_genus_type", "is", "None", ":", "raise", "NullArgument", "(", ")", "url_path", "=", "construct_url", "(", "'assets_by_genus'", ",", "bank_id", "=", "self...
Gets an ``AssetList`` corresponding to the given asset genus ``Type`` which does not include assets of types derived from the specified ``Type``. In plenary mode, the returned list contains all known assets or an error results. Otherwise, the returned list may contain only those assets ...
[ "Gets", "an", "AssetList", "corresponding", "to", "the", "given", "asset", "genus", "Type", "which", "does", "not", "include", "assets", "of", "types", "derived", "from", "the", "specified", "Type", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L259-L283
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetLookupSession.get_assets
def get_assets(self): """Gets all ``Assets``. In plenary mode, the returned list contains all known assets or an error results. Otherwise, the returned list may contain only those assets that are accessible through this session. :return: a list of ``Assets`` :rtype: ``o...
python
def get_assets(self): """Gets all ``Assets``. In plenary mode, the returned list contains all known assets or an error results. Otherwise, the returned list may contain only those assets that are accessible through this session. :return: a list of ``Assets`` :rtype: ``o...
[ "def", "get_assets", "(", "self", ")", ":", "url_path", "=", "construct_url", "(", "'assets'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ")", "return", "objects", ".", "AssetList", "(", "self", ".", "_get_request", "(", "url_path", ")", ")" ]
Gets all ``Assets``. In plenary mode, the returned list contains all known assets or an error results. Otherwise, the returned list may contain only those assets that are accessible through this session. :return: a list of ``Assets`` :rtype: ``osid.repository.AssetList`` ...
[ "Gets", "all", "Assets", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L346-L363
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.can_create_assets
def can_create_assets(self): """Tests if this user can create ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an ``Asset`` will result in a ``PermissionDenied``. This is intended as a hint to an appl...
python
def can_create_assets(self): """Tests if this user can create ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an ``Asset`` will result in a ``PermissionDenied``. This is intended as a hint to an appl...
[ "def", "can_create_assets", "(", "self", ")", ":", "url_path", "=", "construct_url", "(", "'authorization'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ")", "return", "self", ".", "_get_request", "(", "url_path", ")", "[", "'assetHints'", "]", "[", ...
Tests if this user can create ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an ``Asset`` will result in a ``PermissionDenied``. This is intended as a hint to an application that may opt not to offer create...
[ "Tests", "if", "this", "user", "can", "create", "Assets", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L716-L734
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.get_asset_form_for_create
def get_asset_form_for_create(self, asset_record_types=None): """Gets the asset form for creating new assets. A new form should be requested for each create transaction. :param asset_record_types: array of asset record types :type asset_record_types: ``osid.type.Type[]`` :retur...
python
def get_asset_form_for_create(self, asset_record_types=None): """Gets the asset form for creating new assets. A new form should be requested for each create transaction. :param asset_record_types: array of asset record types :type asset_record_types: ``osid.type.Type[]`` :retur...
[ "def", "get_asset_form_for_create", "(", "self", ",", "asset_record_types", "=", "None", ")", ":", "if", "asset_record_types", "is", "None", ":", "pass", "# Still need to deal with the record_types argument", "asset_form", "=", "objects", ".", "AssetForm", "(", ")", "...
Gets the asset form for creating new assets. A new form should be requested for each create transaction. :param asset_record_types: array of asset record types :type asset_record_types: ``osid.type.Type[]`` :return: the asset form :rtype: ``osid.repository.AssetForm`` :...
[ "Gets", "the", "asset", "form", "for", "creating", "new", "assets", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L757-L778
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.can_update_assets
def can_update_assets(self): """Tests if this user can update ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an ``Asset`` will result in a ``PermissionDenied``. This is intended as a hint to an appl...
python
def can_update_assets(self): """Tests if this user can update ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an ``Asset`` will result in a ``PermissionDenied``. This is intended as a hint to an appl...
[ "def", "can_update_assets", "(", "self", ")", ":", "url_path", "=", "construct_url", "(", "'authorization'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ")", "return", "self", ".", "_get_request", "(", "url_path", ")", "[", "'assetHints'", "]", "[", ...
Tests if this user can update ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an ``Asset`` will result in a ``PermissionDenied``. This is intended as a hint to an application that may opt not to offer update...
[ "Tests", "if", "this", "user", "can", "update", "Assets", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L820-L838
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.get_asset_form_for_update
def get_asset_form_for_update(self, asset_id=None): """Gets the asset form for updating an existing asset. A new asset form should be requested for each update transaction. :param asset_id: the ``Id`` of the ``Asset`` :type asset_id: ``osid.id.Id`` :return: the asset fo...
python
def get_asset_form_for_update(self, asset_id=None): """Gets the asset form for updating an existing asset. A new asset form should be requested for each update transaction. :param asset_id: the ``Id`` of the ``Asset`` :type asset_id: ``osid.id.Id`` :return: the asset fo...
[ "def", "get_asset_form_for_update", "(", "self", ",", "asset_id", "=", "None", ")", ":", "if", "asset_id", "is", "None", ":", "raise", "NullArgument", "(", ")", "try", ":", "url_path", "=", "construct_url", "(", "'assets'", ",", "bank_id", "=", "self", "."...
Gets the asset form for updating an existing asset. A new asset form should be requested for each update transaction. :param asset_id: the ``Id`` of the ``Asset`` :type asset_id: ``osid.id.Id`` :return: the asset form :rtype: ``osid.repository.AssetForm`` :raise...
[ "Gets", "the", "asset", "form", "for", "updating", "an", "existing", "asset", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L840-L869
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.update_asset
def update_asset(self, asset_form=None): """Updates an existing asset. :param asset_form: the form containing the elements to be updated :type asset_form: ``osid.repository.AssetForm`` :raise: ``IllegalState`` -- ``asset_form`` already used in anupdate transaction :raise: ``Inva...
python
def update_asset(self, asset_form=None): """Updates an existing asset. :param asset_form: the form containing the elements to be updated :type asset_form: ``osid.repository.AssetForm`` :raise: ``IllegalState`` -- ``asset_form`` already used in anupdate transaction :raise: ``Inva...
[ "def", "update_asset", "(", "self", ",", "asset_form", "=", "None", ")", ":", "if", "asset_form", "is", "None", ":", "raise", "NullArgument", "(", ")", "if", "not", "isinstance", "(", "asset_form", ",", "abc_repository_objects", ".", "AssetForm", ")", ":", ...
Updates an existing asset. :param asset_form: the form containing the elements to be updated :type asset_form: ``osid.repository.AssetForm`` :raise: ``IllegalState`` -- ``asset_form`` already used in anupdate transaction :raise: ``InvalidArgument`` -- the form contains an invalid value ...
[ "Updates", "an", "existing", "asset", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L871-L907
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.can_delete_assets
def can_delete_assets(self): """Tests if this user can delete ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an ``Asset`` will result in a ``PermissionDenied``. This is intended as a hint to an appl...
python
def can_delete_assets(self): """Tests if this user can delete ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an ``Asset`` will result in a ``PermissionDenied``. This is intended as a hint to an appl...
[ "def", "can_delete_assets", "(", "self", ")", ":", "url_path", "=", "construct_url", "(", "'authorization'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ")", "return", "self", ".", "_get_request", "(", "url_path", ")", "[", "'assetHints'", "]", "[", ...
Tests if this user can delete ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an ``Asset`` will result in a ``PermissionDenied``. This is intended as a hint to an application that may opt not to offer delete...
[ "Tests", "if", "this", "user", "can", "delete", "Assets", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L909-L927
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.delete_asset
def delete_asset(self, asset_id=None): """Deletes an ``Asset``. :param asset_id: the ``Id`` of the ``Asset`` to remove :type asset_id: ``osid.id.Id`` :raise: ``NotFound`` -- ``asset_id`` not found :raise: ``NullArgument`` -- ``asset_id`` is ``null`` :raise: ``OperationFa...
python
def delete_asset(self, asset_id=None): """Deletes an ``Asset``. :param asset_id: the ``Id`` of the ``Asset`` to remove :type asset_id: ``osid.id.Id`` :raise: ``NotFound`` -- ``asset_id`` not found :raise: ``NullArgument`` -- ``asset_id`` is ``null`` :raise: ``OperationFa...
[ "def", "delete_asset", "(", "self", ",", "asset_id", "=", "None", ")", ":", "if", "asset_id", "is", "None", ":", "raise", "NullArgument", "(", ")", "if", "not", "isinstance", "(", "asset_id", ",", "Id", ")", ":", "raise", "InvalidArgument", "(", "'argume...
Deletes an ``Asset``. :param asset_id: the ``Id`` of the ``Asset`` to remove :type asset_id: ``osid.id.Id`` :raise: ``NotFound`` -- ``asset_id`` not found :raise: ``NullArgument`` -- ``asset_id`` is ``null`` :raise: ``OperationFailed`` -- unable to complete request :rais...
[ "Deletes", "an", "Asset", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L929-L951
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.can_create_asset_content
def can_create_asset_content(self, asset_id=None): """Tests if this user can create content for ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an ``Asset`` will result in a ``PermissionDenied``. This is int...
python
def can_create_asset_content(self, asset_id=None): """Tests if this user can create content for ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an ``Asset`` will result in a ``PermissionDenied``. This is int...
[ "def", "can_create_asset_content", "(", "self", ",", "asset_id", "=", "None", ")", ":", "url_path", "=", "construct_url", "(", "'authorization'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ")", "return", "self", ".", "_get_request", "(", "url_path", "...
Tests if this user can create content for ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an ``Asset`` will result in a ``PermissionDenied``. This is intended as a hint to an application that may opt not to ...
[ "Tests", "if", "this", "user", "can", "create", "content", "for", "Assets", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L994-L1014
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.can_create_asset_content_with_record_types
def can_create_asset_content_with_record_types(self, asset_id=None, asset_content_record_types=None): """Tests if this user can create an ``AssetContent`` using the desired record types. While ``RepositoryManager.getAssetContentRecordTypes()`` can be used to test which records are supported, th...
python
def can_create_asset_content_with_record_types(self, asset_id=None, asset_content_record_types=None): """Tests if this user can create an ``AssetContent`` using the desired record types. While ``RepositoryManager.getAssetContentRecordTypes()`` can be used to test which records are supported, th...
[ "def", "can_create_asset_content_with_record_types", "(", "self", ",", "asset_id", "=", "None", ",", "asset_content_record_types", "=", "None", ")", ":", "url_path", "=", "construct_url", "(", "'authorization'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ")...
Tests if this user can create an ``AssetContent`` using the desired record types. While ``RepositoryManager.getAssetContentRecordTypes()`` can be used to test which records are supported, this method tests which records are required for creating a specific ``AssetContent``. Providing an...
[ "Tests", "if", "this", "user", "can", "create", "an", "AssetContent", "using", "the", "desired", "record", "types", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1016-L1039
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.get_asset_content_form_for_create
def get_asset_content_form_for_create(self, asset_id=None, asset_content_record_types=None): """Gets an asset content form for creating new assets. :param asset_id: the ``Id`` of an ``Asset`` :type asset_id: ``osid.id.Id`` :param asset_content_record_types: array of asset content record...
python
def get_asset_content_form_for_create(self, asset_id=None, asset_content_record_types=None): """Gets an asset content form for creating new assets. :param asset_id: the ``Id`` of an ``Asset`` :type asset_id: ``osid.id.Id`` :param asset_content_record_types: array of asset content record...
[ "def", "get_asset_content_form_for_create", "(", "self", ",", "asset_id", "=", "None", ",", "asset_content_record_types", "=", "None", ")", ":", "if", "asset_id", "is", "None", ":", "raise", "NullArgument", "(", ")", "if", "asset_content_record_types", "is", "None...
Gets an asset content form for creating new assets. :param asset_id: the ``Id`` of an ``Asset`` :type asset_id: ``osid.id.Id`` :param asset_content_record_types: array of asset content record types :type asset_content_record_types: ``osid.type.Type[]`` :return: the asset content...
[ "Gets", "an", "asset", "content", "form", "for", "creating", "new", "assets", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1041-L1065
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.create_asset_content
def create_asset_content(self, asset_content_form=None): """Creates new ``AssetContent`` for a given asset. :param asset_content_form: the form for this ``AssetContent`` :type asset_content_form: ``osid.repository.AssetContentForm`` :return: the new ``AssetContent`` :rtype: ``os...
python
def create_asset_content(self, asset_content_form=None): """Creates new ``AssetContent`` for a given asset. :param asset_content_form: the form for this ``AssetContent`` :type asset_content_form: ``osid.repository.AssetContentForm`` :return: the new ``AssetContent`` :rtype: ``os...
[ "def", "create_asset_content", "(", "self", ",", "asset_content_form", "=", "None", ")", ":", "if", "asset_content_form", "is", "None", ":", "raise", "NullArgument", "(", ")", "if", "not", "isinstance", "(", "asset_content_form", ",", "abc_repository_objects", "."...
Creates new ``AssetContent`` for a given asset. :param asset_content_form: the form for this ``AssetContent`` :type asset_content_form: ``osid.repository.AssetContentForm`` :return: the new ``AssetContent`` :rtype: ``osid.repository.AssetContent`` :raise: ``IllegalState`` -- ``a...
[ "Creates", "new", "AssetContent", "for", "a", "given", "asset", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1067-L1121
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.can_update_asset_contents
def can_update_asset_contents(self, asset_id=None): """Tests if this user can update ``AssetContent``. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an ``AssetContent`` will result in a ``PermissionDenied``. This is ...
python
def can_update_asset_contents(self, asset_id=None): """Tests if this user can update ``AssetContent``. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an ``AssetContent`` will result in a ``PermissionDenied``. This is ...
[ "def", "can_update_asset_contents", "(", "self", ",", "asset_id", "=", "None", ")", ":", "url_path", "=", "construct_url", "(", "'authorization'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ")", "return", "self", ".", "_get_request", "(", "url_path", ...
Tests if this user can update ``AssetContent``. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an ``AssetContent`` will result in a ``PermissionDenied``. This is intended as a hint to an application that may opt not to...
[ "Tests", "if", "this", "user", "can", "update", "AssetContent", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1123-L1143
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.get_asset_content_form_for_update
def get_asset_content_form_for_update(self, asset_content_id=None): """Gets the asset form for updating content for an existing asset. A new asset content form should be requested for each update transaction. :param asset_content_id: the ``Id`` of the ``AssetContent`` :type ass...
python
def get_asset_content_form_for_update(self, asset_content_id=None): """Gets the asset form for updating content for an existing asset. A new asset content form should be requested for each update transaction. :param asset_content_id: the ``Id`` of the ``AssetContent`` :type ass...
[ "def", "get_asset_content_form_for_update", "(", "self", ",", "asset_content_id", "=", "None", ")", ":", "if", "asset_content_id", "is", "None", ":", "raise", "NullArgument", "(", ")", "asset", "=", "None", "for", "a", "in", "AssetLookupSession", "(", "self", ...
Gets the asset form for updating content for an existing asset. A new asset content form should be requested for each update transaction. :param asset_content_id: the ``Id`` of the ``AssetContent`` :type asset_content_id: ``osid.id.Id`` :return: the asset content form :...
[ "Gets", "the", "asset", "form", "for", "updating", "content", "for", "an", "existing", "asset", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1145-L1178
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.update_asset_content
def update_asset_content(self, asset_content_form=None): """Updates an existing asset. :param asset_content_form: the form containing the elements to be updated :type asset_content_form: ``osid.repository.AssetContentForm`` :raise: ``IllegalState`` -- ``asset_content_form`` already used...
python
def update_asset_content(self, asset_content_form=None): """Updates an existing asset. :param asset_content_form: the form containing the elements to be updated :type asset_content_form: ``osid.repository.AssetContentForm`` :raise: ``IllegalState`` -- ``asset_content_form`` already used...
[ "def", "update_asset_content", "(", "self", ",", "asset_content_form", "=", "None", ")", ":", "if", "asset_content_form", "is", "None", ":", "raise", "NullArgument", "(", ")", "if", "not", "isinstance", "(", "asset_content_form", ",", "abc_repository_objects", "."...
Updates an existing asset. :param asset_content_form: the form containing the elements to be updated :type asset_content_form: ``osid.repository.AssetContentForm`` :raise: ``IllegalState`` -- ``asset_content_form`` already used in an update transaction :raise: ``InvalidArgument`` -- the...
[ "Updates", "an", "existing", "asset", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1180-L1227
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.can_delete_asset_contents
def can_delete_asset_contents(self, asset_id=None): """Tests if this user can delete ``AssetsContent`` from ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an ``AssetContent`` will result in a ``PermissionDe...
python
def can_delete_asset_contents(self, asset_id=None): """Tests if this user can delete ``AssetsContent`` from ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an ``AssetContent`` will result in a ``PermissionDe...
[ "def", "can_delete_asset_contents", "(", "self", ",", "asset_id", "=", "None", ")", ":", "url_path", "=", "construct_url", "(", "'authorization'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ")", "return", "self", ".", "_get_request", "(", "url_path", ...
Tests if this user can delete ``AssetsContent`` from ``Assets``. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an ``AssetContent`` will result in a ``PermissionDenied``. This is intended as a hint to an application th...
[ "Tests", "if", "this", "user", "can", "delete", "AssetsContent", "from", "Assets", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1229-L1249
mitsei/dlkit
dlkit/handcar/repository/sessions.py
AssetAdminSession.delete_asset_content
def delete_asset_content(self, asset_content_id=None): """Deletes content from an ``Asset``. :param asset_content_id: the ``Id`` of the ``AssetContent`` :type asset_content_id: ``osid.id.Id`` :raise: ``NotFound`` -- ``asset_content_id`` is not found :raise: ``NullArgument`` -- `...
python
def delete_asset_content(self, asset_content_id=None): """Deletes content from an ``Asset``. :param asset_content_id: the ``Id`` of the ``AssetContent`` :type asset_content_id: ``osid.id.Id`` :raise: ``NotFound`` -- ``asset_content_id`` is not found :raise: ``NullArgument`` -- `...
[ "def", "delete_asset_content", "(", "self", ",", "asset_content_id", "=", "None", ")", ":", "if", "asset_content_id", "is", "None", ":", "raise", "NullArgument", "(", ")", "asset", "=", "None", "for", "a", "in", "AssetLookupSession", "(", "self", ".", "_repo...
Deletes content from an ``Asset``. :param asset_content_id: the ``Id`` of the ``AssetContent`` :type asset_content_id: ``osid.id.Id`` :raise: ``NotFound`` -- ``asset_content_id`` is not found :raise: ``NullArgument`` -- ``asset_content_id`` is ``null`` :raise: ``OperationFailed`...
[ "Deletes", "content", "from", "an", "Asset", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1251-L1288
mitsei/dlkit
dlkit/handcar/repository/sessions.py
RepositoryLookupSession.can_lookup_repositories
def can_lookup_repositories(self): """Tests if this user can perform ``Repository`` lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a ``PermissionDenied``. This is intended ...
python
def can_lookup_repositories(self): """Tests if this user can perform ``Repository`` lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a ``PermissionDenied``. This is intended ...
[ "def", "can_lookup_repositories", "(", "self", ")", ":", "url_path", "=", "construct_url", "(", "'authorization'", ",", "bank_id", "=", "self", ".", "_repository_id_str", ")", "return", "self", ".", "_get_request", "(", "url_path", ")", "[", "'objectiveBankHints'"...
Tests if this user can perform ``Repository`` lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a ``PermissionDenied``. This is intended as a hint to an application that may opt ...
[ "Tests", "if", "this", "user", "can", "perform", "Repository", "lookups", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1327-L1345
mitsei/dlkit
dlkit/handcar/repository/sessions.py
RepositoryLookupSession.get_repository
def get_repository(self, repository_id=None): """Gets the ``Repository`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``Repository`` may have a different ``Id`` than requested, such as the case where a dup...
python
def get_repository(self, repository_id=None): """Gets the ``Repository`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``Repository`` may have a different ``Id`` than requested, such as the case where a dup...
[ "def", "get_repository", "(", "self", ",", "repository_id", "=", "None", ")", ":", "if", "repository_id", "is", "None", ":", "raise", "NullArgument", "(", ")", "url_path", "=", "construct_url", "(", "'objective_banks'", ",", "bank_id", "=", "repository_id", ")...
Gets the ``Repository`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``Repository`` may have a different ``Id`` than requested, such as the case where a duplicate ``Id`` was assigned to a ``Repository`` and retain...
[ "Gets", "the", "Repository", "specified", "by", "its", "Id", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1374-L1399
mitsei/dlkit
dlkit/handcar/repository/sessions.py
RepositoryLookupSession.get_repositories_by_ids
def get_repositories_by_ids(self, repository_ids=None): """Gets a ``RepositoryList`` corresponding to the given ``IdList``. In plenary mode, the returned list contains all of the repositories specified in the ``Id`` list, in the order of the list, including duplicates, or an error resul...
python
def get_repositories_by_ids(self, repository_ids=None): """Gets a ``RepositoryList`` corresponding to the given ``IdList``. In plenary mode, the returned list contains all of the repositories specified in the ``Id`` list, in the order of the list, including duplicates, or an error resul...
[ "def", "get_repositories_by_ids", "(", "self", ",", "repository_ids", "=", "None", ")", ":", "if", "repository_ids", "is", "None", ":", "raise", "NullArgument", "(", ")", "repositories", "=", "[", "]", "for", "i", "in", "repository_ids", ":", "repository", "...
Gets a ``RepositoryList`` corresponding to the given ``IdList``. In plenary mode, the returned list contains all of the repositories specified in the ``Id`` list, in the order of the list, including duplicates, or an error results if an ``Id`` in the supplied list is not found or inacce...
[ "Gets", "a", "RepositoryList", "corresponding", "to", "the", "given", "IdList", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1401-L1442
mitsei/dlkit
dlkit/handcar/repository/sessions.py
RepositoryLookupSession.get_repositories_by_genus_type
def get_repositories_by_genus_type(self, repository_genus_type=None): """Gets a ``RepositoryList`` corresponding to the given repository genus ``Type`` which does not include repositories of types derived from the specified ``Type``. In plenary mode, the returned list contains all known ...
python
def get_repositories_by_genus_type(self, repository_genus_type=None): """Gets a ``RepositoryList`` corresponding to the given repository genus ``Type`` which does not include repositories of types derived from the specified ``Type``. In plenary mode, the returned list contains all known ...
[ "def", "get_repositories_by_genus_type", "(", "self", ",", "repository_genus_type", "=", "None", ")", ":", "if", "repository_genus_type", "is", "None", ":", "raise", "NullArgument", "(", ")", "url_path", "=", "construct_url", "(", "'objective_banks'", ")", "reposito...
Gets a ``RepositoryList`` corresponding to the given repository genus ``Type`` which does not include repositories of types derived from the specified ``Type``. In plenary mode, the returned list contains all known repositories or an error results. Otherwise, the returned list may c...
[ "Gets", "a", "RepositoryList", "corresponding", "to", "the", "given", "repository", "genus", "Type", "which", "does", "not", "include", "repositories", "of", "types", "derived", "from", "the", "specified", "Type", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1444-L1473
mitsei/dlkit
dlkit/handcar/repository/sessions.py
RepositoryAdminSession.can_create_repositories
def can_create_repositories(self): """Tests if this user can create ``Repositories``. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a ``Repository`` will result in a ``PermissionDenied``. This is intended as a...
python
def can_create_repositories(self): """Tests if this user can create ``Repositories``. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a ``Repository`` will result in a ``PermissionDenied``. This is intended as a...
[ "def", "can_create_repositories", "(", "self", ")", ":", "url_path", "=", "construct_url", "(", "'authorization'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ")", "return", "self", ".", "_get_request", "(", "url_path", ")", "[", "'objectiveBankHints'", ...
Tests if this user can create ``Repositories``. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a ``Repository`` will result in a ``PermissionDenied``. This is intended as a hint to an application that may not wish to o...
[ "Tests", "if", "this", "user", "can", "create", "Repositories", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1752-L1770
mitsei/dlkit
dlkit/handcar/repository/sessions.py
RepositoryAdminSession.can_create_repository_with_record_types
def can_create_repository_with_record_types(self, repository_record_types=None): """Tests if this user can create a single ``Repository`` using the desired record types. While ``RepositoryManager.getRepositoryRecordTypes()`` can be used to examine which records are supported, this method tests ...
python
def can_create_repository_with_record_types(self, repository_record_types=None): """Tests if this user can create a single ``Repository`` using the desired record types. While ``RepositoryManager.getRepositoryRecordTypes()`` can be used to examine which records are supported, this method tests ...
[ "def", "can_create_repository_with_record_types", "(", "self", ",", "repository_record_types", "=", "None", ")", ":", "url_path", "=", "construct_url", "(", "'authorization'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ")", "return", "self", ".", "_get_requ...
Tests if this user can create a single ``Repository`` using the desired record types. While ``RepositoryManager.getRepositoryRecordTypes()`` can be used to examine which records are supported, this method tests which record(s) are required for creating a specific ``Repository``. Providi...
[ "Tests", "if", "this", "user", "can", "create", "a", "single", "Repository", "using", "the", "desired", "record", "types", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1772-L1792
mitsei/dlkit
dlkit/handcar/repository/sessions.py
RepositoryAdminSession.get_repository_form_for_create
def get_repository_form_for_create(self, repository_record_types=None): """Gets the repository form for creating new repositories. A new form should be requested for each create transaction. :param repository_record_types: array of repository record types :type repository_record_types:...
python
def get_repository_form_for_create(self, repository_record_types=None): """Gets the repository form for creating new repositories. A new form should be requested for each create transaction. :param repository_record_types: array of repository record types :type repository_record_types:...
[ "def", "get_repository_form_for_create", "(", "self", ",", "repository_record_types", "=", "None", ")", ":", "if", "repository_record_types", "is", "None", ":", "pass", "# Still need to deal with the record_types argument", "repository_form", "=", "objects", ".", "Repositor...
Gets the repository form for creating new repositories. A new form should be requested for each create transaction. :param repository_record_types: array of repository record types :type repository_record_types: ``osid.type.Type[]`` :return: the repository form :rtype: ``osid.r...
[ "Gets", "the", "repository", "form", "for", "creating", "new", "repositories", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1794-L1815
mitsei/dlkit
dlkit/handcar/repository/sessions.py
RepositoryAdminSession.create_repository
def create_repository(self, repository_form=None): """Creates a new ``Repository``. :param repository_form: the form for this ``Repository`` :type repository_form: ``osid.repository.RepositoryForm`` :return: the new ``Repository`` :rtype: ``osid.repository.Repository`` :...
python
def create_repository(self, repository_form=None): """Creates a new ``Repository``. :param repository_form: the form for this ``Repository`` :type repository_form: ``osid.repository.RepositoryForm`` :return: the new ``Repository`` :rtype: ``osid.repository.Repository`` :...
[ "def", "create_repository", "(", "self", ",", "repository_form", "=", "None", ")", ":", "if", "repository_form", "is", "None", ":", "raise", "NullArgument", "(", ")", "if", "not", "isinstance", "(", "repository_form", ",", "abc_repository_objects", ".", "Reposit...
Creates a new ``Repository``. :param repository_form: the form for this ``Repository`` :type repository_form: ``osid.repository.RepositoryForm`` :return: the new ``Repository`` :rtype: ``osid.repository.Repository`` :raise: ``IllegalState`` -- ``repository_form`` already used in...
[ "Creates", "a", "new", "Repository", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1817-L1854
mitsei/dlkit
dlkit/handcar/repository/sessions.py
RepositoryAdminSession.can_update_repositories
def can_update_repositories(self): """Tests if this user can update ``Repositories``. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a ``Repository`` will result in a ``PermissionDenied``. This is intended as a...
python
def can_update_repositories(self): """Tests if this user can update ``Repositories``. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a ``Repository`` will result in a ``PermissionDenied``. This is intended as a...
[ "def", "can_update_repositories", "(", "self", ")", ":", "url_path", "=", "construct_url", "(", "'authorization'", ",", "bank_id", "=", "self", ".", "_catalog_idstr", ")", "return", "self", ".", "_get_request", "(", "url_path", ")", "[", "'objectiveBankHints'", ...
Tests if this user can update ``Repositories``. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a ``Repository`` will result in a ``PermissionDenied``. This is intended as a hint to an application that may not wish to o...
[ "Tests", "if", "this", "user", "can", "update", "Repositories", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1856-L1874
mitsei/dlkit
dlkit/handcar/repository/sessions.py
RepositoryAdminSession.get_repository_form_for_update
def get_repository_form_for_update(self, repository_id=None): """Gets the repository form for updating an existing repository. A new repository form should be requested for each update transaction. :param repository_id: the ``Id`` of the ``Repository`` :type repository_id: ``os...
python
def get_repository_form_for_update(self, repository_id=None): """Gets the repository form for updating an existing repository. A new repository form should be requested for each update transaction. :param repository_id: the ``Id`` of the ``Repository`` :type repository_id: ``os...
[ "def", "get_repository_form_for_update", "(", "self", ",", "repository_id", "=", "None", ")", ":", "if", "repository_id", "is", "None", ":", "raise", "NullArgument", "(", ")", "try", ":", "repository", "=", "RepositoryLookupSession", "(", "proxy", "=", "self", ...
Gets the repository form for updating an existing repository. A new repository form should be requested for each update transaction. :param repository_id: the ``Id`` of the ``Repository`` :type repository_id: ``osid.id.Id`` :return: the repository form :rtype: ``osid.re...
[ "Gets", "the", "repository", "form", "for", "updating", "an", "existing", "repository", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1876-L1903
mitsei/dlkit
dlkit/handcar/repository/sessions.py
RepositoryAdminSession.update_repository
def update_repository(self, repository_form=None): """Updates an existing repository. :param repository_form: the form containing the elements to be updated :type repository_form: ``osid.repository.RepositoryForm`` :raise: ``IllegalState`` -- ``repository_form`` already used in an updat...
python
def update_repository(self, repository_form=None): """Updates an existing repository. :param repository_form: the form containing the elements to be updated :type repository_form: ``osid.repository.RepositoryForm`` :raise: ``IllegalState`` -- ``repository_form`` already used in an updat...
[ "def", "update_repository", "(", "self", ",", "repository_form", "=", "None", ")", ":", "if", "repository_form", "is", "None", ":", "raise", "NullArgument", "(", ")", "if", "not", "isinstance", "(", "repository_form", ",", "abc_repository_objects", ".", "Reposit...
Updates an existing repository. :param repository_form: the form containing the elements to be updated :type repository_form: ``osid.repository.RepositoryForm`` :raise: ``IllegalState`` -- ``repository_form`` already used in an update transaction :raise: ``InvalidArgument`` -- the form ...
[ "Updates", "an", "existing", "repository", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1905-L1945