_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
75
19.8k
language
stringclasses
1 value
meta_information
dict
q48000
SequenceRuleForm.get_minimum_score_metadata
train
def get_minimum_score_metadata(self): """Gets the metadata for the minimum score. return: (osid.Metadata) - metadata for the minimum score *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.resource.ResourceForm.get_group_metada...
python
{ "resource": "" }
q48001
SequenceRuleForm.get_maximum_score_metadata
train
def get_maximum_score_metadata(self): """Gets the metadata for the maximum score. return: (osid.Metadata) - metadata for the maximum score *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.resource.ResourceForm.get_group_metada...
python
{ "resource": "" }
q48002
SequenceRuleForm.get_cumulative_metadata
train
def get_cumulative_metadata(self): """Gets the metadata for the cumulative flag. return: (osid.Metadata) - metadata for the cumulative flag *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.resource.ResourceForm.get_group_metad...
python
{ "resource": "" }
q48003
SequenceRuleForm.set_cumulative
train
def set_cumulative(self, cumulative): """Applies this rule to all previous assessment parts. arg: cumulative (boolean): ``true`` to apply to all previous assessment parts. ``false`` to apply to the immediate previous assessment part raise: InvalidArgument - `...
python
{ "resource": "" }
q48004
get_parcellation
train
def get_parcellation(atlas, parcel_param): "Placeholder to insert your own function to return parcellation in reference space." parc_path = os.path.join(atlas, 'parcellation_param{}.mgh'.format(parcel_param)) parcel = nibabel.freesurfer.io.read_geometry(parc_path) return parcel
python
{ "resource": "" }
q48005
get_features
train
def get_features(subject_id): "Placeholder to insert your own function to read subject-wise features." features_path = os.path.join(my_project,'base_features', subject_id, 'features.txt') feature_vector = np.loadtxt(features_path) return feature_vector
python
{ "resource": "" }
q48006
TypeLookupSession.get_type
train
def get_type(self, namespace=None, identifier=None, authority=None): """Gets a Type by its string representation which is a combination of the authority and identifier. This method only returns the Type if it is known by the given identification components. arg: namespace (s...
python
{ "resource": "" }
q48007
TypeLookupSession.has_type
train
def has_type(self, type_=None): """Tests if the given Type is known. arg: type (osid.type.Type): the Type to look for return: (boolean) - true if the given Type is known, false otherwise raise: NullArgument - type is null raise: OperationFailed - unable to c...
python
{ "resource": "" }
q48008
TypeLookupSession.get_types
train
def get_types(self): """Gets all the known Types. return: (osid.type.TypeList) - the list of all known Types raise: OperationFailed - unable to complete request raise: PermissionDenied - authorization failure compliance: mandatory - This method must be implemented. ""...
python
{ "resource": "" }
q48009
OsidObject.get_display_name
train
def get_display_name(self): """Creates a display name""" return DisplayText(text=self.id_.get_identifier(), language_type=DEFAULT_LANGUAGE_TYPE, script_type=DEFAULT_SCRIPT_TYPE, format_type=DEFAULT_FORMAT_TYPE,)
python
{ "resource": "" }
q48010
OsidObject.get_description
train
def get_description(self): """Creates a description""" return DisplayText(text='Agent representing ' + str(self.id_), language_type=DEFAULT_LANGUAGE_TYPE, script_type=DEFAULT_SCRIPT_TYPE, format_type=DEFAULT_FORMAT_TYPE,)
python
{ "resource": "" }
q48011
empty
train
def empty(val): """ Checks if value is empty. All unknown data types considered as empty values. @return: bool """ if val == None: return True if isinstance(val,str) and len(val) > 0: return False return True
python
{ "resource": "" }
q48012
docs
train
def docs(): """ Create documentation. """ from epydoc import cli path('build').exists() or path('build').makedirs() # get storage path docs_dir = options.docs.get('docs_dir', 'docs/apidocs') # clean up previous docs (path(docs_dir) / "epydoc.css").exists() and path(docs_dir).rmtree() ...
python
{ "resource": "" }
q48013
release
train
def release(): """ Check release before upload to PyPI. """ sh("paver bdist_egg") # Check that source distribution can be built and is complete print print "~" * 78 print "TESTING SOURCE BUILD" sh( "{ cd dist/ && unzip -q %s-%s.zip && cd %s-%s/" " && /usr/bin/python set...
python
{ "resource": "" }
q48014
lint
train
def lint(): """ Report pylint results. """ from pylint import lint as linter # report according to file extension reporters = { ".html": linter.HTMLReporter, ".log": linter.ParseableTextReporter, ".txt": linter.TextReporter, } lint_build_dir = path("build/lint") ...
python
{ "resource": "" }
q48015
Spinner.indicator
train
def indicator(self): """Produce the spinner.""" while self.run: try: size = self.work_q.qsize() except Exception: note = 'Please wait ' else: note = 'Number of Jobs in Queue = %s ' % size if self.msg: ...
python
{ "resource": "" }
q48016
Spinner.start
train
def start(self): """Indicate that we are performing work in a thread. :returns: multiprocessing job object """ if self.run is True: self.job = multiprocessing.Process(target=self.indicator) self.job.start() return self.job
python
{ "resource": "" }
q48017
Spinner.stop
train
def stop(self): """Stop the indicator process.""" if self.run is True and all([self.job, self.job.is_alive()]): print('Done.') self.job.terminate()
python
{ "resource": "" }
q48018
remove_comments
train
def remove_comments(css): """Remove all CSS comment blocks.""" iemac = False preserve = False comment_start = css.find("/*") while comment_start >= 0: # Preserve comments that look like `/*!...*/`. # Slicing is used to make sure we don"t get an IndexError. preserve = css[com...
python
{ "resource": "" }
q48019
remove_unnecessary_whitespace
train
def remove_unnecessary_whitespace(css): """Remove unnecessary whitespace characters.""" def pseudoclasscolon(css): """ Prevents 'p :link' from becoming 'p:link'. Translates 'p :link' into 'p ___PSEUDOCLASSCOLON___link'; this is translated back again later. """ ...
python
{ "resource": "" }
q48020
wrap_css_lines
train
def wrap_css_lines(css, line_length): """Wrap the lines of the given CSS to an approximate length.""" lines = [] line_start = 0 for i, char in enumerate(css): # It's safe to break after `}` characters. if char == '}' and (i - line_start >= line_length): lines.append(css[line...
python
{ "resource": "" }
q48021
get_log_entry_mdata
train
def get_log_entry_mdata(): """Return default mdata map for LogEntry""" return { 'priority': { 'element_label': { 'text': 'priority', 'languageTypeId': str(DEFAULT_LANGUAGE_TYPE), 'scriptTypeId': str(DEFAULT_SCRIPT_TYPE), 'format...
python
{ "resource": "" }
q48022
get_changeset
train
def get_changeset(args): """Dump the changeset objects as JSON, reading the provided bundle YAML. The YAML can be provided either from stdin or by passing a file path as first argument. """ # Parse the arguments. parser = argparse.ArgumentParser(description=get_changeset.__doc__) parser.add...
python
{ "resource": "" }
q48023
ConcreteJob.build_items
train
def build_items(self): """ get the items from STATS QUEUE calculate self.stats make new items from self.stats put the new items for ITEM QUEUE """ while not self.stats_queue.empty(): item = self.stats_queue.get() self.calculate(item) ...
python
{ "resource": "" }
q48024
QueryBuilder.or_filter
train
def or_filter(self, filter_or_string, *args, **kwargs): """ Convenience method to delegate to the root_filter to generate an `or` clause. :return: :class:`~es_fluent.builder.QueryBuilder` """ self.root_filter.or_filter(filter_or_string, *args, **kwargs) return se...
python
{ "resource": "" }
q48025
QueryBuilder.add_filter
train
def add_filter(self, filter_or_string, *args, **kwargs): """ Adds a filter to the query builder's filters. :return: :class:`~es_fluent.builder.QueryBuilder` """ self.root_filter.add_filter(filter_or_string, *args, **kwargs) return self
python
{ "resource": "" }
q48026
QueryBuilder.sort
train
def sort(self, field, direction="asc"): """ Adds sort criteria. """ if not isinstance(field, basestring): raise ValueError("Field should be a string") if direction not in ["asc", "desc"]: raise ValueError("Sort direction should be `asc` or `desc`") ...
python
{ "resource": "" }
q48027
QueryBuilder.remove_sort
train
def remove_sort(self, field_name): """ Clears sorting criteria affecting ``field_name``. """ self.sorts = [dict(field=value) for field, value in self.sorts if field is not field_name]
python
{ "resource": "" }
q48028
HierarchyTraversalSession._get_catalog_hierarchy_id
train
def _get_catalog_hierarchy_id(self, catalog_id, proxy, runtime): """Gets the catalog hierarchy""" seed_str = convert_catalog_id_to_object_id_string(catalog_id) ident = Id(authority=self._authority, namespace='hierarchy.Hierarchy', identifier=seed_str) ...
python
{ "resource": "" }
q48029
HierarchyTraversalSession._create_catalog_hierarchy
train
def _create_catalog_hierarchy(self, catalog_id, proxy, runtime): """Creates a catalog hierarchy""" seed_str = convert_catalog_id_to_object_id_string(catalog_id) has = HierarchyAdminSession(proxy, runtime) hfc = has.get_hierarchy_form_for_create([]) hfc.set_display_name(catalog_id...
python
{ "resource": "" }
q48030
HierarchyTraversalSession._set_relationship_type
train
def _set_relationship_type(self, type_identifier, display_name=None, display_label=None, description=None, domain='Relationship'): """Sets the relationship type""" if display_name is None: display_name = type_identifier if display_label is None: display_label = display_na...
python
{ "resource": "" }
q48031
HierarchyTraversalSession.get_roots
train
def get_roots(self): """Gets the root nodes of this hierarchy. return: (osid.id.IdList) - the root nodes raise: OperationFailed - unable to complete request raise: PermissionDenied - authorization failure *compliance: mandatory -- This method must be implemented.* """...
python
{ "resource": "" }
q48032
HierarchyTraversalSession.is_parent
train
def is_parent(self, id_, parent_id): """Tests if an ``Id`` is a direct parent of another. arg: id (osid.id.Id): the ``Id`` to query arg: parent_id (osid.id.Id): the ``Id`` of a parent return: (boolean) - ``true`` if this ``parent_id`` is a parent of ``id,`` ``fals...
python
{ "resource": "" }
q48033
HierarchyTraversalSession.get_parents
train
def get_parents(self, id_): """Gets the parents of the given ``id``. arg: id (osid.id.Id): the ``Id`` to query return: (osid.id.IdList) - the parents of the ``id`` raise: NotFound - ``id`` is not found raise: NullArgument - ``id`` is ``null`` raise: OperationFailed...
python
{ "resource": "" }
q48034
HierarchyTraversalSession.get_children
train
def get_children(self, id_): """Gets the children of the given ``Id``. arg: id (osid.id.Id): the ``Id`` to query return: (osid.id.IdList) - the children of the ``id`` raise: NotFound - ``id`` is not found raise: NullArgument - ``id`` is ``null`` raise: OperationFai...
python
{ "resource": "" }
q48035
HierarchyTraversalSession.get_nodes
train
def get_nodes(self, id_, ancestor_levels=10, descendant_levels=10, include_siblings=False): """Gets a portion of the hierarchy for the given ``Id``. arg: id (osid.id.Id): the ``Id`` to query arg: ancestor_levels (cardinal): the maximum number of ancestor levels to include....
python
{ "resource": "" }
q48036
HierarchyDesignSession.add_root
train
def add_root(self, id_): """Adds a root node. arg: id (osid.id.Id): the ``Id`` of the node raise: AlreadyExists - ``id`` is already in hierarchy raise: NotFound - ``id`` not found raise: NullArgument - ``id`` is ``null`` raise: OperationFailed - unable to complete...
python
{ "resource": "" }
q48037
HierarchyDesignSession.add_child
train
def add_child(self, id_, child_id): """Adds a child to a ``Id``. arg: id (osid.id.Id): the ``Id`` of the node arg: child_id (osid.id.Id): the ``Id`` of the new child raise: AlreadyExists - ``child_id`` is already a child of ``id`` raise: NotFound - ``id``...
python
{ "resource": "" }
q48038
HierarchyDesignSession.remove_root
train
def remove_root(self, id_): """Removes a root node. arg: id (osid.id.Id): the ``Id`` of the node raise: NotFound - ``id`` was not found or not in hierarchy raise: NullArgument - ``id`` is ``null`` raise: OperationFailed - unable to complete request raise: Permissi...
python
{ "resource": "" }
q48039
HierarchyDesignSession.remove_child
train
def remove_child(self, id_, child_id): """Removes a childfrom an ``Id``. arg: id (osid.id.Id): the ``Id`` of the node arg: child_id (osid.id.Id): the ``Id`` of the child to remove raise: NotFound - ``id`` or ``child_id`` was not found or ``child_id`` is not a chil...
python
{ "resource": "" }
q48040
HierarchyDesignSession.remove_children
train
def remove_children(self, id_): """Removes all childrenfrom an ``Id``. arg: id (osid.id.Id): the ``Id`` of the node raise: NotFound - an node identified by the given ``Id`` was not found raise: NullArgument - ``id`` is ``null`` raise: OperationFailed - unab...
python
{ "resource": "" }
q48041
HierarchyDesignSession._adopt_orphans
train
def _adopt_orphans(self, negligent_parent_id): """Clean up orphaned children""" for child_id in self._hts.get_children(negligent_parent_id): self.remove_child(negligent_parent_id, child_id) if not self._hts.has_parents(child_id): self._assign_as_root(child_id)
python
{ "resource": "" }
q48042
HierarchyDesignSession._assign_as_root
train
def _assign_as_root(self, id_): """Assign an id_ a root object in the hierarchy""" rfc = self._ras.get_relationship_form_for_create(self._phantom_root_id, id_, []) rfc.set_display_name('Implicit Root to ' + str(id_) + ' Parent-Child Relationship') rfc.set_description(self._relationship_t...
python
{ "resource": "" }
q48043
HierarchyAdminSession.can_create_hierarchy_with_record_types
train
def can_create_hierarchy_with_record_types(self, hierarchy_record_types): """Tests if this user can create a single ``Hierarchy`` using the desired record types. While ``HierarchyManager.getHierarchyRecordTypes()`` can be used to examine which records are supported, this method tests which ...
python
{ "resource": "" }
q48044
HierarchyAdminSession.update_hierarchy
train
def update_hierarchy(self, hierarchy_form): """Updates an existing hierarchy. arg: hierarchy_form (osid.hierarchy.HierarchyForm): the form containing the elements to be updated raise: IllegalState - ``hierarchy_form`` already used in an update transaction ...
python
{ "resource": "" }
q48045
HierarchyAdminSession.delete_hierarchy
train
def delete_hierarchy(self, hierarchy_id): """Deletes a ``Hierarchy``. arg: hierarchy_id (osid.id.Id): the ``Id`` of the ``Hierarchy`` to remove raise: NotFound - ``hierarchy_id`` not found raise: NullArgument - ``hierarchy_id`` is ``null`` raise: OperationF...
python
{ "resource": "" }
q48046
HierarchyAdminSession.alias_hierarchy
train
def alias_hierarchy(self, hierarchy_id, alias_id): """Adds an ``Id`` to a ``Hierarchy`` for the purpose of creating compatibility. The primary ``Id`` of the ``Hierarchy`` is determined by the provider. The new ``Id`` performs as an alias to the primary ``Id``. If the alias is a pointer ...
python
{ "resource": "" }
q48047
AssessmentManager.use_plenary_bank_view
train
def use_plenary_bank_view(self): """Pass through to provider ItemBankSession.use_plenary_bank_view""" self._bank_view = PLENARY # self._get_provider_session('item_bank_session') # To make sure the session is tracked for session in self._get_provider_sessions(): try: ...
python
{ "resource": "" }
q48048
AssessmentManager.get_banks_by_item
train
def get_banks_by_item(self, *args, **kwargs): """Pass through to provider ItemBankSession.get_banks_by_item""" # Implemented from kitosid template for - # osid.resource.ResourceBinSession.get_bins_by_resource catalogs = self._get_provider_session('item_bank_session').get_banks_by_item(*a...
python
{ "resource": "" }
q48049
AssessmentManager.get_bank
train
def get_bank(self, *args, **kwargs): """Pass through to provider BankLookupSession.get_bank""" # Implemented from kitosid template for - # osid.resource.BinLookupSession.get_bin return Bank( self._provider_manager, self._get_provider_session('bank_lookup_session')...
python
{ "resource": "" }
q48050
AssessmentManager.get_banks
train
def get_banks(self): """Pass through to provider BankLookupSession.get_banks""" # Implemented from kitosid template for - # osid.resource.BinLookupSession.get_bins_template catalogs = self._get_provider_session('bank_lookup_session').get_banks() cat_list = [] for cat in c...
python
{ "resource": "" }
q48051
AssessmentManager.get_bank_form
train
def get_bank_form(self, *args, **kwargs): """Pass through to provider BankAdminSession.get_bank_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. if i...
python
{ "resource": "" }
q48052
AssessmentManager.save_bank
train
def save_bank(self, bank_form, *args, **kwargs): """Pass through to provider BankAdminSession.update_bank""" # Implemented from kitosid template for - # osid.resource.BinAdminSession.update_bin if bank_form.is_for_update(): return self.update_bank(bank_form, *args, **kwargs) ...
python
{ "resource": "" }
q48053
AssessmentManager.use_comparative_assessment_part_bank_view
train
def use_comparative_assessment_part_bank_view(self): """Pass through to provider AssessmentPartBankSession.use_comparative_assessment_part_bank_view""" self._bank_view = COMPARATIVE # self._get_provider_session('assessment_part_bank_session') # To make sure the session is tracked for ses...
python
{ "resource": "" }
q48054
Bank._get_sub_package_provider_session
train
def _get_sub_package_provider_session(self, sub_package, session_name, proxy=None): """Gets the session from a sub-package""" agent_key = self._get_agent_key() if session_name in self._provider_sessions[agent_key]: return self._provider_sessions[agent_key][session_name] else:...
python
{ "resource": "" }
q48055
Bank.use_comparative_item_view
train
def use_comparative_item_view(self): """Pass through to provider ItemLookupSession.use_comparative_item_view""" self._object_views['item'] = COMPARATIVE # self._get_provider_session('item_lookup_session') # To make sure the session is tracked for session in self._get_provider_sessions():...
python
{ "resource": "" }
q48056
Bank.use_plenary_item_view
train
def use_plenary_item_view(self): """Pass through to provider ItemLookupSession.use_plenary_item_view""" self._object_views['item'] = PLENARY # self._get_provider_session('item_lookup_session') # To make sure the session is tracked for session in self._get_provider_sessions(): ...
python
{ "resource": "" }
q48057
Bank.use_federated_bank_view
train
def use_federated_bank_view(self): """Pass through to provider ItemLookupSession.use_federated_bank_view""" self._bank_view = FEDERATED # self._get_provider_session('item_lookup_session') # To make sure the session is tracked for session in self._get_provider_sessions(): try:...
python
{ "resource": "" }
q48058
Bank.use_isolated_bank_view
train
def use_isolated_bank_view(self): """Pass through to provider ItemLookupSession.use_isolated_bank_view""" self._bank_view = ISOLATED # self._get_provider_session('item_lookup_session') # To make sure the session is tracked for session in self._get_provider_sessions(): try: ...
python
{ "resource": "" }
q48059
Bank.get_item_form
train
def get_item_form(self, *args, **kwargs): """Pass through to provider ItemAdminSession.get_item_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a bit sketchy. Time will tell. if ...
python
{ "resource": "" }
q48060
Bank.save_item
train
def save_item(self, item_form, *args, **kwargs): """Pass through to provider ItemAdminSession.update_item""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if item_form.is_for_update(): return self.update_item(item_form, *args, ...
python
{ "resource": "" }
q48061
Bank.use_comparative_assessment_view
train
def use_comparative_assessment_view(self): """Pass through to provider AssessmentLookupSession.use_comparative_assessment_view""" self._object_views['assessment'] = COMPARATIVE # self._get_provider_session('assessment_lookup_session') # To make sure the session is tracked for session in ...
python
{ "resource": "" }
q48062
Bank.use_plenary_assessment_view
train
def use_plenary_assessment_view(self): """Pass through to provider AssessmentLookupSession.use_plenary_assessment_view""" self._object_views['assessment'] = PLENARY # self._get_provider_session('assessment_lookup_session') # To make sure the session is tracked for session in self._get_pr...
python
{ "resource": "" }
q48063
Bank.get_assessment_form
train
def get_assessment_form(self, *args, **kwargs): """Pass through to provider AssessmentAdminSession.get_assessment_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a bit sketchy. Time will...
python
{ "resource": "" }
q48064
Bank.save_assessment
train
def save_assessment(self, assessment_form, *args, **kwargs): """Pass through to provider AssessmentAdminSession.update_assessment""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if assessment_form.is_for_update(): return self....
python
{ "resource": "" }
q48065
Bank.use_comparative_assessment_offered_view
train
def use_comparative_assessment_offered_view(self): """Pass through to provider AssessmentOfferedLookupSession.use_comparative_assessment_offered_view""" self._object_views['assessment_offered'] = COMPARATIVE # self._get_provider_session('assessment_offered_lookup_session') # To make sure the ses...
python
{ "resource": "" }
q48066
Bank.use_plenary_assessment_offered_view
train
def use_plenary_assessment_offered_view(self): """Pass through to provider AssessmentOfferedLookupSession.use_plenary_assessment_offered_view""" self._object_views['assessment_offered'] = PLENARY # self._get_provider_session('assessment_offered_lookup_session') # To make sure the session is trac...
python
{ "resource": "" }
q48067
Bank.get_assessment_offered_form
train
def get_assessment_offered_form(self, *args, **kwargs): """Pass through to provider AssessmentOfferedAdminSession.get_assessment_offered_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a...
python
{ "resource": "" }
q48068
Bank.save_assessment_offered
train
def save_assessment_offered(self, assessment_offered_form, *args, **kwargs): """Pass through to provider AssessmentOfferedAdminSession.update_assessment_offered""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if assessment_offered_form.is...
python
{ "resource": "" }
q48069
Bank.use_comparative_assessment_taken_view
train
def use_comparative_assessment_taken_view(self): """Pass through to provider AssessmentTakenLookupSession.use_comparative_assessment_taken_view""" self._object_views['assessment_taken'] = COMPARATIVE # self._get_provider_session('assessment_taken_lookup_session') # To make sure the session is tr...
python
{ "resource": "" }
q48070
Bank.use_plenary_assessment_taken_view
train
def use_plenary_assessment_taken_view(self): """Pass through to provider AssessmentTakenLookupSession.use_plenary_assessment_taken_view""" self._object_views['assessment_taken'] = PLENARY # self._get_provider_session('assessment_taken_lookup_session') # To make sure the session is tracked ...
python
{ "resource": "" }
q48071
Bank.get_assessment_taken_form
train
def get_assessment_taken_form(self, *args, **kwargs): """Pass through to provider AssessmentTakenAdminSession.get_assessment_taken_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a bit s...
python
{ "resource": "" }
q48072
Bank.save_assessment_taken
train
def save_assessment_taken(self, assessment_taken_form, *args, **kwargs): """Pass through to provider AssessmentTakenAdminSession.update_assessment_taken""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if assessment_taken_form.is_for_updat...
python
{ "resource": "" }
q48073
Bank.use_comparative_assessment_part_view
train
def use_comparative_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_comparative_assessment_part_view""" self._object_views['assessment_part'] = COMPARATIVE # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked...
python
{ "resource": "" }
q48074
Bank.use_plenary_assessment_part_view
train
def use_plenary_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_plenary_assessment_part_view""" self._object_views['assessment_part'] = PLENARY # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked for...
python
{ "resource": "" }
q48075
Bank.use_active_assessment_part_view
train
def use_active_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_active_assessment_part_view""" self._operable_views['assessment_part'] = ACTIVE # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked for...
python
{ "resource": "" }
q48076
Bank.use_any_status_assessment_part_view
train
def use_any_status_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_any_status_assessment_part_view""" self._operable_views['assessment_part'] = ANY_STATUS # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked...
python
{ "resource": "" }
q48077
Bank.use_sequestered_assessment_part_view
train
def use_sequestered_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_sequestered_assessment_part_view""" # Does this need to be re-implemented to match the other non-sub-package view setters? self._containable_views['assessment_part'] = SEQUESTERED ...
python
{ "resource": "" }
q48078
Bank.use_unsequestered_assessment_part_view
train
def use_unsequestered_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_unsequestered_assessment_part_view""" # Does this need to be re-implemented to match the other non-sub-package view setters? self._containable_views['assessment_part'] = UNSEQUESTERED ...
python
{ "resource": "" }
q48079
Bank.get_assessment_part_form
train
def get_assessment_part_form(self, *args, **kwargs): """Pass through to provider AssessmentPartAdminSession.get_assessment_part_form_for_update""" # This method might be a bit sketchy. Time will tell. if isinstance(args[-1], list) or 'assessment_part_record_types' in kwargs: return s...
python
{ "resource": "" }
q48080
Bank.save_assessment_part
train
def save_assessment_part(self, assessment_part_form, *args, **kwargs): """Pass through to provider AssessmentPartAdminSession.update_assessment_part""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if assessment_part_form.is_for_update(): ...
python
{ "resource": "" }
q48081
Bank.use_comparative_asseessment_part_item_view
train
def use_comparative_asseessment_part_item_view(self): """Pass through to provider AssessmentPartItemSession.use_comparative_asseessment_part_item_view""" self._object_views['asseessment_part_item'] = COMPARATIVE # self._get_provider_session('assessment_part_item_session') # To make sure the sess...
python
{ "resource": "" }
q48082
Bank.use_plenary_assessment_part_item_view
train
def use_plenary_assessment_part_item_view(self): """Pass through to provider AssessmentPartItemSession.use_plenary_assessment_part_item_view""" self._object_views['assessment_part_item'] = PLENARY # self._get_provider_session('assessment_part_item_session') # To make sure the session is tracked ...
python
{ "resource": "" }
q48083
Bank.use_comparative_sequence_rule_view
train
def use_comparative_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_comparative_sequence_rule_view""" self._object_views['sequence_rule'] = COMPARATIVE # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked f...
python
{ "resource": "" }
q48084
Bank.use_plenary_sequence_rule_view
train
def use_plenary_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_plenary_sequence_rule_view""" self._object_views['sequence_rule'] = PLENARY # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked for session i...
python
{ "resource": "" }
q48085
Bank.use_active_sequence_rule_view
train
def use_active_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_active_sequence_rule_view""" self._operable_views['sequence_rule'] = ACTIVE # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked for session i...
python
{ "resource": "" }
q48086
Bank.use_any_status_sequence_rule_view
train
def use_any_status_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_any_status_sequence_rule_view""" self._operable_views['sequence_rule'] = ANY_STATUS # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked f...
python
{ "resource": "" }
q48087
Bank.save_sequence_rule
train
def save_sequence_rule(self, sequence_rule_form, *args, **kwargs): """Pass through to provider SequenceRuleAdminSession.update_sequence_rule""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if sequence_rule_form.is_for_update(): ...
python
{ "resource": "" }
q48088
Bank.use_comparative_sequence_rule_enabler_view
train
def use_comparative_sequence_rule_enabler_view(self): """Pass through to provider SequenceRuleEnablerLookupSession.use_comparative_sequence_rule_enabler_view""" self._object_views['sequence_rule_enabler'] = COMPARATIVE # self._get_provider_session('sequence_rule_enabler_lookup_session') # To mak...
python
{ "resource": "" }
q48089
Bank.use_plenary_sequence_rule_enabler_view
train
def use_plenary_sequence_rule_enabler_view(self): """Pass through to provider SequenceRuleEnablerLookupSession.use_plenary_sequence_rule_enabler_view""" self._object_views['sequence_rule_enabler'] = PLENARY # self._get_provider_session('sequence_rule_enabler_lookup_session') # To make sure the s...
python
{ "resource": "" }
q48090
Bank.use_active_sequence_rule_enabler_view
train
def use_active_sequence_rule_enabler_view(self): """Pass through to provider SequenceRuleEnablerLookupSession.use_active_sequence_rule_enabler_view""" self._operable_views['sequence_rule_enabler'] = ACTIVE # self._get_provider_session('sequence_rule_enabler_lookup_session') # To make sure the s...
python
{ "resource": "" }
q48091
Bank.use_any_status_sequence_rule_enabler_view
train
def use_any_status_sequence_rule_enabler_view(self): """Pass through to provider SequenceRuleEnablerLookupSession.use_any_status_sequence_rule_enabler_view""" self._operable_views['sequence_rule_enabler'] = ANY_STATUS # self._get_provider_session('sequence_rule_enabler_lookup_session') # To mak...
python
{ "resource": "" }
q48092
Bank.get_sequence_rule_enabler_form
train
def get_sequence_rule_enabler_form(self, *args, **kwargs): """Pass through to provider SequenceRuleEnablerAdminSession.get_sequence_rule_enabler_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method mi...
python
{ "resource": "" }
q48093
Bank.save_sequence_rule_enabler
train
def save_sequence_rule_enabler(self, sequence_rule_enabler_form, *args, **kwargs): """Pass through to provider SequenceRuleEnablerAdminSession.update_sequence_rule_enabler""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if sequence_rule_e...
python
{ "resource": "" }
q48094
Bank.use_comparative_sequence_rule_enabler_rule_view
train
def use_comparative_sequence_rule_enabler_rule_view(self): """Pass through to provider SequenceRuleEnablerRuleLookupSession.use_comparative_sequence_rule_enabler_rule_view""" self._object_views['sequence_rule_enabler_rule'] = COMPARATIVE # self._get_provider_session('sequence_rule_enabler_rule_l...
python
{ "resource": "" }
q48095
Bank.use_plenary_sequence_rule_enabler_rule_view
train
def use_plenary_sequence_rule_enabler_rule_view(self): """Pass through to provider SequenceRuleEnablerRuleLookupSession.use_plenary_sequence_rule_enabler_rule_view""" self._object_views['sequence_rule_enabler_rule'] = PLENARY # self._get_provider_session('sequence_rule_enabler_rule_lookup_sessio...
python
{ "resource": "" }
q48096
Inference._generate_values_with_variability_and_constraints
train
def _generate_values_with_variability_and_constraints(self, symbols, starting_values, variable_parameters): """ Generates the `values_with_variability` formatted list from the provided symbols, starting values and variable parameters :param symbols: The symbols defining each of the valu...
python
{ "resource": "" }
q48097
tmybasename
train
def tmybasename(usaf): """Basename for USAF base. Args: usaf (str): USAF code Returns: (str) """ url_file = open(env.SRC_PATH + '/tmy3.csv') for line in url_file.readlines(): if line.find(usaf) is not -1: return line.rstrip().partition(',')[0]
python
{ "resource": "" }
q48098
normalize_date
train
def normalize_date(tmy_date, year): """change TMY3 date to an arbitrary year. Args: tmy_date (datetime): date to mangle. year (int): desired year. Returns: (None) """ month = tmy_date.month day = tmy_date.day - 1 hour = tmy_date.hour # hack to get around 24:00 n...
python
{ "resource": "" }
q48099
total
train
def total(usaf, field='GHI (W/m^2)'): """total annual insolation, defaults to GHI.""" running_total = 0 usafdata = data(usaf) for record in usafdata: running_total += float(record[field]) return running_total/1000.
python
{ "resource": "" }