_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 75 19.8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q48500 | AssessmentBankSession.get_banks_by_assessment | train | def get_banks_by_assessment(self, assessment_id):
"""Gets the list of ``Banks`` mapped to an ``Assessment``.
arg: assessment_id (osid.id.Id): ``Id`` of an ``Assessment``
return: (osid.assessment.BankList) - list of banks
raise: NotFound - ``assessment_id`` is not found
raise... | python | {
"resource": ""
} |
q48501 | AssessmentBankAssignmentSession.assign_assessment_to_bank | train | def assign_assessment_to_bank(self, assessment_id, bank_id):
"""Adds an existing ``Assessment`` to a ``Bank``.
arg: assessment_id (osid.id.Id): the ``Id`` of the
``Assessment``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise: AlreadyExists - ``assessme... | python | {
"resource": ""
} |
q48502 | AssessmentBankAssignmentSession.unassign_assessment_from_bank | train | def unassign_assessment_from_bank(self, assessment_id, bank_id):
"""Removes an ``Assessment`` from a ``Bank``.
arg: assessment_id (osid.id.Id): the ``Id`` of the
``Assessment``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise: NotFound - ``assessment_id... | python | {
"resource": ""
} |
q48503 | AssessmentBasicAuthoringSession._get_first_part_id | train | def _get_first_part_id(self, assessment_id):
"""This session implemenation assumes all items are assigned to the first assessment part"""
if assessment_id not in self._first_part_index:
self._first_part_index[assessment_id] = get_first_part_id_for_assessment(
assessment_id,
... | python | {
"resource": ""
} |
q48504 | AssessmentBasicAuthoringSession.get_items | train | def get_items(self, assessment_id):
"""Gets the items in sequence from an assessment.
arg: assessment_id (osid.id.Id): the ``Id`` of the
``Assessment``
return: (osid.assessment.ItemList) - list of items
raise: NotFound - ``assessmentid`` not found
raise: Nul... | python | {
"resource": ""
} |
q48505 | AssessmentBasicAuthoringSession.add_item | train | def add_item(self, assessment_id, item_id):
"""Adds an existing ``Item`` to an assessment.
arg: assessment_id (osid.id.Id): the ``Id`` of the
``Assessment``
arg: item_id (osid.id.Id): the ``Id`` of the ``Item``
raise: NotFound - ``assessment_id`` or ``item_id`` no... | python | {
"resource": ""
} |
q48506 | AssessmentBasicAuthoringSession.move_item | train | def move_item(self, assessment_id, item_id, preceeding_item_id):
"""Moves an existing item to follow another item in an assessment.
arg: assessment_id (osid.id.Id): the ``Id`` of the
``Assessment``
arg: item_id (osid.id.Id): the ``Id`` of an ``Item``
arg: precee... | python | {
"resource": ""
} |
q48507 | AssessmentBasicAuthoringSession.order_items | train | def order_items(self, item_ids, assessment_id):
"""Sequences existing items in an assessment.
arg: item_ids (osid.id.Id[]): the ``Id`` of the ``Items``
arg: assessment_id (osid.id.Id): the ``Id`` of the
``Assessment``
raise: NotFound - ``assessment_id`` is not fou... | python | {
"resource": ""
} |
q48508 | AssessmentOfferedLookupSession.get_assessment_offered | train | def get_assessment_offered(self, assessment_offered_id):
"""Gets the ``AssessmentOffered`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``AssessmentOffered`` may have
a different ``Id`` than requested, such as the... | python | {
"resource": ""
} |
q48509 | AssessmentOfferedLookupSession.get_assessments_offered_by_ids | train | def get_assessments_offered_by_ids(self, assessment_offered_ids):
"""Gets an ``AssessmentOfferedList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the
assessments specified in the ``Id`` list, in the order of the
list, including duplicates, ... | python | {
"resource": ""
} |
q48510 | AssessmentOfferedLookupSession.get_assessments_offered_by_genus_type | train | def get_assessments_offered_by_genus_type(self, assessment_offered_genus_type):
"""Gets an ``AssessmentOfferedList`` corresponding to the given assessment offered genus ``Type`` which does not include assessments of types derived from the specified ``Type``.
In plenary mode, the returned list contains ... | python | {
"resource": ""
} |
q48511 | AssessmentOfferedLookupSession.get_assessments_offered_for_assessment | train | def get_assessments_offered_for_assessment(self, assessment_id):
"""Gets an ``AssessmentOfferedList`` by the given assessment.
In plenary mode, the returned list contains all known
assessments offered or an error results. Otherwise, the returned
list may contain only those assessments o... | python | {
"resource": ""
} |
q48512 | AssessmentOfferedLookupSession.get_assessments_offered | train | def get_assessments_offered(self):
"""Gets all ``AssessmentOffered`` elements.
In plenary mode, the returned list contains all known
assessments offered or an error results. Otherwise, the returned
list may contain only those assessments offered that are
accessible through this ... | python | {
"resource": ""
} |
q48513 | AssessmentOfferedQuerySession.get_assessments_offered_by_query | train | def get_assessments_offered_by_query(self, assessment_offered_query):
"""Gets a list of ``AssessmentOffered`` elements matching the given assessment offered query.
arg: assessment_offered_query
(osid.assessment.AssessmentOfferedQuery): the assessment
offered query
... | python | {
"resource": ""
} |
q48514 | AssessmentOfferedAdminSession.create_assessment_offered | train | def create_assessment_offered(self, assessment_offered_form):
"""Creates a new ``AssessmentOffered``.
arg: assessment_offered_form
(osid.assessment.AssessmentOfferedForm): the form for
this ``AssessmentOffered``
return: (osid.assessment.AssessmentOffered) - th... | python | {
"resource": ""
} |
q48515 | AssessmentOfferedAdminSession.update_assessment_offered | train | def update_assessment_offered(self, assessment_offered_form):
"""Updates an existing assessment offered.
arg: assessment_offered_form
(osid.assessment.AssessmentOfferedForm): the form
containing the elements to be updated
raise: IllegalState - ``assessment_of... | python | {
"resource": ""
} |
q48516 | AssessmentOfferedAdminSession.alias_assessment_offered | train | def alias_assessment_offered(self, assessment_offered_id, alias_id):
"""Adds an ``Id`` to an ``AssessmentOffered`` for the purpose of creating compatibility.
The primary ``Id`` of the ``AssessmentOffered`` is determined by
the provider. The new ``Id`` is an alias to the primary ``Id``.
... | python | {
"resource": ""
} |
q48517 | AssessmentOfferedBankSession.get_assessment_offered_ids_by_bank | train | def get_assessment_offered_ids_by_bank(self, bank_id):
"""Gets the list of ``AssessmentOffered`` ``Ids`` associated with a ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.id.IdList) - list of related assessment offered
``Ids``
raise: NotFou... | python | {
"resource": ""
} |
q48518 | AssessmentOfferedBankSession.get_assessments_offered_by_bank | train | def get_assessments_offered_by_bank(self, bank_id):
"""Gets the list of ``AssessmentOffereds`` associated with a ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.assessment.AssessmentOfferedList) - list of
related assessments offered
raise: N... | python | {
"resource": ""
} |
q48519 | AssessmentOfferedBankSession.get_assessment_offered_ids_by_banks | train | def get_assessment_offered_ids_by_banks(self, bank_ids):
"""Gets the list of ``AssessmentOffered Ids`` corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.id.IdList) - list of bank ``Ids``
raise: NullArgument - ``bank_ids`` is ``n... | python | {
"resource": ""
} |
q48520 | AssessmentOfferedBankSession.get_assessments_offered_by_banks | train | def get_assessments_offered_by_banks(self, bank_ids):
"""Gets the list of ``AssessmentOffered`` objects corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.assessment.AssessmentOfferedList) - list of
assessments offered
... | python | {
"resource": ""
} |
q48521 | AssessmentOfferedBankSession.get_bank_ids_by_assessment_offered | train | def get_bank_ids_by_assessment_offered(self, assessment_offered_id):
"""Gets the list of ``Bank`` ``Ids`` mapped to an ``AssessmentOffered``.
arg: assessment_offered_id (osid.id.Id): ``Id`` of an
``AssessmentOffered``
return: (osid.id.IdList) - list of bank ``Ids``
r... | python | {
"resource": ""
} |
q48522 | AssessmentOfferedBankSession.get_banks_by_assessment_offered | train | def get_banks_by_assessment_offered(self, assessment_offered_id):
"""Gets the list of ``Banks`` mapped to an ``AssessmentOffered``.
arg: assessment_offered_id (osid.id.Id): ``Id`` of an
``AssessmentOffered``
return: (osid.assessment.BankList) - list of banks
raise: N... | python | {
"resource": ""
} |
q48523 | AssessmentOfferedBankAssignmentSession.assign_assessment_offered_to_bank | train | def assign_assessment_offered_to_bank(self, assessment_offered_id, bank_id):
"""Adds an existing ``AssessmentOffered`` to a ``Bank``.
arg: assessment_offered_id (osid.id.Id): the ``Id`` of the
``AssessmentOffered``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
... | python | {
"resource": ""
} |
q48524 | AssessmentOfferedBankAssignmentSession.unassign_assessment_offered_from_bank | train | def unassign_assessment_offered_from_bank(self, assessment_offered_id, bank_id):
"""Removes an ``AssessmentOffered`` from a ``Bank``.
arg: assessment_offered_id (osid.id.Id): the ``Id`` of the
``AssessmentOffered``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
... | python | {
"resource": ""
} |
q48525 | AssessmentTakenLookupSession.get_assessment_taken | train | def get_assessment_taken(self, assessment_taken_id):
"""Gets the ``AssessmentTaken`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``AssessmentTaken`` may have a
different ``Id`` than requested, such as the case wh... | python | {
"resource": ""
} |
q48526 | AssessmentTakenLookupSession.get_assessments_taken_by_ids | train | def get_assessments_taken_by_ids(self, assessment_taken_ids):
"""Gets an ``AssessmentTakenList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the
assessments specified in the ``Id`` list, in the order of the
list, including duplicates, or an ... | python | {
"resource": ""
} |
q48527 | AssessmentTakenLookupSession.get_assessments_taken_by_genus_type | train | def get_assessments_taken_by_genus_type(self, assessment_taken_genus_type):
"""Gets an ``AssessmentTakenList`` corresponding to the given assessment taken genus ``Type`` which does not include assessments of types derived from the specified ``Type``.
In plenary mode, the returned list contains all know... | python | {
"resource": ""
} |
q48528 | AssessmentTakenLookupSession.get_assessments_taken_for_assessment | train | def get_assessments_taken_for_assessment(self, assessment_id):
"""Gets an ``AssessmentTakenList`` for the given assessment.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only those assessments taken ... | python | {
"resource": ""
} |
q48529 | AssessmentTakenLookupSession.get_assessments_taken_for_assessment_offered | train | def get_assessments_taken_for_assessment_offered(self, assessment_offered_id):
"""Gets an ``AssessmentTakenList`` by the given assessment offered.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only t... | python | {
"resource": ""
} |
q48530 | AssessmentTakenLookupSession.get_assessments_taken_for_taker_and_assessment_offered | train | def get_assessments_taken_for_taker_and_assessment_offered(self, resource_id, assessment_offered_id):
"""Gets an ``AssessmentTakenList`` for the given resource and assessment offered.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the ret... | python | {
"resource": ""
} |
q48531 | AssessmentTakenLookupSession.get_assessments_taken | train | def get_assessments_taken(self):
"""Gets all ``AssessmentTaken`` elements.
In plenary mode, the returned list contains all known
assessments taken or an error results. Otherwise, the returned
list may contain only those assessments taken that are
accessible through this session.... | python | {
"resource": ""
} |
q48532 | AssessmentTakenQuerySession.get_assessments_taken_by_query | train | def get_assessments_taken_by_query(self, assessment_taken_query):
"""Gets a list of ``AssessmentTaken`` elements matching the given assessment taken query.
arg: assessment_taken_query
(osid.assessment.AssessmentTakenQuery): the assessment
taken query
return: (... | python | {
"resource": ""
} |
q48533 | AssessmentTakenAdminSession.get_assessment_taken_form_for_create | train | def get_assessment_taken_form_for_create(self, assessment_offered_id, assessment_taken_record_types):
"""Gets the assessment taken form for creating new assessments taken.
A new form should be requested for each create transaction.
arg: assessment_offered_id (osid.id.Id): the ``Id`` of the
... | python | {
"resource": ""
} |
q48534 | AssessmentTakenAdminSession.create_assessment_taken | train | def create_assessment_taken(self, assessment_taken_form):
"""Creates a new ``AssessmentTaken``.
arg: assessment_taken_form
(osid.assessment.AssessmentTakenForm): the form for this
``AssessmentTaken``
return: (osid.assessment.AssessmentTaken) - the new
... | python | {
"resource": ""
} |
q48535 | AssessmentTakenAdminSession.update_assessment_taken | train | def update_assessment_taken(self, assessment_taken_form):
"""Updates an existing assessment taken.
arg: assessment_taken_form
(osid.assessment.AssessmentTakenForm): the form
containing the elements to be updated
raise: IllegalState - ``assessment_taken_form``... | python | {
"resource": ""
} |
q48536 | AssessmentTakenAdminSession.delete_assessment_taken | train | def delete_assessment_taken(self, assessment_taken_id):
"""Deletes an ``AssessmentTaken``.
arg: assessment_taken_id (osid.id.Id): the ``Id`` of the
``AssessmentTaken`` to remove
raise: NotFound - ``assessment_taken_id`` not found
raise: NullArgument - ``assessment_t... | python | {
"resource": ""
} |
q48537 | AssessmentTakenAdminSession.alias_assessment_taken | train | def alias_assessment_taken(self, assessment_taken_id, alias_id):
"""Adds an ``Id`` to an ``AssessmentTaken`` for the purpose of creating compatibility.
The primary ``Id`` of the ``AssessmentTaken`` is determined by
the provider. The new ``Id`` is an alias to the primary ``Id``.
If the a... | python | {
"resource": ""
} |
q48538 | AssessmentTakenBankSession.get_assessment_taken_ids_by_bank | train | def get_assessment_taken_ids_by_bank(self, bank_id):
"""Gets the list of ``AssessmentTaken`` ``Ids`` associated with a ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.id.IdList) - list of related assessment taken
``Ids``
raise: NotFound - `... | python | {
"resource": ""
} |
q48539 | AssessmentTakenBankSession.get_assessments_taken_by_bank | train | def get_assessments_taken_by_bank(self, bank_id):
"""Gets the list of ``AssessmentTakens`` associated with a ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.assessment.AssessmentTakenList) - list of related
assessments taken
raise: NotFound ... | python | {
"resource": ""
} |
q48540 | AssessmentTakenBankSession.get_assessment_taken_ids_by_banks | train | def get_assessment_taken_ids_by_banks(self, bank_ids):
"""Gets the list of ``AssessmentTaken Ids`` corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.id.IdList) - list of bank ``Ids``
raise: NullArgument - ``bank_ids`` is ``null`... | python | {
"resource": ""
} |
q48541 | AssessmentTakenBankSession.get_assessments_taken_by_banks | train | def get_assessments_taken_by_banks(self, bank_ids):
"""Gets the list of ``AssessmentTaken`` objects corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.assessment.AssessmentTakenList) - list of
assessments taken
rai... | python | {
"resource": ""
} |
q48542 | AssessmentTakenBankSession.get_bank_ids_by_assessment_taken | train | def get_bank_ids_by_assessment_taken(self, assessment_taken_id):
"""Gets the list of ``Bank`` ``Ids`` mapped to an ``AssessmentTaken``.
arg: assessment_taken_id (osid.id.Id): ``Id`` of an
``AssessmentTaken``
return: (osid.id.IdList) - list of bank ``Ids``
raise: Not... | python | {
"resource": ""
} |
q48543 | AssessmentTakenBankSession.get_banks_by_assessment_taken | train | def get_banks_by_assessment_taken(self, assessment_taken_id):
"""Gets the list of ``Banks`` mapped to an ``AssessmentTaken``.
arg: assessment_taken_id (osid.id.Id): ``Id`` of an
``AssessmentTaken``
return: (osid.assessment.BankList) - list of banks
raise: NotFound - ... | python | {
"resource": ""
} |
q48544 | AssessmentTakenBankAssignmentSession.assign_assessment_taken_to_bank | train | def assign_assessment_taken_to_bank(self, assessment_taken_id, bank_id):
"""Adds an existing ``AssessmentTaken`` to a ``Bank``.
arg: assessment_taken_id (osid.id.Id): the ``Id`` of the
``AssessmentTaken``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise:... | python | {
"resource": ""
} |
q48545 | AssessmentTakenBankAssignmentSession.unassign_assessment_taken_from_bank | train | def unassign_assessment_taken_from_bank(self, assessment_taken_id, bank_id):
"""Removes an ``AssessmentTaken`` from a ``Bank``.
arg: assessment_taken_id (osid.id.Id): the ``Id`` of the
``AssessmentTaken``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise:... | python | {
"resource": ""
} |
q48546 | BankQuerySession.get_banks_by_query | train | def get_banks_by_query(self, bank_query):
"""Gets a list of ``Bank`` objects matching the given bank query.
arg: bank_query (osid.assessment.BankQuery): the bank query
return: (osid.assessment.BankList) - the returned ``BankList``
raise: NullArgument - ``bank_query`` is ``null``
... | python | {
"resource": ""
} |
q48547 | BankAdminSession.can_create_bank_with_record_types | train | def can_create_bank_with_record_types(self, bank_record_types):
"""Tests if this user can create a single ``Bank`` using the desired record types.
While ``AssessmentManager.getBankRecordTypes()`` can be used to
examine which records are supported, this method tests which
record(s) are r... | python | {
"resource": ""
} |
q48548 | BankAdminSession.update_bank | train | def update_bank(self, bank_form):
"""Updates an existing bank.
arg: bank_form (osid.assessment.BankForm): the form
containing the elements to be updated
raise: IllegalState - ``bank_form`` already used in an update
transaction
raise: InvalidArgument ... | python | {
"resource": ""
} |
q48549 | BankAdminSession.alias_bank | train | def alias_bank(self, bank_id, alias_id):
"""Adds an ``Id`` to a ``Bank`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Bank`` is determined by the
provider. The new ``Id`` is an alias to the primary ``Id``. If
the alias is a pointer to another bank, it is reassi... | python | {
"resource": ""
} |
q48550 | BankHierarchySession.get_root_banks | train | def get_root_banks(self):
"""Gets the root banks in this bank hierarchy.
return: (osid.assessment.BankList) - the root banks
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure occurred
*compliance: mandatory -- This method is mu... | python | {
"resource": ""
} |
q48551 | BankHierarchySession.has_parent_banks | train | def has_parent_banks(self, bank_id):
"""Tests if the ``Bank`` has any parents.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (boolean) - ``true`` if the bank has parents, ``false``
otherwise
raise: NotFound - ``bank_id`` is not found
raise: NullArgument -... | python | {
"resource": ""
} |
q48552 | BankHierarchySession.is_parent_of_bank | train | def is_parent_of_bank(self, id_, bank_id):
"""Tests if an ``Id`` is a direct parent of a bank.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if this ``id`` is a parent of
``bank_id,`` ``false`` otherwi... | python | {
"resource": ""
} |
q48553 | BankHierarchySession.get_parent_bank_ids | train | def get_parent_bank_ids(self, bank_id):
"""Gets the parent ``Ids`` of the given bank.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (osid.id.IdList) - the parent ``Ids`` of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... | python | {
"resource": ""
} |
q48554 | BankHierarchySession.get_parent_banks | train | def get_parent_banks(self, bank_id):
"""Gets the parents of the given bank.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (osid.assessment.BankList) - the parents of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... | python | {
"resource": ""
} |
q48555 | BankHierarchySession.is_ancestor_of_bank | train | def is_ancestor_of_bank(self, id_, bank_id):
"""Tests if an ``Id`` is an ancestor of a bank.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if this ``id`` is an ancestor of
``bank_id,`` ``false`` otherw... | python | {
"resource": ""
} |
q48556 | BankHierarchySession.has_child_banks | train | def has_child_banks(self, bank_id):
"""Tests if a bank has any children.
arg: bank_id (osid.id.Id): a ``bank_id``
return: (boolean) - ``true`` if the ``bank_id`` has children,
``false`` otherwise
raise: NotFound - ``bank_id`` is not found
raise: NullArgument... | python | {
"resource": ""
} |
q48557 | BankHierarchySession.is_child_of_bank | train | def is_child_of_bank(self, id_, bank_id):
"""Tests if a bank is a direct child of another.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if the ``id`` is a child of
``bank_id,`` ``false`` otherwise
... | python | {
"resource": ""
} |
q48558 | BankHierarchySession.get_child_bank_ids | train | def get_child_bank_ids(self, bank_id):
"""Gets the child ``Ids`` of the given bank.
arg: bank_id (osid.id.Id): the ``Id`` to query
return: (osid.id.IdList) - the children of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... | python | {
"resource": ""
} |
q48559 | BankHierarchySession.get_child_banks | train | def get_child_banks(self, bank_id):
"""Gets the children of the given bank.
arg: bank_id (osid.id.Id): the ``Id`` to query
return: (osid.assessment.BankList) - the children of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... | python | {
"resource": ""
} |
q48560 | BankHierarchySession.is_descendant_of_bank | train | def is_descendant_of_bank(self, id_, bank_id):
"""Tests if an ``Id`` is a descendant of a bank.
arg: id (osid.id.Id): an ``Id``
arg: bank_id (osid.id.Id): the ``Id`` of a bank
return: (boolean) - ``true`` if the ``id`` is a descendant of
the ``bank_id,`` ``false``... | python | {
"resource": ""
} |
q48561 | BankHierarchySession.get_bank_nodes | train | def get_bank_nodes(self, bank_id, ancestor_levels, descendant_levels, include_siblings):
"""Gets a portion of the hierarchy for the given bank.
arg: bank_id (osid.id.Id): the ``Id`` to query
arg: ancestor_levels (cardinal): the maximum number of
ancestor levels to include.... | python | {
"resource": ""
} |
q48562 | BankHierarchyDesignSession.add_root_bank | train | def add_root_bank(self, bank_id):
"""Adds a root bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
raise: AlreadyExists - ``bank_id`` is already in hierarchy
raise: NotFound - ``bank_id`` not found
raise: NullArgument - ``bank_id`` is ``null``
raise: Operation... | python | {
"resource": ""
} |
q48563 | BankHierarchyDesignSession.remove_root_bank | train | def remove_root_bank(self, bank_id):
"""Removes a root bank from this hierarchy.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
raise: NotFound - ``bank_id`` not a parent of ``child_id``
raise: NullArgument - ``bank_id`` or ``child_id`` is ``null``
raise: OperationFailed ... | python | {
"resource": ""
} |
q48564 | BankHierarchyDesignSession.add_child_bank | train | def add_child_bank(self, bank_id, child_id):
"""Adds a child to a bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: AlreadyExists - ``bank_id`` is already a parent of
``child_id``
raise: N... | python | {
"resource": ""
} |
q48565 | BankHierarchyDesignSession.remove_child_bank | train | def remove_child_bank(self, bank_id, child_id):
"""Removes a child from a bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: NotFound - ``bank_id`` not parent of ``child_id``
raise: NullArgument - ``bank_i... | python | {
"resource": ""
} |
q48566 | BankHierarchyDesignSession.remove_child_banks | train | def remove_child_banks(self, bank_id):
"""Removes all children from a bank.
arg: bank_id (osid.id.Id): the ``Id`` of a bank
raise: NotFound - ``bank_id`` is not in hierarchy
raise: NullArgument - ``bank_id`` is ``null``
raise: OperationFailed - unable to complete request
... | python | {
"resource": ""
} |
q48567 | unaccent | train | def unaccent(string, encoding="utf-8"):
"""not just unaccent, but full to-ascii transliteration"""
string = to_unicode(string)
if has_unidecode:
return unidecode.unidecode(string)
if PYTHON_VERSION < 3:
if type(string) == str:
string = unicode(string, encoding)
nfkd_f... | python | {
"resource": ""
} |
q48568 | RelationshipManager.use_comparative_family_view | train | def use_comparative_family_view(self):
"""Pass through to provider FamilyLookupSession.use_comparative_family_view"""
self._family_view = COMPARATIVE
# self._get_provider_session('family_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions():
... | python | {
"resource": ""
} |
q48569 | RelationshipManager.use_plenary_family_view | train | def use_plenary_family_view(self):
"""Pass through to provider FamilyLookupSession.use_plenary_family_view"""
self._family_view = PLENARY
# self._get_provider_session('family_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions():
... | python | {
"resource": ""
} |
q48570 | RelationshipManager.get_families_by_ids | train | def get_families_by_ids(self, *args, **kwargs):
"""Pass through to provider FamilyLookupSession.get_families_by_ids"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_by_ids
catalogs = self._get_provider_session('family_lookup_session').get_families_by... | python | {
"resource": ""
} |
q48571 | RelationshipManager.get_families | train | def get_families(self):
"""Pass through to provider FamilyLookupSession.get_families"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_template
catalogs = self._get_provider_session('family_lookup_session').get_families()
cat_list = []
... | python | {
"resource": ""
} |
q48572 | RelationshipManager.get_family_form | train | def get_family_form(self, *args, **kwargs):
"""Pass through to provider FamilyAdminSession.get_family_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.get_bin_form_for_update_template
# This method might be a bit sketchy. Time will tell.
... | python | {
"resource": ""
} |
q48573 | Family._get_provider_session | train | def _get_provider_session(self, session_name):
"""Returns the requested provider session.
Instantiates a new one if the named session is not already known.
"""
agent_key = self._get_agent_key()
if session_name in self._provider_sessions[agent_key]:
return self._prov... | python | {
"resource": ""
} |
q48574 | Family.use_comparative_relationship_view | train | def use_comparative_relationship_view(self):
"""Pass through to provider RelationshipLookupSession.use_comparative_relationship_view"""
self._object_views['relationship'] = COMPARATIVE
# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
for s... | python | {
"resource": ""
} |
q48575 | Family.use_plenary_relationship_view | train | def use_plenary_relationship_view(self):
"""Pass through to provider RelationshipLookupSession.use_plenary_relationship_view"""
self._object_views['relationship'] = PLENARY
# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
for session in se... | python | {
"resource": ""
} |
q48576 | Family.use_federated_family_view | train | def use_federated_family_view(self):
"""Pass through to provider RelationshipLookupSession.use_federated_family_view"""
self._family_view = FEDERATED
# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessio... | python | {
"resource": ""
} |
q48577 | Family.use_isolated_family_view | train | def use_isolated_family_view(self):
"""Pass through to provider RelationshipLookupSession.use_isolated_family_view"""
self._family_view = ISOLATED
# self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions(... | python | {
"resource": ""
} |
q48578 | Family.get_relationship_form | train | def get_relationship_form(self, *args, **kwargs):
"""Pass through to provider RelationshipAdminSession.get_relationship_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit sketchy. Tim... | python | {
"resource": ""
} |
q48579 | Family.save_relationship | train | def save_relationship(self, relationship_form, *args, **kwargs):
"""Pass through to provider RelationshipAdminSession.update_relationship"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if relationship_form.is_for_update():
re... | python | {
"resource": ""
} |
q48580 | UserContextFormViewMixin.get_form_kwargs | train | def get_form_kwargs(self):
"""
Return the form kwargs.
This method injects the context variable, defined in
:meth:`get_agnocomplete_context`. Override this method to adjust it to
your needs.
"""
data = super(UserContextFormViewMixin, self).get_form_kwargs()
... | python | {
"resource": ""
} |
q48581 | AgnocompleteView.get_klass | train | def get_klass(self):
"""
Return the agnocomplete class to be used with the eventual query.
"""
# Extract the klass name from the URL arguments
klass_name = self.kwargs.get('klass', None)
klass = self.registry.get(klass_name, None)
if not klass:
raise H... | python | {
"resource": ""
} |
q48582 | parse_v3_unit_placement | train | def parse_v3_unit_placement(placement_str):
"""Return a UnitPlacement for bundles version 3, given a placement string.
See https://github.com/juju/charmstore/blob/v4/docs/bundles.md
Raise a ValueError if the placement is not valid.
"""
placement = placement_str
container = machine = service = u... | python | {
"resource": ""
} |
q48583 | parse_v4_unit_placement | train | def parse_v4_unit_placement(placement_str):
"""Return a UnitPlacement for bundles version 4, given a placement string.
See https://github.com/juju/charmstore/blob/v4/docs/bundles.md
Raise a ValueError if the placement is not valid.
"""
placement = placement_str
container = machine = service = u... | python | {
"resource": ""
} |
q48584 | _parse_unit | train | def _parse_unit(unit, placement_str):
"""Parse a unit as part of the unit placement.
Return the unit as an integer or None.
Raise a ValueError if the unit is specified but it is not a digit.
"""
if not unit:
return None
try:
return int(unit)
except (TypeError, ValueError):
... | python | {
"resource": ""
} |
q48585 | multiprocessing_apply_infer | train | def multiprocessing_apply_infer(object_id):
"""
Used in the InferenceWithRestarts class.
Needs to be in global scope for multiprocessing module to pick it up
"""
global inference_objects, inference_args, inference_kwargs
return inference_objects[object_id]._infer_raw(*inference_args, **inferenc... | python | {
"resource": ""
} |
q48586 | reps_to_intensity | train | def reps_to_intensity(reps, slope=-4.8, constant=97.5, quadratic=True):
"""A function mapping from repetitions in the range 1 to 12
to intensities in the range 0 to 100.
Parameters
----------
reps
The number of repetitions to map to the intensity range.
slope
Slope for the linea... | python | {
"resource": ""
} |
q48587 | CommentSearchResults.get_comments | train | def get_comments(self):
"""Gets the comment list resulting from a search.
return: (osid.commenting.CommentList) - the comment list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.*
"""
if self.retrieved:
... | python | {
"resource": ""
} |
q48588 | BookSearchResults.get_books | train | def get_books(self):
"""Gets the book list resulting from a search.
return: (osid.commenting.BookList) - the book list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.*
"""
if self.retrieved:
r... | python | {
"resource": ""
} |
q48589 | get_assessment_part_mdata | train | def get_assessment_part_mdata():
"""Return default mdata map for AssessmentPart"""
return {
'assessment_part': {
'element_label': {
'text': 'assessment part',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE... | python | {
"resource": ""
} |
q48590 | get_authorization_mdata | train | def get_authorization_mdata():
"""Return default mdata map for Authorization"""
return {
'function': {
'element_label': {
'text': 'function',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
... | python | {
"resource": ""
} |
q48591 | LogEntryQuery.match_timestamp | train | def match_timestamp(self, start_time, end_time, match):
"""Matches the time of this log entry.
arg: start_time (osid.calendaring.DateTime): start time
arg: end_time (osid.calendaring.DateTime): end time
arg: match (boolean): ``true`` if for a positive match,
``f... | python | {
"resource": ""
} |
q48592 | RepositoryManager.use_plenary_repository_view | train | def use_plenary_repository_view(self):
"""Pass through to provider AssetRepositorySession.use_plenary_repository_view"""
self._repository_view = PLENARY
# self._get_provider_session('asset_repository_session') # To make sure the session is tracked
for session in self._get_provider_sessio... | python | {
"resource": ""
} |
q48593 | RepositoryManager.use_comparative_composition_repository_view | train | def use_comparative_composition_repository_view(self):
"""Pass through to provider CompositionRepositorySession.use_comparative_composition_repository_view"""
self._repository_view = COMPARATIVE
# self._get_provider_session('composition_repository_session') # To make sure the session is tracked
... | python | {
"resource": ""
} |
q48594 | RepositoryManager.get_repositories_by_composition | train | def get_repositories_by_composition(self, *args, **kwargs):
"""Pass through to provider CompositionRepositorySession.get_repositories_by_composition"""
# Implemented from kitosid template for -
# osid.resource.ResourceBinSession.get_bins_by_resource
catalogs = self._get_provider_session(... | python | {
"resource": ""
} |
q48595 | RepositoryManager.get_repositories | train | def get_repositories(self):
"""Pass through to provider RepositoryLookupSession.get_repositories"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_template
catalogs = self._get_provider_session('repository_lookup_session').get_repositories()
c... | python | {
"resource": ""
} |
q48596 | RepositoryManager.create_repository | train | def create_repository(self, *args, **kwargs):
"""Pass through to provider RepositoryAdminSession.create_repository"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.create_bin
return Repository(
self._provider_manager,
self._get_provider... | python | {
"resource": ""
} |
q48597 | RepositoryManager.get_repository_form | train | def get_repository_form(self, *args, **kwargs):
"""Pass through to provider RepositoryAdminSession.get_repository_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.get_bin_form_for_update_template
# This method might be a bit sketchy. Time will ... | python | {
"resource": ""
} |
q48598 | RepositoryManager.save_repository | train | def save_repository(self, repository_form, *args, **kwargs):
"""Pass through to provider RepositoryAdminSession.update_repository"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
if repository_form.is_for_update():
return self.update_rep... | python | {
"resource": ""
} |
q48599 | Repository.use_comparative_asset_view | train | def use_comparative_asset_view(self):
"""Pass through to provider AssetLookupSession.use_comparative_asset_view"""
self._object_views['asset'] = COMPARATIVE
# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessio... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.