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_/assessment/sessions.py | AssessmentOfferedBankAssignmentSession.assign_assessment_offered_to_bank | def assign_assessment_offered_to_bank(self, assessment_offered_id, bank_id):
"""Adds an existing ``AssessmentOffered`` to a ``Bank``.
arg: assessment_offered_id (osid.id.Id): the ``Id`` of the
``AssessmentOffered``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
... | python | def assign_assessment_offered_to_bank(self, assessment_offered_id, bank_id):
"""Adds an existing ``AssessmentOffered`` to a ``Bank``.
arg: assessment_offered_id (osid.id.Id): the ``Id`` of the
``AssessmentOffered``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
... | [
"def",
"assign_assessment_offered_to_bank",
"(",
"self",
",",
"assessment_offered_id",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinAssignmentSession.assign_resource_to_bin",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'ASSE... | Adds an existing ``AssessmentOffered`` to a ``Bank``.
arg: assessment_offered_id (osid.id.Id): the ``Id`` of the
``AssessmentOffered``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise: AlreadyExists - ``assessment_offered_id`` is already
assigne... | [
"Adds",
"an",
"existing",
"AssessmentOffered",
"to",
"a",
"Bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L6474-L6496 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentOfferedBankAssignmentSession.unassign_assessment_offered_from_bank | def unassign_assessment_offered_from_bank(self, assessment_offered_id, bank_id):
"""Removes an ``AssessmentOffered`` from a ``Bank``.
arg: assessment_offered_id (osid.id.Id): the ``Id`` of the
``AssessmentOffered``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
... | python | def unassign_assessment_offered_from_bank(self, assessment_offered_id, bank_id):
"""Removes an ``AssessmentOffered`` from a ``Bank``.
arg: assessment_offered_id (osid.id.Id): the ``Id`` of the
``AssessmentOffered``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
... | [
"def",
"unassign_assessment_offered_from_bank",
"(",
"self",
",",
"assessment_offered_id",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinAssignmentSession.unassign_resource_from_bin",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
... | Removes an ``AssessmentOffered`` from a ``Bank``.
arg: assessment_offered_id (osid.id.Id): the ``Id`` of the
``AssessmentOffered``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise: NotFound - ``assessment_offered_id`` or ``bank_id`` not
found or... | [
"Removes",
"an",
"AssessmentOffered",
"from",
"a",
"Bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L6499-L6520 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenLookupSession.get_assessment_taken | def get_assessment_taken(self, assessment_taken_id):
"""Gets the ``AssessmentTaken`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``AssessmentTaken`` may have a
different ``Id`` than requested, such as the case wh... | python | def get_assessment_taken(self, assessment_taken_id):
"""Gets the ``AssessmentTaken`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``AssessmentTaken`` may have a
different ``Id`` than requested, such as the case wh... | [
"def",
"get_assessment_taken",
"(",
"self",
",",
"assessment_taken_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resource",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated",
"(",
"'asse... | Gets the ``AssessmentTaken`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``AssessmentTaken`` may have a
different ``Id`` than requested, such as the case where a
duplicate ``Id`` was assigned to an ``AssessmentTa... | [
"Gets",
"the",
"AssessmentTaken",
"specified",
"by",
"its",
"Id",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L6664-L6692 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenLookupSession.get_assessments_taken_by_ids | def get_assessments_taken_by_ids(self, assessment_taken_ids):
"""Gets an ``AssessmentTakenList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the
assessments specified in the ``Id`` list, in the order of the
list, including duplicates, or an ... | python | def get_assessments_taken_by_ids(self, assessment_taken_ids):
"""Gets an ``AssessmentTakenList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the
assessments specified in the ``Id`` list, in the order of the
list, including duplicates, or an ... | [
"def",
"get_assessments_taken_by_ids",
"(",
"self",
",",
"assessment_taken_ids",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resources_by_ids",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated"... | Gets an ``AssessmentTakenList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the
assessments 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 i... | [
"Gets",
"an",
"AssessmentTakenList",
"corresponding",
"to",
"the",
"given",
"IdList",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L6695-L6736 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenLookupSession.get_assessments_taken_by_genus_type | def get_assessments_taken_by_genus_type(self, assessment_taken_genus_type):
"""Gets an ``AssessmentTakenList`` corresponding to the given assessment taken genus ``Type`` which does not include assessments of types derived from the specified ``Type``.
In plenary mode, the returned list contains all know... | python | def get_assessments_taken_by_genus_type(self, assessment_taken_genus_type):
"""Gets an ``AssessmentTakenList`` corresponding to the given assessment taken genus ``Type`` which does not include assessments of types derived from the specified ``Type``.
In plenary mode, the returned list contains all know... | [
"def",
"get_assessments_taken_by_genus_type",
"(",
"self",
",",
"assessment_taken_genus_type",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resources_by_genus_type",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
... | Gets an ``AssessmentTakenList`` corresponding to the given assessment taken genus ``Type`` which does not include assessments of types derived from the specified ``Type``.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list m... | [
"Gets",
"an",
"AssessmentTakenList",
"corresponding",
"to",
"the",
"given",
"assessment",
"taken",
"genus",
"Type",
"which",
"does",
"not",
"include",
"assessments",
"of",
"types",
"derived",
"from",
"the",
"specified",
"Type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L6739-L6767 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenLookupSession.get_assessments_taken_for_assessment | def get_assessments_taken_for_assessment(self, assessment_id):
"""Gets an ``AssessmentTakenList`` for the given assessment.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only those assessments taken ... | python | def get_assessments_taken_for_assessment(self, assessment_id):
"""Gets an ``AssessmentTakenList`` for the given assessment.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only those assessments taken ... | [
"def",
"get_assessments_taken_for_assessment",
"(",
"self",
",",
"assessment_id",
")",
":",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment'",
",",
"collection",
"=",
"'AssessmentOffered'",
",",
"runtime",
"=",
"self",
".",
"_runtime",
")",
"result",
"="... | Gets an ``AssessmentTakenList`` for the given assessment.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only those assessments taken that are
accessible through this session.
arg: assessm... | [
"Gets",
"an",
"AssessmentTakenList",
"for",
"the",
"given",
"assessment",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L6889-L6928 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenLookupSession.get_assessments_taken_for_assessment_offered | def get_assessments_taken_for_assessment_offered(self, assessment_offered_id):
"""Gets an ``AssessmentTakenList`` by the given assessment offered.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only t... | python | def get_assessments_taken_for_assessment_offered(self, assessment_offered_id):
"""Gets an ``AssessmentTakenList`` by the given assessment offered.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only t... | [
"def",
"get_assessments_taken_for_assessment_offered",
"(",
"self",
",",
"assessment_offered_id",
")",
":",
"# Implemented from template for",
"# osid.learning.ActivityLookupSession.get_activities_for_objective_template",
"# NOTE: This implementation currently ignores plenary view",
"collectio... | Gets an ``AssessmentTakenList`` by the given assessment offered.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only those assessments taken that are
accessible through this session.
arg: ... | [
"Gets",
"an",
"AssessmentTakenList",
"by",
"the",
"given",
"assessment",
"offered",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7002-L7029 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenLookupSession.get_assessments_taken_for_taker_and_assessment_offered | def get_assessments_taken_for_taker_and_assessment_offered(self, resource_id, assessment_offered_id):
"""Gets an ``AssessmentTakenList`` for the given resource and assessment offered.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the ret... | python | def get_assessments_taken_for_taker_and_assessment_offered(self, resource_id, assessment_offered_id):
"""Gets an ``AssessmentTakenList`` for the given resource and assessment offered.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the ret... | [
"def",
"get_assessments_taken_for_taker_and_assessment_offered",
"(",
"self",
",",
"resource_id",
",",
"assessment_offered_id",
")",
":",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment'",
",",
"collection",
... | Gets an ``AssessmentTakenList`` for the given resource and assessment offered.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only those assessments taken that are
accessible through this session.
... | [
"Gets",
"an",
"AssessmentTakenList",
"for",
"the",
"given",
"resource",
"and",
"assessment",
"offered",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7057-L7099 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenLookupSession.get_assessments_taken | def get_assessments_taken(self):
"""Gets all ``AssessmentTaken`` elements.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only those assessments taken that are
accessible through this session.... | python | def get_assessments_taken(self):
"""Gets all ``AssessmentTaken`` elements.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only those assessments taken that are
accessible through this session.... | [
"def",
"get_assessments_taken",
"(",
"self",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resources",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment'",
",",
"collection... | Gets all ``AssessmentTaken`` elements.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only those assessments taken that are
accessible through this session.
return: (osid.assessment.Assessmen... | [
"Gets",
"all",
"AssessmentTaken",
"elements",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7127-L7149 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenQuerySession.get_assessments_taken_by_query | def get_assessments_taken_by_query(self, assessment_taken_query):
"""Gets a list of ``AssessmentTaken`` elements matching the given assessment taken query.
arg: assessment_taken_query
(osid.assessment.AssessmentTakenQuery): the assessment
taken query
return: (... | python | def get_assessments_taken_by_query(self, assessment_taken_query):
"""Gets a list of ``AssessmentTaken`` elements matching the given assessment taken query.
arg: assessment_taken_query
(osid.assessment.AssessmentTakenQuery): the assessment
taken query
return: (... | [
"def",
"get_assessments_taken_by_query",
"(",
"self",
",",
"assessment_taken_query",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceQuerySession.get_resources_by_query",
"and_list",
"=",
"list",
"(",
")",
"or_list",
"=",
"list",
"(",
")",
"for",
"term... | Gets a list of ``AssessmentTaken`` elements matching the given assessment taken query.
arg: assessment_taken_query
(osid.assessment.AssessmentTakenQuery): the assessment
taken query
return: (osid.assessment.AssessmentTakenList) - the returned
``Assessm... | [
"Gets",
"a",
"list",
"of",
"AssessmentTaken",
"elements",
"matching",
"the",
"given",
"assessment",
"taken",
"query",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7275-L7317 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenAdminSession.get_assessment_taken_form_for_create | def get_assessment_taken_form_for_create(self, assessment_offered_id, assessment_taken_record_types):
"""Gets the assessment taken form for creating new assessments taken.
A new form should be requested for each create transaction.
arg: assessment_offered_id (osid.id.Id): the ``Id`` of the
... | python | def get_assessment_taken_form_for_create(self, assessment_offered_id, assessment_taken_record_types):
"""Gets the assessment taken form for creating new assessments taken.
A new form should be requested for each create transaction.
arg: assessment_offered_id (osid.id.Id): the ``Id`` of the
... | [
"def",
"get_assessment_taken_form_for_create",
"(",
"self",
",",
"assessment_offered_id",
",",
"assessment_taken_record_types",
")",
":",
"if",
"not",
"isinstance",
"(",
"assessment_offered_id",
",",
"ABCId",
")",
":",
"raise",
"errors",
".",
"InvalidArgument",
"(",
"... | Gets the assessment taken form for creating new assessments taken.
A new form should be requested for each create transaction.
arg: assessment_offered_id (osid.id.Id): the ``Id`` of the
related ``AssessmentOffered``
arg: assessment_taken_record_types (osid.type.Type[]): a... | [
"Gets",
"the",
"assessment",
"taken",
"form",
"for",
"creating",
"new",
"assessments",
"taken",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7447-L7506 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenAdminSession.create_assessment_taken | def create_assessment_taken(self, assessment_taken_form):
"""Creates a new ``AssessmentTaken``.
arg: assessment_taken_form
(osid.assessment.AssessmentTakenForm): the form for this
``AssessmentTaken``
return: (osid.assessment.AssessmentTaken) - the new
... | python | def create_assessment_taken(self, assessment_taken_form):
"""Creates a new ``AssessmentTaken``.
arg: assessment_taken_form
(osid.assessment.AssessmentTakenForm): the form for this
``AssessmentTaken``
return: (osid.assessment.AssessmentTaken) - the new
... | [
"def",
"create_assessment_taken",
"(",
"self",
",",
"assessment_taken_form",
")",
":",
"# This impl differs from the usual create_osid_object method in that it",
"# sets an agent id and default display name based on the underlying Assessment",
"# and checks for exceeding max attempts...",
"col... | Creates a new ``AssessmentTaken``.
arg: assessment_taken_form
(osid.assessment.AssessmentTakenForm): the form for this
``AssessmentTaken``
return: (osid.assessment.AssessmentTaken) - the new
``AssessmentTaken``
raise: IllegalState - ``assessme... | [
"Creates",
"a",
"new",
"AssessmentTaken",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7509-L7571 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenAdminSession.update_assessment_taken | def update_assessment_taken(self, assessment_taken_form):
"""Updates an existing assessment taken.
arg: assessment_taken_form
(osid.assessment.AssessmentTakenForm): the form
containing the elements to be updated
raise: IllegalState - ``assessment_taken_form``... | python | def update_assessment_taken(self, assessment_taken_form):
"""Updates an existing assessment taken.
arg: assessment_taken_form
(osid.assessment.AssessmentTakenForm): the form
containing the elements to be updated
raise: IllegalState - ``assessment_taken_form``... | [
"def",
"update_assessment_taken",
"(",
"self",
",",
"assessment_taken_form",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.update_resource_template",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment'",
",",
"collection",
"=",
"'Asse... | Updates an existing assessment taken.
arg: assessment_taken_form
(osid.assessment.AssessmentTakenForm): the form
containing the elements to be updated
raise: IllegalState - ``assessment_taken_form`` already used in
an update transaction
raise:... | [
"Updates",
"an",
"existing",
"assessment",
"taken",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7629-L7671 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenAdminSession.delete_assessment_taken | def delete_assessment_taken(self, assessment_taken_id):
"""Deletes an ``AssessmentTaken``.
arg: assessment_taken_id (osid.id.Id): the ``Id`` of the
``AssessmentTaken`` to remove
raise: NotFound - ``assessment_taken_id`` not found
raise: NullArgument - ``assessment_t... | python | def delete_assessment_taken(self, assessment_taken_id):
"""Deletes an ``AssessmentTaken``.
arg: assessment_taken_id (osid.id.Id): the ``Id`` of the
``AssessmentTaken`` to remove
raise: NotFound - ``assessment_taken_id`` not found
raise: NullArgument - ``assessment_t... | [
"def",
"delete_assessment_taken",
"(",
"self",
",",
"assessment_taken_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.delete_resource_template",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment'",
",",
"collection",
"=",
"'Assess... | Deletes an ``AssessmentTaken``.
arg: assessment_taken_id (osid.id.Id): the ``Id`` of the
``AssessmentTaken`` to remove
raise: NotFound - ``assessment_taken_id`` not found
raise: NullArgument - ``assessment_taken_id`` is ``null``
raise: OperationFailed - unable to c... | [
"Deletes",
"an",
"AssessmentTaken",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7694-L7718 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenAdminSession.alias_assessment_taken | def alias_assessment_taken(self, assessment_taken_id, alias_id):
"""Adds an ``Id`` to an ``AssessmentTaken`` for the purpose of creating compatibility.
The primary ``Id`` of the ``AssessmentTaken`` is determined by
the provider. The new ``Id`` is an alias to the primary ``Id``.
If the a... | python | def alias_assessment_taken(self, assessment_taken_id, alias_id):
"""Adds an ``Id`` to an ``AssessmentTaken`` for the purpose of creating compatibility.
The primary ``Id`` of the ``AssessmentTaken`` is determined by
the provider. The new ``Id`` is an alias to the primary ``Id``.
If the a... | [
"def",
"alias_assessment_taken",
"(",
"self",
",",
"assessment_taken_id",
",",
"alias_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.alias_resources_template",
"self",
".",
"_alias_id",
"(",
"primary_id",
"=",
"assessment_taken_id",
",",... | Adds an ``Id`` to an ``AssessmentTaken`` for the purpose of creating compatibility.
The primary ``Id`` of the ``AssessmentTaken`` is determined by
the provider. The new ``Id`` is an alias to the primary ``Id``.
If the alias is a pointer to another assessment taken, it is
reassigned to t... | [
"Adds",
"an",
"Id",
"to",
"an",
"AssessmentTaken",
"for",
"the",
"purpose",
"of",
"creating",
"compatibility",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7739-L7762 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenBankSession.get_assessment_taken_ids_by_bank | def get_assessment_taken_ids_by_bank(self, bank_id):
"""Gets the list of ``AssessmentTaken`` ``Ids`` associated with a ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.id.IdList) - list of related assessment taken
``Ids``
raise: NotFound - `... | python | def get_assessment_taken_ids_by_bank(self, bank_id):
"""Gets the list of ``AssessmentTaken`` ``Ids`` associated with a ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.id.IdList) - list of related assessment taken
``Ids``
raise: NotFound - `... | [
"def",
"get_assessment_taken_ids_by_bank",
"(",
"self",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_resource_ids_by_bin",
"id_list",
"=",
"[",
"]",
"for",
"assessment_taken",
"in",
"self",
".",
"get_assessments_taken_by_b... | Gets the list of ``AssessmentTaken`` ``Ids`` associated with a ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.id.IdList) - list of related assessment taken
``Ids``
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id... | [
"Gets",
"the",
"list",
"of",
"AssessmentTaken",
"Ids",
"associated",
"with",
"a",
"Bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7838-L7856 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenBankSession.get_assessments_taken_by_bank | def get_assessments_taken_by_bank(self, bank_id):
"""Gets the list of ``AssessmentTakens`` associated with a ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.assessment.AssessmentTakenList) - list of related
assessments taken
raise: NotFound ... | python | def get_assessments_taken_by_bank(self, bank_id):
"""Gets the list of ``AssessmentTakens`` associated with a ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.assessment.AssessmentTakenList) - list of related
assessments taken
raise: NotFound ... | [
"def",
"get_assessments_taken_by_bank",
"(",
"self",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_resources_by_bin",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'ASSESSMENT'",
",",
"local",
"=",
"True",
")"... | Gets the list of ``AssessmentTakens`` associated with a ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.assessment.AssessmentTakenList) - list of related
assessments taken
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``b... | [
"Gets",
"the",
"list",
"of",
"AssessmentTakens",
"associated",
"with",
"a",
"Bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7859-L7877 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenBankSession.get_assessment_taken_ids_by_banks | def get_assessment_taken_ids_by_banks(self, bank_ids):
"""Gets the list of ``AssessmentTaken Ids`` corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.id.IdList) - list of bank ``Ids``
raise: NullArgument - ``bank_ids`` is ``null`... | python | def get_assessment_taken_ids_by_banks(self, bank_ids):
"""Gets the list of ``AssessmentTaken Ids`` corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.id.IdList) - list of bank ``Ids``
raise: NullArgument - ``bank_ids`` is ``null`... | [
"def",
"get_assessment_taken_ids_by_banks",
"(",
"self",
",",
"bank_ids",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_resource_ids_by_bins",
"id_list",
"=",
"[",
"]",
"for",
"assessment_taken",
"in",
"self",
".",
"get_assessments_taken_b... | Gets the list of ``AssessmentTaken Ids`` corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.id.IdList) - list of bank ``Ids``
raise: NullArgument - ``bank_ids`` is ``null``
raise: OperationFailed - unable to complete request
... | [
"Gets",
"the",
"list",
"of",
"AssessmentTaken",
"Ids",
"corresponding",
"to",
"a",
"list",
"of",
"Banks",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7880-L7896 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenBankSession.get_assessments_taken_by_banks | def get_assessments_taken_by_banks(self, bank_ids):
"""Gets the list of ``AssessmentTaken`` objects corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.assessment.AssessmentTakenList) - list of
assessments taken
rai... | python | def get_assessments_taken_by_banks(self, bank_ids):
"""Gets the list of ``AssessmentTaken`` objects corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.assessment.AssessmentTakenList) - list of
assessments taken
rai... | [
"def",
"get_assessments_taken_by_banks",
"(",
"self",
",",
"bank_ids",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_resources_by_bins",
"assessment_taken_list",
"=",
"[",
"]",
"for",
"bank_id",
"in",
"bank_ids",
":",
"assessment_taken_lis... | Gets the list of ``AssessmentTaken`` objects corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.assessment.AssessmentTakenList) - list of
assessments taken
raise: NullArgument - ``bank_ids`` is ``null``
raise: Op... | [
"Gets",
"the",
"list",
"of",
"AssessmentTaken",
"objects",
"corresponding",
"to",
"a",
"list",
"of",
"Banks",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7899-L7917 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenBankSession.get_bank_ids_by_assessment_taken | def get_bank_ids_by_assessment_taken(self, assessment_taken_id):
"""Gets the list of ``Bank`` ``Ids`` mapped to an ``AssessmentTaken``.
arg: assessment_taken_id (osid.id.Id): ``Id`` of an
``AssessmentTaken``
return: (osid.id.IdList) - list of bank ``Ids``
raise: Not... | python | def get_bank_ids_by_assessment_taken(self, assessment_taken_id):
"""Gets the list of ``Bank`` ``Ids`` mapped to an ``AssessmentTaken``.
arg: assessment_taken_id (osid.id.Id): ``Id`` of an
``AssessmentTaken``
return: (osid.id.IdList) - list of bank ``Ids``
raise: Not... | [
"def",
"get_bank_ids_by_assessment_taken",
"(",
"self",
",",
"assessment_taken_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_bin_ids_by_resource",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'ASSESSMENT'",
",",
"local",
"=... | Gets the list of ``Bank`` ``Ids`` mapped to an ``AssessmentTaken``.
arg: assessment_taken_id (osid.id.Id): ``Id`` of an
``AssessmentTaken``
return: (osid.id.IdList) - list of bank ``Ids``
raise: NotFound - ``assessment_taken_id`` is not found
raise: NullArgument - ... | [
"Gets",
"the",
"list",
"of",
"Bank",
"Ids",
"mapped",
"to",
"an",
"AssessmentTaken",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7920-L7942 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenBankSession.get_banks_by_assessment_taken | def get_banks_by_assessment_taken(self, assessment_taken_id):
"""Gets the list of ``Banks`` mapped to an ``AssessmentTaken``.
arg: assessment_taken_id (osid.id.Id): ``Id`` of an
``AssessmentTaken``
return: (osid.assessment.BankList) - list of banks
raise: NotFound - ... | python | def get_banks_by_assessment_taken(self, assessment_taken_id):
"""Gets the list of ``Banks`` mapped to an ``AssessmentTaken``.
arg: assessment_taken_id (osid.id.Id): ``Id`` of an
``AssessmentTaken``
return: (osid.assessment.BankList) - list of banks
raise: NotFound - ... | [
"def",
"get_banks_by_assessment_taken",
"(",
"self",
",",
"assessment_taken_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_bins_by_resource",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'ASSESSMENT'",
",",
"local",
"=",
"... | Gets the list of ``Banks`` mapped to an ``AssessmentTaken``.
arg: assessment_taken_id (osid.id.Id): ``Id`` of an
``AssessmentTaken``
return: (osid.assessment.BankList) - list of banks
raise: NotFound - ``assessment_taken_id`` is not found
raise: NullArgument - ``ass... | [
"Gets",
"the",
"list",
"of",
"Banks",
"mapped",
"to",
"an",
"AssessmentTaken",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L7945-L7963 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenBankAssignmentSession.assign_assessment_taken_to_bank | def assign_assessment_taken_to_bank(self, assessment_taken_id, bank_id):
"""Adds an existing ``AssessmentTaken`` to a ``Bank``.
arg: assessment_taken_id (osid.id.Id): the ``Id`` of the
``AssessmentTaken``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise:... | python | def assign_assessment_taken_to_bank(self, assessment_taken_id, bank_id):
"""Adds an existing ``AssessmentTaken`` to a ``Bank``.
arg: assessment_taken_id (osid.id.Id): the ``Id`` of the
``AssessmentTaken``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise:... | [
"def",
"assign_assessment_taken_to_bank",
"(",
"self",
",",
"assessment_taken_id",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinAssignmentSession.assign_resource_to_bin",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'ASSESSME... | Adds an existing ``AssessmentTaken`` to a ``Bank``.
arg: assessment_taken_id (osid.id.Id): the ``Id`` of the
``AssessmentTaken``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise: AlreadyExists - ``assessment_taken_id`` is already
assigned to ``b... | [
"Adds",
"an",
"existing",
"AssessmentTaken",
"to",
"a",
"Bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L8073-L8095 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | AssessmentTakenBankAssignmentSession.unassign_assessment_taken_from_bank | def unassign_assessment_taken_from_bank(self, assessment_taken_id, bank_id):
"""Removes an ``AssessmentTaken`` from a ``Bank``.
arg: assessment_taken_id (osid.id.Id): the ``Id`` of the
``AssessmentTaken``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise:... | python | def unassign_assessment_taken_from_bank(self, assessment_taken_id, bank_id):
"""Removes an ``AssessmentTaken`` from a ``Bank``.
arg: assessment_taken_id (osid.id.Id): the ``Id`` of the
``AssessmentTaken``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise:... | [
"def",
"unassign_assessment_taken_from_bank",
"(",
"self",
",",
"assessment_taken_id",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinAssignmentSession.unassign_resource_from_bin",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'... | Removes an ``AssessmentTaken`` from a ``Bank``.
arg: assessment_taken_id (osid.id.Id): the ``Id`` of the
``AssessmentTaken``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise: NotFound - ``assessment_taken_id`` or ``bank_id`` not
found or ``asses... | [
"Removes",
"an",
"AssessmentTaken",
"from",
"a",
"Bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L8098-L8119 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankQuerySession.get_banks_by_query | def get_banks_by_query(self, bank_query):
"""Gets a list of ``Bank`` objects matching the given bank query.
arg: bank_query (osid.assessment.BankQuery): the bank query
return: (osid.assessment.BankList) - the returned ``BankList``
raise: NullArgument - ``bank_query`` is ``null``
... | python | def get_banks_by_query(self, bank_query):
"""Gets a list of ``Bank`` objects matching the given bank query.
arg: bank_query (osid.assessment.BankQuery): the bank query
return: (osid.assessment.BankList) - the returned ``BankList``
raise: NullArgument - ``bank_query`` is ``null``
... | [
"def",
"get_banks_by_query",
"(",
"self",
",",
"bank_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 ``Bank`` objects matching the given bank query.
arg: bank_query (osid.assessment.BankQuery): the bank query
return: (osid.assessment.BankList) - the returned ``BankList``
raise: NullArgument - ``bank_query`` is ``null``
raise: OperationFailed - unable to complete req... | [
"Gets",
"a",
"list",
"of",
"Bank",
"objects",
"matching",
"the",
"given",
"bank",
"query",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L8472-L8494 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankAdminSession.can_create_bank_with_record_types | def can_create_bank_with_record_types(self, bank_record_types):
"""Tests if this user can create a single ``Bank`` using the desired record types.
While ``AssessmentManager.getBankRecordTypes()`` can be used to
examine which records are supported, this method tests which
record(s) are r... | python | def can_create_bank_with_record_types(self, bank_record_types):
"""Tests if this user can create a single ``Bank`` using the desired record types.
While ``AssessmentManager.getBankRecordTypes()`` can be used to
examine which records are supported, this method tests which
record(s) are r... | [
"def",
"can_create_bank_with_record_types",
"(",
"self",
",",
"bank_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 a... | Tests if this user can create a single ``Bank`` using the desired record types.
While ``AssessmentManager.getBankRecordTypes()`` can be used to
examine which records are supported, this method tests which
record(s) are required for creating a specific ``Bank``.
Providing an empty array ... | [
"Tests",
"if",
"this",
"user",
"can",
"create",
"a",
"single",
"Bank",
"using",
"the",
"desired",
"record",
"types",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L8561-L8584 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankAdminSession.update_bank | def update_bank(self, bank_form):
"""Updates an existing bank.
arg: bank_form (osid.assessment.BankForm): the form
containing the elements to be updated
raise: IllegalState - ``bank_form`` already used in an update
transaction
raise: InvalidArgument ... | python | def update_bank(self, bank_form):
"""Updates an existing bank.
arg: bank_form (osid.assessment.BankForm): the form
containing the elements to be updated
raise: IllegalState - ``bank_form`` already used in an update
transaction
raise: InvalidArgument ... | [
"def",
"update_bank",
"(",
"self",
",",
"bank_form",
")",
":",
"# Implemented from template for",
"# osid.resource.BinAdminSession.update_bin_template",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_session",
".",
"upd... | Updates an existing bank.
arg: bank_form (osid.assessment.BankForm): the form
containing the elements to be updated
raise: IllegalState - ``bank_form`` already used in an update
transaction
raise: InvalidArgument - the form contains an invalid value
... | [
"Updates",
"an",
"existing",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L8726-L8765 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankAdminSession.alias_bank | def alias_bank(self, bank_id, alias_id):
"""Adds an ``Id`` to a ``Bank`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Bank`` is determined by the
provider. The new ``Id`` is an alias to the primary ``Id``. If
the alias is a pointer to another bank, it is reassi... | python | def alias_bank(self, bank_id, alias_id):
"""Adds an ``Id`` to a ``Bank`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Bank`` is determined by the
provider. The new ``Id`` is an alias to the primary ``Id``. If
the alias is a pointer to another bank, it is reassi... | [
"def",
"alias_bank",
"(",
"self",
",",
"bank_id",
",",
"alias_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinLookupSession.alias_bin_template",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_sessi... | Adds an ``Id`` to a ``Bank`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Bank`` is determined by the
provider. The new ``Id`` is an alias to the primary ``Id``. If
the alias is a pointer to another bank, it is reassigned to the
given bank ``Id``.
arg:... | [
"Adds",
"an",
"Id",
"to",
"a",
"Bank",
"for",
"the",
"purpose",
"of",
"creating",
"compatibility",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L8838-L8861 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchySession.get_root_banks | def get_root_banks(self):
"""Gets the root banks in this bank hierarchy.
return: (osid.assessment.BankList) - the root banks
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure occurred
*compliance: mandatory -- This method is mu... | python | def get_root_banks(self):
"""Gets the root banks in this bank hierarchy.
return: (osid.assessment.BankList) - the root banks
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure occurred
*compliance: mandatory -- This method is mu... | [
"def",
"get_root_banks",
"(",
"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 banks in this bank hierarchy.
return: (osid.assessment.BankList) - the root banks
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure occurred
*compliance: mandatory -- This method is must be implemented.* | [
"Gets",
"the",
"root",
"banks",
"in",
"this",
"bank",
"hierarchy",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9013-L9028 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchySession.has_parent_banks | def has_parent_banks(self, bank_id):
"""Tests if the ``Bank`` has any parents.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (boolean) - ``true`` if the bank has parents, ``false``
otherwise
raise: NotFound - ``bank_id`` is not found
raise: NullArgument -... | python | def has_parent_banks(self, bank_id):
"""Tests if the ``Bank`` has any parents.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (boolean) - ``true`` if the bank has parents, ``false``
otherwise
raise: NotFound - ``bank_id`` is not found
raise: NullArgument -... | [
"def",
"has_parent_banks",
"(",
"self",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.has_parent_bins",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_session",
".",
"... | Tests if the ``Bank`` has any parents.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (boolean) - ``true`` if the bank has parents, ``false``
otherwise
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
raise: Operati... | [
"Tests",
"if",
"the",
"Bank",
"has",
"any",
"parents",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9033-L9050 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchySession.is_parent_of_bank | def is_parent_of_bank(self, id_, bank_id):
"""Tests if an ``Id`` is a direct parent of a bank.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if this ``id`` is a parent of
``bank_id,`` ``false`` otherwi... | python | def is_parent_of_bank(self, id_, bank_id):
"""Tests if an ``Id`` is a direct parent of a bank.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if this ``id`` is a parent of
``bank_id,`` ``false`` otherwi... | [
"def",
"is_parent_of_bank",
"(",
"self",
",",
"id_",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.is_parent_of_bin",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_se... | Tests if an ``Id`` is a direct parent of a bank.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if this ``id`` is a parent of
``bank_id,`` ``false`` otherwise
raise: NotFound - ``bank_id`` is not found... | [
"Tests",
"if",
"an",
"Id",
"is",
"a",
"direct",
"parent",
"of",
"a",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9053-L9072 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchySession.get_parent_bank_ids | def get_parent_bank_ids(self, bank_id):
"""Gets the parent ``Ids`` of the given bank.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (osid.id.IdList) - the parent ``Ids`` of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... | python | def get_parent_bank_ids(self, bank_id):
"""Gets the parent ``Ids`` of the given bank.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (osid.id.IdList) - the parent ``Ids`` of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... | [
"def",
"get_parent_bank_ids",
"(",
"self",
",",
"bank_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 bank.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (osid.id.IdList) - the parent ``Ids`` of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
raise: OperationFailed - unable to complet... | [
"Gets",
"the",
"parent",
"Ids",
"of",
"the",
"given",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9075-L9091 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchySession.get_parent_banks | def get_parent_banks(self, bank_id):
"""Gets the parents of the given bank.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (osid.assessment.BankList) - the parents of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... | python | def get_parent_banks(self, bank_id):
"""Gets the parents of the given bank.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (osid.assessment.BankList) - the parents of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... | [
"def",
"get_parent_banks",
"(",
"self",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.get_parent_bins",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_session",
".",
"... | Gets the parents of the given bank.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (osid.assessment.BankList) - the parents of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
raise: OperationFailed - unable to complete re... | [
"Gets",
"the",
"parents",
"of",
"the",
"given",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9094-L9113 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchySession.is_ancestor_of_bank | def is_ancestor_of_bank(self, id_, bank_id):
"""Tests if an ``Id`` is an ancestor of a bank.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if this ``id`` is an ancestor of
``bank_id,`` ``false`` otherw... | python | def is_ancestor_of_bank(self, id_, bank_id):
"""Tests if an ``Id`` is an ancestor of a bank.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if this ``id`` is an ancestor of
``bank_id,`` ``false`` otherw... | [
"def",
"is_ancestor_of_bank",
"(",
"self",
",",
"id_",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.is_ancestor_of_bin",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalo... | Tests if an ``Id`` is an ancestor of a bank.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if this ``id`` is an ancestor of
``bank_id,`` ``false`` otherwise
raise: NotFound - ``bank_id`` is not found
... | [
"Tests",
"if",
"an",
"Id",
"is",
"an",
"ancestor",
"of",
"a",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9116-L9135 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchySession.has_child_banks | def has_child_banks(self, bank_id):
"""Tests if a bank has any children.
arg: bank_id (osid.id.Id): a ``bank_id``
return: (boolean) - ``true`` if the ``bank_id`` has children,
``false`` otherwise
raise: NotFound - ``bank_id`` is not found
raise: NullArgument... | python | def has_child_banks(self, bank_id):
"""Tests if a bank has any children.
arg: bank_id (osid.id.Id): a ``bank_id``
return: (boolean) - ``true`` if the ``bank_id`` has children,
``false`` otherwise
raise: NotFound - ``bank_id`` is not found
raise: NullArgument... | [
"def",
"has_child_banks",
"(",
"self",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.has_child_bins",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_session",
".",
"ha... | Tests if a bank has any children.
arg: bank_id (osid.id.Id): a ``bank_id``
return: (boolean) - ``true`` if the ``bank_id`` has children,
``false`` otherwise
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
raise: Oper... | [
"Tests",
"if",
"a",
"bank",
"has",
"any",
"children",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9138-L9155 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchySession.is_child_of_bank | def is_child_of_bank(self, id_, bank_id):
"""Tests if a bank is a direct child of another.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if the ``id`` is a child of
``bank_id,`` ``false`` otherwise
... | python | def is_child_of_bank(self, id_, bank_id):
"""Tests if a bank is a direct child of another.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if the ``id`` is a child of
``bank_id,`` ``false`` otherwise
... | [
"def",
"is_child_of_bank",
"(",
"self",
",",
"id_",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.is_child_of_bin",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_sess... | Tests if a bank is a direct child of another.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if the ``id`` is a child of
``bank_id,`` ``false`` otherwise
raise: NotFound - ``bank_id`` not found
... | [
"Tests",
"if",
"a",
"bank",
"is",
"a",
"direct",
"child",
"of",
"another",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9158-L9177 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchySession.get_child_bank_ids | def get_child_bank_ids(self, bank_id):
"""Gets the child ``Ids`` of the given bank.
arg: bank_id (osid.id.Id): the ``Id`` to query
return: (osid.id.IdList) - the children of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... | python | def get_child_bank_ids(self, bank_id):
"""Gets the child ``Ids`` of the given bank.
arg: bank_id (osid.id.Id): the ``Id`` to query
return: (osid.id.IdList) - the children of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... | [
"def",
"get_child_bank_ids",
"(",
"self",
",",
"bank_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 bank.
arg: bank_id (osid.id.Id): the ``Id`` to query
return: (osid.id.IdList) - the children of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
raise: OperationFailed - unable to complete... | [
"Gets",
"the",
"child",
"Ids",
"of",
"the",
"given",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9180-L9196 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchySession.get_child_banks | def get_child_banks(self, bank_id):
"""Gets the children of the given bank.
arg: bank_id (osid.id.Id): the ``Id`` to query
return: (osid.assessment.BankList) - the children of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... | python | def get_child_banks(self, bank_id):
"""Gets the children of the given bank.
arg: bank_id (osid.id.Id): the ``Id`` to query
return: (osid.assessment.BankList) - the children of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... | [
"def",
"get_child_banks",
"(",
"self",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.get_child_bins",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_session",
".",
"ge... | Gets the children of the given bank.
arg: bank_id (osid.id.Id): the ``Id`` to query
return: (osid.assessment.BankList) - the children of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
raise: OperationFailed - unable to com... | [
"Gets",
"the",
"children",
"of",
"the",
"given",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9199-L9218 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchySession.is_descendant_of_bank | def is_descendant_of_bank(self, id_, bank_id):
"""Tests if an ``Id`` is a descendant of a bank.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if the ``id`` is a descendant of
the ``bank_id,`` ``false``... | python | def is_descendant_of_bank(self, id_, bank_id):
"""Tests if an ``Id`` is a descendant of a bank.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if the ``id`` is a descendant of
the ``bank_id,`` ``false``... | [
"def",
"is_descendant_of_bank",
"(",
"self",
",",
"id_",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.is_descendant_of_bin",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_ca... | Tests if an ``Id`` is a descendant of a bank.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if the ``id`` is a descendant of
the ``bank_id,`` ``false`` otherwise
raise: NotFound - ``bank_id`` not foun... | [
"Tests",
"if",
"an",
"Id",
"is",
"a",
"descendant",
"of",
"a",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9221-L9240 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchySession.get_bank_nodes | def get_bank_nodes(self, bank_id, ancestor_levels, descendant_levels, include_siblings):
"""Gets a portion of the hierarchy for the given bank.
arg: bank_id (osid.id.Id): the ``Id`` to query
arg: ancestor_levels (cardinal): the maximum number of
ancestor levels to include.... | python | def get_bank_nodes(self, bank_id, ancestor_levels, descendant_levels, include_siblings):
"""Gets a portion of the hierarchy for the given bank.
arg: bank_id (osid.id.Id): the ``Id`` to query
arg: ancestor_levels (cardinal): the maximum number of
ancestor levels to include.... | [
"def",
"get_bank_nodes",
"(",
"self",
",",
"bank_id",
",",
"ancestor_levels",
",",
"descendant_levels",
",",
"include_siblings",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.get_bin_nodes",
"return",
"objects",
".",
"BankNode",
"(",
"sel... | Gets a portion of the hierarchy for the given bank.
arg: bank_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 (car... | [
"Gets",
"a",
"portion",
"of",
"the",
"hierarchy",
"for",
"the",
"given",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9279-L9306 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchyDesignSession.add_root_bank | def add_root_bank(self, bank_id):
"""Adds a root bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
raise: AlreadyExists - ``bank_id`` is already in hierarchy
raise: NotFound - ``bank_id`` not found
raise: NullArgument - ``bank_id`` is ``null``
raise: Operation... | python | def add_root_bank(self, bank_id):
"""Adds a root bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
raise: AlreadyExists - ``bank_id`` is already in hierarchy
raise: NotFound - ``bank_id`` not found
raise: NullArgument - ``bank_id`` is ``null``
raise: Operation... | [
"def",
"add_root_bank",
"(",
"self",
",",
"bank_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 bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
raise: AlreadyExists - ``bank_id`` is already in hierarchy
raise: NotFound - ``bank_id`` not found
raise: NullArgument - ``bank_id`` is ``null``
raise: OperationFailed - unable to complete request
r... | [
"Adds",
"a",
"root",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9391-L9407 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchyDesignSession.remove_root_bank | def remove_root_bank(self, bank_id):
"""Removes a root bank from this hierarchy.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
raise: NotFound - ``bank_id`` not a parent of ``child_id``
raise: NullArgument - ``bank_id`` or ``child_id`` is ``null``
raise: OperationFailed ... | python | def remove_root_bank(self, bank_id):
"""Removes a root bank from this hierarchy.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
raise: NotFound - ``bank_id`` not a parent of ``child_id``
raise: NullArgument - ``bank_id`` or ``child_id`` is ``null``
raise: OperationFailed ... | [
"def",
"remove_root_bank",
"(",
"self",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchyDesignSession.remove_root_bin_template",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_sessi... | Removes a root bank from this hierarchy.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
raise: NotFound - ``bank_id`` not a parent of ``child_id``
raise: NullArgument - ``bank_id`` or ``child_id`` is ``null``
raise: OperationFailed - unable to complete request
raise: Per... | [
"Removes",
"a",
"root",
"bank",
"from",
"this",
"hierarchy",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9410-L9425 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchyDesignSession.add_child_bank | def add_child_bank(self, bank_id, child_id):
"""Adds a child to a bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: AlreadyExists - ``bank_id`` is already a parent of
``child_id``
raise: N... | python | def add_child_bank(self, bank_id, child_id):
"""Adds a child to a bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: AlreadyExists - ``bank_id`` is already a parent of
``child_id``
raise: N... | [
"def",
"add_child_bank",
"(",
"self",
",",
"bank_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 bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: AlreadyExists - ``bank_id`` is already a parent of
``child_id``
raise: NotFound - ``bank_id`` or ``child_id`` not found
... | [
"Adds",
"a",
"child",
"to",
"a",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9428-L9446 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchyDesignSession.remove_child_bank | def remove_child_bank(self, bank_id, child_id):
"""Removes a child from a bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: NotFound - ``bank_id`` not parent of ``child_id``
raise: NullArgument - ``bank_i... | python | def remove_child_bank(self, bank_id, child_id):
"""Removes a child from a bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: NotFound - ``bank_id`` not parent of ``child_id``
raise: NullArgument - ``bank_i... | [
"def",
"remove_child_bank",
"(",
"self",
",",
"bank_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 bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: NotFound - ``bank_id`` not parent of ``child_id``
raise: NullArgument - ``bank_id`` or ``child_id`` is ``null``
raise: OperationFa... | [
"Removes",
"a",
"child",
"from",
"a",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9449-L9465 |
mitsei/dlkit | dlkit/json_/assessment/sessions.py | BankHierarchyDesignSession.remove_child_banks | def remove_child_banks(self, bank_id):
"""Removes all children from a bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
raise: NotFound - ``bank_id`` is not in hierarchy
raise: NullArgument - ``bank_id`` is ``null``
raise: OperationFailed - unable to complete request
... | python | def remove_child_banks(self, bank_id):
"""Removes all children from a bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
raise: NotFound - ``bank_id`` is not in hierarchy
raise: NullArgument - ``bank_id`` is ``null``
raise: OperationFailed - unable to complete request
... | [
"def",
"remove_child_banks",
"(",
"self",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchyDesignSession.remove_child_bin_template",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_se... | Removes all children from a bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
raise: NotFound - ``bank_id`` is not in hierarchy
raise: NullArgument - ``bank_id`` is ``null``
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization fa... | [
"Removes",
"all",
"children",
"from",
"a",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/sessions.py#L9468-L9483 |
delfick/harpoon | harpoon/layers.py | Layers.layered | def layered(self):
"""Yield list of [[(name, image), ...], [(name, image), ...], ...]"""
result = []
for layer in self._layered:
nxt = []
for name in layer:
nxt.append((name, self.all_images[name]))
result.append(nxt)
return result | python | def layered(self):
"""Yield list of [[(name, image), ...], [(name, image), ...], ...]"""
result = []
for layer in self._layered:
nxt = []
for name in layer:
nxt.append((name, self.all_images[name]))
result.append(nxt)
return result | [
"def",
"layered",
"(",
"self",
")",
":",
"result",
"=",
"[",
"]",
"for",
"layer",
"in",
"self",
".",
"_layered",
":",
"nxt",
"=",
"[",
"]",
"for",
"name",
"in",
"layer",
":",
"nxt",
".",
"append",
"(",
"(",
"name",
",",
"self",
".",
"all_images",... | Yield list of [[(name, image), ...], [(name, image), ...], ...] | [
"Yield",
"list",
"of",
"[[",
"(",
"name",
"image",
")",
"...",
"]",
"[",
"(",
"name",
"image",
")",
"...",
"]",
"...",
"]"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/layers.py#L36-L44 |
immstudios/nxtools | nxtools/misc.py | unaccent | def unaccent(string, encoding="utf-8"):
"""not just unaccent, but full to-ascii transliteration"""
string = to_unicode(string)
if has_unidecode:
return unidecode.unidecode(string)
if PYTHON_VERSION < 3:
if type(string) == str:
string = unicode(string, encoding)
nfkd_f... | python | def unaccent(string, encoding="utf-8"):
"""not just unaccent, but full to-ascii transliteration"""
string = to_unicode(string)
if has_unidecode:
return unidecode.unidecode(string)
if PYTHON_VERSION < 3:
if type(string) == str:
string = unicode(string, encoding)
nfkd_f... | [
"def",
"unaccent",
"(",
"string",
",",
"encoding",
"=",
"\"utf-8\"",
")",
":",
"string",
"=",
"to_unicode",
"(",
"string",
")",
"if",
"has_unidecode",
":",
"return",
"unidecode",
".",
"unidecode",
"(",
"string",
")",
"if",
"PYTHON_VERSION",
"<",
"3",
":",
... | not just unaccent, but full to-ascii transliteration | [
"not",
"just",
"unaccent",
"but",
"full",
"to",
"-",
"ascii",
"transliteration"
] | train | https://github.com/immstudios/nxtools/blob/8c30213c61aec460c648d5e9ae7ce79dfb7b4b9a/nxtools/misc.py#L70-L81 |
jason-weirather/py-seq-tools | seqtools/cli/utilities/lr_to_transcriptome.py | main | def main(args):
"""Read any reference transcriptome we can"""
txome = Transcriptome()
#read the reference gpd if one is gven
if args.reference:
rinf = None
if re.search('\.gz$',args.reference):
rinf = gzip.open(args.reference)
else:
rinf = open(args.reference)
sys.... | python | def main(args):
"""Read any reference transcriptome we can"""
txome = Transcriptome()
#read the reference gpd if one is gven
if args.reference:
rinf = None
if re.search('\.gz$',args.reference):
rinf = gzip.open(args.reference)
else:
rinf = open(args.reference)
sys.... | [
"def",
"main",
"(",
"args",
")",
":",
"txome",
"=",
"Transcriptome",
"(",
")",
"#read the reference gpd if one is gven",
"if",
"args",
".",
"reference",
":",
"rinf",
"=",
"None",
"if",
"re",
".",
"search",
"(",
"'\\.gz$'",
",",
"args",
".",
"reference",
")... | Read any reference transcriptome we can | [
"Read",
"any",
"reference",
"transcriptome",
"we",
"can"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/cli/utilities/lr_to_transcriptome.py#L19-L127 |
jason-weirather/py-seq-tools | seqtools/cli/utilities/lr_to_transcriptome.py | annotated_reads | def annotated_reads(txome,sorted_read_stream,output,args):
if not os.path.exists(args.tempdir+'/'+output):
os.makedirs(args.tempdir+'/'+output)
ts = OrderedStream(iter(txome.transcript_stream()))
rs = OrderedStream(GPDStream(sorted_read_stream))
mls = MultiLocusStream([ts,rs])
aof = gzip.open(a... | python | def annotated_reads(txome,sorted_read_stream,output,args):
if not os.path.exists(args.tempdir+'/'+output):
os.makedirs(args.tempdir+'/'+output)
ts = OrderedStream(iter(txome.transcript_stream()))
rs = OrderedStream(GPDStream(sorted_read_stream))
mls = MultiLocusStream([ts,rs])
aof = gzip.open(a... | [
"def",
"annotated_reads",
"(",
"txome",
",",
"sorted_read_stream",
",",
"output",
",",
"args",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"args",
".",
"tempdir",
"+",
"'/'",
"+",
"output",
")",
":",
"os",
".",
"makedirs",
"(",
"arg... | Sort our progress | [
"Sort",
"our",
"progress"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/cli/utilities/lr_to_transcriptome.py#L130-L267 |
tommyod/streprogen | streprogen/exercises.py | DynamicExercise.weekly_growth | def weekly_growth(self, weeks):
"""Calculate the weekly growth in percentage, and rounds
to one digit.
Parameters
----------
weeks
Number of weeks to calculate growth over.
Returns
-------
growth_factor
A real number such that... | python | def weekly_growth(self, weeks):
"""Calculate the weekly growth in percentage, and rounds
to one digit.
Parameters
----------
weeks
Number of weeks to calculate growth over.
Returns
-------
growth_factor
A real number such that... | [
"def",
"weekly_growth",
"(",
"self",
",",
"weeks",
")",
":",
"start",
",",
"end",
"=",
"self",
".",
"start_weight",
",",
"self",
".",
"final_weight",
"growth_factor",
"=",
"(",
"(",
"end",
"/",
"start",
")",
"**",
"(",
"1",
"/",
"weeks",
")",
"-",
... | Calculate the weekly growth in percentage, and rounds
to one digit.
Parameters
----------
weeks
Number of weeks to calculate growth over.
Returns
-------
growth_factor
A real number such that start * growth_factor** weeks = end.
... | [
"Calculate",
"the",
"weekly",
"growth",
"in",
"percentage",
"and",
"rounds",
"to",
"one",
"digit",
".",
"Parameters",
"----------",
"weeks",
"Number",
"of",
"weeks",
"to",
"calculate",
"growth",
"over",
"."
] | train | https://github.com/tommyod/streprogen/blob/21b903618e8b2d398bceb394d18d7c74ca984def/streprogen/exercises.py#L85-L110 |
mitsei/dlkit | dlkit/services/relationship.py | RelationshipManager._set_family_view | def _set_family_view(self, session):
"""Sets the underlying family view to match current view"""
if self._family_view == COMPARATIVE:
try:
session.use_comparative_family_view()
except AttributeError:
pass
else:
try:
... | python | def _set_family_view(self, session):
"""Sets the underlying family view to match current view"""
if self._family_view == COMPARATIVE:
try:
session.use_comparative_family_view()
except AttributeError:
pass
else:
try:
... | [
"def",
"_set_family_view",
"(",
"self",
",",
"session",
")",
":",
"if",
"self",
".",
"_family_view",
"==",
"COMPARATIVE",
":",
"try",
":",
"session",
".",
"use_comparative_family_view",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"else",
":",
"try",
"... | Sets the underlying family view to match current view | [
"Sets",
"the",
"underlying",
"family",
"view",
"to",
"match",
"current",
"view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L128-L139 |
mitsei/dlkit | dlkit/services/relationship.py | RelationshipManager.use_comparative_family_view | def use_comparative_family_view(self):
"""Pass through to provider FamilyLookupSession.use_comparative_family_view"""
self._family_view = COMPARATIVE
# self._get_provider_session('family_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions():
... | python | def use_comparative_family_view(self):
"""Pass through to provider FamilyLookupSession.use_comparative_family_view"""
self._family_view = COMPARATIVE
# self._get_provider_session('family_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions():
... | [
"def",
"use_comparative_family_view",
"(",
"self",
")",
":",
"self",
".",
"_family_view",
"=",
"COMPARATIVE",
"# self._get_provider_session('family_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",
"(",
")",
... | Pass through to provider FamilyLookupSession.use_comparative_family_view | [
"Pass",
"through",
"to",
"provider",
"FamilyLookupSession",
".",
"use_comparative_family_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L334-L342 |
mitsei/dlkit | dlkit/services/relationship.py | RelationshipManager.use_plenary_family_view | def use_plenary_family_view(self):
"""Pass through to provider FamilyLookupSession.use_plenary_family_view"""
self._family_view = PLENARY
# self._get_provider_session('family_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions():
... | python | def use_plenary_family_view(self):
"""Pass through to provider FamilyLookupSession.use_plenary_family_view"""
self._family_view = PLENARY
# self._get_provider_session('family_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions():
... | [
"def",
"use_plenary_family_view",
"(",
"self",
")",
":",
"self",
".",
"_family_view",
"=",
"PLENARY",
"# self._get_provider_session('family_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",
"(",
")",
":",
... | Pass through to provider FamilyLookupSession.use_plenary_family_view | [
"Pass",
"through",
"to",
"provider",
"FamilyLookupSession",
".",
"use_plenary_family_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L344-L352 |
mitsei/dlkit | dlkit/services/relationship.py | RelationshipManager.get_families_by_ids | def get_families_by_ids(self, *args, **kwargs):
"""Pass through to provider FamilyLookupSession.get_families_by_ids"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_by_ids
catalogs = self._get_provider_session('family_lookup_session').get_families_by... | python | def get_families_by_ids(self, *args, **kwargs):
"""Pass through to provider FamilyLookupSession.get_families_by_ids"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_by_ids
catalogs = self._get_provider_session('family_lookup_session').get_families_by... | [
"def",
"get_families_by_ids",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinLookupSession.get_bins_by_ids",
"catalogs",
"=",
"self",
".",
"_get_provider_session",
"(",
"'family_lookup_sessi... | Pass through to provider FamilyLookupSession.get_families_by_ids | [
"Pass",
"through",
"to",
"provider",
"FamilyLookupSession",
".",
"get_families_by_ids"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L364-L372 |
mitsei/dlkit | dlkit/services/relationship.py | RelationshipManager.get_families | def get_families(self):
"""Pass through to provider FamilyLookupSession.get_families"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_template
catalogs = self._get_provider_session('family_lookup_session').get_families()
cat_list = []
... | python | def get_families(self):
"""Pass through to provider FamilyLookupSession.get_families"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_template
catalogs = self._get_provider_session('family_lookup_session').get_families()
cat_list = []
... | [
"def",
"get_families",
"(",
"self",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinLookupSession.get_bins_template",
"catalogs",
"=",
"self",
".",
"_get_provider_session",
"(",
"'family_lookup_session'",
")",
".",
"get_families",
"(",
")",
"cat_lis... | Pass through to provider FamilyLookupSession.get_families | [
"Pass",
"through",
"to",
"provider",
"FamilyLookupSession",
".",
"get_families"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L414-L422 |
mitsei/dlkit | dlkit/services/relationship.py | RelationshipManager.get_family_form | def get_family_form(self, *args, **kwargs):
"""Pass through to provider FamilyAdminSession.get_family_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.get_bin_form_for_update_template
# This method might be a bit sketchy. Time will tell.
... | python | def get_family_form(self, *args, **kwargs):
"""Pass through to provider FamilyAdminSession.get_family_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.get_bin_form_for_update_template
# This method might be a bit sketchy. Time will tell.
... | [
"def",
"get_family_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",
"isinstance",
... | Pass through to provider FamilyAdminSession.get_family_form_for_update | [
"Pass",
"through",
"to",
"provider",
"FamilyAdminSession",
".",
"get_family_form_for_update"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L468-L476 |
mitsei/dlkit | dlkit/services/relationship.py | RelationshipManager.update_family | def update_family(self, *args, **kwargs):
"""Pass through to provider FamilyAdminSession.update_family"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
# OSID spec does not require returning updated catalog
return Family(
self._p... | python | def update_family(self, *args, **kwargs):
"""Pass through to provider FamilyAdminSession.update_family"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
# OSID spec does not require returning updated catalog
return Family(
self._p... | [
"def",
"update_family",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinAdminSession.update_bin",
"# OSID spec does not require returning updated catalog",
"return",
"Family",
"(",
"self",
".",... | Pass through to provider FamilyAdminSession.update_family | [
"Pass",
"through",
"to",
"provider",
"FamilyAdminSession",
".",
"update_family"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L478-L487 |
mitsei/dlkit | dlkit/services/relationship.py | RelationshipManager.save_family | def save_family(self, family_form, *args, **kwargs):
"""Pass through to provider FamilyAdminSession.update_family"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
if family_form.is_for_update():
return self.update_family(family_form, *ar... | python | def save_family(self, family_form, *args, **kwargs):
"""Pass through to provider FamilyAdminSession.update_family"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
if family_form.is_for_update():
return self.update_family(family_form, *ar... | [
"def",
"save_family",
"(",
"self",
",",
"family_form",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinAdminSession.update_bin",
"if",
"family_form",
".",
"is_for_update",
"(",
")",
":",
"return",
... | Pass through to provider FamilyAdminSession.update_family | [
"Pass",
"through",
"to",
"provider",
"FamilyAdminSession",
".",
"update_family"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L489-L496 |
mitsei/dlkit | dlkit/services/relationship.py | Family._set_family_view | def _set_family_view(self, session):
"""Sets the underlying family view to match current view"""
if self._family_view == FEDERATED:
try:
session.use_federated_family_view()
except AttributeError:
pass
else:
try:
... | python | def _set_family_view(self, session):
"""Sets the underlying family view to match current view"""
if self._family_view == FEDERATED:
try:
session.use_federated_family_view()
except AttributeError:
pass
else:
try:
... | [
"def",
"_set_family_view",
"(",
"self",
",",
"session",
")",
":",
"if",
"self",
".",
"_family_view",
"==",
"FEDERATED",
":",
"try",
":",
"session",
".",
"use_federated_family_view",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"else",
":",
"try",
":",
... | Sets the underlying family view to match current view | [
"Sets",
"the",
"underlying",
"family",
"view",
"to",
"match",
"current",
"view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L770-L781 |
mitsei/dlkit | dlkit/services/relationship.py | Family._get_provider_session | def _get_provider_session(self, session_name):
"""Returns the requested provider session.
Instantiates a new one if the named session is not already known.
"""
agent_key = self._get_agent_key()
if session_name in self._provider_sessions[agent_key]:
return self._prov... | python | def _get_provider_session(self, session_name):
"""Returns the requested provider session.
Instantiates a new one if the named session is not already known.
"""
agent_key = self._get_agent_key()
if session_name in self._provider_sessions[agent_key]:
return self._prov... | [
"def",
"_get_provider_session",
"(",
"self",
",",
"session_name",
")",
":",
"agent_key",
"=",
"self",
".",
"_get_agent_key",
"(",
")",
"if",
"session_name",
"in",
"self",
".",
"_provider_sessions",
"[",
"agent_key",
"]",
":",
"return",
"self",
".",
"_provider_... | Returns the requested provider session.
Instantiates a new one if the named session is not already known. | [
"Returns",
"the",
"requested",
"provider",
"session",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L825-L854 |
mitsei/dlkit | dlkit/services/relationship.py | Family.use_comparative_relationship_view | def use_comparative_relationship_view(self):
"""Pass through to provider RelationshipLookupSession.use_comparative_relationship_view"""
self._object_views['relationship'] = COMPARATIVE
# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
for s... | python | def use_comparative_relationship_view(self):
"""Pass through to provider RelationshipLookupSession.use_comparative_relationship_view"""
self._object_views['relationship'] = COMPARATIVE
# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
for s... | [
"def",
"use_comparative_relationship_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'relationship'",
"]",
"=",
"COMPARATIVE",
"# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
... | Pass through to provider RelationshipLookupSession.use_comparative_relationship_view | [
"Pass",
"through",
"to",
"provider",
"RelationshipLookupSession",
".",
"use_comparative_relationship_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L905-L913 |
mitsei/dlkit | dlkit/services/relationship.py | Family.use_plenary_relationship_view | def use_plenary_relationship_view(self):
"""Pass through to provider RelationshipLookupSession.use_plenary_relationship_view"""
self._object_views['relationship'] = PLENARY
# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
for session in se... | python | def use_plenary_relationship_view(self):
"""Pass through to provider RelationshipLookupSession.use_plenary_relationship_view"""
self._object_views['relationship'] = PLENARY
# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
for session in se... | [
"def",
"use_plenary_relationship_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'relationship'",
"]",
"=",
"PLENARY",
"# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"... | Pass through to provider RelationshipLookupSession.use_plenary_relationship_view | [
"Pass",
"through",
"to",
"provider",
"RelationshipLookupSession",
".",
"use_plenary_relationship_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L915-L923 |
mitsei/dlkit | dlkit/services/relationship.py | Family.use_federated_family_view | def use_federated_family_view(self):
"""Pass through to provider RelationshipLookupSession.use_federated_family_view"""
self._family_view = FEDERATED
# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessio... | python | def use_federated_family_view(self):
"""Pass through to provider RelationshipLookupSession.use_federated_family_view"""
self._family_view = FEDERATED
# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessio... | [
"def",
"use_federated_family_view",
"(",
"self",
")",
":",
"self",
".",
"_family_view",
"=",
"FEDERATED",
"# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",
"(",
")"... | Pass through to provider RelationshipLookupSession.use_federated_family_view | [
"Pass",
"through",
"to",
"provider",
"RelationshipLookupSession",
".",
"use_federated_family_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L925-L933 |
mitsei/dlkit | dlkit/services/relationship.py | Family.use_isolated_family_view | def use_isolated_family_view(self):
"""Pass through to provider RelationshipLookupSession.use_isolated_family_view"""
self._family_view = ISOLATED
# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions(... | python | def use_isolated_family_view(self):
"""Pass through to provider RelationshipLookupSession.use_isolated_family_view"""
self._family_view = ISOLATED
# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions(... | [
"def",
"use_isolated_family_view",
"(",
"self",
")",
":",
"self",
".",
"_family_view",
"=",
"ISOLATED",
"# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",
"(",
")",
... | Pass through to provider RelationshipLookupSession.use_isolated_family_view | [
"Pass",
"through",
"to",
"provider",
"RelationshipLookupSession",
".",
"use_isolated_family_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L935-L943 |
mitsei/dlkit | dlkit/services/relationship.py | Family.get_relationship_form | def get_relationship_form(self, *args, **kwargs):
"""Pass through to provider RelationshipAdminSession.get_relationship_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit sketchy. Tim... | python | def get_relationship_form(self, *args, **kwargs):
"""Pass through to provider RelationshipAdminSession.get_relationship_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit sketchy. Tim... | [
"def",
"get_relationship_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",
"isinst... | Pass through to provider RelationshipAdminSession.get_relationship_form_for_update | [
"Pass",
"through",
"to",
"provider",
"RelationshipAdminSession",
".",
"get_relationship_form_for_update"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L1107-L1115 |
mitsei/dlkit | dlkit/services/relationship.py | Family.save_relationship | def save_relationship(self, relationship_form, *args, **kwargs):
"""Pass through to provider RelationshipAdminSession.update_relationship"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if relationship_form.is_for_update():
re... | python | def save_relationship(self, relationship_form, *args, **kwargs):
"""Pass through to provider RelationshipAdminSession.update_relationship"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if relationship_form.is_for_update():
re... | [
"def",
"save_relationship",
"(",
"self",
",",
"relationship_form",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.ResourceAdminSession.update_resource",
"if",
"relationship_form",
".",
"is_for_update",
"(",... | Pass through to provider RelationshipAdminSession.update_relationship | [
"Pass",
"through",
"to",
"provider",
"RelationshipAdminSession",
".",
"update_relationship"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/relationship.py#L1129-L1136 |
peopledoc/django-agnocomplete | agnocomplete/views.py | get_error | def get_error(exc):
"""
Return the appropriate HTTP status code according to the Exception/Error.
"""
if isinstance(exc, HTTPError):
# Returning the HTTP Error code coming from requests module
return exc.response.status_code, text(exc.response.content)
if isinstance(exc, Timeout):
... | python | def get_error(exc):
"""
Return the appropriate HTTP status code according to the Exception/Error.
"""
if isinstance(exc, HTTPError):
# Returning the HTTP Error code coming from requests module
return exc.response.status_code, text(exc.response.content)
if isinstance(exc, Timeout):
... | [
"def",
"get_error",
"(",
"exc",
")",
":",
"if",
"isinstance",
"(",
"exc",
",",
"HTTPError",
")",
":",
"# Returning the HTTP Error code coming from requests module",
"return",
"exc",
".",
"response",
".",
"status_code",
",",
"text",
"(",
"exc",
".",
"response",
"... | Return the appropriate HTTP status code according to the Exception/Error. | [
"Return",
"the",
"appropriate",
"HTTP",
"status",
"code",
"according",
"to",
"the",
"Exception",
"/",
"Error",
"."
] | train | https://github.com/peopledoc/django-agnocomplete/blob/9bf21db2f2036ba5059b843acd32902a09192053/agnocomplete/views.py#L20-L46 |
peopledoc/django-agnocomplete | agnocomplete/views.py | UserContextFormViewMixin.get_form_kwargs | def get_form_kwargs(self):
"""
Return the form kwargs.
This method injects the context variable, defined in
:meth:`get_agnocomplete_context`. Override this method to adjust it to
your needs.
"""
data = super(UserContextFormViewMixin, self).get_form_kwargs()
... | python | def get_form_kwargs(self):
"""
Return the form kwargs.
This method injects the context variable, defined in
:meth:`get_agnocomplete_context`. Override this method to adjust it to
your needs.
"""
data = super(UserContextFormViewMixin, self).get_form_kwargs()
... | [
"def",
"get_form_kwargs",
"(",
"self",
")",
":",
"data",
"=",
"super",
"(",
"UserContextFormViewMixin",
",",
"self",
")",
".",
"get_form_kwargs",
"(",
")",
"data",
".",
"update",
"(",
"{",
"'user'",
":",
"self",
".",
"get_agnocomplete_context",
"(",
")",
"... | Return the form kwargs.
This method injects the context variable, defined in
:meth:`get_agnocomplete_context`. Override this method to adjust it to
your needs. | [
"Return",
"the",
"form",
"kwargs",
"."
] | train | https://github.com/peopledoc/django-agnocomplete/blob/9bf21db2f2036ba5059b843acd32902a09192053/agnocomplete/views.py#L122-L134 |
peopledoc/django-agnocomplete | agnocomplete/views.py | AgnocompleteView.get_klass | def get_klass(self):
"""
Return the agnocomplete class to be used with the eventual query.
"""
# Extract the klass name from the URL arguments
klass_name = self.kwargs.get('klass', None)
klass = self.registry.get(klass_name, None)
if not klass:
raise H... | python | def get_klass(self):
"""
Return the agnocomplete class to be used with the eventual query.
"""
# Extract the klass name from the URL arguments
klass_name = self.kwargs.get('klass', None)
klass = self.registry.get(klass_name, None)
if not klass:
raise H... | [
"def",
"get_klass",
"(",
"self",
")",
":",
"# Extract the klass name from the URL arguments",
"klass_name",
"=",
"self",
".",
"kwargs",
".",
"get",
"(",
"'klass'",
",",
"None",
")",
"klass",
"=",
"self",
".",
"registry",
".",
"get",
"(",
"klass_name",
",",
"... | Return the agnocomplete class to be used with the eventual query. | [
"Return",
"the",
"agnocomplete",
"class",
"to",
"be",
"used",
"with",
"the",
"eventual",
"query",
"."
] | train | https://github.com/peopledoc/django-agnocomplete/blob/9bf21db2f2036ba5059b843acd32902a09192053/agnocomplete/views.py#L187-L196 |
juju/juju-bundlelib | jujubundlelib/models.py | parse_v3_unit_placement | def parse_v3_unit_placement(placement_str):
"""Return a UnitPlacement for bundles version 3, given a placement string.
See https://github.com/juju/charmstore/blob/v4/docs/bundles.md
Raise a ValueError if the placement is not valid.
"""
placement = placement_str
container = machine = service = u... | python | def parse_v3_unit_placement(placement_str):
"""Return a UnitPlacement for bundles version 3, given a placement string.
See https://github.com/juju/charmstore/blob/v4/docs/bundles.md
Raise a ValueError if the placement is not valid.
"""
placement = placement_str
container = machine = service = u... | [
"def",
"parse_v3_unit_placement",
"(",
"placement_str",
")",
":",
"placement",
"=",
"placement_str",
"container",
"=",
"machine",
"=",
"service",
"=",
"unit",
"=",
"''",
"if",
"':'",
"in",
"placement",
":",
"try",
":",
"container",
",",
"placement",
"=",
"pl... | Return a UnitPlacement for bundles version 3, given a placement string.
See https://github.com/juju/charmstore/blob/v4/docs/bundles.md
Raise a ValueError if the placement is not valid. | [
"Return",
"a",
"UnitPlacement",
"for",
"bundles",
"version",
"3",
"given",
"a",
"placement",
"string",
"."
] | train | https://github.com/juju/juju-bundlelib/blob/c2efa614f53675ed9526027776448bfbb0454ca6/jujubundlelib/models.py#L30-L64 |
juju/juju-bundlelib | jujubundlelib/models.py | parse_v4_unit_placement | def parse_v4_unit_placement(placement_str):
"""Return a UnitPlacement for bundles version 4, given a placement string.
See https://github.com/juju/charmstore/blob/v4/docs/bundles.md
Raise a ValueError if the placement is not valid.
"""
placement = placement_str
container = machine = service = u... | python | def parse_v4_unit_placement(placement_str):
"""Return a UnitPlacement for bundles version 4, given a placement string.
See https://github.com/juju/charmstore/blob/v4/docs/bundles.md
Raise a ValueError if the placement is not valid.
"""
placement = placement_str
container = machine = service = u... | [
"def",
"parse_v4_unit_placement",
"(",
"placement_str",
")",
":",
"placement",
"=",
"placement_str",
"container",
"=",
"machine",
"=",
"service",
"=",
"unit",
"=",
"''",
"if",
"':'",
"in",
"placement",
":",
"try",
":",
"container",
",",
"placement",
"=",
"pl... | Return a UnitPlacement for bundles version 4, given a placement string.
See https://github.com/juju/charmstore/blob/v4/docs/bundles.md
Raise a ValueError if the placement is not valid. | [
"Return",
"a",
"UnitPlacement",
"for",
"bundles",
"version",
"4",
"given",
"a",
"placement",
"string",
"."
] | train | https://github.com/juju/juju-bundlelib/blob/c2efa614f53675ed9526027776448bfbb0454ca6/jujubundlelib/models.py#L67-L98 |
juju/juju-bundlelib | jujubundlelib/models.py | _parse_unit | def _parse_unit(unit, placement_str):
"""Parse a unit as part of the unit placement.
Return the unit as an integer or None.
Raise a ValueError if the unit is specified but it is not a digit.
"""
if not unit:
return None
try:
return int(unit)
except (TypeError, ValueError):
... | python | def _parse_unit(unit, placement_str):
"""Parse a unit as part of the unit placement.
Return the unit as an integer or None.
Raise a ValueError if the unit is specified but it is not a digit.
"""
if not unit:
return None
try:
return int(unit)
except (TypeError, ValueError):
... | [
"def",
"_parse_unit",
"(",
"unit",
",",
"placement_str",
")",
":",
"if",
"not",
"unit",
":",
"return",
"None",
"try",
":",
"return",
"int",
"(",
"unit",
")",
"except",
"(",
"TypeError",
",",
"ValueError",
")",
":",
"msg",
"=",
"'unit in placement {} must b... | Parse a unit as part of the unit placement.
Return the unit as an integer or None.
Raise a ValueError if the unit is specified but it is not a digit. | [
"Parse",
"a",
"unit",
"as",
"part",
"of",
"the",
"unit",
"placement",
"."
] | train | https://github.com/juju/juju-bundlelib/blob/c2efa614f53675ed9526027776448bfbb0454ca6/jujubundlelib/models.py#L101-L113 |
askovpen/discord_simple | discord_simple/transport.py | Transport.get | def get(self, endpoint):
""" Todo """
r = self.http.request('GET',
self._api_base.format(endpoint),
headers={'Authorization': 'Bot '+self.token})
if r.status == 200:
return json.loads(r.data.decode('utf-8'))
else:
return {} | python | def get(self, endpoint):
""" Todo """
r = self.http.request('GET',
self._api_base.format(endpoint),
headers={'Authorization': 'Bot '+self.token})
if r.status == 200:
return json.loads(r.data.decode('utf-8'))
else:
return {} | [
"def",
"get",
"(",
"self",
",",
"endpoint",
")",
":",
"r",
"=",
"self",
".",
"http",
".",
"request",
"(",
"'GET'",
",",
"self",
".",
"_api_base",
".",
"format",
"(",
"endpoint",
")",
",",
"headers",
"=",
"{",
"'Authorization'",
":",
"'Bot '",
"+",
... | Todo | [
"Todo"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/transport.py#L46-L54 |
askovpen/discord_simple | discord_simple/transport.py | Transport.post | def post(self, endpoint, message):
""" Todo """
r = self.http.request('POST',
self._api_base.format(endpoint),
headers={'Content-Type': 'application/json',
'Authorization': 'Bot '+self.token},
body=m... | python | def post(self, endpoint, message):
""" Todo """
r = self.http.request('POST',
self._api_base.format(endpoint),
headers={'Content-Type': 'application/json',
'Authorization': 'Bot '+self.token},
body=m... | [
"def",
"post",
"(",
"self",
",",
"endpoint",
",",
"message",
")",
":",
"r",
"=",
"self",
".",
"http",
".",
"request",
"(",
"'POST'",
",",
"self",
".",
"_api_base",
".",
"format",
"(",
"endpoint",
")",
",",
"headers",
"=",
"{",
"'Content-Type'",
":",
... | Todo | [
"Todo"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/transport.py#L56-L62 |
askovpen/discord_simple | discord_simple/transport.py | Transport.connect | def connect(self):
""" Todo """
r = self.get('gateway')
self.ws = websocket.WebSocketApp(r["url"]+"/?encoding=json&v=6",
on_message=self.on_message,
on_error=self.on_error,
on_close=self.on_close)
... | python | def connect(self):
""" Todo """
r = self.get('gateway')
self.ws = websocket.WebSocketApp(r["url"]+"/?encoding=json&v=6",
on_message=self.on_message,
on_error=self.on_error,
on_close=self.on_close)
... | [
"def",
"connect",
"(",
"self",
")",
":",
"r",
"=",
"self",
".",
"get",
"(",
"'gateway'",
")",
"self",
".",
"ws",
"=",
"websocket",
".",
"WebSocketApp",
"(",
"r",
"[",
"\"url\"",
"]",
"+",
"\"/?encoding=json&v=6\"",
",",
"on_message",
"=",
"self",
".",
... | Todo | [
"Todo"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/transport.py#L64-L71 |
askovpen/discord_simple | discord_simple/transport.py | Transport.on_message | def on_message(self, ws, message):
""" Todo """
m = json.loads(message)
self.logger.debug(m)
if m.get("s", 0):
self.sequence = m["s"]
if m["op"] == self.DISPATCH:
if m["t"] == "READY":
for channel in m["d"]["private_channels"]:
if len(channel["recipients"]) == 1:
... | python | def on_message(self, ws, message):
""" Todo """
m = json.loads(message)
self.logger.debug(m)
if m.get("s", 0):
self.sequence = m["s"]
if m["op"] == self.DISPATCH:
if m["t"] == "READY":
for channel in m["d"]["private_channels"]:
if len(channel["recipients"]) == 1:
... | [
"def",
"on_message",
"(",
"self",
",",
"ws",
",",
"message",
")",
":",
"m",
"=",
"json",
".",
"loads",
"(",
"message",
")",
"self",
".",
"logger",
".",
"debug",
"(",
"m",
")",
"if",
"m",
".",
"get",
"(",
"\"s\"",
",",
"0",
")",
":",
"self",
"... | Todo | [
"Todo"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/transport.py#L81-L110 |
askovpen/discord_simple | discord_simple/transport.py | Transport.on_error | def on_error(self, ws, error):
""" Todo """
if type(error).__name__ == "KeyboardInterrupt":
sys.exit()
self.logger.debug("error") | python | def on_error(self, ws, error):
""" Todo """
if type(error).__name__ == "KeyboardInterrupt":
sys.exit()
self.logger.debug("error") | [
"def",
"on_error",
"(",
"self",
",",
"ws",
",",
"error",
")",
":",
"if",
"type",
"(",
"error",
")",
".",
"__name__",
"==",
"\"KeyboardInterrupt\"",
":",
"sys",
".",
"exit",
"(",
")",
"self",
".",
"logger",
".",
"debug",
"(",
"\"error\"",
")"
] | Todo | [
"Todo"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/transport.py#L112-L116 |
askovpen/discord_simple | discord_simple/transport.py | Transport.on_connect | def on_connect(self, ws):
""" Todo """
self.logger.info("onconnect")
msg = {'op': self.IDENTIFY,
'd': {'token': self.token,
'properties': {'$os': 'lnx',
'$browser': 'discord_simple',
'$device': 'discord_simple',
... | python | def on_connect(self, ws):
""" Todo """
self.logger.info("onconnect")
msg = {'op': self.IDENTIFY,
'd': {'token': self.token,
'properties': {'$os': 'lnx',
'$browser': 'discord_simple',
'$device': 'discord_simple',
... | [
"def",
"on_connect",
"(",
"self",
",",
"ws",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"onconnect\"",
")",
"msg",
"=",
"{",
"'op'",
":",
"self",
".",
"IDENTIFY",
",",
"'d'",
":",
"{",
"'token'",
":",
"self",
".",
"token",
",",
"'properti... | Todo | [
"Todo"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/transport.py#L118-L131 |
askovpen/discord_simple | discord_simple/transport.py | Transport.send_message | def send_message(self, user=None, message=None, channel=None):
""" Todo """
self.logger.info("sending message to %s: %s", user, message)
cid=channel
if not cid:
for cid in self.channels:
if str(self.channels[cid]) == str(user):
channel=cid
self.logger.debug(cid)
if ... | python | def send_message(self, user=None, message=None, channel=None):
""" Todo """
self.logger.info("sending message to %s: %s", user, message)
cid=channel
if not cid:
for cid in self.channels:
if str(self.channels[cid]) == str(user):
channel=cid
self.logger.debug(cid)
if ... | [
"def",
"send_message",
"(",
"self",
",",
"user",
"=",
"None",
",",
"message",
"=",
"None",
",",
"channel",
"=",
"None",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"sending message to %s: %s\"",
",",
"user",
",",
"message",
")",
"cid",
"=",
"c... | Todo | [
"Todo"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/transport.py#L133-L147 |
askovpen/discord_simple | discord_simple/transport.py | Heartbeat.run | def run(self):
""" Todo """
self.logger.debug("heartbeat started")
while True:
time.sleep(self.interval)
self.send_heartbeat() | python | def run(self):
""" Todo """
self.logger.debug("heartbeat started")
while True:
time.sleep(self.interval)
self.send_heartbeat() | [
"def",
"run",
"(",
"self",
")",
":",
"self",
".",
"logger",
".",
"debug",
"(",
"\"heartbeat started\"",
")",
"while",
"True",
":",
"time",
".",
"sleep",
"(",
"self",
".",
"interval",
")",
"self",
".",
"send_heartbeat",
"(",
")"
] | Todo | [
"Todo"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/transport.py#L159-L164 |
askovpen/discord_simple | discord_simple/transport.py | Heartbeat.send_heartbeat | def send_heartbeat(self):
""" Todo """
self.logger.debug("heartbeat "+str(self.t.sequence))
self.t.ws.send(json.dumps({'op': self.t.HEARTBEAT,
'd': self.t.sequence})) | python | def send_heartbeat(self):
""" Todo """
self.logger.debug("heartbeat "+str(self.t.sequence))
self.t.ws.send(json.dumps({'op': self.t.HEARTBEAT,
'd': self.t.sequence})) | [
"def",
"send_heartbeat",
"(",
"self",
")",
":",
"self",
".",
"logger",
".",
"debug",
"(",
"\"heartbeat \"",
"+",
"str",
"(",
"self",
".",
"t",
".",
"sequence",
")",
")",
"self",
".",
"t",
".",
"ws",
".",
"send",
"(",
"json",
".",
"dumps",
"(",
"{... | Todo | [
"Todo"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/transport.py#L166-L170 |
theosysbio/means | src/means/inference/parallelisation.py | multiprocessing_apply_infer | def multiprocessing_apply_infer(object_id):
"""
Used in the InferenceWithRestarts class.
Needs to be in global scope for multiprocessing module to pick it up
"""
global inference_objects, inference_args, inference_kwargs
return inference_objects[object_id]._infer_raw(*inference_args, **inferenc... | python | def multiprocessing_apply_infer(object_id):
"""
Used in the InferenceWithRestarts class.
Needs to be in global scope for multiprocessing module to pick it up
"""
global inference_objects, inference_args, inference_kwargs
return inference_objects[object_id]._infer_raw(*inference_args, **inferenc... | [
"def",
"multiprocessing_apply_infer",
"(",
"object_id",
")",
":",
"global",
"inference_objects",
",",
"inference_args",
",",
"inference_kwargs",
"return",
"inference_objects",
"[",
"object_id",
"]",
".",
"_infer_raw",
"(",
"*",
"inference_args",
",",
"*",
"*",
"infe... | Used in the InferenceWithRestarts class.
Needs to be in global scope for multiprocessing module to pick it up | [
"Used",
"in",
"the",
"InferenceWithRestarts",
"class",
".",
"Needs",
"to",
"be",
"in",
"global",
"scope",
"for",
"multiprocessing",
"module",
"to",
"pick",
"it",
"up"
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/inference/parallelisation.py#L18-L25 |
tommyod/streprogen | streprogen/modeling.py | reps_to_intensity | def reps_to_intensity(reps, slope=-4.8, constant=97.5, quadratic=True):
"""A function mapping from repetitions in the range 1 to 12
to intensities in the range 0 to 100.
Parameters
----------
reps
The number of repetitions to map to the intensity range.
slope
Slope for the linea... | python | def reps_to_intensity(reps, slope=-4.8, constant=97.5, quadratic=True):
"""A function mapping from repetitions in the range 1 to 12
to intensities in the range 0 to 100.
Parameters
----------
reps
The number of repetitions to map to the intensity range.
slope
Slope for the linea... | [
"def",
"reps_to_intensity",
"(",
"reps",
",",
"slope",
"=",
"-",
"4.8",
",",
"constant",
"=",
"97.5",
",",
"quadratic",
"=",
"True",
")",
":",
"intensity",
"=",
"constant",
"+",
"slope",
"*",
"(",
"reps",
"-",
"1",
")",
"if",
"quadratic",
":",
"retur... | A function mapping from repetitions in the range 1 to 12
to intensities in the range 0 to 100.
Parameters
----------
reps
The number of repetitions to map to the intensity range.
slope
Slope for the linear function.
constant
Constant for the linear function
quadratic... | [
"A",
"function",
"mapping",
"from",
"repetitions",
"in",
"the",
"range",
"1",
"to",
"12",
"to",
"intensities",
"in",
"the",
"range",
"0",
"to",
"100",
"."
] | train | https://github.com/tommyod/streprogen/blob/21b903618e8b2d398bceb394d18d7c74ca984def/streprogen/modeling.py#L116-L153 |
tommyod/streprogen | streprogen/modeling.py | progression_linear | def progression_linear(week, start_weight, final_weight, start_week, end_week):
"""A linear progression function going through the points
('start_week', 'start_weight') and ('end_week', 'final_weight'), evaluated
in 'week'.
Parameters
----------
week
The week to evaluate the linear func... | python | def progression_linear(week, start_weight, final_weight, start_week, end_week):
"""A linear progression function going through the points
('start_week', 'start_weight') and ('end_week', 'final_weight'), evaluated
in 'week'.
Parameters
----------
week
The week to evaluate the linear func... | [
"def",
"progression_linear",
"(",
"week",
",",
"start_weight",
",",
"final_weight",
",",
"start_week",
",",
"end_week",
")",
":",
"# Calculate the slope of the linear function",
"slope",
"=",
"(",
"start_weight",
"-",
"final_weight",
")",
"/",
"(",
"start_week",
"-"... | A linear progression function going through the points
('start_week', 'start_weight') and ('end_week', 'final_weight'), evaluated
in 'week'.
Parameters
----------
week
The week to evaluate the linear function at.
start_weight
The weight at 'start_week'.
final_weight
... | [
"A",
"linear",
"progression",
"function",
"going",
"through",
"the",
"points",
"(",
"start_week",
"start_weight",
")",
"and",
"(",
"end_week",
"final_weight",
")",
"evaluated",
"in",
"week",
"."
] | train | https://github.com/tommyod/streprogen/blob/21b903618e8b2d398bceb394d18d7c74ca984def/streprogen/modeling.py#L156-L194 |
tommyod/streprogen | streprogen/modeling.py | progression_sinusoidal | def progression_sinusoidal(week, start_weight, final_weight, start_week,
end_week,
periods=2, scale=0.025, offset=0):
"""A sinusoidal progression function going through the points
('start_week', 'start_weight') and ('end_week', 'final_weight'), evaluated
... | python | def progression_sinusoidal(week, start_weight, final_weight, start_week,
end_week,
periods=2, scale=0.025, offset=0):
"""A sinusoidal progression function going through the points
('start_week', 'start_weight') and ('end_week', 'final_weight'), evaluated
... | [
"def",
"progression_sinusoidal",
"(",
"week",
",",
"start_weight",
",",
"final_weight",
",",
"start_week",
",",
"end_week",
",",
"periods",
"=",
"2",
",",
"scale",
"=",
"0.025",
",",
"offset",
"=",
"0",
")",
":",
"# Get the linear model",
"linear",
"=",
"pro... | A sinusoidal progression function going through the points
('start_week', 'start_weight') and ('end_week', 'final_weight'), evaluated
in 'week'. This function calls a linear progression function
and multiplies it by a sinusoid.
Parameters
----------
week
The week to evaluate the linear ... | [
"A",
"sinusoidal",
"progression",
"function",
"going",
"through",
"the",
"points",
"(",
"start_week",
"start_weight",
")",
"and",
"(",
"end_week",
"final_weight",
")",
"evaluated",
"in",
"week",
".",
"This",
"function",
"calls",
"a",
"linear",
"progression",
"fu... | train | https://github.com/tommyod/streprogen/blob/21b903618e8b2d398bceb394d18d7c74ca984def/streprogen/modeling.py#L197-L250 |
tommyod/streprogen | streprogen/modeling.py | RepellentGenerator.generate_one | def generate_one(self):
"""Generate a single element.
Returns
-------
element
An element from the domain.
Examples
-------
>>> generator = RepellentGenerator(['a', 'b'])
>>> gen_item = generator.generate_one()
>>> gen_ite... | python | def generate_one(self):
"""Generate a single element.
Returns
-------
element
An element from the domain.
Examples
-------
>>> generator = RepellentGenerator(['a', 'b'])
>>> gen_item = generator.generate_one()
>>> gen_ite... | [
"def",
"generate_one",
"(",
"self",
")",
":",
"# Get the weights for all items in the domain",
"weights",
"=",
"[",
"self",
".",
"probability_func",
"(",
"self",
".",
"generated",
"[",
"element",
"]",
")",
"for",
"element",
"in",
"self",
".",
"domain",
"]",
"#... | Generate a single element.
Returns
-------
element
An element from the domain.
Examples
-------
>>> generator = RepellentGenerator(['a', 'b'])
>>> gen_item = generator.generate_one()
>>> gen_item in ['a', 'b']
True | [
"Generate",
"a",
"single",
"element",
".",
"Returns",
"-------",
"element",
"An",
"element",
"from",
"the",
"domain",
".",
"Examples",
"-------",
">>>",
"generator",
"=",
"RepellentGenerator",
"(",
"[",
"a",
"b",
"]",
")",
">>>",
"gen_item",
"=",
"generator"... | train | https://github.com/tommyod/streprogen/blob/21b903618e8b2d398bceb394d18d7c74ca984def/streprogen/modeling.py#L65-L91 |
mitsei/dlkit | dlkit/json_/commenting/searches.py | CommentSearchResults.get_comments | def get_comments(self):
"""Gets the comment list resulting from a search.
return: (osid.commenting.CommentList) - the comment list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.*
"""
if self.retrieved:
... | python | def get_comments(self):
"""Gets the comment list resulting from a search.
return: (osid.commenting.CommentList) - the comment list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.*
"""
if self.retrieved:
... | [
"def",
"get_comments",
"(",
"self",
")",
":",
"if",
"self",
".",
"retrieved",
":",
"raise",
"errors",
".",
"IllegalState",
"(",
"'List has already been retrieved.'",
")",
"self",
".",
"retrieved",
"=",
"True",
"return",
"objects",
".",
"CommentList",
"(",
"sel... | Gets the comment list resulting from a search.
return: (osid.commenting.CommentList) - the comment list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"comment",
"list",
"resulting",
"from",
"a",
"search",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/commenting/searches.py#L97-L108 |
mitsei/dlkit | dlkit/json_/commenting/searches.py | BookSearchResults.get_books | def get_books(self):
"""Gets the book list resulting from a search.
return: (osid.commenting.BookList) - the book list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.*
"""
if self.retrieved:
r... | python | def get_books(self):
"""Gets the book list resulting from a search.
return: (osid.commenting.BookList) - the book list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.*
"""
if self.retrieved:
r... | [
"def",
"get_books",
"(",
"self",
")",
":",
"if",
"self",
".",
"retrieved",
":",
"raise",
"errors",
".",
"IllegalState",
"(",
"'List has already been retrieved.'",
")",
"self",
".",
"retrieved",
"=",
"True",
"return",
"objects",
".",
"BookList",
"(",
"self",
... | Gets the book list resulting from a search.
return: (osid.commenting.BookList) - the book list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"book",
"list",
"resulting",
"from",
"a",
"search",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/commenting/searches.py#L219-L230 |
mitsei/dlkit | dlkit/json_/assessment_authoring/default_mdata.py | get_assessment_part_mdata | def get_assessment_part_mdata():
"""Return default mdata map for AssessmentPart"""
return {
'assessment_part': {
'element_label': {
'text': 'assessment part',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE... | python | def get_assessment_part_mdata():
"""Return default mdata map for AssessmentPart"""
return {
'assessment_part': {
'element_label': {
'text': 'assessment part',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE... | [
"def",
"get_assessment_part_mdata",
"(",
")",
":",
"return",
"{",
"'assessment_part'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'assessment part'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
":",
"s... | Return default mdata map for AssessmentPart | [
"Return",
"default",
"mdata",
"map",
"for",
"AssessmentPart"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/default_mdata.py#L11-L100 |
mitsei/dlkit | dlkit/json_/assessment_authoring/default_mdata.py | get_sequence_rule_mdata | def get_sequence_rule_mdata():
"""Return default mdata map for SequenceRule"""
return {
'next_assessment_part': {
'element_label': {
'text': 'next assessment part',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIP... | python | def get_sequence_rule_mdata():
"""Return default mdata map for SequenceRule"""
return {
'next_assessment_part': {
'element_label': {
'text': 'next assessment part',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIP... | [
"def",
"get_sequence_rule_mdata",
"(",
")",
":",
"return",
"{",
"'next_assessment_part'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'next assessment part'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
"... | Return default mdata map for SequenceRule | [
"Return",
"default",
"mdata",
"map",
"for",
"SequenceRule"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/default_mdata.py#L103-L214 |
mitsei/dlkit | dlkit/json_/authorization/default_mdata.py | get_authorization_mdata | def get_authorization_mdata():
"""Return default mdata map for Authorization"""
return {
'function': {
'element_label': {
'text': 'function',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
... | python | def get_authorization_mdata():
"""Return default mdata map for Authorization"""
return {
'function': {
'element_label': {
'text': 'function',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
... | [
"def",
"get_authorization_mdata",
"(",
")",
":",
"return",
"{",
"'function'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'function'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
":",
"str",
"(",
"D... | Return default mdata map for Authorization | [
"Return",
"default",
"mdata",
"map",
"for",
"Authorization"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/authorization/default_mdata.py#L11-L56 |
mitsei/dlkit | dlkit/json_/logging_/queries.py | LogEntryQuery.match_timestamp | def match_timestamp(self, start_time, end_time, match):
"""Matches the time of this log entry.
arg: start_time (osid.calendaring.DateTime): start time
arg: end_time (osid.calendaring.DateTime): end time
arg: match (boolean): ``true`` if for a positive match,
``f... | python | def match_timestamp(self, start_time, end_time, match):
"""Matches the time of this log entry.
arg: start_time (osid.calendaring.DateTime): start time
arg: end_time (osid.calendaring.DateTime): end time
arg: match (boolean): ``true`` if for a positive match,
``f... | [
"def",
"match_timestamp",
"(",
"self",
",",
"start_time",
",",
"end_time",
",",
"match",
")",
":",
"self",
".",
"_match_minimum_date_time",
"(",
"'timestamp'",
",",
"start_time",
",",
"match",
")",
"self",
".",
"_match_maximum_date_time",
"(",
"'timestamp'",
","... | Matches the time of this log entry.
arg: start_time (osid.calendaring.DateTime): start time
arg: end_time (osid.calendaring.DateTime): end time
arg: match (boolean): ``true`` if for a positive match,
``false`` for a negative match
raise: InvalidArgument - ``sta... | [
"Matches",
"the",
"time",
"of",
"this",
"log",
"entry",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/logging_/queries.py#L99-L114 |
mitsei/dlkit | dlkit/services/repository.py | RepositoryManager._set_repository_view | def _set_repository_view(self, session):
"""Sets the underlying repository view to match current view"""
if self._repository_view == COMPARATIVE:
try:
session.use_comparative_repository_view()
except AttributeError:
pass
else:
t... | python | def _set_repository_view(self, session):
"""Sets the underlying repository view to match current view"""
if self._repository_view == COMPARATIVE:
try:
session.use_comparative_repository_view()
except AttributeError:
pass
else:
t... | [
"def",
"_set_repository_view",
"(",
"self",
",",
"session",
")",
":",
"if",
"self",
".",
"_repository_view",
"==",
"COMPARATIVE",
":",
"try",
":",
"session",
".",
"use_comparative_repository_view",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"else",
":",
... | Sets the underlying repository view to match current view | [
"Sets",
"the",
"underlying",
"repository",
"view",
"to",
"match",
"current",
"view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L256-L267 |
mitsei/dlkit | dlkit/services/repository.py | RepositoryManager.use_plenary_repository_view | def use_plenary_repository_view(self):
"""Pass through to provider AssetRepositorySession.use_plenary_repository_view"""
self._repository_view = PLENARY
# self._get_provider_session('asset_repository_session') # To make sure the session is tracked
for session in self._get_provider_sessio... | python | def use_plenary_repository_view(self):
"""Pass through to provider AssetRepositorySession.use_plenary_repository_view"""
self._repository_view = PLENARY
# self._get_provider_session('asset_repository_session') # To make sure the session is tracked
for session in self._get_provider_sessio... | [
"def",
"use_plenary_repository_view",
"(",
"self",
")",
":",
"self",
".",
"_repository_view",
"=",
"PLENARY",
"# self._get_provider_session('asset_repository_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",
"(",
")... | Pass through to provider AssetRepositorySession.use_plenary_repository_view | [
"Pass",
"through",
"to",
"provider",
"AssetRepositorySession",
".",
"use_plenary_repository_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L610-L618 |
mitsei/dlkit | dlkit/services/repository.py | RepositoryManager.use_comparative_composition_repository_view | def use_comparative_composition_repository_view(self):
"""Pass through to provider CompositionRepositorySession.use_comparative_composition_repository_view"""
self._repository_view = COMPARATIVE
# self._get_provider_session('composition_repository_session') # To make sure the session is tracked
... | python | def use_comparative_composition_repository_view(self):
"""Pass through to provider CompositionRepositorySession.use_comparative_composition_repository_view"""
self._repository_view = COMPARATIVE
# self._get_provider_session('composition_repository_session') # To make sure the session is tracked
... | [
"def",
"use_comparative_composition_repository_view",
"(",
"self",
")",
":",
"self",
".",
"_repository_view",
"=",
"COMPARATIVE",
"# self._get_provider_session('composition_repository_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provi... | Pass through to provider CompositionRepositorySession.use_comparative_composition_repository_view | [
"Pass",
"through",
"to",
"provider",
"CompositionRepositorySession",
".",
"use_comparative_composition_repository_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L700-L708 |
mitsei/dlkit | dlkit/services/repository.py | RepositoryManager.get_repositories_by_composition | def get_repositories_by_composition(self, *args, **kwargs):
"""Pass through to provider CompositionRepositorySession.get_repositories_by_composition"""
# Implemented from kitosid template for -
# osid.resource.ResourceBinSession.get_bins_by_resource
catalogs = self._get_provider_session(... | python | def get_repositories_by_composition(self, *args, **kwargs):
"""Pass through to provider CompositionRepositorySession.get_repositories_by_composition"""
# Implemented from kitosid template for -
# osid.resource.ResourceBinSession.get_bins_by_resource
catalogs = self._get_provider_session(... | [
"def",
"get_repositories_by_composition",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.ResourceBinSession.get_bins_by_resource",
"catalogs",
"=",
"self",
".",
"_get_provider_session",
"(",
"'... | Pass through to provider CompositionRepositorySession.get_repositories_by_composition | [
"Pass",
"through",
"to",
"provider",
"CompositionRepositorySession",
".",
"get_repositories_by_composition"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L756-L764 |
mitsei/dlkit | dlkit/services/repository.py | RepositoryManager.get_repositories | def get_repositories(self):
"""Pass through to provider RepositoryLookupSession.get_repositories"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_template
catalogs = self._get_provider_session('repository_lookup_session').get_repositories()
c... | python | def get_repositories(self):
"""Pass through to provider RepositoryLookupSession.get_repositories"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_template
catalogs = self._get_provider_session('repository_lookup_session').get_repositories()
c... | [
"def",
"get_repositories",
"(",
"self",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinLookupSession.get_bins_template",
"catalogs",
"=",
"self",
".",
"_get_provider_session",
"(",
"'repository_lookup_session'",
")",
".",
"get_repositories",
"(",
")"... | Pass through to provider RepositoryLookupSession.get_repositories | [
"Pass",
"through",
"to",
"provider",
"RepositoryLookupSession",
".",
"get_repositories"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L866-L874 |
mitsei/dlkit | dlkit/services/repository.py | RepositoryManager.create_repository | def create_repository(self, *args, **kwargs):
"""Pass through to provider RepositoryAdminSession.create_repository"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.create_bin
return Repository(
self._provider_manager,
self._get_provider... | python | def create_repository(self, *args, **kwargs):
"""Pass through to provider RepositoryAdminSession.create_repository"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.create_bin
return Repository(
self._provider_manager,
self._get_provider... | [
"def",
"create_repository",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinAdminSession.create_bin",
"return",
"Repository",
"(",
"self",
".",
"_provider_manager",
",",
"self",
".",
"_... | Pass through to provider RepositoryAdminSession.create_repository | [
"Pass",
"through",
"to",
"provider",
"RepositoryAdminSession",
".",
"create_repository"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L920-L928 |
mitsei/dlkit | dlkit/services/repository.py | RepositoryManager.get_repository_form | def get_repository_form(self, *args, **kwargs):
"""Pass through to provider RepositoryAdminSession.get_repository_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.get_bin_form_for_update_template
# This method might be a bit sketchy. Time will ... | python | def get_repository_form(self, *args, **kwargs):
"""Pass through to provider RepositoryAdminSession.get_repository_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.get_bin_form_for_update_template
# This method might be a bit sketchy. Time will ... | [
"def",
"get_repository_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",
"isinstanc... | Pass through to provider RepositoryAdminSession.get_repository_form_for_update | [
"Pass",
"through",
"to",
"provider",
"RepositoryAdminSession",
".",
"get_repository_form_for_update"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L942-L950 |
mitsei/dlkit | dlkit/services/repository.py | RepositoryManager.save_repository | def save_repository(self, repository_form, *args, **kwargs):
"""Pass through to provider RepositoryAdminSession.update_repository"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
if repository_form.is_for_update():
return self.update_rep... | python | def save_repository(self, repository_form, *args, **kwargs):
"""Pass through to provider RepositoryAdminSession.update_repository"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
if repository_form.is_for_update():
return self.update_rep... | [
"def",
"save_repository",
"(",
"self",
",",
"repository_form",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinAdminSession.update_bin",
"if",
"repository_form",
".",
"is_for_update",
"(",
")",
":",
... | Pass through to provider RepositoryAdminSession.update_repository | [
"Pass",
"through",
"to",
"provider",
"RepositoryAdminSession",
".",
"update_repository"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L963-L970 |
mitsei/dlkit | dlkit/services/repository.py | Repository._set_repository_view | def _set_repository_view(self, session):
"""Sets the underlying repository view to match current view"""
if self._repository_view == FEDERATED:
try:
session.use_federated_repository_view()
except AttributeError:
pass
else:
try:
... | python | def _set_repository_view(self, session):
"""Sets the underlying repository view to match current view"""
if self._repository_view == FEDERATED:
try:
session.use_federated_repository_view()
except AttributeError:
pass
else:
try:
... | [
"def",
"_set_repository_view",
"(",
"self",
",",
"session",
")",
":",
"if",
"self",
".",
"_repository_view",
"==",
"FEDERATED",
":",
"try",
":",
"session",
".",
"use_federated_repository_view",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"else",
":",
"t... | Sets the underlying repository view to match current view | [
"Sets",
"the",
"underlying",
"repository",
"view",
"to",
"match",
"current",
"view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1328-L1339 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.