_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
75
19.8k
language
stringclasses
1 value
meta_information
dict
q49200
Timer.log
train
def log(self, statement): '''Write statement to stderr with timing info in DEBUG mode.''' global DEBUG time_ms = 1000 * time.time() if DEBUG: total_time_ms = time_ms - self._start_time_ms_ lap_time_ms = time_ms - self._last_time_ms_ sys.stderr.write('%...
python
{ "resource": "" }
q49201
resolve_content_type
train
def resolve_content_type(type_resolvers, request): # type: (Iterable[Callable[[Any], str]], Any) -> Optional[str] """ Resolve content types from a request. """ for resolver in type_resolvers: content_type = parse_content_type(resolver(request)) if content_type: return con...
python
{ "resource": "" }
q49202
get_resource
train
def get_resource(request, resource, allow_multiple=False, full_clean=True, default_to_not_supplied=False): """ Get a resource instance from ``request.body``. Note error code 98 is returned in multiple places, this is to prevent leakage of details of defined resources. """ # Decode the request body...
python
{ "resource": "" }
q49203
create_response
train
def create_response(request, body=None, status=None, headers=None): # type: (BaseHttpRequest, Any, HTTPStatus, dict) -> HttpResponse """ Generate a HttpResponse. :param request: Request object :param body: Body of the response :param status: HTTP status code :param headers: Any headers. ...
python
{ "resource": "" }
q49204
Directory.read
train
def read(self): """ This module is lazy-loaded by default. You can read all internal structure by calling this method. """ stack = [self[0].child] while stack: current = stack.pop() if current.right: stack.append(current.right) ...
python
{ "resource": "" }
q49205
Directory.by_name
train
def by_name(self, name): """ In many cases you want to access directory not by it's ID, but by it's name. This method implements red-black search method, which internally uses CFB format. Also this method has internal name cache to speed up 2nd+ named accesses. """ ...
python
{ "resource": "" }
q49206
AuthorizationManager.use_comparative_vault_view
train
def use_comparative_vault_view(self): """Pass through to provider AuthorizationVaultSession.use_comparative_vault_view""" self._vault_view = COMPARATIVE # self._get_provider_session('authorization_vault_session') # To make sure the session is tracked for session in self._get_provider_ses...
python
{ "resource": "" }
q49207
AuthorizationManager.use_plenary_vault_view
train
def use_plenary_vault_view(self): """Pass through to provider AuthorizationVaultSession.use_plenary_vault_view""" self._vault_view = PLENARY # self._get_provider_session('authorization_vault_session') # To make sure the session is tracked for session in self._get_provider_sessions(): ...
python
{ "resource": "" }
q49208
AuthorizationManager.get_vaults_by_ids
train
def get_vaults_by_ids(self, *args, **kwargs): """Pass through to provider VaultLookupSession.get_vaults_by_ids""" # Implemented from kitosid template for - # osid.resource.BinLookupSession.get_bins_by_ids catalogs = self._get_provider_session('vault_lookup_session').get_vaults_by_ids(*ar...
python
{ "resource": "" }
q49209
AuthorizationManager.get_vaults
train
def get_vaults(self): """Pass through to provider VaultLookupSession.get_vaults""" # Implemented from kitosid template for - # osid.resource.BinLookupSession.get_bins_template catalogs = self._get_provider_session('vault_lookup_session').get_vaults() cat_list = [] for cat...
python
{ "resource": "" }
q49210
AuthorizationManager.create_vault
train
def create_vault(self, *args, **kwargs): """Pass through to provider VaultAdminSession.create_vault""" # Implemented from kitosid template for - # osid.resource.BinAdminSession.create_bin return Vault( self._provider_manager, self._get_provider_session('vault_admi...
python
{ "resource": "" }
q49211
AuthorizationManager.get_vault_form
train
def get_vault_form(self, *args, **kwargs): """Pass through to provider VaultAdminSession.get_vault_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. i...
python
{ "resource": "" }
q49212
AuthorizationManager.save_vault
train
def save_vault(self, vault_form, *args, **kwargs): """Pass through to provider VaultAdminSession.update_vault""" # Implemented from kitosid template for - # osid.resource.BinAdminSession.update_bin if vault_form.is_for_update(): return self.update_vault(vault_form, *args, **k...
python
{ "resource": "" }
q49213
Vault.use_comparative_authorization_view
train
def use_comparative_authorization_view(self): """Pass through to provider AuthorizationLookupSession.use_comparative_authorization_view""" self._object_views['authorization'] = COMPARATIVE # self._get_provider_session('authorization_lookup_session') # To make sure the session is tracked ...
python
{ "resource": "" }
q49214
Vault.use_plenary_authorization_view
train
def use_plenary_authorization_view(self): """Pass through to provider AuthorizationLookupSession.use_plenary_authorization_view""" self._object_views['authorization'] = PLENARY # self._get_provider_session('authorization_lookup_session') # To make sure the session is tracked for session ...
python
{ "resource": "" }
q49215
Vault.use_federated_vault_view
train
def use_federated_vault_view(self): """Pass through to provider AuthorizationLookupSession.use_federated_vault_view""" self._vault_view = FEDERATED # self._get_provider_session('authorization_lookup_session') # To make sure the session is tracked for session in self._get_provider_session...
python
{ "resource": "" }
q49216
Vault.use_isolated_vault_view
train
def use_isolated_vault_view(self): """Pass through to provider AuthorizationLookupSession.use_isolated_vault_view""" self._vault_view = ISOLATED # self._get_provider_session('authorization_lookup_session') # To make sure the session is tracked for session in self._get_provider_sessions()...
python
{ "resource": "" }
q49217
Vault.get_authorization_form
train
def get_authorization_form(self, *args, **kwargs): """Pass through to provider AuthorizationAdminSession.get_authorization_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a bit sketchy. ...
python
{ "resource": "" }
q49218
Vault.save_authorization
train
def save_authorization(self, authorization_form, *args, **kwargs): """Pass through to provider AuthorizationAdminSession.update_authorization""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if authorization_form.is_for_update(): ...
python
{ "resource": "" }
q49219
Grade.get_grade_system_id
train
def get_grade_system_id(self): """Gets the ``GradeSystem Id`` in which this grade belongs. return: (osid.id.Id) - the grade system ``Id`` *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.learning.Activity.get_objective_id ...
python
{ "resource": "" }
q49220
GradeForm.get_output_score_metadata
train
def get_output_score_metadata(self): """Gets the metadata for the output score start range. return: (osid.Metadata) - metadata for the output score start range *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.r...
python
{ "resource": "" }
q49221
GradeForm.set_output_score
train
def set_output_score(self, score): """Sets the output score. arg: score (decimal): the new output score raise: InvalidArgument - ``score`` is invalid raise: NoAccess - ``score`` cannot be modified *compliance: mandatory -- This method must be implemented.* """ ...
python
{ "resource": "" }
q49222
GradeForm.clear_output_score
train
def clear_output_score(self): """Clears the output score. raise: NoAccess - ``Metadata.isRequired()`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.grading.GradeSyst...
python
{ "resource": "" }
q49223
GradeSystem.get_grades
train
def get_grades(self): """Gets the grades in this system ranked from highest to lowest. return: (osid.grading.GradeList) - the list of grades raise: IllegalState - ``is_based_on_grades()`` is ``false`` raise: OperationFailed - unable to complete request *compliance: mandatory -...
python
{ "resource": "" }
q49224
GradeSystem.get_lowest_numeric_score
train
def get_lowest_numeric_score(self): """Gets the lowest number in a numeric grading system. return: (decimal) - the lowest number raise: IllegalState - ``is_based_on_grades()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ if self.is_based_...
python
{ "resource": "" }
q49225
GradeSystem.get_numeric_score_increment
train
def get_numeric_score_increment(self): """Gets the incremental step. return: (decimal) - the increment raise: IllegalState - ``is_based_on_grades()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ if self.is_based_on_grades(): r...
python
{ "resource": "" }
q49226
GradeSystem.get_highest_numeric_score
train
def get_highest_numeric_score(self): """Gets the highest number in a numeric grading system. return: (decimal) - the highest number raise: IllegalState - ``is_based_on_grades()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ if self.is_bas...
python
{ "resource": "" }
q49227
GradeSystemForm.get_based_on_grades_metadata
train
def get_based_on_grades_metadata(self): """Gets the metadata for a grade-based designation. return: (osid.Metadata) - metadata for the grade-based designation *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.re...
python
{ "resource": "" }
q49228
GradeSystemForm.set_based_on_grades
train
def set_based_on_grades(self, grades): """Sets the grade-based designation. arg: grades (boolean): the grade-based designation raise: InvalidArgument - ``grades`` is invalid raise: NoAccess - ``grades`` cannot be modified *compliance: mandatory -- This method must be implem...
python
{ "resource": "" }
q49229
GradeSystemForm.clear_based_on_grades
train
def clear_based_on_grades(self): """Clears the based on grades designation. raise: NoAccess - ``Metadata.isRequired()`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid...
python
{ "resource": "" }
q49230
GradeSystemForm.set_lowest_numeric_score
train
def set_lowest_numeric_score(self, score): """Sets the lowest numeric score. arg: score (decimal): the lowest numeric score raise: InvalidArgument - ``score`` is invalid raise: NoAccess - ``score`` cannot be modified *compliance: mandatory -- This method must be implemented...
python
{ "resource": "" }
q49231
GradeSystemForm.clear_lowest_numeric_score
train
def clear_lowest_numeric_score(self): """Clears the lowest score. raise: NoAccess - ``Metadata.isRequired()`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.grading.G...
python
{ "resource": "" }
q49232
GradeSystemForm.set_numeric_score_increment
train
def set_numeric_score_increment(self, increment): """Sets the numeric score increment. arg: increment (decimal): the numeric score increment raise: InvalidArgument - ``increment`` is invalid raise: NoAccess - ``increment`` cannot be modified *compliance: mandatory -- This m...
python
{ "resource": "" }
q49233
GradeSystemForm.clear_numeric_score_increment
train
def clear_numeric_score_increment(self): """Clears the numeric score increment. raise: NoAccess - ``Metadata.isRequired()`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for ...
python
{ "resource": "" }
q49234
GradeSystemForm.get_highest_numeric_score_metadata
train
def get_highest_numeric_score_metadata(self): """Gets the metadata for the highest numeric score. return: (osid.Metadata) - metadata for the highest numeric score *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.resource.Resou...
python
{ "resource": "" }
q49235
GradeSystemForm.set_highest_numeric_score
train
def set_highest_numeric_score(self, score): """Sets the highest numeric score. arg: score (decimal): the highest numeric score raise: InvalidArgument - ``score`` is invalid raise: NoAccess - ``score`` cannot be modified *compliance: mandatory -- This method must be implemen...
python
{ "resource": "" }
q49236
GradeSystemForm.clear_highest_numeric_score
train
def clear_highest_numeric_score(self): """Clears the highest numeric score. raise: NoAccess - ``Metadata.isRequired()`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid...
python
{ "resource": "" }
q49237
GradeEntry.get_gradebook_column_id
train
def get_gradebook_column_id(self): """Gets the ``Id`` of the ``GradebookColumn``. return: (osid.id.Id) - the ``Id`` of the ``GradebookColumn`` *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.learning.Activity.get_objective_id...
python
{ "resource": "" }
q49238
GradeEntry.get_gradebook_column
train
def get_gradebook_column(self): """Gets the ``GradebookColumn``. return: (osid.grading.GradebookColumn) - the ``GradebookColumn`` raise: OperationFailed - unable to complete request *compliance: mandatory -- This method must be implemented.* """ # Implemented from temp...
python
{ "resource": "" }
q49239
GradeEntry.get_overridden_calculated_entry
train
def get_overridden_calculated_entry(self): """Gets the calculated entry this entry overrides. return: (osid.grading.GradeEntry) - the calculated entry raise: IllegalState - ``overrides_calculated_entry()`` is ``false`` raise: OperationFailed - unable to complete reques...
python
{ "resource": "" }
q49240
GradeEntry.get_grade_id
train
def get_grade_id(self): """Gets the grade ``Id`` in this entry if the grading system is based on grades. return: (osid.id.Id) - the grade ``Id`` raise: IllegalState - ``is_graded()`` is ``false`` or ``GradeSystem.isBasedOnGrades()`` is ``false`` *compliance: mandatory -...
python
{ "resource": "" }
q49241
GradeEntry.get_grade
train
def get_grade(self): """Gets the grade in this entry if the grading system is based on grades. return: (osid.grading.Grade) - the grade raise: IllegalState - ``is_graded()`` is ``false`` or ``GradeSystem.isBasedOnGrades()`` is ``false`` raise: OperationFailed - unable ...
python
{ "resource": "" }
q49242
GradeEntry.get_time_graded
train
def get_time_graded(self): """Gets the time the gradeable object was graded. return: (osid.calendaring.DateTime) - the timestamp of the grading entry raise: IllegalState - ``is_graded()`` is ``false`` or ``is_derived()`` is ``true`` *compliance: mandator...
python
{ "resource": "" }
q49243
GradeEntry.get_grading_agent_id
train
def get_grading_agent_id(self): """Gets the ``Id`` of the ``Agent`` that created this entry. return: (osid.id.Id) - the ``Id`` of the ``Agent`` raise: IllegalState - ``is_graded()`` is ``false`` or ``is_derived()`` is ``true`` *compliance: mandatory -- This method must ...
python
{ "resource": "" }
q49244
GradeEntryForm.get_ignored_for_calculations_metadata
train
def get_ignored_for_calculations_metadata(self): """Gets the metadata for the ignore flag. return: (osid.Metadata) - metadata for the ignore flag *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.resource.ResourceForm.get_group...
python
{ "resource": "" }
q49245
GradeEntryForm.set_ignored_for_calculations
train
def set_ignored_for_calculations(self, ignore): """Sets the ignore for calculations flag. arg: ignore (boolean): the new ignore flag raise: InvalidArgument - ``ignore`` is invalid raise: NoAccess - ``ignore`` cannot be modified *compliance: mandatory -- This method must be ...
python
{ "resource": "" }
q49246
GradeEntryForm.clear_ignored_for_calculations
train
def clear_ignored_for_calculations(self): """Clears the ignore for calculations flag. raise: NoAccess - ``Metadata.isRequired()`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ # Implemented from templat...
python
{ "resource": "" }
q49247
GradeEntryForm.get_grade_metadata
train
def get_grade_metadata(self): """Gets the metadata for a grade. return: (osid.Metadata) - metadata for the grade *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.resource.ResourceForm.get_group_metadata_template metada...
python
{ "resource": "" }
q49248
GradeEntryForm.set_grade
train
def set_grade(self, grade_id): """Sets the grade. arg: grade_id (osid.id.Id): the new grade raise: InvalidArgument - ``grade_id`` is invalid or ``GradebookColumn.getGradeSystem().isBasedOnGrades()`` is ``false`` raise: NoAccess - ``grade_id`` cannot ...
python
{ "resource": "" }
q49249
GradeEntryForm.clear_grade
train
def clear_grade(self): """Clears the grade. raise: NoAccess - ``Metadata.isRequired()`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ if not self._grade_system.is_based_on_grades(): return ...
python
{ "resource": "" }
q49250
GradeEntryForm.get_score_metadata
train
def get_score_metadata(self): """Gets the metadata for a score. return: (osid.Metadata) - metadata for the score *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.resource.ResourceForm.get_group_metadata_template metada...
python
{ "resource": "" }
q49251
GradeEntryForm.set_score
train
def set_score(self, score): """Sets the score. arg: score (decimal): the new score raise: InvalidArgument - ``score`` is invalid or ``GradebookColumn.getGradeSystem().isBasedOnGrades()`` is ``true`` raise: NoAccess - ``score`` cannot be modified ...
python
{ "resource": "" }
q49252
GradeEntryForm.clear_score
train
def clear_score(self): """Clears the score. raise: NoAccess - ``Metadata.isRequired()`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ if self._grade_system.is_based_on_grades(): return # do...
python
{ "resource": "" }
q49253
GradebookColumnSummary._get_entries_for_calculation
train
def _get_entries_for_calculation(self): """Ignores entries flagged with ignoreForCalculation""" mgr = self._get_provider_manager('Grading') # what about the Proxy? if not mgr.supports_gradebook_column_lookup(): raise errors.OperationFailed('Grading does not support GradebookColumn l...
python
{ "resource": "" }
q49254
GradebookColumnSummary.get_mode
train
def get_mode(self): """Gets the mode of the score. If this system is based on grades, the mode of the output score is returned. return: (decimal) - the median score *compliance: mandatory -- This method must be implemented.* """ # http://stackoverflow.com/quest...
python
{ "resource": "" }
q49255
GradebookColumnSummary.get_rms
train
def get_rms(self): """Gets the root mean square of the score. If this system is based on grades, the RMS of the output score is returned. return: (decimal) - the median score *compliance: mandatory -- This method must be implemented.* """ return np.sqrt(np.mean...
python
{ "resource": "" }
q49256
GradebookNode.get_gradebook
train
def get_gradebook(self): """Gets the ``Gradebook`` at this node. return: (osid.grading.Gradebook) - the gradebook represented by this node *compliance: mandatory -- This method must be implemented.* """ if self._lookup_session is None: mgr = get_prov...
python
{ "resource": "" }
q49257
GradebookNode.get_parent_gradebook_nodes
train
def get_parent_gradebook_nodes(self): """Gets the parents of this gradebook. return: (osid.grading.GradebookNodeList) - the parents of the ``id`` *compliance: mandatory -- This method must be implemented.* """ parent_gradebook_nodes = [] for node in self...
python
{ "resource": "" }
q49258
register_filter
train
def register_filter(filter_cls): """ Adds the ``filter_cls`` to our registry. """ if filter_cls.name is None: return elif filter_cls.name in FILTER_REGISTRY: raise RuntimeError( "Filter class already registered: {}".format(filter_cls.name)) else: FILTER_REGIST...
python
{ "resource": "" }
q49259
build_filter
train
def build_filter(filter_or_string, *args, **kwargs): """ Overloaded filter construction. If ``filter_or_string`` is a string we look up it's corresponding class in the filter registry and return it. Otherwise, assume ``filter_or_string`` is an instance of a filter. :return: :class:`~es_fluent.filte...
python
{ "resource": "" }
q49260
GPD.Options
train
def Options(**kwargs): """ A method for declaring options for the class""" construct = GPDOptions #IMPORTANT! Set this names = construct._fields d = {} for name in names: d[name] = None #default values for k,v in kwargs.iteritems(): if k in names: d[k] = v else: raise ValueE...
python
{ "resource": "" }
q49261
AssetAdminSession.create_asset
train
def create_asset(self, asset_form): """Creates a new ``Asset``. arg: asset_form (osid.repository.AssetForm): the form for this ``Asset`` return: (osid.repository.Asset) - the new ``Asset`` raise: IllegalState - ``asset_form`` already used in a create ...
python
{ "resource": "" }
q49262
AssetAdminSession.alias_asset
train
def alias_asset(self, asset_id, alias_id): """Adds an ``Id`` to an ``Asset`` for the purpose of creating compatibility. The primary ``Id`` of the ``Asset`` is determined by the provider. The new ``Id`` performs as an alias to the primary ``Id``. If the alias is a pointer to another asse...
python
{ "resource": "" }
q49263
AssetAdminSession._get_asset_id_with_enclosure
train
def _get_asset_id_with_enclosure(self, enclosure_id): """Create an Asset with an enclosed foreign object. This is here to support AssetCompositionSession.set_asset. May need to add this in other objects to support other osid.Containable objects. return: (osid.id.Id) - the id of the new ...
python
{ "resource": "" }
q49264
AssetNotificationSession.register_for_new_assets_by_genus_type
train
def register_for_new_assets_by_genus_type(self, asset_genus_type): """Registers for notification of new assets of the given asset genus type. ``AssetReceiver.newAssets()`` is invoked when an asset is appears in this repository. arg: asset_genus_type (osid.type.Type): the genus type ...
python
{ "resource": "" }
q49265
AssetNotificationSession.register_for_deleted_asset
train
def register_for_deleted_asset(self, asset_id): """Registers for notification of a deleted asset. ``AssetReceiver.deletedAssets()`` is invoked when the specified asset is deleted or removed from this repository. arg: asset_id (osid.id.Id): the ``Id`` of the ``Asset`` to ...
python
{ "resource": "" }
q49266
AssetRepositorySession.get_asset_ids_by_repository
train
def get_asset_ids_by_repository(self, repository_id): """Gets the list of ``Asset`` ``Ids`` associated with a ``Repository``. arg: repository_id (osid.id.Id): ``Id`` of the ``Repository`` return: (osid.id.IdList) - list of related asset ``Ids`` raise: NotFound - ``repository_id`` i...
python
{ "resource": "" }
q49267
AssetRepositorySession.get_assets_by_repository
train
def get_assets_by_repository(self, repository_id): """Gets the list of ``Assets`` associated with a ``Repository``. arg: repository_id (osid.id.Id): ``Id`` of the ``Repository`` return: (osid.repository.AssetList) - list of related assets raise: NotFound - ``repository_id`` is not f...
python
{ "resource": "" }
q49268
AssetRepositorySession.get_asset_ids_by_repositories
train
def get_asset_ids_by_repositories(self, repository_ids): """Gets the list of ``Asset Ids`` corresponding to a list of ``Repository`` objects. arg: repository_ids (osid.id.IdList): list of repository ``Ids`` return: (osid.id.IdList) - list of asset ``Ids`` raise: Null...
python
{ "resource": "" }
q49269
AssetRepositorySession.get_assets_by_repositories
train
def get_assets_by_repositories(self, repository_ids): """Gets the list of ``Assets`` corresponding to a list of ``Repository`` objects. arg: repository_ids (osid.id.IdList): list of repository ``Ids`` return: (osid.repository.AssetList) - list of assets raise: NullAr...
python
{ "resource": "" }
q49270
AssetRepositorySession.get_repository_ids_by_asset
train
def get_repository_ids_by_asset(self, asset_id): """Gets the list of ``Repository`` ``Ids`` mapped to an ``Asset``. arg: asset_id (osid.id.Id): ``Id`` of an ``Asset`` return: (osid.id.IdList) - list of repository ``Ids`` raise: NotFound - ``asset_id`` is not found raise: N...
python
{ "resource": "" }
q49271
AssetRepositorySession.get_repositories_by_asset
train
def get_repositories_by_asset(self, asset_id): """Gets the list of ``Repository`` objects mapped to an ``Asset``. arg: asset_id (osid.id.Id): ``Id`` of an ``Asset`` return: (osid.repository.RepositoryList) - list of repositories raise: NotFound - ``asset_id`` is not found ra...
python
{ "resource": "" }
q49272
AssetRepositoryAssignmentSession.get_assignable_repository_ids
train
def get_assignable_repository_ids(self, repository_id): """Gets a list of repositories including and under the given repository node in which any asset can be assigned. arg: repository_id (osid.id.Id): the ``Id`` of the ``Repository`` return: (osid.id.IdList) - list of assign...
python
{ "resource": "" }
q49273
AssetRepositoryAssignmentSession.assign_asset_to_repository
train
def assign_asset_to_repository(self, asset_id, repository_id): """Adds an existing ``Asset`` to a ``Repository``. arg: asset_id (osid.id.Id): the ``Id`` of the ``Asset`` arg: repository_id (osid.id.Id): the ``Id`` of the ``Repository`` raise: AlreadyExists - ``ass...
python
{ "resource": "" }
q49274
AssetRepositoryAssignmentSession.unassign_asset_from_repository
train
def unassign_asset_from_repository(self, asset_id, repository_id): """Removes an ``Asset`` from a ``Repository``. arg: asset_id (osid.id.Id): the ``Id`` of the ``Asset`` arg: repository_id (osid.id.Id): the ``Id`` of the ``Repository`` raise: NotFound - ``asset_id...
python
{ "resource": "" }
q49275
AssetCompositionSession.get_composition_assets
train
def get_composition_assets(self, composition_id): """Gets the list of assets mapped to the given ``Composition``. arg: composition_id (osid.id.Id): ``Id`` of the ``Composition`` return: (osid.repository.AssetList) - list of assets raise: NotFound - ``composition_id``...
python
{ "resource": "" }
q49276
AssetCompositionSession.get_compositions_by_asset
train
def get_compositions_by_asset(self, asset_id): """Gets a list of compositions including the given asset. arg: asset_id (osid.id.Id): ``Id`` of the ``Asset`` return: (osid.repository.CompositionList) - the returned ``Composition list`` raise: NotFound - ``asset_id`` i...
python
{ "resource": "" }
q49277
AssetCompositionDesignSession._get_composition_collection
train
def _get_composition_collection(self, composition_id): """Returns a Mongo Collection and Composition given a Composition Id""" collection = JSONClientValidated('repository', collection='Composition', runtime=self._runtime)...
python
{ "resource": "" }
q49278
CompositionLookupSession.get_composition
train
def get_composition(self, composition_id): """Gets the ``Composition`` specified by its ``Id``. arg: composition_id (osid.id.Id): ``Id`` of the ``Composiiton`` return: (osid.repository.Composition) - the composition raise: NotFound - ``composition_id`` not found ...
python
{ "resource": "" }
q49279
CompositionLookupSession.get_compositions_by_ids
train
def get_compositions_by_ids(self, composition_ids): """Gets a ``CompositionList`` corresponding to the given ``IdList``. arg: composition_ids (osid.id.IdList): the list of ``Ids`` to retrieve return: (osid.repository.CompositionList) - the returned ``Compositi...
python
{ "resource": "" }
q49280
CompositionLookupSession.get_compositions_by_genus_type
train
def get_compositions_by_genus_type(self, composition_genus_type): """Gets a ``CompositionList`` corresponding to the given composition genus ``Type`` which does not include compositions of types derived from the specified ``Type``. arg: composition_genus_type (osid.type.Type): a composition ...
python
{ "resource": "" }
q49281
CompositionLookupSession.get_compositions
train
def get_compositions(self): """Gets all ``Compositions``. return: (osid.repository.CompositionList) - a list of ``Compositions`` raise: OperationFailed - unable to complete request raise: PermissionDenied - authorization failure *compliance: mandatory -- This m...
python
{ "resource": "" }
q49282
CompositionQuerySession.get_compositions_by_query
train
def get_compositions_by_query(self, composition_query): """Gets a list of ``Compositions`` matching the given composition query. arg: composition_query (osid.repository.CompositionQuery): the composition query return: (osid.repository.CompositionList) - the returned ...
python
{ "resource": "" }
q49283
CompositionAdminSession.get_composition_form_for_create
train
def get_composition_form_for_create(self, composition_record_types): """Gets the composition form for creating new compositions. A new form should be requested for each create transaction. arg: composition_record_types (osid.type.Type[]): array of composition record types ...
python
{ "resource": "" }
q49284
CompositionAdminSession.create_composition
train
def create_composition(self, composiiton_form): """Creates a new ``Composition``. arg: composiiton_form (osid.repository.CompositionForm): the form for this ``Composition`` return: (osid.repository.Composition) - the new ``Composition`` raise: IllegalState - ``compos...
python
{ "resource": "" }
q49285
CompositionAdminSession.update_composition
train
def update_composition(self, composiiton_form): """Updates an existing composition. arg: composiiton_form (osid.repository.CompositionForm): the form containing the elements to be updated raise: IllegalState - ``composition_form`` already used in an update tr...
python
{ "resource": "" }
q49286
CompositionAdminSession.delete_composition
train
def delete_composition(self, composition_id): """Deletes a ``Composition``. arg: composition_id (osid.id.Id): the ``Id`` of the ``Composition`` to remove raise: NotFound - ``composition_id`` not found raise: NullArgument - ``composition_id`` is ``null`` rais...
python
{ "resource": "" }
q49287
CompositionAdminSession.alias_composition
train
def alias_composition(self, composition_id, alias_id): """Adds an ``Id`` to a ``Composition`` for the purpose of creating compatibility. The primary ``Id`` of the ``Composition`` is determined by the provider. The new ``Id`` is an alias to the primary ``Id``. If the alias is a pointer t...
python
{ "resource": "" }
q49288
CompositionRepositorySession.get_composition_ids_by_repository
train
def get_composition_ids_by_repository(self, repository_id): """Gets the list of ``Composition`` ``Ids`` associated with a ``Repository``. arg: repository_id (osid.id.Id): ``Id`` of the ``Repository`` return: (osid.id.IdList) - list of related composition ``Ids`` raise: NotFound - `...
python
{ "resource": "" }
q49289
CompositionRepositorySession.get_compositions_by_repository
train
def get_compositions_by_repository(self, repository_id): """Gets the list of ``Compositions`` associated with a ``Repository``. arg: repository_id (osid.id.Id): ``Id`` of the ``Repository`` return: (osid.repository.CompositionList) - list of related compositions raise...
python
{ "resource": "" }
q49290
CompositionRepositorySession.get_composition_ids_by_repositories
train
def get_composition_ids_by_repositories(self, repository_ids): """Gets the list of ``Composition`` ``Ids`` corresponding to a list of ``Repository`` objects. arg: repository_ids (osid.id.IdList): list of repository ``Ids`` return: (osid.id.IdList) - list of composition ``Ids...
python
{ "resource": "" }
q49291
CompositionRepositorySession.get_compositions_by_repositories
train
def get_compositions_by_repositories(self, repository_ids): """Gets the list of ``Compositions`` corresponding to a list of ``Repository`` objects. arg: repository_ids (osid.id.IdList): list of repository ``Ids`` return: (osid.repository.CompositionList) - list of Composition...
python
{ "resource": "" }
q49292
CompositionRepositorySession.get_repository_ids_by_composition
train
def get_repository_ids_by_composition(self, composition_id): """Gets the ``Repository`` ``Ids`` mapped to a ``Composition``. arg: composition_id (osid.id.Id): ``Id`` of a ``Composition`` return: (osid.id.IdList) - list of repository ``Ids`` raise: NotFound - ``composition_id`` is n...
python
{ "resource": "" }
q49293
CompositionRepositorySession.get_repositories_by_composition
train
def get_repositories_by_composition(self, composition_id): """Gets the ``Repository`` objects mapped to a ``Composition``. arg: composition_id (osid.id.Id): ``Id`` of a ``Composition`` return: (osid.repository.RepositoryList) - list of repositories raise: NotFound - ``composition_id...
python
{ "resource": "" }
q49294
CompositionRepositoryAssignmentSession.assign_composition_to_repository
train
def assign_composition_to_repository(self, composition_id, repository_id): """Adds an existing ``Composition`` to a ``Repository``. arg: composition_id (osid.id.Id): the ``Id`` of the ``Composition`` arg: repository_id (osid.id.Id): the ``Id`` of the ``Repo...
python
{ "resource": "" }
q49295
CompositionRepositoryAssignmentSession.unassign_composition_from_repository
train
def unassign_composition_from_repository(self, composition_id, repository_id): """Removes ``Composition`` from a ``Repository``. arg: composition_id (osid.id.Id): the ``Id`` of the ``Composition`` arg: repository_id (osid.id.Id): the ``Id`` of the ``Reposit...
python
{ "resource": "" }
q49296
RepositoryQuerySession.get_repositories_by_query
train
def get_repositories_by_query(self, repository_query): """Gets a list of ``Repositories`` matching the given repository query. arg: repository_query (osid.repository.RepositoryQuery): the repository query return: (osid.repository.RepositoryList) - the returned ...
python
{ "resource": "" }
q49297
RepositoryHierarchySession.get_root_repositories
train
def get_root_repositories(self): """Gets the root repositories in the repository hierarchy. A node with no parents is an orphan. While all repository ``Ids`` are known to the hierarchy, an orphan does not appear in the hierarchy unless explicitly added as a root node or child of ...
python
{ "resource": "" }
q49298
RepositoryHierarchySession.has_parent_repositories
train
def has_parent_repositories(self, repository_id): """Tests if the ``Repository`` has any parents. arg: repository_id (osid.id.Id): a repository ``Id`` return: (boolean) - ``true`` if the repository has parents, ``false`` otherwise raise: NotFound - ``repository_id`` ...
python
{ "resource": "" }
q49299
RepositoryHierarchySession.is_parent_of_repository
train
def is_parent_of_repository(self, id_, repository_id): """Tests if an ``Id`` is a direct parent of a repository. arg: id (osid.id.Id): an ``Id`` arg: repository_id (osid.id.Id): the ``Id`` of a repository return: (boolean) - ``true`` if this ``id`` is a parent of `...
python
{ "resource": "" }