_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
75
19.8k
language
stringclasses
1 value
meta_information
dict
q48400
Dictator.get
train
def get(self, key, default=None): """Return the value at key ``key``, or default value ``default`` which is None by default. >>> dc = Dictator() >>> dc['l0'] = [1, 2, 3, 4] >>> dc.get('l0') ['1', '2', '3', '4'] >>> dc['l0'] ['1', '2', '3', '4'] >>...
python
{ "resource": "" }
q48401
Dictator.pop
train
def pop(self, key, default=None): """Remove and return the last item of the list ``key``. If key doesn't exists it return ``default``. >>> dc = Dictator() >>> dc['l0'] = [1, 2, 3, 4] >>> dc.pop('l0') ['1', '2', '3', '4'] >>> dc.pop('l1', 'empty') 'empty' ...
python
{ "resource": "" }
q48402
Dictator.keys
train
def keys(self, pattern=None): """Returns a list of keys matching ``pattern``. By default return all keys. >>> dc = Dictator() >>> dc['l0'] = [1, 2, 3, 4] >>> dc['s0'] = 'string value' >>> dc.keys() ['l0', 's0'] >>> dc.keys('h*') [] >>> dc....
python
{ "resource": "" }
q48403
Dictator.items
train
def items(self): """Return list of tuples of keys and values in db >>> dc = Dictator() >>> dc['l0'] = [1, 2, 3, 4] >>> dc.items() [('l0', ['1', '2', '3', '4'])] >>> dc.clear() :return: list of (key, value) pairs :rtype: list of tuple """ ...
python
{ "resource": "" }
q48404
Dictator.values
train
def values(self): """Return list of values in db >>> dc = Dictator() >>> dc['l0'] = [1, 2, 3, 4] >>> dc.items() [('l0', ['1', '2', '3', '4'])] >>> dc.clear() :return: list of tuple :rtype: list """ logger.debug('call values') retu...
python
{ "resource": "" }
q48405
Dictator.iterkeys
train
def iterkeys(self, match=None, count=1): """Return an iterator over the db's keys. ``match`` allows for filtering the keys by pattern. ``count`` allows for hint the minimum number of returns. >>> dc = Dictator() >>> dc['1'] = 'abc' >>> dc['2'] = 'def' >>> dc['3']...
python
{ "resource": "" }
q48406
ResourceSearchSession.get_resources_by_search
train
def get_resources_by_search(self, resource_query, resource_search): """Pass through to provider ResourceSearchSession.get_resources_by_search""" # Implemented from azosid template for - # osid.resource.ResourceSearchSession.get_resources_by_search_template if not self._can('search'): ...
python
{ "resource": "" }
q48407
ResourceRelationshipLookupSession.get_resource_relationships_for_source_resource_on_date
train
def get_resource_relationships_for_source_resource_on_date(self, source_resource_id, from_, to): """Pass through to provider ResourceRelationshipLookupSession.get_resource_relationships_for_source_resource_on_date""" # Implemented from azosid template for - # osid.relationship.RelationshipLookup...
python
{ "resource": "" }
q48408
ResourceRelationshipSearchSession.get_resource_relationships_by_search
train
def get_resource_relationships_by_search(self, resource_relationship_query, resource_relationship_search): """Pass through to provider ResourceRelationshipSearchSession.get_resource_relationships_by_search""" # Implemented from azosid template for - # osid.resource.ResourceSearchSession.get_reso...
python
{ "resource": "" }
q48409
FlowManager
train
def FlowManager(start_string, end_string): """ A factory for creating context managers for standard code constructions, such as if statements and functions. :param str start_string: A format string for the beginning of this code structure :param str end_string: A format string for the end of th...
python
{ "resource": "" }
q48410
CodeWriter.writeln
train
def writeln(self, data): """ Write a line of text to the file :param data: The text to write """ self.f.write(" "*self.indent_level) self.f.write(data + "\n")
python
{ "resource": "" }
q48411
CodeWriter._function
train
def _function(self, type, name, args=""): """ Returns a context manager for writing a function. :param str type: The return type of the function :param str name: The name of the functino :param str args: The argument specification for the function """ return Func...
python
{ "resource": "" }
q48412
CodeGen.write_to
train
def write_to(self, f): """ Generates code based on the given module configuration and writes it to the file object `f`. """ f = CodeWriter(f) # Write all header files headers = set() for plugin in self.plugins: headers = headers.union(plugin.h...
python
{ "resource": "" }
q48413
OsidObject.is_of_genus_type
train
def is_of_genus_type(self, genus_type=None): """Tests if this object is of the given genus Type. The given genus type may be supported by the object through the type hierarchy. | arg: ``genus_type`` (``osid.type.Type``): a genus type | return: (``boolean``) - true if this ob...
python
{ "resource": "" }
q48414
OsidForm.is_valid
train
def is_valid(self): """Tests if ths form is in a valid state for submission. A form is valid if all required data has been supplied compliant with any constraints. return: (boolean) - false if there is a known error in this form, true otherwise raise: Operation...
python
{ "resource": "" }
q48415
confirm
train
def confirm(prompt, default=None, show_default=True, abort=False, input_function=None): '''Prompts for confirmation from the user. ''' valid = { 'yes': True, 'y': True, 'no': False, 'n': False } input_function = get_input_fn(input_function) if default not in ['yes', 'no', None]: default = None if show_...
python
{ "resource": "" }
q48416
prompt
train
def prompt(text, default=None, show_default=True, invisible=False, confirm=False, skip=False, type=None, input_function=None): '''Prompts for input from the user. ''' t = determine_type(type, default) input_function = get_input_fn(input_function, invisible) if default is not None and show_default: tex...
python
{ "resource": "" }
q48417
Parameter.consume
train
def consume(self, tokens): '''Have this parameter consume some tokens. This stores the consumed value for later use and returns the modified tokens array for further processing. ''' n = len(tokens) if self._nargs == -1 else self._nargs if n > len(tokens): exit('Error: Not enough arguments for "{}".'.for...
python
{ "resource": "" }
q48418
App.parse
train
def parse(self, tokens): '''Parses a list of tokens into a JSON-serializable object. The parsing proceeds from left to right and is greedy. Precedence order: 1. Parameters with active context. For example, an Option with nargs=-1 will gobble all the remaining tokens. 2. Subcommands. 3. Parame...
python
{ "resource": "" }
q48419
get_resource_mdata
train
def get_resource_mdata(): """Return default mdata map for Resource""" return { 'group': { 'element_label': { 'text': 'group', 'languageTypeId': str(DEFAULT_LANGUAGE_TYPE), 'scriptTypeId': str(DEFAULT_SCRIPT_TYPE), 'formatTypeId'...
python
{ "resource": "" }
q48420
calculate_affinity
train
def calculate_affinity(user1, user2, round=False): # pragma: no cover """ Quick one-off affinity calculations. Creates an instance of the ``MALAffinity`` class with ``user1``, then calculates affinity with ``user2``. :param str user1: First user :param str user2: Second user :param round:...
python
{ "resource": "" }
q48421
s2time
train
def s2time(secs, show_secs=True, show_fracs=True): """Converts seconds to time""" try: secs = float(secs) except: return "--:--:--.--" wholesecs = int(secs) centisecs = int((secs - wholesecs) * 100) hh = int(wholesecs / 3600) hd = int(hh % 24) mm = int((wholesecs / 60) - ...
python
{ "resource": "" }
q48422
f2tc
train
def f2tc(f,base=25): """Converts frames to timecode""" try: f = int(f) except: return "--:--:--:--" hh = int((f / base) / 3600) mm = int(((f / base) / 60) - (hh*60)) ss = int((f/base) - (hh*3600) - (mm*60)) ff = int(f - (hh*3600*base) - (mm*60*base) - (ss*base)) return "{...
python
{ "resource": "" }
q48423
s2tc
train
def s2tc(s,base=25): """Converts seconds to timecode""" try: f = int(s*base) except: return "--:--:--:--" hh = int((f / base) / 3600) hhd = int((hh % 24)) mm = int(((f / base) / 60) - (hh*60)) ss = int((f/base) - (hh*3600) - (mm*60)) ff = int(f - (hh*3600*base) - (mm*...
python
{ "resource": "" }
q48424
ContextWrapper.clone_with_new_dockerfile
train
def clone_with_new_dockerfile(self, conf, docker_file): """Clone this tarfile and add in another filename before closing the new tar and returning""" log.info("Copying context to add a different dockerfile") self.close() with a_temp_file() as tmpfile: old_t = os.stat(self.tmp...
python
{ "resource": "" }
q48425
ContextBuilder.make_context
train
def make_context(self, context, silent_build=False, extra_context=None): """ Context manager for creating the context of the image Arguments: context - ``harpoon.option_spec.image_objs.Context`` Knows all the context related options silent_build - boolean ...
python
{ "resource": "" }
q48426
ContextBuilder.the_context
train
def the_context(self, content, silent_build=False): """Return either a file with the content written to it, or a whole new context tar""" if isinstance(content, six.string_types): with a_temp_file() as fle: fle.write(content.encode('utf-8')) fle.seek(0) ...
python
{ "resource": "" }
q48427
ContextBuilder.find_files
train
def find_files(self, context, silent_build): """ Find the set of files from our parent_dir that we care about """ first_layer = ["'{0}'".format(thing) for thing in os.listdir(context.parent_dir)] output, status = command_output("find {0} -type l -or -type f {1} -follow -print".fo...
python
{ "resource": "" }
q48428
ContextBuilder.convert_nonascii
train
def convert_nonascii(self, lst): """Convert the strange outputs from git commands""" for item in lst: if item.startswith('"') and item.endswith('"'): item = item[1:-1] yield item.encode('utf-8').decode('unicode-escape') else: yield ...
python
{ "resource": "" }
q48429
ContextBuilder.find_notignored_git_files
train
def find_notignored_git_files(self, context, silent_build): """ Return a list of files that are not ignored by git """ def git(args, error_message, cwd=context.parent_dir, **error_kwargs): output, status = command_output("git {0}".format(args), cwd=cwd) if status ...
python
{ "resource": "" }
q48430
to_bool
train
def to_bool(answer, default): """ Converts user answer to boolean """ answer = str(answer).lower() default = str(default).lower() if answer and answer in "yes": return True return False
python
{ "resource": "" }
q48431
out
train
def out(*args): """ Outputs its parameters to users stdout. """ for value in args: sys.stdout.write(value) sys.stdout.write(os.linesep)
python
{ "resource": "" }
q48432
err
train
def err(*args): """ Outputs its parameters to users stderr. """ for value in args: sys.stderr.write(value) sys.stderr.write(os.linesep)
python
{ "resource": "" }
q48433
AssessmentSession.has_next_assessment_section
train
def has_next_assessment_section(self, assessment_section_id): """Tests if there is a next assessment section in the assessment following the given assessment section ``Id``. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` return: (boolean) - ``tru...
python
{ "resource": "" }
q48434
AssessmentSession.has_previous_assessment_section
train
def has_previous_assessment_section(self, assessment_section_id): """Tests if there is a previous assessment section in the assessment following the given assessment section ``Id``. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` return: (boolean)...
python
{ "resource": "" }
q48435
AssessmentSession.get_assessment_section
train
def get_assessment_section(self, assessment_section_id): """Gets an assessemnts section by ``Id``. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` return: (osid.assessment.AssessmentSection) - the assessment section raise: ...
python
{ "resource": "" }
q48436
AssessmentSession.get_incomplete_assessment_sections
train
def get_incomplete_assessment_sections(self, assessment_taken_id): """Gets the incomplete assessment sections of this assessment. arg: assessment_taken_id (osid.id.Id): ``Id`` of the ``AssessmentTaken`` return: (osid.assessment.AssessmentSectionList) - the list of ...
python
{ "resource": "" }
q48437
AssessmentSession.has_assessment_section_begun
train
def has_assessment_section_begun(self, assessment_section_id): """Tests if this assessment section has started. A section begins from the designated start time if a start time is defined. If no start time is defined the section may begin at any time. Assessment items cannot be accessed ...
python
{ "resource": "" }
q48438
AssessmentSession.has_next_question
train
def has_next_question(self, assessment_section_id, item_id): """Tests if there is a next question following the given question ``Id``. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of the ``Item`` ret...
python
{ "resource": "" }
q48439
AssessmentSession.get_next_question
train
def get_next_question(self, assessment_section_id, item_id): """Gets the next question in this assesment section. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of the ``Item`` return: (osid.assessment...
python
{ "resource": "" }
q48440
AssessmentSession.has_previous_question
train
def has_previous_question(self, assessment_section_id, item_id): """Tests if there is a previous question preceeding the given question ``Id``. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of the ``Item`` ...
python
{ "resource": "" }
q48441
AssessmentSession.get_previous_question
train
def get_previous_question(self, assessment_section_id, item_id): """Gets the previous question in this assesment section. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of the ``Item`` return: (osid.as...
python
{ "resource": "" }
q48442
AssessmentSession.get_question
train
def get_question(self, assessment_section_id, item_id): """Gets the ``Question`` specified by its ``Id``. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of the ``Item`` return: (osid.assessment.Questio...
python
{ "resource": "" }
q48443
AssessmentSession.get_response_form
train
def get_response_form(self, assessment_section_id, item_id): """Gets the response form for submitting an answer. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of the ``Item`` return: (osid.assessment....
python
{ "resource": "" }
q48444
AssessmentSession.submit_response
train
def submit_response(self, assessment_section_id, item_id, answer_form): """Submits an answer to an item. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of the ``Item`` arg: answer_form (osid.assessm...
python
{ "resource": "" }
q48445
AssessmentSession.get_first_unanswered_question
train
def get_first_unanswered_question(self, assessment_section_id): """Gets the first unanswered question in this assesment section. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` return: (osid.assessment.Question) - the first unanswered ...
python
{ "resource": "" }
q48446
AssessmentSession.has_next_unanswered_question
train
def has_next_unanswered_question(self, assessment_section_id, item_id): """Tests if there is a next unanswered question following the given question ``Id``. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of th...
python
{ "resource": "" }
q48447
AssessmentSession.get_next_unanswered_question
train
def get_next_unanswered_question(self, assessment_section_id, item_id): """Gets the next unanswered question in this assesment section. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of the ``Item`` re...
python
{ "resource": "" }
q48448
AssessmentSession.has_previous_unanswered_question
train
def has_previous_unanswered_question(self, assessment_section_id, item_id): """Tests if there is a previous unanswered question preceeding the given question ``Id``. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``I...
python
{ "resource": "" }
q48449
AssessmentSession.get_previous_unanswered_question
train
def get_previous_unanswered_question(self, assessment_section_id, item_id): """Gets the previous unanswered question in this assesment section. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of the ``Item`` ...
python
{ "resource": "" }
q48450
AssessmentSession.get_response
train
def get_response(self, assessment_section_id, item_id): """Gets the submitted response to the associated item. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of the ``Item`` return: (osid.assessment.Re...
python
{ "resource": "" }
q48451
AssessmentSession.clear_response
train
def clear_response(self, assessment_section_id, item_id): """Clears the response to an item The item appears as unanswered. If no response exists, the method simply returns. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id ...
python
{ "resource": "" }
q48452
AssessmentSession.finish_assessment_section
train
def finish_assessment_section(self, assessment_section_id): """Indicates an assessment section is complete. Finished sections may or may not allow new or updated responses. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` raise: IllegalSt...
python
{ "resource": "" }
q48453
AssessmentSession.is_answer_available
train
def is_answer_available(self, assessment_section_id, item_id): """Tests if an answer is available for the given item. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of the ``Item`` return: (boolean) - ...
python
{ "resource": "" }
q48454
AssessmentSession.get_answers
train
def get_answers(self, assessment_section_id, item_id): """Gets the acceptable answers to the associated item. arg: assessment_section_id (osid.id.Id): ``Id`` of the ``AssessmentSection`` arg: item_id (osid.id.Id): ``Id`` of the ``Item`` return: (osid.assessment.Ans...
python
{ "resource": "" }
q48455
AssessmentSession.finish_assessment
train
def finish_assessment(self, assessment_taken_id): """Indicates the entire assessment is complete. arg: assessment_taken_id (osid.id.Id): ``Id`` of the ``AssessmentTaken`` raise: IllegalState - ``has_begun()`` is ``false or is_over()`` is ``true`` rais...
python
{ "resource": "" }
q48456
AssessmentSession._get_assessment_taken
train
def _get_assessment_taken(self, assessment_taken_id): """Helper method for getting an AssessmentTaken objects given an Id.""" if assessment_taken_id not in self._assessments_taken: mgr = self._get_provider_manager('ASSESSMENT') lookup_session = mgr.get_assessment_taken_lookup_ses...
python
{ "resource": "" }
q48457
AssessmentResultsSession.get_items
train
def get_items(self, assessment_taken_id): """Gets the items questioned in a assessment. arg: assessment_taken_id (osid.id.Id): ``Id`` of the ``AssessmentTaken`` return: (osid.assessment.ItemList) - the list of assessment questions raise: NotFound - ``...
python
{ "resource": "" }
q48458
AssessmentResultsSession.get_responses
train
def get_responses(self, assessment_taken_id): """Gets the submitted responses. arg: assessment_taken_id (osid.id.Id): ``Id`` of the ``AssessmentTaken`` return: (osid.assessment.ResponseList) - the submitted answers raise: NotFound - ``assessment_taken_id`` is not fou...
python
{ "resource": "" }
q48459
ItemLookupSession.get_item
train
def get_item(self, item_id): """Gets the ``Item`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``Item`` may have a different ``Id`` than requested, such as the case where a duplicate ``Id`` was assigned to...
python
{ "resource": "" }
q48460
ItemLookupSession.get_items_by_ids
train
def get_items_by_ids(self, item_ids): """Gets an ``ItemList`` corresponding to the given ``IdList``. In plenary mode, the returned list contains all of the items specified in the ``Id`` list, in the order of the list, including duplicates, or an error results if an ``Id`` in the ...
python
{ "resource": "" }
q48461
ItemLookupSession.get_items_by_genus_type
train
def get_items_by_genus_type(self, item_genus_type): """Gets an ``ItemList`` corresponding to the given assessment item genus ``Type`` which does not include assessment items of genus types derived from the specified ``Type``. In plenary mode, the returned list contains all known assessment item...
python
{ "resource": "" }
q48462
ItemLookupSession.get_items
train
def get_items(self): """Gets all ``Items``. In plenary mode, the returned list contains all known items or an error results. Otherwise, the returned list may contain only those items that are accessible through this session. return: (osid.assessment.ItemList) - a list of ``Item...
python
{ "resource": "" }
q48463
ItemQuerySession.get_items_by_query
train
def get_items_by_query(self, item_query): """Gets a list of ``Items`` matching the given item query. arg: item_query (osid.assessment.ItemQuery): the item query return: (osid.assessment.ItemList) - the returned ``ItemList`` raise: NullArgument - ``item_query`` is ``null`` ra...
python
{ "resource": "" }
q48464
ItemAdminSession.get_item_form_for_create
train
def get_item_form_for_create(self, item_record_types): """Gets the assessment item form for creating new assessment items. A new form should be requested for each create transaction. arg: item_record_types (osid.type.Type[]): array of item record types to be included in the ...
python
{ "resource": "" }
q48465
ItemAdminSession.create_item
train
def create_item(self, item_form): """Creates a new ``Item``. arg: item_form (osid.assessment.ItemForm): the form for this ``Item`` return: (osid.assessment.Item) - the new ``Item`` raise: IllegalState - ``item_form`` already used in a create transacti...
python
{ "resource": "" }
q48466
ItemAdminSession.update_item
train
def update_item(self, item_form): """Updates an existing item. arg: item_form (osid.assessment.ItemForm): the form containing the elements to be updated raise: IllegalState - ``item_form`` already used in an update transaction raise: InvalidArgument ...
python
{ "resource": "" }
q48467
ItemAdminSession.delete_item
train
def delete_item(self, item_id): """Deletes the ``Item`` identified by the given ``Id``. arg: item_id (osid.id.Id): the ``Id`` of the ``Item`` to delete raise: NotFound - an ``Item`` was not found identified by the given ``Id`` raise: NullArgument - `...
python
{ "resource": "" }
q48468
ItemAdminSession.alias_item
train
def alias_item(self, item_id, alias_id): """Adds an ``Id`` to an ``Item`` for the purpose of creating compatibility. The primary ``Id`` of the ``Item`` is determined by the provider. The new ``Id`` is an alias to the primary ``Id``. If the alias is a pointer to another item, it is reass...
python
{ "resource": "" }
q48469
ItemAdminSession.get_question_form_for_create
train
def get_question_form_for_create(self, item_id, question_record_types): """Gets the question form for creating new questions. A new form should be requested for each create transaction. arg: item_id (osid.id.Id): an assessment item ``Id`` arg: question_record_types (osid.type.Typ...
python
{ "resource": "" }
q48470
ItemAdminSession.get_question_form_for_update
train
def get_question_form_for_update(self, question_id): """Gets the question form for updating an existing question. A new question form should be requested for each update transaction. arg: question_id (osid.id.Id): the ``Id`` of the ``Question`` return: (osid.assessment.Quest...
python
{ "resource": "" }
q48471
ItemAdminSession.update_question
train
def update_question(self, question_form): """Updates an existing question. arg: question_form (osid.assessment.QuestionForm): the form containing the elements to be updated raise: IllegalState - ``question_form`` already used in an update transaction ...
python
{ "resource": "" }
q48472
ItemAdminSession.delete_question
train
def delete_question(self, question_id): """Deletes the ``Question`` identified by the given ``Id``. arg: question_id (osid.id.Id): the ``Id`` of the ``Question`` to delete raise: NotFound - a ``Question`` was not found identified by the given ``Id`` r...
python
{ "resource": "" }
q48473
ItemAdminSession.create_answer
train
def create_answer(self, answer_form): """Creates a new ``Answer``. arg: answer_form (osid.assessment.AnswerForm): the form for this ``Answer`` return: (osid.assessment.Answer) - the new ``Answer`` raise: IllegalState - ``answer_form`` already used in a create ...
python
{ "resource": "" }
q48474
ItemAdminSession.update_answer
train
def update_answer(self, answer_form): """Updates an existing answer. arg: answer_form (osid.assessment.AnswerForm): the form containing the elements to be updated raise: IllegalState - ``answer_form`` already used in an update transaction raise: Inva...
python
{ "resource": "" }
q48475
ItemAdminSession.delete_answer
train
def delete_answer(self, answer_id): """Deletes the ``Answer`` identified by the given ``Id``. arg: answer_id (osid.id.Id): the ``Id`` of the ``Answer`` to delete raise: NotFound - an ``Answer`` was not found identified by the given ``Id`` raise: Null...
python
{ "resource": "" }
q48476
ItemNotificationSession.register_for_deleted_item
train
def register_for_deleted_item(self, item_id): """Registers for notification of a deleted assessment item. ``ItemReceiver.deletedItems()`` is invoked when the specified assessment item is removed from the assessment bank. arg: item_id (osid.id.Id): the ``Id`` of the ``Item`` to ...
python
{ "resource": "" }
q48477
ItemBankSession.get_item_ids_by_bank
train
def get_item_ids_by_bank(self, bank_id): """Gets the list of ``Item`` ``Ids`` associated with a ``Bank``. arg: bank_id (osid.id.Id): ``Id`` of the ``Bank`` return: (osid.id.IdList) - list of related item ``Ids`` raise: NotFound - ``bank_id`` is not found raise: NullArgumen...
python
{ "resource": "" }
q48478
ItemBankSession.get_items_by_bank
train
def get_items_by_bank(self, bank_id): """Gets the list of ``Items`` associated with a ``Bank``. arg: bank_id (osid.id.Id): ``Id`` of the ``Bank`` return: (osid.assessment.ItemList) - list of related items raise: NotFound - ``bank_id`` is not found raise: NullArgument - ``ba...
python
{ "resource": "" }
q48479
ItemBankSession.get_item_ids_by_banks
train
def get_item_ids_by_banks(self, bank_ids): """Gets the list of ``Item Ids`` corresponding to a list of ``Banks``. arg: bank_ids (osid.id.IdList): list of bank ``Ids`` return: (osid.id.IdList) - list of bank ``Ids`` raise: NullArgument - ``bank_ids`` is ``null`` raise: Opera...
python
{ "resource": "" }
q48480
ItemBankSession.get_items_by_banks
train
def get_items_by_banks(self, bank_ids): """Gets the list of ``Items`` corresponding to a list of ``Banks``. arg: bank_ids (osid.id.IdList): list of bank ``Ids`` return: (osid.assessment.ItemList) - list of items raise: NullArgument - ``bank_ids`` is ``null`` raise: Operatio...
python
{ "resource": "" }
q48481
ItemBankSession.get_bank_ids_by_item
train
def get_bank_ids_by_item(self, item_id): """Gets the list of ``Bank`` ``Ids`` mapped to an ``Item``. arg: item_id (osid.id.Id): ``Id`` of an ``Item`` return: (osid.id.IdList) - list of bank ``Ids`` raise: NotFound - ``item_id`` is not found raise: NullArgument - ``item_id`...
python
{ "resource": "" }
q48482
ItemBankSession.get_banks_by_item
train
def get_banks_by_item(self, item_id): """Gets the list of ``Banks`` mapped to an ``Item``. arg: item_id (osid.id.Id): ``Id`` of an ``Item`` return: (osid.assessment.BankList) - list of banks raise: NotFound - ``item_id`` is not found raise: NullArgument - ``item_id`` is ``n...
python
{ "resource": "" }
q48483
ItemBankAssignmentSession.assign_item_to_bank
train
def assign_item_to_bank(self, item_id, bank_id): """Adds an existing ``Item`` to a ``Bank``. arg: item_id (osid.id.Id): the ``Id`` of the ``Item`` arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank`` raise: AlreadyExists - ``item_id`` is already assigned to ``ban...
python
{ "resource": "" }
q48484
ItemBankAssignmentSession.unassign_item_from_bank
train
def unassign_item_from_bank(self, item_id, bank_id): """Removes an ``Item`` from a ``Bank``. arg: item_id (osid.id.Id): the ``Id`` of the ``Item`` arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank`` raise: NotFound - ``item_id`` or ``bank_id`` not found or ``ite...
python
{ "resource": "" }
q48485
AssessmentLookupSession.get_assessment
train
def get_assessment(self, assessment_id): """Gets the ``Assessment`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``Assessment`` may have a different ``Id`` than requested, such as the case where a duplicat...
python
{ "resource": "" }
q48486
AssessmentLookupSession.get_assessments_by_ids
train
def get_assessments_by_ids(self, assessment_ids): """Gets an ``AssessmentList`` corresponding to the given ``IdList``. In plenary mode, the returned list contains all of the assessments specified in the ``Id`` list, in the order of the list, including duplicates, or an error results if ...
python
{ "resource": "" }
q48487
AssessmentLookupSession.get_assessments_by_genus_type
train
def get_assessments_by_genus_type(self, assessment_genus_type): """Gets an ``AssessmentList`` corresponding to the given assessment genus ``Type`` which does not include assessments of types derived from the specified ``Type``. In plenary mode, the returned list contains all known assessments o...
python
{ "resource": "" }
q48488
AssessmentLookupSession.get_assessments
train
def get_assessments(self): """Gets all ``Assessments``. In plenary mode, the returned list contains all known assessments or an error results. Otherwise, the returned list may contain only those assessments that are accessible through this session. return: (osid.assessm...
python
{ "resource": "" }
q48489
AssessmentQuerySession.get_assessments_by_query
train
def get_assessments_by_query(self, assessment_query): """Gets a list of ``Assessments`` matching the given assessment query. arg: assessment_query (osid.assessment.AssessmentQuery): the assessment query return: (osid.assessment.AssessmentList) - the returned `...
python
{ "resource": "" }
q48490
AssessmentAdminSession.get_assessment_form_for_create
train
def get_assessment_form_for_create(self, assessment_record_types): """Gets the assessment form for creating new assessments. A new form should be requested for each create transaction. arg: assessment_record_types (osid.type.Type[]): array of assessment record types to be in...
python
{ "resource": "" }
q48491
AssessmentAdminSession.create_assessment
train
def create_assessment(self, assessment_form): """Creates a new ``Assessment``. arg: assessment_form (osid.assessment.AssessmentForm): the form for this ``Assessment`` return: (osid.assessment.Assessment) - the new ``Assessment`` raise: IllegalState - ``assessment_for...
python
{ "resource": "" }
q48492
AssessmentAdminSession.update_assessment
train
def update_assessment(self, assessment_form): """Updates an existing assessment. arg: assessment_form (osid.assessment.AssessmentForm): the form containing the elements to be updated raise: IllegalState - ``assessment_form`` already used in an update transact...
python
{ "resource": "" }
q48493
AssessmentAdminSession.delete_assessment
train
def delete_assessment(self, assessment_id): """Deletes an ``Assessment``. arg: assessment_id (osid.id.Id): the ``Id`` of the ``Assessment`` to remove raise: NotFound - ``assessment_id`` not found raise: NullArgument - ``assessment_id`` is ``null`` raise: Op...
python
{ "resource": "" }
q48494
AssessmentAdminSession.alias_assessment
train
def alias_assessment(self, assessment_id, alias_id): """Adds an ``Id`` to an ``Assessment`` for the purpose of creating compatibility. The primary ``Id`` of the ``Assessment`` is determined by the provider. The new ``Id`` is an alias to the primary ``Id``. If the alias is a pointer to a...
python
{ "resource": "" }
q48495
AssessmentBankSession.get_assessment_ids_by_bank
train
def get_assessment_ids_by_bank(self, bank_id): """Gets the list of ``Assessment`` ``Ids`` associated with a ``Bank``. arg: bank_id (osid.id.Id): ``Id`` of the ``Bank`` return: (osid.id.IdList) - list of related assessment ``Ids`` raise: NotFound - ``bank_id`` is not found r...
python
{ "resource": "" }
q48496
AssessmentBankSession.get_assessments_by_bank
train
def get_assessments_by_bank(self, bank_id): """Gets the list of ``Assessments`` associated with a ``Bank``. arg: bank_id (osid.id.Id): ``Id`` of the ``Bank`` return: (osid.assessment.AssessmentList) - list of related assessments raise: NotFound - ``bank_id`` is not f...
python
{ "resource": "" }
q48497
AssessmentBankSession.get_assessment_ids_by_banks
train
def get_assessment_ids_by_banks(self, bank_ids): """Gets the list of ``Assessment 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`` r...
python
{ "resource": "" }
q48498
AssessmentBankSession.get_assessments_by_banks
train
def get_assessments_by_banks(self, bank_ids): """Gets the list of ``Assessments`` corresponding to a list of ``Banks``. arg: bank_ids (osid.id.IdList): list of bank ``Ids`` return: (osid.assessment.AssessmentList) - list of assessments raise: NullArgument - ``bank_ids`` is ``null`` ...
python
{ "resource": "" }
q48499
AssessmentBankSession.get_bank_ids_by_assessment
train
def get_bank_ids_by_assessment(self, assessment_id): """Gets the list of ``Bank`` ``Ids`` mapped to an ``Assessment``. arg: assessment_id (osid.id.Id): ``Id`` of an ``Assessment`` return: (osid.id.IdList) - list of bank ``Ids`` raise: NotFound - ``assessment_id`` is not found ...
python
{ "resource": "" }