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_/learning/sessions.py | ActivityAdminSession.delete_activity | def delete_activity(self, activity_id):
"""Deletes the ``Activity`` identified by the given ``Id``.
arg: activity_id (osid.id.Id): the ``Id`` of the ``Activity``
to delete
raise: NotFound - an ``Activity`` was not found identified by
the given ``Id``
... | python | def delete_activity(self, activity_id):
"""Deletes the ``Activity`` identified by the given ``Id``.
arg: activity_id (osid.id.Id): the ``Id`` of the ``Activity``
to delete
raise: NotFound - an ``Activity`` was not found identified by
the given ``Id``
... | [
"def",
"delete_activity",
"(",
"self",
",",
"activity_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.delete_resource_template",
"collection",
"=",
"JSONClientValidated",
"(",
"'learning'",
",",
"collection",
"=",
"'Activity'",
",",
"ru... | Deletes the ``Activity`` identified by the given ``Id``.
arg: activity_id (osid.id.Id): the ``Id`` of the ``Activity``
to delete
raise: NotFound - an ``Activity`` was not found identified by
the given ``Id``
raise: NullArgument - ``activity_id`` is ``null``
... | [
"Deletes",
"the",
"Activity",
"identified",
"by",
"the",
"given",
"Id",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3343-L3368 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ActivityAdminSession.alias_activity | def alias_activity(self, activity_id, alias_id):
"""Adds an ``Id`` to an ``Activity`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Activity`` is determined by the
provider. The new ``Id`` performs as an alias to the primary
``Id``. If the alias is a pointer to ... | python | def alias_activity(self, activity_id, alias_id):
"""Adds an ``Id`` to an ``Activity`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Activity`` is determined by the
provider. The new ``Id`` performs as an alias to the primary
``Id``. If the alias is a pointer to ... | [
"def",
"alias_activity",
"(",
"self",
",",
"activity_id",
",",
"alias_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.alias_resources_template",
"self",
".",
"_alias_id",
"(",
"primary_id",
"=",
"activity_id",
",",
"equivalent_id",
"=... | Adds an ``Id`` to an ``Activity`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Activity`` is determined by the
provider. The new ``Id`` performs as an alias to the primary
``Id``. If the alias is a pointer to another activity, it is
reassigned to the given acti... | [
"Adds",
"an",
"Id",
"to",
"an",
"Activity",
"for",
"the",
"purpose",
"of",
"creating",
"compatibility",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3389-L3410 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ActivityObjectiveBankSession.get_activity_ids_by_objective_bank | def get_activity_ids_by_objective_bank(self, objective_bank_id):
"""Gets the list of ``Activity`` ``Ids`` associated with an ``ObjectiveBank``.
arg: objective_bank_id (osid.id.Id): ``Id`` of the
``ObjectiveBank``
return: (osid.id.IdList) - list of related activity ``Ids``
... | python | def get_activity_ids_by_objective_bank(self, objective_bank_id):
"""Gets the list of ``Activity`` ``Ids`` associated with an ``ObjectiveBank``.
arg: objective_bank_id (osid.id.Id): ``Id`` of the
``ObjectiveBank``
return: (osid.id.IdList) - list of related activity ``Ids``
... | [
"def",
"get_activity_ids_by_objective_bank",
"(",
"self",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_resource_ids_by_bin",
"id_list",
"=",
"[",
"]",
"for",
"activity",
"in",
"self",
".",
"get_activities_by_obje... | Gets the list of ``Activity`` ``Ids`` associated with an ``ObjectiveBank``.
arg: objective_bank_id (osid.id.Id): ``Id`` of the
``ObjectiveBank``
return: (osid.id.IdList) - list of related activity ``Ids``
raise: NotFound - ``objective_bank_id`` is not found
raise: ... | [
"Gets",
"the",
"list",
"of",
"Activity",
"Ids",
"associated",
"with",
"an",
"ObjectiveBank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3486-L3504 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ActivityObjectiveBankSession.get_activities_by_objective_bank | def get_activities_by_objective_bank(self, objective_bank_id):
"""Gets the list of ``Activities`` associated with an ``ObjectiveBank``.
arg: objective_bank_id (osid.id.Id): ``Id`` of the
``ObjectiveBank``
return: (osid.learning.ActivityList) - list of related
... | python | def get_activities_by_objective_bank(self, objective_bank_id):
"""Gets the list of ``Activities`` associated with an ``ObjectiveBank``.
arg: objective_bank_id (osid.id.Id): ``Id`` of the
``ObjectiveBank``
return: (osid.learning.ActivityList) - list of related
... | [
"def",
"get_activities_by_objective_bank",
"(",
"self",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_resources_by_bin",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'LEARNING'",
",",
"local",
"=",
"T... | Gets the list of ``Activities`` associated with an ``ObjectiveBank``.
arg: objective_bank_id (osid.id.Id): ``Id`` of the
``ObjectiveBank``
return: (osid.learning.ActivityList) - list of related
activities
raise: NotFound - ``objective_bank_id`` is not found
... | [
"Gets",
"the",
"list",
"of",
"Activities",
"associated",
"with",
"an",
"ObjectiveBank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3507-L3526 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ActivityObjectiveBankSession.get_activity_ids_by_objective_banks | def get_activity_ids_by_objective_banks(self, objective_bank_ids):
"""Gets the list of ``Activity Ids`` corresponding to a list of ``ObjectiveBanks``.
arg: objective_bank_ids (osid.id.IdList): list of objective
bank ``Ids``
return: (osid.id.IdList) - list of activity ``Ids``
... | python | def get_activity_ids_by_objective_banks(self, objective_bank_ids):
"""Gets the list of ``Activity Ids`` corresponding to a list of ``ObjectiveBanks``.
arg: objective_bank_ids (osid.id.IdList): list of objective
bank ``Ids``
return: (osid.id.IdList) - list of activity ``Ids``
... | [
"def",
"get_activity_ids_by_objective_banks",
"(",
"self",
",",
"objective_bank_ids",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_resource_ids_by_bins",
"id_list",
"=",
"[",
"]",
"for",
"activity",
"in",
"self",
".",
"get_activities_by_o... | Gets the list of ``Activity Ids`` corresponding to a list of ``ObjectiveBanks``.
arg: objective_bank_ids (osid.id.IdList): list of objective
bank ``Ids``
return: (osid.id.IdList) - list of activity ``Ids``
raise: NullArgument - ``objective_bank_ids`` is ``null``
rais... | [
"Gets",
"the",
"list",
"of",
"Activity",
"Ids",
"corresponding",
"to",
"a",
"list",
"of",
"ObjectiveBanks",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3529-L3546 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ActivityObjectiveBankSession.get_activities_by_objective_banks | def get_activities_by_objective_banks(self, objective_bank_ids):
"""Gets the list of ``Activities`` corresponding to a list of ``ObjectiveBanks``.
arg: objective_bank_ids (osid.id.IdList): list of objective
bank ``Ids``
return: (osid.learning.ActivityList) - list of activitie... | python | def get_activities_by_objective_banks(self, objective_bank_ids):
"""Gets the list of ``Activities`` corresponding to a list of ``ObjectiveBanks``.
arg: objective_bank_ids (osid.id.IdList): list of objective
bank ``Ids``
return: (osid.learning.ActivityList) - list of activitie... | [
"def",
"get_activities_by_objective_banks",
"(",
"self",
",",
"objective_bank_ids",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_resources_by_bins",
"activity_list",
"=",
"[",
"]",
"for",
"objective_bank_id",
"in",
"objective_bank_ids",
":"... | Gets the list of ``Activities`` corresponding to a list of ``ObjectiveBanks``.
arg: objective_bank_ids (osid.id.IdList): list of objective
bank ``Ids``
return: (osid.learning.ActivityList) - list of activities
raise: NullArgument - ``objective_bank_ids`` is ``null``
... | [
"Gets",
"the",
"list",
"of",
"Activities",
"corresponding",
"to",
"a",
"list",
"of",
"ObjectiveBanks",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3549-L3567 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ActivityObjectiveBankSession.get_objective_bank_ids_by_activity | def get_objective_bank_ids_by_activity(self, activity_id):
"""Gets the list of ``ObjectiveBank Ids`` mapped to a ``Activity``.
arg: activity_id (osid.id.Id): ``Id`` of a ``Activity``
return: (osid.id.IdList) - list of objective bank ``Ids``
raise: NotFound - ``activity_id`` is not f... | python | def get_objective_bank_ids_by_activity(self, activity_id):
"""Gets the list of ``ObjectiveBank Ids`` mapped to a ``Activity``.
arg: activity_id (osid.id.Id): ``Id`` of a ``Activity``
return: (osid.id.IdList) - list of objective bank ``Ids``
raise: NotFound - ``activity_id`` is not f... | [
"def",
"get_objective_bank_ids_by_activity",
"(",
"self",
",",
"activity_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_bin_ids_by_resource",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'LEARNING'",
",",
"local",
"=",
"Tr... | Gets the list of ``ObjectiveBank Ids`` mapped to a ``Activity``.
arg: activity_id (osid.id.Id): ``Id`` of a ``Activity``
return: (osid.id.IdList) - list of objective bank ``Ids``
raise: NotFound - ``activity_id`` is not found
raise: NullArgument - ``activity_id`` is ``null``
... | [
"Gets",
"the",
"list",
"of",
"ObjectiveBank",
"Ids",
"mapped",
"to",
"a",
"Activity",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3570-L3591 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ActivityObjectiveBankSession.get_objective_banks_by_activity | def get_objective_banks_by_activity(self, activity_id):
"""Gets the list of ``ObjectiveBanks`` mapped to a ``Activity``.
arg: activity_id (osid.id.Id): ``Id`` of a ``Activity``
return: (osid.learning.ObjectiveBankList) - list of objective
bank ``Ids``
raise: NotFound... | python | def get_objective_banks_by_activity(self, activity_id):
"""Gets the list of ``ObjectiveBanks`` mapped to a ``Activity``.
arg: activity_id (osid.id.Id): ``Id`` of a ``Activity``
return: (osid.learning.ObjectiveBankList) - list of objective
bank ``Ids``
raise: NotFound... | [
"def",
"get_objective_banks_by_activity",
"(",
"self",
",",
"activity_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_bins_by_resource",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'LEARNING'",
",",
"local",
"=",
"True",
... | Gets the list of ``ObjectiveBanks`` mapped to a ``Activity``.
arg: activity_id (osid.id.Id): ``Id`` of a ``Activity``
return: (osid.learning.ObjectiveBankList) - list of objective
bank ``Ids``
raise: NotFound - ``activity_id`` is not found
raise: NullArgument - ``ac... | [
"Gets",
"the",
"list",
"of",
"ObjectiveBanks",
"mapped",
"to",
"a",
"Activity",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3594-L3612 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ActivityObjectiveBankAssignmentSession.assign_activity_to_objective_bank | def assign_activity_to_objective_bank(self, activity_id, objective_bank_id):
"""Adds an existing ``Activity`` to a ``ObjectiveBank``.
arg: activity_id (osid.id.Id): the ``Id`` of the ``Activity``
arg: objective_bank_id (osid.id.Id): the ``Id`` of the
``ObjectiveBank``
... | python | def assign_activity_to_objective_bank(self, activity_id, objective_bank_id):
"""Adds an existing ``Activity`` to a ``ObjectiveBank``.
arg: activity_id (osid.id.Id): the ``Id`` of the ``Activity``
arg: objective_bank_id (osid.id.Id): the ``Id`` of the
``ObjectiveBank``
... | [
"def",
"assign_activity_to_objective_bank",
"(",
"self",
",",
"activity_id",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinAssignmentSession.assign_resource_to_bin",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'LEAR... | Adds an existing ``Activity`` to a ``ObjectiveBank``.
arg: activity_id (osid.id.Id): the ``Id`` of the ``Activity``
arg: objective_bank_id (osid.id.Id): the ``Id`` of the
``ObjectiveBank``
raise: AlreadyExists - ``activity_id`` already mapped to
``objectiv... | [
"Adds",
"an",
"existing",
"Activity",
"to",
"a",
"ObjectiveBank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3727-L3749 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ActivityObjectiveBankAssignmentSession.unassign_activity_from_objective_bank | def unassign_activity_from_objective_bank(self, activity_id, objective_bank_id):
"""Removes a ``Activity`` from a ``ObjectiveBank``.
arg: activity_id (osid.id.Id): the ``Id`` of the ``Activity``
arg: objective_bank_id (osid.id.Id): the ``Id`` of the
``ObjectiveBank``
... | python | def unassign_activity_from_objective_bank(self, activity_id, objective_bank_id):
"""Removes a ``Activity`` from a ``ObjectiveBank``.
arg: activity_id (osid.id.Id): the ``Id`` of the ``Activity``
arg: objective_bank_id (osid.id.Id): the ``Id`` of the
``ObjectiveBank``
... | [
"def",
"unassign_activity_from_objective_bank",
"(",
"self",
",",
"activity_id",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinAssignmentSession.unassign_resource_from_bin",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
... | Removes a ``Activity`` from a ``ObjectiveBank``.
arg: activity_id (osid.id.Id): the ``Id`` of the ``Activity``
arg: objective_bank_id (osid.id.Id): the ``Id`` of the
``ObjectiveBank``
raise: NotFound - ``activity_id`` or ``objective_bank_id`` not
found or ... | [
"Removes",
"a",
"Activity",
"from",
"a",
"ObjectiveBank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3752-L3773 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ActivityObjectiveBankAssignmentSession.reassign_activity_to_objective_bank | def reassign_activity_to_objective_bank(self, activity_id, from_objective_bank_id, to_objective_bank_id):
"""Moves an ``Activity`` from one ``ObjectiveBank`` to another.
Mappings to other ``ObjectiveBanks`` are unaffected.
arg: activity_id (osid.id.Id): the ``Id`` of the ``Activity``
... | python | def reassign_activity_to_objective_bank(self, activity_id, from_objective_bank_id, to_objective_bank_id):
"""Moves an ``Activity`` from one ``ObjectiveBank`` to another.
Mappings to other ``ObjectiveBanks`` are unaffected.
arg: activity_id (osid.id.Id): the ``Id`` of the ``Activity``
... | [
"def",
"reassign_activity_to_objective_bank",
"(",
"self",
",",
"activity_id",
",",
"from_objective_bank_id",
",",
"to_objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinAssignmentSession.reassign_resource_to_bin",
"self",
".",
"assign_activi... | Moves an ``Activity`` from one ``ObjectiveBank`` to another.
Mappings to other ``ObjectiveBanks`` are unaffected.
arg: activity_id (osid.id.Id): the ``Id`` of the ``Activity``
arg: from_objective_bank_id (osid.id.Id): the ``Id`` of the
current ``ObjectiveBank``
ar... | [
"Moves",
"an",
"Activity",
"from",
"one",
"ObjectiveBank",
"to",
"another",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3776-L3803 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyLookupSession.get_proficiency | def get_proficiency(self, proficiency_id):
"""Gets the ``Proficiency`` specified by its ``Id``.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency`` to retrieve
return: (osid.learning.Proficiency) - the returned
``Proficiency``
raise: N... | python | def get_proficiency(self, proficiency_id):
"""Gets the ``Proficiency`` specified by its ``Id``.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency`` to retrieve
return: (osid.learning.Proficiency) - the returned
``Proficiency``
raise: N... | [
"def",
"get_proficiency",
"(",
"self",
",",
"proficiency_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resource",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated",
"(",
"'learning'",
... | Gets the ``Proficiency`` specified by its ``Id``.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency`` to retrieve
return: (osid.learning.Proficiency) - the returned
``Proficiency``
raise: NotFound - no ``Proficiency`` found with the given
... | [
"Gets",
"the",
"Proficiency",
"specified",
"by",
"its",
"Id",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3944-L3968 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyLookupSession.get_proficiencies_by_ids | def get_proficiencies_by_ids(self, proficiency_ids):
"""Gets a ``ProficiencyList`` corresponding to the given ``IdList``.
arg: proficiency_ids (osid.id.IdList): the list of ``Ids`` to
retrieve
return: (osid.learning.ProficiencyList) - the returned
``Proficienc... | python | def get_proficiencies_by_ids(self, proficiency_ids):
"""Gets a ``ProficiencyList`` corresponding to the given ``IdList``.
arg: proficiency_ids (osid.id.IdList): the list of ``Ids`` to
retrieve
return: (osid.learning.ProficiencyList) - the returned
``Proficienc... | [
"def",
"get_proficiencies_by_ids",
"(",
"self",
",",
"proficiency_ids",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resources_by_ids",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated",
"(",
... | Gets a ``ProficiencyList`` corresponding to the given ``IdList``.
arg: proficiency_ids (osid.id.IdList): the list of ``Ids`` to
retrieve
return: (osid.learning.ProficiencyList) - the returned
``Proficiency`` list
raise: NotFound - an ``Id`` was not found
... | [
"Gets",
"a",
"ProficiencyList",
"corresponding",
"to",
"the",
"given",
"IdList",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L3971-L4004 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyLookupSession.get_proficiencies_by_genus_type | def get_proficiencies_by_genus_type(self, proficiency_genus_type):
"""Gets a ``ProficiencyList`` corresponding to the given proficiency genus ``Type`` which does not include proficiencies of types derived from the specified ``Type``.
arg: proficiency_genus_type (osid.type.Type): a proficiency
... | python | def get_proficiencies_by_genus_type(self, proficiency_genus_type):
"""Gets a ``ProficiencyList`` corresponding to the given proficiency genus ``Type`` which does not include proficiencies of types derived from the specified ``Type``.
arg: proficiency_genus_type (osid.type.Type): a proficiency
... | [
"def",
"get_proficiencies_by_genus_type",
"(",
"self",
",",
"proficiency_genus_type",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resources_by_genus_type",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClie... | Gets a ``ProficiencyList`` corresponding to the given proficiency genus ``Type`` which does not include proficiencies of types derived from the specified ``Type``.
arg: proficiency_genus_type (osid.type.Type): a proficiency
genus type
return: (osid.learning.ProficiencyList) - the ret... | [
"Gets",
"a",
"ProficiencyList",
"corresponding",
"to",
"the",
"given",
"proficiency",
"genus",
"Type",
"which",
"does",
"not",
"include",
"proficiencies",
"of",
"types",
"derived",
"from",
"the",
"specified",
"Type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4007-L4029 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyLookupSession.get_proficiencies_on_date | def get_proficiencies_on_date(self, from_, to):
"""Gets a ``ProficiencyList`` effecyive during the entire given date range inclusive but not confined to the date range.
arg: from (osid.calendaring.DateTime): starting date
arg: to (osid.calendaring.DateTime): ending date
return: (o... | python | def get_proficiencies_on_date(self, from_, to):
"""Gets a ``ProficiencyList`` effecyive during the entire given date range inclusive but not confined to the date range.
arg: from (osid.calendaring.DateTime): starting date
arg: to (osid.calendaring.DateTime): ending date
return: (o... | [
"def",
"get_proficiencies_on_date",
"(",
"self",
",",
"from_",
",",
"to",
")",
":",
"# Implemented from template for",
"# osid.relationship.RelationshipLookupSession.get_relationships_on_date",
"proficiency_list",
"=",
"[",
"]",
"for",
"proficiency",
"in",
"self",
".",
"get... | Gets a ``ProficiencyList`` effecyive during the entire given date range inclusive but not confined to the date range.
arg: from (osid.calendaring.DateTime): starting date
arg: to (osid.calendaring.DateTime): ending date
return: (osid.learning.ProficiencyList) - the returned
... | [
"Gets",
"a",
"ProficiencyList",
"effecyive",
"during",
"the",
"entire",
"given",
"date",
"range",
"inclusive",
"but",
"not",
"confined",
"to",
"the",
"date",
"range",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4070-L4090 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyLookupSession.get_proficiencies_for_objective_on_date | def get_proficiencies_for_objective_on_date(self, objective_id, from_, to):
"""Gets a ``ProficiencyList`` relating to the given objective effective during the entire given date range inclusive but not confined to the date range.
arg: objective_id (osid.id.Id): an objective ``Id``
arg: fro... | python | def get_proficiencies_for_objective_on_date(self, objective_id, from_, to):
"""Gets a ``ProficiencyList`` relating to the given objective effective during the entire given date range inclusive but not confined to the date range.
arg: objective_id (osid.id.Id): an objective ``Id``
arg: fro... | [
"def",
"get_proficiencies_for_objective_on_date",
"(",
"self",
",",
"objective_id",
",",
"from_",
",",
"to",
")",
":",
"# Implemented from template for",
"# osid.relationship.RelationshipLookupSession.get_relationships_for_destination_on_date",
"proficiency_list",
"=",
"[",
"]",
... | Gets a ``ProficiencyList`` relating to the given objective effective during the entire given date range inclusive but not confined to the date range.
arg: objective_id (osid.id.Id): an objective ``Id``
arg: from (osid.calendaring.DateTime): starting date
arg: to (osid.calendaring.DateT... | [
"Gets",
"a",
"ProficiencyList",
"relating",
"to",
"the",
"given",
"objective",
"effective",
"during",
"the",
"entire",
"given",
"date",
"range",
"inclusive",
"but",
"not",
"confined",
"to",
"the",
"date",
"range",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4137-L4159 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyLookupSession.get_proficiencies_for_objectives | def get_proficiencies_for_objectives(self, objective_ids):
"""Gets a ``ProficiencyList`` relating to the given objectives.
arg: objective_ids (osid.id.IdList): the objective ``Ids``
return: (osid.learning.ProficiencyList) - the returned
``Proficiency`` list
raise: Nu... | python | def get_proficiencies_for_objectives(self, objective_ids):
"""Gets a ``ProficiencyList`` relating to the given objectives.
arg: objective_ids (osid.id.IdList): the objective ``Ids``
return: (osid.learning.ProficiencyList) - the returned
``Proficiency`` list
raise: Nu... | [
"def",
"get_proficiencies_for_objectives",
"(",
"self",
",",
"objective_ids",
")",
":",
"# Implemented from template for",
"# osid.relationship.RelationshipLookupSession.get_relationships_for_destination",
"# NOTE: This implementation currently ignores plenary and effective views",
"collection... | Gets a ``ProficiencyList`` relating to the given objectives.
arg: objective_ids (osid.id.IdList): the objective ``Ids``
return: (osid.learning.ProficiencyList) - the returned
``Proficiency`` list
raise: NullArgument - ``objective_ids`` is ``null``
raise: OperationFa... | [
"Gets",
"a",
"ProficiencyList",
"relating",
"to",
"the",
"given",
"objectives",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4211-L4232 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyLookupSession.get_proficiencies_for_resource_on_date | def get_proficiencies_for_resource_on_date(self, resource_id, from_, to):
"""Gets a ``ProficiencyList`` relating to the given resource effective during the entire given date range inclusive but not confined to the date range.
arg: resource_id (osid.id.Id): a resource ``Id``
arg: from (osi... | python | def get_proficiencies_for_resource_on_date(self, resource_id, from_, to):
"""Gets a ``ProficiencyList`` relating to the given resource effective during the entire given date range inclusive but not confined to the date range.
arg: resource_id (osid.id.Id): a resource ``Id``
arg: from (osi... | [
"def",
"get_proficiencies_for_resource_on_date",
"(",
"self",
",",
"resource_id",
",",
"from_",
",",
"to",
")",
":",
"# Implemented from template for",
"# osid.relationship.RelationshipLookupSession.get_relationships_for_source_on_date",
"proficiency_list",
"=",
"[",
"]",
"for",
... | Gets a ``ProficiencyList`` relating to the given resource effective during the entire given date range inclusive but not confined to the date range.
arg: resource_id (osid.id.Id): a resource ``Id``
arg: from (osid.calendaring.DateTime): starting date
arg: to (osid.calendaring.DateTime)... | [
"Gets",
"a",
"ProficiencyList",
"relating",
"to",
"the",
"given",
"resource",
"effective",
"during",
"the",
"entire",
"given",
"date",
"range",
"inclusive",
"but",
"not",
"confined",
"to",
"the",
"date",
"range",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4259-L4281 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyLookupSession.get_proficiencies_by_genus_type_for_resource_on_date | def get_proficiencies_by_genus_type_for_resource_on_date(self, resource_id, proficiency_genus_type, from_, to):
"""Gets a ``ProficiencyList`` of the given proficiency genus type relating to the given resource effective during the entire given date range inclusive but not confined to the date range.
arg... | python | def get_proficiencies_by_genus_type_for_resource_on_date(self, resource_id, proficiency_genus_type, from_, to):
"""Gets a ``ProficiencyList`` of the given proficiency genus type relating to the given resource effective during the entire given date range inclusive but not confined to the date range.
arg... | [
"def",
"get_proficiencies_by_genus_type_for_resource_on_date",
"(",
"self",
",",
"resource_id",
",",
"proficiency_genus_type",
",",
"from_",
",",
"to",
")",
":",
"# Implemented from template for",
"# osid.relationship.RelationshipLookupSession.get_relationships_by_genus_type_for_source... | Gets a ``ProficiencyList`` of the given proficiency genus type relating to the given resource effective during the entire given date range inclusive but not confined to the date range.
arg: resource_id (osid.id.Id): a resource ``Id``
arg: proficiency_genus_type (osid.type.Type): a proficiency
... | [
"Gets",
"a",
"ProficiencyList",
"of",
"the",
"given",
"proficiency",
"genus",
"type",
"relating",
"to",
"the",
"given",
"resource",
"effective",
"during",
"the",
"entire",
"given",
"date",
"range",
"inclusive",
"but",
"not",
"confined",
"to",
"the",
"date",
"r... | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4312-L4336 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyLookupSession.get_proficiencies_for_resources | def get_proficiencies_for_resources(self, resource_ids):
"""Gets a ``ProficiencyList`` relating to the given resources.
arg: resource_ids (osid.id.IdList): the resource ``Ids``
return: (osid.learning.ProficiencyList) - the returned
``Proficiency`` list
raise: NullArg... | python | def get_proficiencies_for_resources(self, resource_ids):
"""Gets a ``ProficiencyList`` relating to the given resources.
arg: resource_ids (osid.id.IdList): the resource ``Ids``
return: (osid.learning.ProficiencyList) - the returned
``Proficiency`` list
raise: NullArg... | [
"def",
"get_proficiencies_for_resources",
"(",
"self",
",",
"resource_ids",
")",
":",
"# Implemented from template for",
"# osid.relationship.RelationshipLookupSession.get_relationships_for_source",
"# NOTE: This implementation currently ignores plenary and effective views",
"collection",
"=... | Gets a ``ProficiencyList`` relating to the given resources.
arg: resource_ids (osid.id.IdList): the resource ``Ids``
return: (osid.learning.ProficiencyList) - the returned
``Proficiency`` list
raise: NullArgument - ``resource_ids`` is ``null``
raise: OperationFailed... | [
"Gets",
"a",
"ProficiencyList",
"relating",
"to",
"the",
"given",
"resources",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4339-L4360 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyLookupSession.get_proficiencies_for_objective_and_resource | def get_proficiencies_for_objective_and_resource(self, objective_id, resource_id):
"""Gets a ``ProficiencyList`` relating to the given objective and resource ````.
arg: objective_id (osid.id.Id): an objective ``Id``
arg: resource_id (osid.id.Id): a resource ``Id``
return: (osid.le... | python | def get_proficiencies_for_objective_and_resource(self, objective_id, resource_id):
"""Gets a ``ProficiencyList`` relating to the given objective and resource ````.
arg: objective_id (osid.id.Id): an objective ``Id``
arg: resource_id (osid.id.Id): a resource ``Id``
return: (osid.le... | [
"def",
"get_proficiencies_for_objective_and_resource",
"(",
"self",
",",
"objective_id",
",",
"resource_id",
")",
":",
"# Implemented from template for",
"# osid.relationship.RelationshipLookupSession.get_relationships_for_peers",
"# NOTE: This implementation currently ignores plenary and ef... | Gets a ``ProficiencyList`` relating to the given objective and resource ````.
arg: objective_id (osid.id.Id): an objective ``Id``
arg: resource_id (osid.id.Id): a resource ``Id``
return: (osid.learning.ProficiencyList) - the returned
``Proficiency`` list
raise: Nu... | [
"Gets",
"a",
"ProficiencyList",
"relating",
"to",
"the",
"given",
"objective",
"and",
"resource",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4363-L4387 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyLookupSession.get_proficiencies | def get_proficiencies(self):
"""Gets all ``Proficiencies``.
return: (osid.learning.ProficiencyList) - a list of
``Proficiencies``
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure
*compliance: mandatory -- This ... | python | def get_proficiencies(self):
"""Gets all ``Proficiencies``.
return: (osid.learning.ProficiencyList) - a list of
``Proficiencies``
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure
*compliance: mandatory -- This ... | [
"def",
"get_proficiencies",
"(",
"self",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resources",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated",
"(",
"'learning'",
",",
"collection",
"... | Gets all ``Proficiencies``.
return: (osid.learning.ProficiencyList) - a list of
``Proficiencies``
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"all",
"Proficiencies",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4461-L4478 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyQuerySession.get_proficiencies_by_query | def get_proficiencies_by_query(self, proficiency_query):
"""Gets a list of ``Proficiencies`` matching the given proficiency query.
arg: proficiency_query (osid.learning.ProficiencyQuery): the
proficiency query
return: (osid.learning.ProficiencyList) - the returned
... | python | def get_proficiencies_by_query(self, proficiency_query):
"""Gets a list of ``Proficiencies`` matching the given proficiency query.
arg: proficiency_query (osid.learning.ProficiencyQuery): the
proficiency query
return: (osid.learning.ProficiencyList) - the returned
... | [
"def",
"get_proficiencies_by_query",
"(",
"self",
",",
"proficiency_query",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceQuerySession.get_resources_by_query",
"and_list",
"=",
"list",
"(",
")",
"or_list",
"=",
"list",
"(",
")",
"for",
"term",
"in"... | Gets a list of ``Proficiencies`` matching the given proficiency query.
arg: proficiency_query (osid.learning.ProficiencyQuery): the
proficiency query
return: (osid.learning.ProficiencyList) - the returned
``ProficiencyList``
raise: NullArgument - ``proficienc... | [
"Gets",
"a",
"list",
"of",
"Proficiencies",
"matching",
"the",
"given",
"proficiency",
"query",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4604-L4645 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyAdminSession.get_proficiency_form_for_create | def get_proficiency_form_for_create(self, objective_id, resource_id, proficiency_record_types):
"""Gets the proficiency form for creating new proficiencies.
A new form should be requested for each create transaction.
arg: objective_id (osid.id.Id): the ``Id`` of the
``Object... | python | def get_proficiency_form_for_create(self, objective_id, resource_id, proficiency_record_types):
"""Gets the proficiency form for creating new proficiencies.
A new form should be requested for each create transaction.
arg: objective_id (osid.id.Id): the ``Id`` of the
``Object... | [
"def",
"get_proficiency_form_for_create",
"(",
"self",
",",
"objective_id",
",",
"resource_id",
",",
"proficiency_record_types",
")",
":",
"# Implemented from template for",
"# osid.relationship.RelationshipAdminSession.get_relationship_form_for_create",
"# These really need to be in mod... | Gets the proficiency form for creating new proficiencies.
A new form should be requested for each create transaction.
arg: objective_id (osid.id.Id): the ``Id`` of the
``Objective``
arg: resource_id (osid.id.Id): the ``Id`` of the ``Resource``
arg: proficiency_... | [
"Gets",
"the",
"proficiency",
"form",
"for",
"creating",
"new",
"proficiencies",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4773-L4827 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyAdminSession.create_proficiency | def create_proficiency(self, proficiency_form):
"""Creates a new ``Proficiency``.
A new form should be requested for each create transaction.
arg: proficiency_form (osid.learning.ProficiencyForm): the
form for this ``Proficiency``
return: (osid.learning.Proficiency) ... | python | def create_proficiency(self, proficiency_form):
"""Creates a new ``Proficiency``.
A new form should be requested for each create transaction.
arg: proficiency_form (osid.learning.ProficiencyForm): the
form for this ``Proficiency``
return: (osid.learning.Proficiency) ... | [
"def",
"create_proficiency",
"(",
"self",
",",
"proficiency_form",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.create_resource_template",
"collection",
"=",
"JSONClientValidated",
"(",
"'learning'",
",",
"collection",
"=",
"'Proficiency'",
... | Creates a new ``Proficiency``.
A new form should be requested for each create transaction.
arg: proficiency_form (osid.learning.ProficiencyForm): the
form for this ``Proficiency``
return: (osid.learning.Proficiency) - the new ``Proficiency``
raise: IllegalState - ``... | [
"Creates",
"a",
"new",
"Proficiency",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4830-L4874 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyAdminSession.update_proficiency | def update_proficiency(self, proficiency_form):
"""Updates an existing proficiency.
arg: proficiency_form (osid.learning.ProficiencyForm): the
form containing the elements to be updated
raise: IllegalState - ``proficiency_form`` already used in an
update tran... | python | def update_proficiency(self, proficiency_form):
"""Updates an existing proficiency.
arg: proficiency_form (osid.learning.ProficiencyForm): the
form containing the elements to be updated
raise: IllegalState - ``proficiency_form`` already used in an
update tran... | [
"def",
"update_proficiency",
"(",
"self",
",",
"proficiency_form",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.update_resource_template",
"collection",
"=",
"JSONClientValidated",
"(",
"'learning'",
",",
"collection",
"=",
"'Proficiency'",
... | Updates an existing proficiency.
arg: proficiency_form (osid.learning.ProficiencyForm): the
form containing the elements to be updated
raise: IllegalState - ``proficiency_form`` already used in an
update transaction
raise: InvalidArgument - the form contains... | [
"Updates",
"an",
"existing",
"proficiency",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4928-L4968 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyAdminSession.delete_proficiency | def delete_proficiency(self, proficiency_id):
"""Deletes a ``Proficiency``.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency`` to remove
raise: NotFound - ``proficiency_id`` not found
raise: NullArgument - ``proficiency_id`` is ``null``
rais... | python | def delete_proficiency(self, proficiency_id):
"""Deletes a ``Proficiency``.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency`` to remove
raise: NotFound - ``proficiency_id`` not found
raise: NullArgument - ``proficiency_id`` is ``null``
rais... | [
"def",
"delete_proficiency",
"(",
"self",
",",
"proficiency_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.delete_resource_template",
"collection",
"=",
"JSONClientValidated",
"(",
"'learning'",
",",
"collection",
"=",
"'Proficiency'",
"... | Deletes a ``Proficiency``.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency`` to remove
raise: NotFound - ``proficiency_id`` not found
raise: NullArgument - ``proficiency_id`` is ``null``
raise: OperationFailed - unable to complete request
... | [
"Deletes",
"a",
"Proficiency",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L4991-L5015 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyAdminSession.alias_proficiency | def alias_proficiency(self, proficiency_id, alias_id):
"""Adds an ``Id`` to a ``Proficiency`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Proficiency`` is determined by the
provider. The new ``Id`` performs as an alias to the primary
``Id``. If the alias is a ... | python | def alias_proficiency(self, proficiency_id, alias_id):
"""Adds an ``Id`` to a ``Proficiency`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Proficiency`` is determined by the
provider. The new ``Id`` performs as an alias to the primary
``Id``. If the alias is a ... | [
"def",
"alias_proficiency",
"(",
"self",
",",
"proficiency_id",
",",
"alias_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.alias_resources_template",
"self",
".",
"_alias_id",
"(",
"primary_id",
"=",
"proficiency_id",
",",
"equivalent_... | Adds an ``Id`` to a ``Proficiency`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Proficiency`` is determined by the
provider. The new ``Id`` performs as an alias to the primary
``Id``. If the alias is a pointer to another proficiency, it is
reassigned to the gi... | [
"Adds",
"an",
"Id",
"to",
"a",
"Proficiency",
"for",
"the",
"purpose",
"of",
"creating",
"compatibility",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L5046-L5068 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyObjectiveBankAssignmentSession.assign_proficiency_to_objective_bank | def assign_proficiency_to_objective_bank(self, proficiency_id, objective_bank_id):
"""Adds an existing ``Proficiency`` to a ``ObjectiveBank``.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency``
arg: objective_bank_id (osid.id.Id): the ``Id`` of the
... | python | def assign_proficiency_to_objective_bank(self, proficiency_id, objective_bank_id):
"""Adds an existing ``Proficiency`` to a ``ObjectiveBank``.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency``
arg: objective_bank_id (osid.id.Id): the ``Id`` of the
... | [
"def",
"assign_proficiency_to_objective_bank",
"(",
"self",
",",
"proficiency_id",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinAssignmentSession.assign_resource_to_bin",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
... | Adds an existing ``Proficiency`` to a ``ObjectiveBank``.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency``
arg: objective_bank_id (osid.id.Id): the ``Id`` of the
``ObjectiveBank``
raise: AlreadyExists - ``proficiency_id`` is already mappe... | [
"Adds",
"an",
"existing",
"Proficiency",
"to",
"a",
"ObjectiveBank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L5183-L5206 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyObjectiveBankAssignmentSession.unassign_proficiency_from_objective_bank | def unassign_proficiency_from_objective_bank(self, proficiency_id, objective_bank_id):
"""Removes a ``Proficiency`` from a ``ObjectiveBank``.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency``
arg: objective_bank_id (osid.id.Id): the ``Id`` of the
... | python | def unassign_proficiency_from_objective_bank(self, proficiency_id, objective_bank_id):
"""Removes a ``Proficiency`` from a ``ObjectiveBank``.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency``
arg: objective_bank_id (osid.id.Id): the ``Id`` of the
... | [
"def",
"unassign_proficiency_from_objective_bank",
"(",
"self",
",",
"proficiency_id",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinAssignmentSession.unassign_resource_from_bin",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
... | Removes a ``Proficiency`` from a ``ObjectiveBank``.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency``
arg: objective_bank_id (osid.id.Id): the ``Id`` of the
``ObjectiveBank``
raise: NotFound - ``proficiency_id`` or ``objective_bank_id``
... | [
"Removes",
"a",
"Proficiency",
"from",
"a",
"ObjectiveBank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L5209-L5231 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ProficiencyObjectiveBankAssignmentSession.reassign_proficiency_to_objective_bank | def reassign_proficiency_to_objective_bank(self, proficiency_id, from_objective_bank_id, to_objective_bank_id):
"""Moves a ``Proficiency`` from one ``ObjectiveBank`` to another.
Mappings to other ``ObjectiveBanks`` are unaffected.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
... | python | def reassign_proficiency_to_objective_bank(self, proficiency_id, from_objective_bank_id, to_objective_bank_id):
"""Moves a ``Proficiency`` from one ``ObjectiveBank`` to another.
Mappings to other ``ObjectiveBanks`` are unaffected.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
... | [
"def",
"reassign_proficiency_to_objective_bank",
"(",
"self",
",",
"proficiency_id",
",",
"from_objective_bank_id",
",",
"to_objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinAssignmentSession.reassign_resource_to_bin",
"self",
".",
"assign_... | Moves a ``Proficiency`` from one ``ObjectiveBank`` to another.
Mappings to other ``ObjectiveBanks`` are unaffected.
arg: proficiency_id (osid.id.Id): the ``Id`` of the
``Proficiency``
arg: from_objective_bank_id (osid.id.Id): the ``Id`` of the
current ``Ob... | [
"Moves",
"a",
"Proficiency",
"from",
"one",
"ObjectiveBank",
"to",
"another",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L5234-L5264 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankLookupSession.get_objective_banks | def get_objective_banks(self):
"""Gets all ``ObjectiveBanks``.
In plenary mode, the returned list contains all known objective
banks or an error results. Otherwise, the returned list may
contain only those objective banks that are accessible through
this session.
return... | python | def get_objective_banks(self):
"""Gets all ``ObjectiveBanks``.
In plenary mode, the returned list contains all known objective
banks or an error results. Otherwise, the returned list may
contain only those objective banks that are accessible through
this session.
return... | [
"def",
"get_objective_banks",
"(",
"self",
")",
":",
"# Implemented from template for",
"# osid.resource.BinLookupSession.get_bins_template",
"# NOTE: This implementation currently ignores plenary view",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"... | Gets all ``ObjectiveBanks``.
In plenary mode, the returned list contains all known objective
banks or an error results. Otherwise, the returned list may
contain only those objective banks that are accessible through
this session.
return: (osid.learning.ObjectiveBankList) - a
... | [
"Gets",
"all",
"ObjectiveBanks",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L5527-L5552 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankAdminSession.can_create_objective_bank_with_record_types | def can_create_objective_bank_with_record_types(self, objective_bank_record_types):
"""Tests if this user can create a single ``ObjectiveBank`` using the desired record types.
While ``LearningManager.getObjectiveBankRecordTypes()`` can be
used to examine which records are supported, this method... | python | def can_create_objective_bank_with_record_types(self, objective_bank_record_types):
"""Tests if this user can create a single ``ObjectiveBank`` using the desired record types.
While ``LearningManager.getObjectiveBankRecordTypes()`` can be
used to examine which records are supported, this method... | [
"def",
"can_create_objective_bank_with_record_types",
"(",
"self",
",",
"objective_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... | Tests if this user can create a single ``ObjectiveBank`` using the desired record types.
While ``LearningManager.getObjectiveBankRecordTypes()`` can be
used to examine which records are supported, this method tests
which record(s) are required for creating a specific
``ObjectiveBank``. ... | [
"Tests",
"if",
"this",
"user",
"can",
"create",
"a",
"single",
"ObjectiveBank",
"using",
"the",
"desired",
"record",
"types",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L5624-L5649 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankAdminSession.update_objective_bank | def update_objective_bank(self, objective_bank_form):
"""Updates an existing objective bank.
arg: objective_bank_form (osid.learning.ObjectiveBankForm):
the form containing the elements to be updated
raise: IllegalState - ``objective_bank_form`` already used in
... | python | def update_objective_bank(self, objective_bank_form):
"""Updates an existing objective bank.
arg: objective_bank_form (osid.learning.ObjectiveBankForm):
the form containing the elements to be updated
raise: IllegalState - ``objective_bank_form`` already used in
... | [
"def",
"update_objective_bank",
"(",
"self",
",",
"objective_bank_form",
")",
":",
"# Implemented from template for",
"# osid.resource.BinAdminSession.update_bin_template",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_ses... | Updates an existing objective bank.
arg: objective_bank_form (osid.learning.ObjectiveBankForm):
the form containing the elements to be updated
raise: IllegalState - ``objective_bank_form`` already used in
an update transaction
raise: InvalidArgument - the fo... | [
"Updates",
"an",
"existing",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L5796-L5835 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankAdminSession.alias_objective_bank | def alias_objective_bank(self, objective_bank_id, alias_id):
"""Adds an ``Id`` to an ``ObjectiveBank`` for the purpose of creating compatibility.
The primary ``Id`` of the ``ObjectiveBank`` is determined by the
provider. The new ``Id`` performs as an alias to the primary
``Id``. If the ... | python | def alias_objective_bank(self, objective_bank_id, alias_id):
"""Adds an ``Id`` to an ``ObjectiveBank`` for the purpose of creating compatibility.
The primary ``Id`` of the ``ObjectiveBank`` is determined by the
provider. The new ``Id`` performs as an alias to the primary
``Id``. If the ... | [
"def",
"alias_objective_bank",
"(",
"self",
",",
"objective_bank_id",
",",
"alias_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinLookupSession.alias_bin_template",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".... | Adds an ``Id`` to an ``ObjectiveBank`` for the purpose of creating compatibility.
The primary ``Id`` of the ``ObjectiveBank`` is determined by the
provider. The new ``Id`` performs as an alias to the primary
``Id``. If the alias is a pointer to another objective bank, it
is reassigned t... | [
"Adds",
"an",
"Id",
"to",
"an",
"ObjectiveBank",
"for",
"the",
"purpose",
"of",
"creating",
"compatibility",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L5908-L5932 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchySession.get_root_objective_banks | def get_root_objective_banks(self):
"""Gets the root objective banks in this objective bank hierarchy.
return: (osid.learning.ObjectiveBankList) - the root objective
banks
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failu... | python | def get_root_objective_banks(self):
"""Gets the root objective banks in this objective bank hierarchy.
return: (osid.learning.ObjectiveBankList) - the root objective
banks
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failu... | [
"def",
"get_root_objective_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_catal... | Gets the root objective banks in this objective bank hierarchy.
return: (osid.learning.ObjectiveBankList) - the root objective
banks
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure
*compliance: mandatory -- This metho... | [
"Gets",
"the",
"root",
"objective",
"banks",
"in",
"this",
"objective",
"bank",
"hierarchy",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6085-L6101 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchySession.has_parent_objective_banks | def has_parent_objective_banks(self, objective_bank_id):
"""Tests if the ``ObjectiveBank`` has any parents.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if the objective bank has parents,
``false`` otherwise... | python | def has_parent_objective_banks(self, objective_bank_id):
"""Tests if the ``ObjectiveBank`` has any parents.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if the objective bank has parents,
``false`` otherwise... | [
"def",
"has_parent_objective_banks",
"(",
"self",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.has_parent_bins",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_... | Tests if the ``ObjectiveBank`` has any parents.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if the objective bank has parents,
``false`` otherwise
raise: NotFound - ``objective_bank_id`` is not found
... | [
"Tests",
"if",
"the",
"ObjectiveBank",
"has",
"any",
"parents",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6106-L6124 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchySession.is_parent_of_objective_bank | def is_parent_of_objective_bank(self, id_, objective_bank_id):
"""Tests if an ``Id`` is a direct parent of an objective bank.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if this `... | python | def is_parent_of_objective_bank(self, id_, objective_bank_id):
"""Tests if an ``Id`` is a direct parent of an objective bank.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if this `... | [
"def",
"is_parent_of_objective_bank",
"(",
"self",
",",
"id_",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.is_parent_of_bin",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
... | Tests if an ``Id`` is a direct parent of an objective bank.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if this ``id`` is a parent of
``objective_bank_id,`` ``false`` oth... | [
"Tests",
"if",
"an",
"Id",
"is",
"a",
"direct",
"parent",
"of",
"an",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6127-L6148 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchySession.get_parent_objective_bank_ids | def get_parent_objective_bank_ids(self, objective_bank_id):
"""Gets the parent ``Ids`` of the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (osid.id.IdList) - the parent ``Ids`` of the objective
bank
... | python | def get_parent_objective_bank_ids(self, objective_bank_id):
"""Gets the parent ``Ids`` of the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (osid.id.IdList) - the parent ``Ids`` of the objective
bank
... | [
"def",
"get_parent_objective_bank_ids",
"(",
"self",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.get_parent_bin_ids",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_ca... | Gets the parent ``Ids`` of the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (osid.id.IdList) - the parent ``Ids`` of the objective
bank
raise: NotFound - ``objective_bank_id`` is not found
raise: ... | [
"Gets",
"the",
"parent",
"Ids",
"of",
"the",
"given",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6151-L6169 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchySession.get_parent_objective_banks | def get_parent_objective_banks(self, objective_bank_id):
"""Gets the parents of the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (osid.learning.ObjectiveBankList) - the parents of the
objective bank
... | python | def get_parent_objective_banks(self, objective_bank_id):
"""Gets the parents of the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (osid.learning.ObjectiveBankList) - the parents of the
objective bank
... | [
"def",
"get_parent_objective_banks",
"(",
"self",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.get_parent_bins",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_... | Gets the parents of the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (osid.learning.ObjectiveBankList) - the parents of the
objective bank
raise: NotFound - ``objective_bank_id`` is not found
raise... | [
"Gets",
"the",
"parents",
"of",
"the",
"given",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6172-L6193 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchySession.is_ancestor_of_objective_bank | def is_ancestor_of_objective_bank(self, id_, objective_bank_id):
"""Tests if an ``Id`` is an ancestor of an objective bank.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if this ``i... | python | def is_ancestor_of_objective_bank(self, id_, objective_bank_id):
"""Tests if an ``Id`` is an ancestor of an objective bank.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if this ``i... | [
"def",
"is_ancestor_of_objective_bank",
"(",
"self",
",",
"id_",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.is_ancestor_of_bin",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self... | Tests if an ``Id`` is an ancestor of an objective bank.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if this ``id`` is an ancestor of
``objective_bank_id,`` ``false`` other... | [
"Tests",
"if",
"an",
"Id",
"is",
"an",
"ancestor",
"of",
"an",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6196-L6217 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchySession.has_child_objective_banks | def has_child_objective_banks(self, objective_bank_id):
"""Tests if an objective bank has any children.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if the ``objective_bank_id`` has
children, ``false`` other... | python | def has_child_objective_banks(self, objective_bank_id):
"""Tests if an objective bank has any children.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if the ``objective_bank_id`` has
children, ``false`` other... | [
"def",
"has_child_objective_banks",
"(",
"self",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.has_child_bins",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_se... | Tests if an objective bank has any children.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if the ``objective_bank_id`` has
children, ``false`` otherwise
raise: NotFound - ``objective_bank_id`` is not found
... | [
"Tests",
"if",
"an",
"objective",
"bank",
"has",
"any",
"children",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6220-L6238 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchySession.is_child_of_objective_bank | def is_child_of_objective_bank(self, id_, objective_bank_id):
"""Tests if an objective bank is a direct child of another.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if the ``id``... | python | def is_child_of_objective_bank(self, id_, objective_bank_id):
"""Tests if an objective bank is a direct child of another.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if the ``id``... | [
"def",
"is_child_of_objective_bank",
"(",
"self",
",",
"id_",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.is_child_of_bin",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
"... | Tests if an objective bank is a direct child of another.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if the ``id`` is a child of
``objective_bank_id,`` ``false`` otherwis... | [
"Tests",
"if",
"an",
"objective",
"bank",
"is",
"a",
"direct",
"child",
"of",
"another",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6241-L6262 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchySession.get_child_objective_bank_ids | def get_child_objective_bank_ids(self, objective_bank_id):
"""Gets the child ``Ids`` of the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` to query
return: (osid.id.IdList) - the children of the objective bank
raise: NotFound - ``objective_bank_id`` is not fou... | python | def get_child_objective_bank_ids(self, objective_bank_id):
"""Gets the child ``Ids`` of the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` to query
return: (osid.id.IdList) - the children of the objective bank
raise: NotFound - ``objective_bank_id`` is not fou... | [
"def",
"get_child_objective_bank_ids",
"(",
"self",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.get_child_bin_ids",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_cata... | Gets the child ``Ids`` of the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` to query
return: (osid.id.IdList) - the children of the objective bank
raise: NotFound - ``objective_bank_id`` is not found
raise: NullArgument - ``objective_bank_id`` is ``null``
... | [
"Gets",
"the",
"child",
"Ids",
"of",
"the",
"given",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6265-L6281 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchySession.get_child_objective_banks | def get_child_objective_banks(self, objective_bank_id):
"""Gets the children of the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` to query
return: (osid.learning.ObjectiveBankList) - the children of the
objective bank
raise: NotFound - ``objec... | python | def get_child_objective_banks(self, objective_bank_id):
"""Gets the children of the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` to query
return: (osid.learning.ObjectiveBankList) - the children of the
objective bank
raise: NotFound - ``objec... | [
"def",
"get_child_objective_banks",
"(",
"self",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.get_child_bins",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_catalog_se... | Gets the children of the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` to query
return: (osid.learning.ObjectiveBankList) - the children of the
objective bank
raise: NotFound - ``objective_bank_id`` is not found
raise: NullArgument - ``object... | [
"Gets",
"the",
"children",
"of",
"the",
"given",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6284-L6304 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchySession.is_descendant_of_objective_bank | def is_descendant_of_objective_bank(self, id_, objective_bank_id):
"""Tests if an ``Id`` is a descendant of an objective bank.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if the `... | python | def is_descendant_of_objective_bank(self, id_, objective_bank_id):
"""Tests if an ``Id`` is a descendant of an objective bank.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if the `... | [
"def",
"is_descendant_of_objective_bank",
"(",
"self",
",",
"id_",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.is_descendant_of_bin",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"... | Tests if an ``Id`` is a descendant of an objective bank.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if the ``id`` is a descendant of
the ``objective_bank_id,`` ``false`` ... | [
"Tests",
"if",
"an",
"Id",
"is",
"a",
"descendant",
"of",
"an",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6307-L6328 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchySession.get_objective_bank_nodes | def get_objective_bank_nodes(self, objective_bank_id, ancestor_levels, descendant_levels, include_siblings):
"""Gets a portion of the hierarchy for the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` to query
arg: ancestor_levels (cardinal): the maximum number of
... | python | def get_objective_bank_nodes(self, objective_bank_id, ancestor_levels, descendant_levels, include_siblings):
"""Gets a portion of the hierarchy for the given objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` to query
arg: ancestor_levels (cardinal): the maximum number of
... | [
"def",
"get_objective_bank_nodes",
"(",
"self",
",",
"objective_bank_id",
",",
"ancestor_levels",
",",
"descendant_levels",
",",
"include_siblings",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchySession.get_bin_nodes",
"return",
"objects",
".",
"Obje... | Gets a portion of the hierarchy for the given objective bank.
arg: objective_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: de... | [
"Gets",
"a",
"portion",
"of",
"the",
"hierarchy",
"for",
"the",
"given",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6367-L6395 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchyDesignSession.add_root_objective_bank | def add_root_objective_bank(self, objective_bank_id):
"""Adds a root objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
raise: AlreadyExists - ``objective_bank_id`` is already in
hierarchy
raise: NotFound - ``objecti... | python | def add_root_objective_bank(self, objective_bank_id):
"""Adds a root objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
raise: AlreadyExists - ``objective_bank_id`` is already in
hierarchy
raise: NotFound - ``objecti... | [
"def",
"add_root_objective_bank",
"(",
"self",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchyDesignSession.add_root_bin_template",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".",
"... | Adds a root objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
raise: AlreadyExists - ``objective_bank_id`` is already in
hierarchy
raise: NotFound - ``objective_bank_id`` not found
raise: NullArgument - ``objective... | [
"Adds",
"a",
"root",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6480-L6498 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchyDesignSession.remove_root_objective_bank | def remove_root_objective_bank(self, objective_bank_id):
"""Removes a root objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
raise: NotFound - ``objective_bank_id`` is not a root
raise: NullArgument - ``objective_bank_id`` is ``nul... | python | def remove_root_objective_bank(self, objective_bank_id):
"""Removes a root objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
raise: NotFound - ``objective_bank_id`` is not a root
raise: NullArgument - ``objective_bank_id`` is ``nul... | [
"def",
"remove_root_objective_bank",
"(",
"self",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchyDesignSession.remove_root_bin_template",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
".... | Removes a root objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
raise: NotFound - ``objective_bank_id`` is not a root
raise: NullArgument - ``objective_bank_id`` is ``null``
raise: OperationFailed - unable to complete request
... | [
"Removes",
"a",
"root",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6501-L6517 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchyDesignSession.add_child_objective_bank | def add_child_objective_bank(self, objective_bank_id, child_id):
"""Adds a child to an objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: AlreadyExists - ``objective_b... | python | def add_child_objective_bank(self, objective_bank_id, child_id):
"""Adds a child to an objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: AlreadyExists - ``objective_b... | [
"def",
"add_child_objective_bank",
"(",
"self",
",",
"objective_bank_id",
",",
"child_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchyDesignSession.add_child_bin_template",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return... | Adds a child to an objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: AlreadyExists - ``objective_bank_id`` is already a
parent of ``child_id``
raise: ... | [
"Adds",
"a",
"child",
"to",
"an",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6520-L6541 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchyDesignSession.remove_child_objective_bank | def remove_child_objective_bank(self, objective_bank_id, child_id):
"""Removes a child from an objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
arg: child_id (osid.id.Id): the ``Id`` of the child
raise: NotFound - ``objective_ba... | python | def remove_child_objective_bank(self, objective_bank_id, child_id):
"""Removes a child from an objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
arg: child_id (osid.id.Id): the ``Id`` of the child
raise: NotFound - ``objective_ba... | [
"def",
"remove_child_objective_bank",
"(",
"self",
",",
"objective_bank_id",
",",
"child_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchyDesignSession.remove_child_bin_template",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"... | Removes a child from an objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
arg: child_id (osid.id.Id): the ``Id`` of the child
raise: NotFound - ``objective_bank_id`` not a parent of
``child_id``
raise: NullArgume... | [
"Removes",
"a",
"child",
"from",
"an",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6544-L6563 |
mitsei/dlkit | dlkit/json_/learning/sessions.py | ObjectiveBankHierarchyDesignSession.remove_child_objective_banks | def remove_child_objective_banks(self, objective_bank_id):
"""Removes all children from an objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
raise: NotFound - ``objective_bank_id`` not in hierarchy
raise: NullArgument - ``objective... | python | def remove_child_objective_banks(self, objective_bank_id):
"""Removes all children from an objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
raise: NotFound - ``objective_bank_id`` not in hierarchy
raise: NullArgument - ``objective... | [
"def",
"remove_child_objective_banks",
"(",
"self",
",",
"objective_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.BinHierarchyDesignSession.remove_child_bin_template",
"if",
"self",
".",
"_catalog_session",
"is",
"not",
"None",
":",
"return",
"self",
... | Removes all children from an objective bank.
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
raise: NotFound - ``objective_bank_id`` not in hierarchy
raise: NullArgument - ``objective_bank_id`` is ``null``
raise: OperationFailed - unable to com... | [
"Removes",
"all",
"children",
"from",
"an",
"objective",
"bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/sessions.py#L6566-L6582 |
MacHu-GWU/docfly-project | docfly/api_reference_doc.py | is_ignored | def is_ignored(mod_or_pkg, ignored_package):
"""Test, if this :class:`docfly.pkg.picage.Module`
or :class:`docfly.pkg.picage.Package` should be included to generate
API reference document.
:param mod_or_pkg: module or package
:param ignored_package: ignored package
**中文文档**
根据全名判断一个包或者模块是... | python | def is_ignored(mod_or_pkg, ignored_package):
"""Test, if this :class:`docfly.pkg.picage.Module`
or :class:`docfly.pkg.picage.Package` should be included to generate
API reference document.
:param mod_or_pkg: module or package
:param ignored_package: ignored package
**中文文档**
根据全名判断一个包或者模块是... | [
"def",
"is_ignored",
"(",
"mod_or_pkg",
",",
"ignored_package",
")",
":",
"ignored_pattern",
"=",
"list",
"(",
")",
"for",
"pkg_fullname",
"in",
"ignored_package",
":",
"if",
"pkg_fullname",
".",
"endswith",
"(",
"\".py\"",
")",
":",
"pkg_fullname",
"=",
"pkg_... | Test, if this :class:`docfly.pkg.picage.Module`
or :class:`docfly.pkg.picage.Package` should be included to generate
API reference document.
:param mod_or_pkg: module or package
:param ignored_package: ignored package
**中文文档**
根据全名判断一个包或者模块是否要被包含到自动生成的API文档中。 | [
"Test",
"if",
"this",
":",
"class",
":",
"docfly",
".",
"pkg",
".",
"picage",
".",
"Module",
"or",
":",
"class",
":",
"docfly",
".",
"pkg",
".",
"picage",
".",
"Package",
"should",
"be",
"included",
"to",
"generate",
"API",
"reference",
"document",
"."... | train | https://github.com/MacHu-GWU/docfly-project/blob/46da8a9793211301c3ebc12d195228dbf79fdfec/docfly/api_reference_doc.py#L30-L53 |
MacHu-GWU/docfly-project | docfly/api_reference_doc.py | ApiReferenceDoc.fly | def fly(self):
"""
Generate doc tree.
"""
dst_dir = Path(self.conf_file).parent.abspath
package_dir = Path(dst_dir, self.package.shortname)
# delete existing api document
try:
if package_dir.exists():
shutil.rmtree(package_dir.abspath... | python | def fly(self):
"""
Generate doc tree.
"""
dst_dir = Path(self.conf_file).parent.abspath
package_dir = Path(dst_dir, self.package.shortname)
# delete existing api document
try:
if package_dir.exists():
shutil.rmtree(package_dir.abspath... | [
"def",
"fly",
"(",
"self",
")",
":",
"dst_dir",
"=",
"Path",
"(",
"self",
".",
"conf_file",
")",
".",
"parent",
".",
"abspath",
"package_dir",
"=",
"Path",
"(",
"dst_dir",
",",
"self",
".",
"package",
".",
"shortname",
")",
"# delete existing api document"... | Generate doc tree. | [
"Generate",
"doc",
"tree",
"."
] | train | https://github.com/MacHu-GWU/docfly-project/blob/46da8a9793211301c3ebc12d195228dbf79fdfec/docfly/api_reference_doc.py#L109-L142 |
MacHu-GWU/docfly-project | docfly/api_reference_doc.py | ApiReferenceDoc.generate_package_content | def generate_package_content(self, package):
"""Generate package.rst text content.
::
{{ package_name }}
==================
.. automodule:: {{ package_name }}
:members:
sub packages and modules
------------------------
... | python | def generate_package_content(self, package):
"""Generate package.rst text content.
::
{{ package_name }}
==================
.. automodule:: {{ package_name }}
:members:
sub packages and modules
------------------------
... | [
"def",
"generate_package_content",
"(",
"self",
",",
"package",
")",
":",
"if",
"isinstance",
"(",
"package",
",",
"Package",
")",
":",
"return",
"package",
".",
"render",
"(",
"ignored_package",
"=",
"self",
".",
"ignored_package",
")",
"else",
":",
"# prag... | Generate package.rst text content.
::
{{ package_name }}
==================
.. automodule:: {{ package_name }}
:members:
sub packages and modules
------------------------
.. toctree::
:maxdepth: 1
... | [
"Generate",
"package",
".",
"rst",
"text",
"content",
"."
] | train | https://github.com/MacHu-GWU/docfly-project/blob/46da8a9793211301c3ebc12d195228dbf79fdfec/docfly/api_reference_doc.py#L144-L170 |
MacHu-GWU/docfly-project | docfly/api_reference_doc.py | ApiReferenceDoc.generate_module_content | def generate_module_content(self, module):
"""Generate module.rst text content.
::
{{ module_name }}
=================
.. automodule:: {{ module_fullname }}
:members:
"""
if isinstance(module, Module):
return module.rende... | python | def generate_module_content(self, module):
"""Generate module.rst text content.
::
{{ module_name }}
=================
.. automodule:: {{ module_fullname }}
:members:
"""
if isinstance(module, Module):
return module.rende... | [
"def",
"generate_module_content",
"(",
"self",
",",
"module",
")",
":",
"if",
"isinstance",
"(",
"module",
",",
"Module",
")",
":",
"return",
"module",
".",
"render",
"(",
")",
"else",
":",
"# pragma: no cover",
"raise",
"Exception",
"(",
"\"%r is not a Module... | Generate module.rst text content.
::
{{ module_name }}
=================
.. automodule:: {{ module_fullname }}
:members: | [
"Generate",
"module",
".",
"rst",
"text",
"content",
"."
] | train | https://github.com/MacHu-GWU/docfly-project/blob/46da8a9793211301c3ebc12d195228dbf79fdfec/docfly/api_reference_doc.py#L172-L186 |
bluec0re/android-backup-tools | android_backup/android_backup.py | AndroidBackup.open | def open(self, fname, mode='rb'):
"""
(Re-)opens a backup file
"""
self.close()
self.fp = open(fname, mode)
self.fname = fname | python | def open(self, fname, mode='rb'):
"""
(Re-)opens a backup file
"""
self.close()
self.fp = open(fname, mode)
self.fname = fname | [
"def",
"open",
"(",
"self",
",",
"fname",
",",
"mode",
"=",
"'rb'",
")",
":",
"self",
".",
"close",
"(",
")",
"self",
".",
"fp",
"=",
"open",
"(",
"fname",
",",
"mode",
")",
"self",
".",
"fname",
"=",
"fname"
] | (Re-)opens a backup file | [
"(",
"Re",
"-",
")",
"opens",
"a",
"backup",
"file"
] | train | https://github.com/bluec0re/android-backup-tools/blob/e2e0d95e56624c1a99a176df9e307398e837d908/android_backup/android_backup.py#L104-L110 |
bluec0re/android-backup-tools | android_backup/android_backup.py | AndroidBackup.parse | def parse(self):
"""
Parses a backup file header. Will be done automatically if
used together with the 'with' statement
"""
self.fp.seek(0)
magic = self.fp.readline()
assert magic == b'ANDROID BACKUP\n'
self.version = int(self.fp.readline().strip())
... | python | def parse(self):
"""
Parses a backup file header. Will be done automatically if
used together with the 'with' statement
"""
self.fp.seek(0)
magic = self.fp.readline()
assert magic == b'ANDROID BACKUP\n'
self.version = int(self.fp.readline().strip())
... | [
"def",
"parse",
"(",
"self",
")",
":",
"self",
".",
"fp",
".",
"seek",
"(",
"0",
")",
"magic",
"=",
"self",
".",
"fp",
".",
"readline",
"(",
")",
"assert",
"magic",
"==",
"b'ANDROID BACKUP\\n'",
"self",
".",
"version",
"=",
"int",
"(",
"self",
".",... | Parses a backup file header. Will be done automatically if
used together with the 'with' statement | [
"Parses",
"a",
"backup",
"file",
"header",
".",
"Will",
"be",
"done",
"automatically",
"if",
"used",
"together",
"with",
"the",
"with",
"statement"
] | train | https://github.com/bluec0re/android-backup-tools/blob/e2e0d95e56624c1a99a176df9e307398e837d908/android_backup/android_backup.py#L125-L136 |
bluec0re/android-backup-tools | android_backup/android_backup.py | AndroidBackup._decrypt | def _decrypt(self, fp, password=None):
"""
Internal decryption function
Uses either the password argument for the decryption,
or, if not supplied, the password field of the object
:param fp: a file object or similar which supports the readline and read methods
:rtype: P... | python | def _decrypt(self, fp, password=None):
"""
Internal decryption function
Uses either the password argument for the decryption,
or, if not supplied, the password field of the object
:param fp: a file object or similar which supports the readline and read methods
:rtype: P... | [
"def",
"_decrypt",
"(",
"self",
",",
"fp",
",",
"password",
"=",
"None",
")",
":",
"if",
"AES",
"is",
"None",
":",
"raise",
"ImportError",
"(",
"\"PyCrypto required\"",
")",
"if",
"password",
"is",
"None",
":",
"password",
"=",
"self",
".",
"password",
... | Internal decryption function
Uses either the password argument for the decryption,
or, if not supplied, the password field of the object
:param fp: a file object or similar which supports the readline and read methods
:rtype: Proxy | [
"Internal",
"decryption",
"function"
] | train | https://github.com/bluec0re/android-backup-tools/blob/e2e0d95e56624c1a99a176df9e307398e837d908/android_backup/android_backup.py#L145-L236 |
bluec0re/android-backup-tools | android_backup/android_backup.py | AndroidBackup.encode_utf8 | def encode_utf8(mk):
"""
(Double-)encodes the given string (masterkey) with utf-8
Tries to behave like the Java implementation
"""
utf8mk = mk.decode('raw_unicode_escape')
utf8mk = list(utf8mk)
to_char = chr
if sys.version_info[0] < 3:
to_char... | python | def encode_utf8(mk):
"""
(Double-)encodes the given string (masterkey) with utf-8
Tries to behave like the Java implementation
"""
utf8mk = mk.decode('raw_unicode_escape')
utf8mk = list(utf8mk)
to_char = chr
if sys.version_info[0] < 3:
to_char... | [
"def",
"encode_utf8",
"(",
"mk",
")",
":",
"utf8mk",
"=",
"mk",
".",
"decode",
"(",
"'raw_unicode_escape'",
")",
"utf8mk",
"=",
"list",
"(",
"utf8mk",
")",
"to_char",
"=",
"chr",
"if",
"sys",
".",
"version_info",
"[",
"0",
"]",
"<",
"3",
":",
"to_cha... | (Double-)encodes the given string (masterkey) with utf-8
Tries to behave like the Java implementation | [
"(",
"Double",
"-",
")",
"encodes",
"the",
"given",
"string",
"(",
"masterkey",
")",
"with",
"utf",
"-",
"8"
] | train | https://github.com/bluec0re/android-backup-tools/blob/e2e0d95e56624c1a99a176df9e307398e837d908/android_backup/android_backup.py#L239-L256 |
bluec0re/android-backup-tools | android_backup/android_backup.py | AndroidBackup._encrypt | def _encrypt(self, dec, password=None):
"""
Internal encryption function
Uses either the password argument for the encryption,
or, if not supplied, the password field of the object
:param dec: a byte string representing the to be encrypted data
:rtype: bytes
"""... | python | def _encrypt(self, dec, password=None):
"""
Internal encryption function
Uses either the password argument for the encryption,
or, if not supplied, the password field of the object
:param dec: a byte string representing the to be encrypted data
:rtype: bytes
"""... | [
"def",
"_encrypt",
"(",
"self",
",",
"dec",
",",
"password",
"=",
"None",
")",
":",
"if",
"AES",
"is",
"None",
":",
"raise",
"ImportError",
"(",
"\"PyCrypto required\"",
")",
"if",
"password",
"is",
"None",
":",
"password",
"=",
"self",
".",
"password",
... | Internal encryption function
Uses either the password argument for the encryption,
or, if not supplied, the password field of the object
:param dec: a byte string representing the to be encrypted data
:rtype: bytes | [
"Internal",
"encryption",
"function"
] | train | https://github.com/bluec0re/android-backup-tools/blob/e2e0d95e56624c1a99a176df9e307398e837d908/android_backup/android_backup.py#L258-L318 |
bluec0re/android-backup-tools | android_backup/android_backup.py | AndroidBackup._decompress | def _decompress(self, fp):
"""
Internal function for decompressing a backup file with the DEFLATE algorithm
:rtype: Proxy
"""
decompressor = zlib.decompressobj()
if self.stream:
return Proxy(decompressor.decompress, fp)
else:
out = io.Byte... | python | def _decompress(self, fp):
"""
Internal function for decompressing a backup file with the DEFLATE algorithm
:rtype: Proxy
"""
decompressor = zlib.decompressobj()
if self.stream:
return Proxy(decompressor.decompress, fp)
else:
out = io.Byte... | [
"def",
"_decompress",
"(",
"self",
",",
"fp",
")",
":",
"decompressor",
"=",
"zlib",
".",
"decompressobj",
"(",
")",
"if",
"self",
".",
"stream",
":",
"return",
"Proxy",
"(",
"decompressor",
".",
"decompress",
",",
"fp",
")",
"else",
":",
"out",
"=",
... | Internal function for decompressing a backup file with the DEFLATE algorithm
:rtype: Proxy | [
"Internal",
"function",
"for",
"decompressing",
"a",
"backup",
"file",
"with",
"the",
"DEFLATE",
"algorithm"
] | train | https://github.com/bluec0re/android-backup-tools/blob/e2e0d95e56624c1a99a176df9e307398e837d908/android_backup/android_backup.py#L320-L333 |
bluec0re/android-backup-tools | android_backup/android_backup.py | AndroidBackup.read_data | def read_data(self, password=None):
"""
Helper function which decrypts and decompresses the data if necessary
and returns a tarfile.TarFile to interact with
"""
fp = self.fp
fp.seek(self.__data_start)
if self.is_encrypted():
fp = self._decrypt(fp, pas... | python | def read_data(self, password=None):
"""
Helper function which decrypts and decompresses the data if necessary
and returns a tarfile.TarFile to interact with
"""
fp = self.fp
fp.seek(self.__data_start)
if self.is_encrypted():
fp = self._decrypt(fp, pas... | [
"def",
"read_data",
"(",
"self",
",",
"password",
"=",
"None",
")",
":",
"fp",
"=",
"self",
".",
"fp",
"fp",
".",
"seek",
"(",
"self",
".",
"__data_start",
")",
"if",
"self",
".",
"is_encrypted",
"(",
")",
":",
"fp",
"=",
"self",
".",
"_decrypt",
... | Helper function which decrypts and decompresses the data if necessary
and returns a tarfile.TarFile to interact with | [
"Helper",
"function",
"which",
"decrypts",
"and",
"decompresses",
"the",
"data",
"if",
"necessary",
"and",
"returns",
"a",
"tarfile",
".",
"TarFile",
"to",
"interact",
"with"
] | train | https://github.com/bluec0re/android-backup-tools/blob/e2e0d95e56624c1a99a176df9e307398e837d908/android_backup/android_backup.py#L335-L354 |
bluec0re/android-backup-tools | android_backup/android_backup.py | AndroidBackup.unpack | def unpack(self, target_dir=None, password=None, pickle_fname=None):
"""
High level function for unpacking a backup file into the given
target directory (will be generated based on the filename if not given).
Creates also a filename.pickle file containing the exact order of the included... | python | def unpack(self, target_dir=None, password=None, pickle_fname=None):
"""
High level function for unpacking a backup file into the given
target directory (will be generated based on the filename if not given).
Creates also a filename.pickle file containing the exact order of the included... | [
"def",
"unpack",
"(",
"self",
",",
"target_dir",
"=",
"None",
",",
"password",
"=",
"None",
",",
"pickle_fname",
"=",
"None",
")",
":",
"if",
"target_dir",
"is",
"None",
":",
"target_dir",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"self",
".",
"f... | High level function for unpacking a backup file into the given
target directory (will be generated based on the filename if not given).
Creates also a filename.pickle file containing the exact order of the included files
(required for repacking).
:param target_dir: the directory to ext... | [
"High",
"level",
"function",
"for",
"unpacking",
"a",
"backup",
"file",
"into",
"the",
"given",
"target",
"directory",
"(",
"will",
"be",
"generated",
"based",
"on",
"the",
"filename",
"if",
"not",
"given",
")",
"."
] | train | https://github.com/bluec0re/android-backup-tools/blob/e2e0d95e56624c1a99a176df9e307398e837d908/android_backup/android_backup.py#L356-L386 |
bluec0re/android-backup-tools | android_backup/android_backup.py | AndroidBackup.pack | def pack(self, fname, source_dir=None, password=None, pickle_fname=None):
"""
High level function for repacking a backup file from the given
target directory (will be generated based on the filename if not given).
Requires also a filename.pickle file which was generated during the unpac... | python | def pack(self, fname, source_dir=None, password=None, pickle_fname=None):
"""
High level function for repacking a backup file from the given
target directory (will be generated based on the filename if not given).
Requires also a filename.pickle file which was generated during the unpac... | [
"def",
"pack",
"(",
"self",
",",
"fname",
",",
"source_dir",
"=",
"None",
",",
"password",
"=",
"None",
",",
"pickle_fname",
"=",
"None",
")",
":",
"if",
"source_dir",
"is",
"None",
":",
"source_dir",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"fn... | High level function for repacking a backup file from the given
target directory (will be generated based on the filename if not given).
Requires also a filename.pickle file which was generated during the unpacking
step.
The fields `version`, `compression` and `encryption` have to be se... | [
"High",
"level",
"function",
"for",
"repacking",
"a",
"backup",
"file",
"from",
"the",
"given",
"target",
"directory",
"(",
"will",
"be",
"generated",
"based",
"on",
"the",
"filename",
"if",
"not",
"given",
")",
"."
] | train | https://github.com/bluec0re/android-backup-tools/blob/e2e0d95e56624c1a99a176df9e307398e837d908/android_backup/android_backup.py#L402-L458 |
mitsei/dlkit | dlkit/json_/type/objects.py | TypeForm.set_display_name | def set_display_name(self, display_name):
"""Sets a display name.
arg: display_name (string): the new display name
raise: InvalidArgument - ``display_name`` is invalid
raise: NoAccess - ``display_name`` cannot be modified
raise: NullArgument - ``display_name`` is ``null``
... | python | def set_display_name(self, display_name):
"""Sets a display name.
arg: display_name (string): the new display name
raise: InvalidArgument - ``display_name`` is invalid
raise: NoAccess - ``display_name`` cannot be modified
raise: NullArgument - ``display_name`` is ``null``
... | [
"def",
"set_display_name",
"(",
"self",
",",
"display_name",
")",
":",
"if",
"self",
".",
"get_display_name_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"errors",
".",
"NoAccess",
"(",
")",
"if",
"not",
"self",
".",
"_is_valid_string",
... | Sets a display name.
arg: display_name (string): the new display name
raise: InvalidArgument - ``display_name`` is invalid
raise: NoAccess - ``display_name`` cannot be modified
raise: NullArgument - ``display_name`` is ``null``
*compliance: mandatory -- This method must be... | [
"Sets",
"a",
"display",
"name",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/type/objects.py#L88-L103 |
mitsei/dlkit | dlkit/json_/type/objects.py | TypeForm.clear_display_name | def clear_display_name(self):
"""Clears the display name.
raise: NoAccess - ``display_name`` cannot be modified
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_display_name_metadata().is_read_only() or
self.get_display_name_metadata... | python | def clear_display_name(self):
"""Clears the display name.
raise: NoAccess - ``display_name`` cannot be modified
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_display_name_metadata().is_read_only() or
self.get_display_name_metadata... | [
"def",
"clear_display_name",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_display_name_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_display_name_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
"er... | Clears the display name.
raise: NoAccess - ``display_name`` cannot be modified
*compliance: mandatory -- This method must be implemented.* | [
"Clears",
"the",
"display",
"name",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/type/objects.py#L105-L115 |
mitsei/dlkit | dlkit/json_/type/objects.py | TypeForm.set_display_label | def set_display_label(self, display_label):
"""Seta a display label.
arg: display_label (string): the new display label
raise: InvalidArgument - ``display_label`` is invalid
raise: NoAccess - ``display_label`` cannot be modified
raise: NullArgument - ``display_label`` is `... | python | def set_display_label(self, display_label):
"""Seta a display label.
arg: display_label (string): the new display label
raise: InvalidArgument - ``display_label`` is invalid
raise: NoAccess - ``display_label`` cannot be modified
raise: NullArgument - ``display_label`` is `... | [
"def",
"set_display_label",
"(",
"self",
",",
"display_label",
")",
":",
"if",
"self",
".",
"get_display_label_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"errors",
".",
"NoAccess",
"(",
")",
"if",
"not",
"self",
".",
"_is_valid_string"... | Seta a display label.
arg: display_label (string): the new display label
raise: InvalidArgument - ``display_label`` is invalid
raise: NoAccess - ``display_label`` cannot be modified
raise: NullArgument - ``display_label`` is ``null``
*compliance: mandatory -- This method m... | [
"Seta",
"a",
"display",
"label",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/type/objects.py#L132-L147 |
mitsei/dlkit | dlkit/json_/type/objects.py | TypeForm.clear_display_label | def clear_display_label(self):
"""Clears the display label.
raise: NoAccess - ``display_label`` cannot be modified
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_display_label_metadata().is_read_only() or
self.get_display_label_met... | python | def clear_display_label(self):
"""Clears the display label.
raise: NoAccess - ``display_label`` cannot be modified
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_display_label_metadata().is_read_only() or
self.get_display_label_met... | [
"def",
"clear_display_label",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_display_label_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_display_label_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
... | Clears the display label.
raise: NoAccess - ``display_label`` cannot be modified
*compliance: mandatory -- This method must be implemented.* | [
"Clears",
"the",
"display",
"label",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/type/objects.py#L149-L159 |
mitsei/dlkit | dlkit/json_/type/objects.py | TypeForm.set_description | def set_description(self, description):
"""Sets a description.
arg: description (string): the new description
raise: InvalidArgument - ``description`` is invalid
raise: NoAccess - ``description`` cannot be modified
raise: NullArgument - ``description`` is ``null``
... | python | def set_description(self, description):
"""Sets a description.
arg: description (string): the new description
raise: InvalidArgument - ``description`` is invalid
raise: NoAccess - ``description`` cannot be modified
raise: NullArgument - ``description`` is ``null``
... | [
"def",
"set_description",
"(",
"self",
",",
"description",
")",
":",
"if",
"self",
".",
"get_description_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"errors",
".",
"NoAccess",
"(",
")",
"if",
"not",
"self",
".",
"_is_valid_string",
"(... | Sets a description.
arg: description (string): the new description
raise: InvalidArgument - ``description`` is invalid
raise: NoAccess - ``description`` cannot be modified
raise: NullArgument - ``description`` is ``null``
*compliance: mandatory -- This method must be imple... | [
"Sets",
"a",
"description",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/type/objects.py#L176-L191 |
mitsei/dlkit | dlkit/json_/type/objects.py | TypeForm.clear_description | def clear_description(self):
"""Clears the description.
raise: NoAccess - ``description`` cannot be modified
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_domain_metadata().is_read_only() or
self.get_domain_metadata().is_required(... | python | def clear_description(self):
"""Clears the description.
raise: NoAccess - ``description`` cannot be modified
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_domain_metadata().is_read_only() or
self.get_domain_metadata().is_required(... | [
"def",
"clear_description",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_domain_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_domain_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
"errors",
".",... | Clears the description.
raise: NoAccess - ``description`` cannot be modified
*compliance: mandatory -- This method must be implemented.* | [
"Clears",
"the",
"description",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/type/objects.py#L193-L203 |
mitsei/dlkit | dlkit/json_/type/objects.py | TypeForm.set_domain | def set_domain(self, domain):
"""Sets a domain.
arg: domain (string): the new domain
raise: InvalidArgument - ``domain`` is invalid
raise: NoAccess - ``domain`` cannot be modified
raise: NullArgument - ``domain`` is ``null``
*compliance: mandatory -- This method mu... | python | def set_domain(self, domain):
"""Sets a domain.
arg: domain (string): the new domain
raise: InvalidArgument - ``domain`` is invalid
raise: NoAccess - ``domain`` cannot be modified
raise: NullArgument - ``domain`` is ``null``
*compliance: mandatory -- This method mu... | [
"def",
"set_domain",
"(",
"self",
",",
"domain",
")",
":",
"if",
"self",
".",
"get_domain_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"errors",
".",
"NoAccess",
"(",
")",
"if",
"not",
"self",
".",
"_is_valid_string",
"(",
"domain",
... | Sets a domain.
arg: domain (string): the new domain
raise: InvalidArgument - ``domain`` is invalid
raise: NoAccess - ``domain`` cannot be modified
raise: NullArgument - ``domain`` is ``null``
*compliance: mandatory -- This method must be implemented.* | [
"Sets",
"a",
"domain",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/type/objects.py#L220-L235 |
mitsei/dlkit | dlkit/handcar/relationship/objects.py | RelationshipList.get_next_relationship | def get_next_relationship(self):
"""Gets the next ``Relationship`` in this list.
return: (osid.relationship.Relationship) - the next
``Relationship`` in this list. The ``has_next()`` method
should be used to test that a next ``Relationship`` is
available ... | python | def get_next_relationship(self):
"""Gets the next ``Relationship`` in this list.
return: (osid.relationship.Relationship) - the next
``Relationship`` in this list. The ``has_next()`` method
should be used to test that a next ``Relationship`` is
available ... | [
"def",
"get_next_relationship",
"(",
"self",
")",
":",
"try",
":",
"next_object",
"=",
"next",
"(",
"self",
")",
"except",
"StopIteration",
":",
"raise",
"IllegalState",
"(",
"'no more elements available in this list'",
")",
"except",
"Exception",
":",
"# Need to sp... | Gets the next ``Relationship`` in this list.
return: (osid.relationship.Relationship) - the next
``Relationship`` in this list. The ``has_next()`` method
should be used to test that a next ``Relationship`` is
available before calling this method.
raise: ... | [
"Gets",
"the",
"next",
"Relationship",
"in",
"this",
"list",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/relationship/objects.py#L139-L158 |
mitsei/dlkit | dlkit/handcar/relationship/objects.py | RelationshipList.get_next_relationships | def get_next_relationships(self, n=None):
"""Gets the next set of ``Relationships`` elements in this list.
The specified amount must be less than or equal to the return
from ``available()``.
arg: n (cardinal): the number of ``Relationship`` elements
requested which m... | python | def get_next_relationships(self, n=None):
"""Gets the next set of ``Relationships`` elements in this list.
The specified amount must be less than or equal to the return
from ``available()``.
arg: n (cardinal): the number of ``Relationship`` elements
requested which m... | [
"def",
"get_next_relationships",
"(",
"self",
",",
"n",
"=",
"None",
")",
":",
"if",
"n",
">",
"self",
".",
"available",
"(",
")",
":",
"# !!! This is not quite as specified (see method docs) !!!",
"raise",
"IllegalState",
"(",
"'not enough elements available in this li... | Gets the next set of ``Relationships`` elements in this list.
The specified amount must be less than or equal to the return
from ``available()``.
arg: n (cardinal): the number of ``Relationship`` elements
requested which must be less than or equal to
``availa... | [
"Gets",
"the",
"next",
"set",
"of",
"Relationships",
"elements",
"in",
"this",
"list",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/relationship/objects.py#L173-L202 |
mitsei/dlkit | dlkit/handcar/relationship/objects.py | FamilyList.get_next_family | def get_next_family(self):
"""Gets the next ``Family`` in this list.
return: (osid.relationship.Family) - the next ``Family`` in this
list. The ``has_next()`` method should be used to test
that a next ``Family`` is available before calling this
method.
... | python | def get_next_family(self):
"""Gets the next ``Family`` in this list.
return: (osid.relationship.Family) - the next ``Family`` in this
list. The ``has_next()`` method should be used to test
that a next ``Family`` is available before calling this
method.
... | [
"def",
"get_next_family",
"(",
"self",
")",
":",
"try",
":",
"next_object",
"=",
"next",
"(",
"self",
")",
"except",
"StopIteration",
":",
"raise",
"IllegalState",
"(",
"'no more elements available in this list'",
")",
"except",
"Exception",
":",
"# Need to specify ... | Gets the next ``Family`` in this list.
return: (osid.relationship.Family) - the next ``Family`` in this
list. The ``has_next()`` method should be used to test
that a next ``Family`` is available before calling this
method.
raise: IllegalState - no more e... | [
"Gets",
"the",
"next",
"Family",
"in",
"this",
"list",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/relationship/objects.py#L308-L327 |
compmech/composites | composites/matlamina.py | read_laminaprop | def read_laminaprop(laminaprop=None, rho=None):
"""Returns a ``MatLamina`` object based on an input ``laminaprop`` tuple
Parameters
----------
laminaprop : list or tuple
Tuple containing the folliwing entries:
(e1, e2, nu12, g12, g13, g23, e3, nu13, nu23)
for othotropic ma... | python | def read_laminaprop(laminaprop=None, rho=None):
"""Returns a ``MatLamina`` object based on an input ``laminaprop`` tuple
Parameters
----------
laminaprop : list or tuple
Tuple containing the folliwing entries:
(e1, e2, nu12, g12, g13, g23, e3, nu13, nu23)
for othotropic ma... | [
"def",
"read_laminaprop",
"(",
"laminaprop",
"=",
"None",
",",
"rho",
"=",
"None",
")",
":",
"matlam",
"=",
"MatLamina",
"(",
")",
"#laminaProp = (e1, e2, nu12, g12, g13, g23, e3, nu13, nu23)",
"if",
"laminaprop",
"==",
"None",
":",
"error",
"(",
"'laminaprop must b... | Returns a ``MatLamina`` object based on an input ``laminaprop`` tuple
Parameters
----------
laminaprop : list or tuple
Tuple containing the folliwing entries:
(e1, e2, nu12, g12, g13, g23, e3, nu13, nu23)
for othotropic materials the user can only supply:
(e1, e2,... | [
"Returns",
"a",
"MatLamina",
"object",
"based",
"on",
"an",
"input",
"laminaprop",
"tuple"
] | train | https://github.com/compmech/composites/blob/3c5d4fd6033898e35a5085063af5dbb81eb6a97d/composites/matlamina.py#L199-L274 |
erkghlerngm44/malaffinity | malaffinity/endpoints.py | myanimelist | def myanimelist(username):
"""
Retrieve a users' animelist scores from MAL.
Only anime scored > 0 will be returned, and all
PTW entries are ignored, even if they are scored.
:param str username: MAL username
:return: `id`, `score` pairs
:rtype: list
"""
params = {
"u": user... | python | def myanimelist(username):
"""
Retrieve a users' animelist scores from MAL.
Only anime scored > 0 will be returned, and all
PTW entries are ignored, even if they are scored.
:param str username: MAL username
:return: `id`, `score` pairs
:rtype: list
"""
params = {
"u": user... | [
"def",
"myanimelist",
"(",
"username",
")",
":",
"params",
"=",
"{",
"\"u\"",
":",
"username",
",",
"\"status\"",
":",
"\"all\"",
",",
"\"type\"",
":",
"\"anime\"",
"}",
"resp",
"=",
"requests",
".",
"request",
"(",
"\"GET\"",
",",
"ENDPOINT_URLS",
".",
... | Retrieve a users' animelist scores from MAL.
Only anime scored > 0 will be returned, and all
PTW entries are ignored, even if they are scored.
:param str username: MAL username
:return: `id`, `score` pairs
:rtype: list | [
"Retrieve",
"a",
"users",
"animelist",
"scores",
"from",
"MAL",
"."
] | train | https://github.com/erkghlerngm44/malaffinity/blob/d866b9198b668333f0b86567b2faebdb20587e30/malaffinity/endpoints.py#L15-L76 |
python-odin/odinweb | odinweb/signing.py | _generate_signature | def _generate_signature(url_path, secret_key, query_args, digest=None, encoder=None):
# type: (str, bytes, Dict[str, str], Callable, Callable) -> str
"""
Generate signature from pre-parsed URL.
"""
digest = digest or DEFAULT_DIGEST
encoder = encoder or DEFAULT_ENCODER
msg = "%s?%s" % (url_pa... | python | def _generate_signature(url_path, secret_key, query_args, digest=None, encoder=None):
# type: (str, bytes, Dict[str, str], Callable, Callable) -> str
"""
Generate signature from pre-parsed URL.
"""
digest = digest or DEFAULT_DIGEST
encoder = encoder or DEFAULT_ENCODER
msg = "%s?%s" % (url_pa... | [
"def",
"_generate_signature",
"(",
"url_path",
",",
"secret_key",
",",
"query_args",
",",
"digest",
"=",
"None",
",",
"encoder",
"=",
"None",
")",
":",
"# type: (str, bytes, Dict[str, str], Callable, Callable) -> str",
"digest",
"=",
"digest",
"or",
"DEFAULT_DIGEST",
... | Generate signature from pre-parsed URL. | [
"Generate",
"signature",
"from",
"pre",
"-",
"parsed",
"URL",
"."
] | train | https://github.com/python-odin/odinweb/blob/198424133584acc18cb41c8d18d91f803abc810f/odinweb/signing.py#L32-L46 |
python-odin/odinweb | odinweb/signing.py | sign_url_path | def sign_url_path(url, secret_key, expire_in=None, digest=None):
# type: (str, bytes, int, Callable) -> str
"""
Sign a URL (excluding the domain and scheme).
:param url: URL to sign
:param secret_key: Secret key
:param expire_in: Expiry time.
:param digest: Specify the digest function to us... | python | def sign_url_path(url, secret_key, expire_in=None, digest=None):
# type: (str, bytes, int, Callable) -> str
"""
Sign a URL (excluding the domain and scheme).
:param url: URL to sign
:param secret_key: Secret key
:param expire_in: Expiry time.
:param digest: Specify the digest function to us... | [
"def",
"sign_url_path",
"(",
"url",
",",
"secret_key",
",",
"expire_in",
"=",
"None",
",",
"digest",
"=",
"None",
")",
":",
"# type: (str, bytes, int, Callable) -> str",
"result",
"=",
"urlparse",
"(",
"url",
")",
"query_args",
"=",
"MultiValueDict",
"(",
"parse... | Sign a URL (excluding the domain and scheme).
:param url: URL to sign
:param secret_key: Secret key
:param expire_in: Expiry time.
:param digest: Specify the digest function to use; default is sha256 from hashlib
:return: Signed URL | [
"Sign",
"a",
"URL",
"(",
"excluding",
"the",
"domain",
"and",
"scheme",
")",
"."
] | train | https://github.com/python-odin/odinweb/blob/198424133584acc18cb41c8d18d91f803abc810f/odinweb/signing.py#L49-L67 |
python-odin/odinweb | odinweb/signing.py | verify_url_path | def verify_url_path(url_path, query_args, secret_key, salt_arg='_', max_expiry=None, digest=None):
# type: (str, Dict[str, str], bytes, str, int, Callable) -> bool
"""
Verify a URL path is correctly signed.
:param url_path: URL path
:param secret_key: Signing key
:param query_args: Arguments th... | python | def verify_url_path(url_path, query_args, secret_key, salt_arg='_', max_expiry=None, digest=None):
# type: (str, Dict[str, str], bytes, str, int, Callable) -> bool
"""
Verify a URL path is correctly signed.
:param url_path: URL path
:param secret_key: Signing key
:param query_args: Arguments th... | [
"def",
"verify_url_path",
"(",
"url_path",
",",
"query_args",
",",
"secret_key",
",",
"salt_arg",
"=",
"'_'",
",",
"max_expiry",
"=",
"None",
",",
"digest",
"=",
"None",
")",
":",
"# type: (str, Dict[str, str], bytes, str, int, Callable) -> bool",
"try",
":",
"suppl... | Verify a URL path is correctly signed.
:param url_path: URL path
:param secret_key: Signing key
:param query_args: Arguments that make up the query string
:param salt_arg: Argument required for salt (set to None to disable)
:param max_expiry: Maximum length of time an expiry value can be for (set t... | [
"Verify",
"a",
"URL",
"path",
"is",
"correctly",
"signed",
"."
] | train | https://github.com/python-odin/odinweb/blob/198424133584acc18cb41c8d18d91f803abc810f/odinweb/signing.py#L70-L115 |
python-odin/odinweb | odinweb/signing.py | verify_url | def verify_url(url, secret_key, **kwargs):
"""
Verify a signed URL (excluding the domain and scheme).
:param url: URL to sign
:param secret_key: Secret key
:rtype: bool
:raises: URLError
"""
result = urlparse(url)
query_args = MultiValueDict(parse_qs(result.query))
return verif... | python | def verify_url(url, secret_key, **kwargs):
"""
Verify a signed URL (excluding the domain and scheme).
:param url: URL to sign
:param secret_key: Secret key
:rtype: bool
:raises: URLError
"""
result = urlparse(url)
query_args = MultiValueDict(parse_qs(result.query))
return verif... | [
"def",
"verify_url",
"(",
"url",
",",
"secret_key",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"urlparse",
"(",
"url",
")",
"query_args",
"=",
"MultiValueDict",
"(",
"parse_qs",
"(",
"result",
".",
"query",
")",
")",
"return",
"verify_url_path",
"... | Verify a signed URL (excluding the domain and scheme).
:param url: URL to sign
:param secret_key: Secret key
:rtype: bool
:raises: URLError | [
"Verify",
"a",
"signed",
"URL",
"(",
"excluding",
"the",
"domain",
"and",
"scheme",
")",
"."
] | train | https://github.com/python-odin/odinweb/blob/198424133584acc18cb41c8d18d91f803abc810f/odinweb/signing.py#L118-L130 |
mitsei/dlkit | dlkit/primordium/locale/primitives.py | DisplayText._unfold_map | def _unfold_map(self, display_text_map):
"""Parses a display text dictionary map."""
from ..type.primitives import Type
lt_identifier = Id(display_text_map['languageTypeId']).get_identifier()
st_identifier = Id(display_text_map['scriptTypeId']).get_identifier()
ft_identifier = Id... | python | def _unfold_map(self, display_text_map):
"""Parses a display text dictionary map."""
from ..type.primitives import Type
lt_identifier = Id(display_text_map['languageTypeId']).get_identifier()
st_identifier = Id(display_text_map['scriptTypeId']).get_identifier()
ft_identifier = Id... | [
"def",
"_unfold_map",
"(",
"self",
",",
"display_text_map",
")",
":",
"from",
".",
".",
"type",
".",
"primitives",
"import",
"Type",
"lt_identifier",
"=",
"Id",
"(",
"display_text_map",
"[",
"'languageTypeId'",
"]",
")",
".",
"get_identifier",
"(",
")",
"st_... | Parses a display text dictionary map. | [
"Parses",
"a",
"display",
"text",
"dictionary",
"map",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/primordium/locale/primitives.py#L42-L60 |
jason-weirather/py-seq-tools | seqtools/simulation/randomsource.py | RandomSource.choice | def choice(self,arr):
"""Uniform random selection of a member of an list
:param arr: list you want to select an element from
:type arr: list
:return: one element from the list
"""
ind = self.randint(0,len(arr)-1)
return arr[ind] | python | def choice(self,arr):
"""Uniform random selection of a member of an list
:param arr: list you want to select an element from
:type arr: list
:return: one element from the list
"""
ind = self.randint(0,len(arr)-1)
return arr[ind] | [
"def",
"choice",
"(",
"self",
",",
"arr",
")",
":",
"ind",
"=",
"self",
".",
"randint",
"(",
"0",
",",
"len",
"(",
"arr",
")",
"-",
"1",
")",
"return",
"arr",
"[",
"ind",
"]"
] | Uniform random selection of a member of an list
:param arr: list you want to select an element from
:type arr: list
:return: one element from the list | [
"Uniform",
"random",
"selection",
"of",
"a",
"member",
"of",
"an",
"list"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/simulation/randomsource.py#L23-L31 |
jason-weirather/py-seq-tools | seqtools/simulation/randomsource.py | RandomSource.different_random_nt | def different_random_nt(self,nt):
global nts
"""generate a random nucleotide change. uniform random. will never return itself
:param nt: current nucleotide
:type nt: char
:return: new nucleotide
:rtype: char
"""
return self._random.choice([x for x in nts if x != nt.upper()]) | python | def different_random_nt(self,nt):
global nts
"""generate a random nucleotide change. uniform random. will never return itself
:param nt: current nucleotide
:type nt: char
:return: new nucleotide
:rtype: char
"""
return self._random.choice([x for x in nts if x != nt.upper()]) | [
"def",
"different_random_nt",
"(",
"self",
",",
"nt",
")",
":",
"global",
"nts",
"return",
"self",
".",
"_random",
".",
"choice",
"(",
"[",
"x",
"for",
"x",
"in",
"nts",
"if",
"x",
"!=",
"nt",
".",
"upper",
"(",
")",
"]",
")"
] | generate a random nucleotide change. uniform random. will never return itself
:param nt: current nucleotide
:type nt: char
:return: new nucleotide
:rtype: char | [
"generate",
"a",
"random",
"nucleotide",
"change",
".",
"uniform",
"random",
".",
"will",
"never",
"return",
"itself"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/simulation/randomsource.py#L59-L68 |
jason-weirather/py-seq-tools | seqtools/simulation/randomsource.py | RandomSource.get_weighted_random_index | def get_weighted_random_index(self,weights):
"""Return an index of an array based on the weights
if a random number between 0 and 1 is less than an index return the lowest index
:param weights: a list of floats for how to weight each index [w1, w2, ... wN]
:type weights: list
:return: index
... | python | def get_weighted_random_index(self,weights):
"""Return an index of an array based on the weights
if a random number between 0 and 1 is less than an index return the lowest index
:param weights: a list of floats for how to weight each index [w1, w2, ... wN]
:type weights: list
:return: index
... | [
"def",
"get_weighted_random_index",
"(",
"self",
",",
"weights",
")",
":",
"tot",
"=",
"float",
"(",
"sum",
"(",
"[",
"float",
"(",
"x",
")",
"for",
"x",
"in",
"weights",
"]",
")",
")",
"fracarray",
"=",
"[",
"weights",
"[",
"0",
"]",
"]",
"for",
... | Return an index of an array based on the weights
if a random number between 0 and 1 is less than an index return the lowest index
:param weights: a list of floats for how to weight each index [w1, w2, ... wN]
:type weights: list
:return: index
:rtype: int | [
"Return",
"an",
"index",
"of",
"an",
"array",
"based",
"on",
"the",
"weights",
"if",
"a",
"random",
"number",
"between",
"0",
"and",
"1",
"is",
"less",
"than",
"an",
"index",
"return",
"the",
"lowest",
"index"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/simulation/randomsource.py#L79-L99 |
jason-weirather/py-seq-tools | seqtools/simulation/randomsource.py | RandomSource.uuid4 | def uuid4(self):
"""Make an id in the format of UUID4, but keep in mind this could very well be pseudorandom, and if it is you'll not be truely random, and can regenerate same id if same seed"""
return ''.join([hexchars[self.randint(0,15)] for x in range(0,8)]) + '-' +\
''.join([hexchars[self.randint... | python | def uuid4(self):
"""Make an id in the format of UUID4, but keep in mind this could very well be pseudorandom, and if it is you'll not be truely random, and can regenerate same id if same seed"""
return ''.join([hexchars[self.randint(0,15)] for x in range(0,8)]) + '-' +\
''.join([hexchars[self.randint... | [
"def",
"uuid4",
"(",
"self",
")",
":",
"return",
"''",
".",
"join",
"(",
"[",
"hexchars",
"[",
"self",
".",
"randint",
"(",
"0",
",",
"15",
")",
"]",
"for",
"x",
"in",
"range",
"(",
"0",
",",
"8",
")",
"]",
")",
"+",
"'-'",
"+",
"''",
".",
... | Make an id in the format of UUID4, but keep in mind this could very well be pseudorandom, and if it is you'll not be truely random, and can regenerate same id if same seed | [
"Make",
"an",
"id",
"in",
"the",
"format",
"of",
"UUID4",
"but",
"keep",
"in",
"mind",
"this",
"could",
"very",
"well",
"be",
"pseudorandom",
"and",
"if",
"it",
"is",
"you",
"ll",
"not",
"be",
"truely",
"random",
"and",
"can",
"regenerate",
"same",
"id... | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/simulation/randomsource.py#L101-L107 |
mitsei/dlkit | dlkit/authz_adapter/repository/sessions.py | AssetSearchSession.get_assets_by_search | def get_assets_by_search(self, asset_query, asset_search):
"""Pass through to provider AssetSearchSession.get_assets_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
if not self._can('search'):
raise ... | python | def get_assets_by_search(self, asset_query, asset_search):
"""Pass through to provider AssetSearchSession.get_assets_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
if not self._can('search'):
raise ... | [
"def",
"get_assets_by_search",
"(",
"self",
",",
"asset_query",
",",
"asset_search",
")",
":",
"# Implemented from azosid template for -",
"# osid.resource.ResourceSearchSession.get_resources_by_search_template",
"if",
"not",
"self",
".",
"_can",
"(",
"'search'",
")",
":",
... | Pass through to provider AssetSearchSession.get_assets_by_search | [
"Pass",
"through",
"to",
"provider",
"AssetSearchSession",
".",
"get_assets_by_search"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/repository/sessions.py#L479-L485 |
mitsei/dlkit | dlkit/authz_adapter/repository/sessions.py | CompositionSearchSession.get_compositions_by_search | def get_compositions_by_search(self, composition_query, composition_search):
"""Pass through to provider CompositionSearchSession.get_compositions_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
if not self._can... | python | def get_compositions_by_search(self, composition_query, composition_search):
"""Pass through to provider CompositionSearchSession.get_compositions_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
if not self._can... | [
"def",
"get_compositions_by_search",
"(",
"self",
",",
"composition_query",
",",
"composition_search",
")",
":",
"# Implemented from azosid template for -",
"# osid.resource.ResourceSearchSession.get_resources_by_search_template",
"if",
"not",
"self",
".",
"_can",
"(",
"'search'"... | Pass through to provider CompositionSearchSession.get_compositions_by_search | [
"Pass",
"through",
"to",
"provider",
"CompositionSearchSession",
".",
"get_compositions_by_search"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/repository/sessions.py#L1671-L1677 |
mitsei/dlkit | dlkit/manager_impls/type/objects.py | TypeList.get_next_types | def get_next_types(self, n=None):
"""Gets the next set of ``Types`` in this list.
The specified amount must be less than or equal to the return
from ``available()``.
arg: n (cardinal): the number of ``Type`` elements requested
which must be less than or equal to ``av... | python | def get_next_types(self, n=None):
"""Gets the next set of ``Types`` in this list.
The specified amount must be less than or equal to the return
from ``available()``.
arg: n (cardinal): the number of ``Type`` elements requested
which must be less than or equal to ``av... | [
"def",
"get_next_types",
"(",
"self",
",",
"n",
"=",
"None",
")",
":",
"if",
"n",
">",
"self",
".",
"available",
"(",
")",
":",
"# !!! This is not quite as specified (see method docs) !!!",
"raise",
"IllegalState",
"(",
"'not enough elements available in this list'",
... | Gets the next set of ``Types`` in this list.
The specified amount must be less than or equal to the return
from ``available()``.
arg: n (cardinal): the number of ``Type`` elements requested
which must be less than or equal to ``available()``
return: (osid.type.Type) ... | [
"Gets",
"the",
"next",
"set",
"of",
"Types",
"in",
"this",
"list",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/manager_impls/type/objects.py#L63-L91 |
pyroscope/auvyon | src/auvyon/audio/transcode.py | extract_wav | def extract_wav(datafile, target=None):
""" Get LPCM 16bit audio stream from mediafile.
If `target` is a directory, create a .wav with the same basename as the input.
If target is empty, write to the directory of the source file. Otherwise, use it
directly as the target filename.
"... | python | def extract_wav(datafile, target=None):
""" Get LPCM 16bit audio stream from mediafile.
If `target` is a directory, create a .wav with the same basename as the input.
If target is empty, write to the directory of the source file. Otherwise, use it
directly as the target filename.
"... | [
"def",
"extract_wav",
"(",
"datafile",
",",
"target",
"=",
"None",
")",
":",
"if",
"datafile",
".",
"endswith",
"(",
"\".wav\"",
")",
":",
"return",
"datafile",
"target",
"=",
"target",
"or",
"os",
".",
"path",
".",
"dirname",
"(",
"datafile",
")",
"if... | Get LPCM 16bit audio stream from mediafile.
If `target` is a directory, create a .wav with the same basename as the input.
If target is empty, write to the directory of the source file. Otherwise, use it
directly as the target filename. | [
"Get",
"LPCM",
"16bit",
"audio",
"stream",
"from",
"mediafile",
".",
"If",
"target",
"is",
"a",
"directory",
"create",
"a",
".",
"wav",
"with",
"the",
"same",
"basename",
"as",
"the",
"input",
".",
"If",
"target",
"is",
"empty",
"write",
"to",
"the",
"... | train | https://github.com/pyroscope/auvyon/blob/5115c26f966df03df92a9934580b66c72e23d4e8/src/auvyon/audio/transcode.py#L13-L33 |
pyroscope/auvyon | src/auvyon/audio/transcode.py | to_wav | def to_wav(mediafile):
""" Context manager providing a temporary WAV file created from the given media file.
"""
if mediafile.endswith(".wav"):
yield mediafile
else:
wavfile = tempfile.mktemp(__name__) + ".wav"
try:
extract_wav(mediafile, wavfile)
yield wa... | python | def to_wav(mediafile):
""" Context manager providing a temporary WAV file created from the given media file.
"""
if mediafile.endswith(".wav"):
yield mediafile
else:
wavfile = tempfile.mktemp(__name__) + ".wav"
try:
extract_wav(mediafile, wavfile)
yield wa... | [
"def",
"to_wav",
"(",
"mediafile",
")",
":",
"if",
"mediafile",
".",
"endswith",
"(",
"\".wav\"",
")",
":",
"yield",
"mediafile",
"else",
":",
"wavfile",
"=",
"tempfile",
".",
"mktemp",
"(",
"__name__",
")",
"+",
"\".wav\"",
"try",
":",
"extract_wav",
"(... | Context manager providing a temporary WAV file created from the given media file. | [
"Context",
"manager",
"providing",
"a",
"temporary",
"WAV",
"file",
"created",
"from",
"the",
"given",
"media",
"file",
"."
] | train | https://github.com/pyroscope/auvyon/blob/5115c26f966df03df92a9934580b66c72e23d4e8/src/auvyon/audio/transcode.py#L37-L49 |
mitsei/dlkit | dlkit/json_/commenting/default_mdata.py | get_comment_mdata | def get_comment_mdata():
"""Return default mdata map for Comment"""
return {
'text': {
'element_label': {
'text': 'text',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
'formatTypeId': st... | python | def get_comment_mdata():
"""Return default mdata map for Comment"""
return {
'text': {
'element_label': {
'text': 'text',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
'formatTypeId': st... | [
"def",
"get_comment_mdata",
"(",
")",
":",
"return",
"{",
"'text'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'text'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
":",
"str",
"(",
"DEFAULT_SCRIPT_... | Return default mdata map for Comment | [
"Return",
"default",
"mdata",
"map",
"for",
"Comment"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/commenting/default_mdata.py#L11-L84 |
abbot/pwdhash | pwdhash.py | b64_hmac_md5 | def b64_hmac_md5(key, data):
"""
return base64-encoded HMAC-MD5 for key and data, with trailing '='
stripped.
"""
bdigest = base64.b64encode(hmac.new(key, data, _md5).digest()).strip().decode("utf-8")
return re.sub('=+$', '', bdigest) | python | def b64_hmac_md5(key, data):
"""
return base64-encoded HMAC-MD5 for key and data, with trailing '='
stripped.
"""
bdigest = base64.b64encode(hmac.new(key, data, _md5).digest()).strip().decode("utf-8")
return re.sub('=+$', '', bdigest) | [
"def",
"b64_hmac_md5",
"(",
"key",
",",
"data",
")",
":",
"bdigest",
"=",
"base64",
".",
"b64encode",
"(",
"hmac",
".",
"new",
"(",
"key",
",",
"data",
",",
"_md5",
")",
".",
"digest",
"(",
")",
")",
".",
"strip",
"(",
")",
".",
"decode",
"(",
... | return base64-encoded HMAC-MD5 for key and data, with trailing '='
stripped. | [
"return",
"base64",
"-",
"encoded",
"HMAC",
"-",
"MD5",
"for",
"key",
"and",
"data",
"with",
"trailing",
"=",
"stripped",
"."
] | train | https://github.com/abbot/pwdhash/blob/4ebc389eaa511ac3e765ce0488ee89950c9e29e1/pwdhash.py#L27-L33 |
abbot/pwdhash | pwdhash.py | extract_domain | def extract_domain(host):
"""
Domain name extractor. Turns host names into domain names, ported
from pwdhash javascript code"""
host = re.sub('https?://', '', host)
host = re.match('([^/]+)', host).groups()[0]
domain = '.'.join(host.split('.')[-2:])
if domain in _domains:
domain = '.... | python | def extract_domain(host):
"""
Domain name extractor. Turns host names into domain names, ported
from pwdhash javascript code"""
host = re.sub('https?://', '', host)
host = re.match('([^/]+)', host).groups()[0]
domain = '.'.join(host.split('.')[-2:])
if domain in _domains:
domain = '.... | [
"def",
"extract_domain",
"(",
"host",
")",
":",
"host",
"=",
"re",
".",
"sub",
"(",
"'https?://'",
",",
"''",
",",
"host",
")",
"host",
"=",
"re",
".",
"match",
"(",
"'([^/]+)'",
",",
"host",
")",
".",
"groups",
"(",
")",
"[",
"0",
"]",
"domain",... | Domain name extractor. Turns host names into domain names, ported
from pwdhash javascript code | [
"Domain",
"name",
"extractor",
".",
"Turns",
"host",
"names",
"into",
"domain",
"names",
"ported",
"from",
"pwdhash",
"javascript",
"code"
] | train | https://github.com/abbot/pwdhash/blob/4ebc389eaa511ac3e765ce0488ee89950c9e29e1/pwdhash.py#L89-L98 |
abbot/pwdhash | pwdhash.py | generate | def generate(password, uri):
"""
generate the pwdhash password for master password and uri or
domain name.
"""
realm = extract_domain(uri)
if password.startswith(_password_prefix):
password = password[len(_password_prefix):]
password_hash = b64_hmac_md5(password.encode("utf-8"), rea... | python | def generate(password, uri):
"""
generate the pwdhash password for master password and uri or
domain name.
"""
realm = extract_domain(uri)
if password.startswith(_password_prefix):
password = password[len(_password_prefix):]
password_hash = b64_hmac_md5(password.encode("utf-8"), rea... | [
"def",
"generate",
"(",
"password",
",",
"uri",
")",
":",
"realm",
"=",
"extract_domain",
"(",
"uri",
")",
"if",
"password",
".",
"startswith",
"(",
"_password_prefix",
")",
":",
"password",
"=",
"password",
"[",
"len",
"(",
"_password_prefix",
")",
":",
... | generate the pwdhash password for master password and uri or
domain name. | [
"generate",
"the",
"pwdhash",
"password",
"for",
"master",
"password",
"and",
"uri",
"or",
"domain",
"name",
"."
] | train | https://github.com/abbot/pwdhash/blob/4ebc389eaa511ac3e765ce0488ee89950c9e29e1/pwdhash.py#L104-L117 |
abbot/pwdhash | pwdhash.py | apply_constraints | def apply_constraints(phash, size, nonalphanumeric):
"""
Fiddle with the password a bit after hashing it so that it will
get through most website filters. We require one upper and lower
case, one digit, and we look at the user's password to determine
if there should be at least one alphanumeric or n... | python | def apply_constraints(phash, size, nonalphanumeric):
"""
Fiddle with the password a bit after hashing it so that it will
get through most website filters. We require one upper and lower
case, one digit, and we look at the user's password to determine
if there should be at least one alphanumeric or n... | [
"def",
"apply_constraints",
"(",
"phash",
",",
"size",
",",
"nonalphanumeric",
")",
":",
"starting_size",
"=",
"max",
"(",
"0",
",",
"size",
"-",
"4",
")",
"result",
"=",
"phash",
"[",
":",
"starting_size",
"]",
"extras",
"=",
"itertools",
".",
"chain",
... | Fiddle with the password a bit after hashing it so that it will
get through most website filters. We require one upper and lower
case, one digit, and we look at the user's password to determine
if there should be at least one alphanumeric or not. | [
"Fiddle",
"with",
"the",
"password",
"a",
"bit",
"after",
"hashing",
"it",
"so",
"that",
"it",
"will",
"get",
"through",
"most",
"website",
"filters",
".",
"We",
"require",
"one",
"upper",
"and",
"lower",
"case",
"one",
"digit",
"and",
"we",
"look",
"at"... | train | https://github.com/abbot/pwdhash/blob/4ebc389eaa511ac3e765ce0488ee89950c9e29e1/pwdhash.py#L120-L160 |
MacHu-GWU/docfly-project | docfly/doctree.py | ArticleFolder.title | def title(self):
"""
Title for the first header.
"""
if self._title is None:
self._title = self.get_title()
return self._title | python | def title(self):
"""
Title for the first header.
"""
if self._title is None:
self._title = self.get_title()
return self._title | [
"def",
"title",
"(",
"self",
")",
":",
"if",
"self",
".",
"_title",
"is",
"None",
":",
"self",
".",
"_title",
"=",
"self",
".",
"get_title",
"(",
")",
"return",
"self",
".",
"_title"
] | Title for the first header. | [
"Title",
"for",
"the",
"first",
"header",
"."
] | train | https://github.com/MacHu-GWU/docfly-project/blob/46da8a9793211301c3ebc12d195228dbf79fdfec/docfly/doctree.py#L56-L62 |
MacHu-GWU/docfly-project | docfly/doctree.py | ArticleFolder.get_title | def get_title(self):
"""
Get title line from .rst file.
**中文文档**
从一个 ``_filename`` 所指定的 .rst 文件中, 找到顶级标题.
也就是第一个 ``====`` 或 ``----`` 或 ``~~~~`` 上面一行.
"""
header_bar_char_list = "=-~+*#^"
cursor_previous_line = None
for cursor_line in textfile.re... | python | def get_title(self):
"""
Get title line from .rst file.
**中文文档**
从一个 ``_filename`` 所指定的 .rst 文件中, 找到顶级标题.
也就是第一个 ``====`` 或 ``----`` 或 ``~~~~`` 上面一行.
"""
header_bar_char_list = "=-~+*#^"
cursor_previous_line = None
for cursor_line in textfile.re... | [
"def",
"get_title",
"(",
"self",
")",
":",
"header_bar_char_list",
"=",
"\"=-~+*#^\"",
"cursor_previous_line",
"=",
"None",
"for",
"cursor_line",
"in",
"textfile",
".",
"readlines",
"(",
"self",
".",
"rst_path",
",",
"strip",
"=",
"\"both\"",
")",
":",
"for",
... | Get title line from .rst file.
**中文文档**
从一个 ``_filename`` 所指定的 .rst 文件中, 找到顶级标题.
也就是第一个 ``====`` 或 ``----`` 或 ``~~~~`` 上面一行. | [
"Get",
"title",
"line",
"from",
".",
"rst",
"file",
"."
] | train | https://github.com/MacHu-GWU/docfly-project/blob/46da8a9793211301c3ebc12d195228dbf79fdfec/docfly/doctree.py#L64-L89 |
MacHu-GWU/docfly-project | docfly/doctree.py | ArticleFolder.sub_article_folders | def sub_article_folders(self):
"""
Returns all valid ArticleFolder sitting inside of
:attr:`ArticleFolder.dir_path`.
"""
l = list()
for p in Path.sort_by_fname(
Path(self.dir_path).select_dir(recursive=False)
):
af = ArticleFolder(dir_p... | python | def sub_article_folders(self):
"""
Returns all valid ArticleFolder sitting inside of
:attr:`ArticleFolder.dir_path`.
"""
l = list()
for p in Path.sort_by_fname(
Path(self.dir_path).select_dir(recursive=False)
):
af = ArticleFolder(dir_p... | [
"def",
"sub_article_folders",
"(",
"self",
")",
":",
"l",
"=",
"list",
"(",
")",
"for",
"p",
"in",
"Path",
".",
"sort_by_fname",
"(",
"Path",
"(",
"self",
".",
"dir_path",
")",
".",
"select_dir",
"(",
"recursive",
"=",
"False",
")",
")",
":",
"af",
... | Returns all valid ArticleFolder sitting inside of
:attr:`ArticleFolder.dir_path`. | [
"Returns",
"all",
"valid",
"ArticleFolder",
"sitting",
"inside",
"of",
":",
"attr",
":",
"ArticleFolder",
".",
"dir_path",
"."
] | train | https://github.com/MacHu-GWU/docfly-project/blob/46da8a9793211301c3ebc12d195228dbf79fdfec/docfly/doctree.py#L92-L107 |
MacHu-GWU/docfly-project | docfly/doctree.py | ArticleFolder.toc_directive | def toc_directive(self, maxdepth=1):
"""
Generate toctree directive text.
:param table_of_content_header:
:param header_bar_char:
:param header_line_length:
:param maxdepth:
:return:
"""
articles_directive_content = TC.toc.render(
maxd... | python | def toc_directive(self, maxdepth=1):
"""
Generate toctree directive text.
:param table_of_content_header:
:param header_bar_char:
:param header_line_length:
:param maxdepth:
:return:
"""
articles_directive_content = TC.toc.render(
maxd... | [
"def",
"toc_directive",
"(",
"self",
",",
"maxdepth",
"=",
"1",
")",
":",
"articles_directive_content",
"=",
"TC",
".",
"toc",
".",
"render",
"(",
"maxdepth",
"=",
"maxdepth",
",",
"article_list",
"=",
"self",
".",
"sub_article_folders",
",",
")",
"return",
... | Generate toctree directive text.
:param table_of_content_header:
:param header_bar_char:
:param header_line_length:
:param maxdepth:
:return: | [
"Generate",
"toctree",
"directive",
"text",
"."
] | train | https://github.com/MacHu-GWU/docfly-project/blob/46da8a9793211301c3ebc12d195228dbf79fdfec/docfly/doctree.py#L109-L123 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.