_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 75 19.8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q47400 | SequenceRuleEnablerSearchSession.get_sequence_rule_enablers_by_search | train | def get_sequence_rule_enablers_by_search(self, sequence_rule_enabler_query, sequence_rule_enabler_search):
"""Pass through to provider SequenceRuleEnablerSearchSession.get_sequence_rule_enablers_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resou... | python | {
"resource": ""
} |
q47401 | Image.image_name | train | def image_name(self):
"""
The image_name of a container is the concatenation of the ``image_index``,
``image_name_prefix``, and ``name`` of the image.
Also, if $EXTRA_IMAGE_NAME is defined, that is appended
"""
if getattr(self, "_image_name", NotSpecified) is NotSpecifie... | python | {
"resource": ""
} |
q47402 | Image.container_name | train | def container_name(self):
"""
The container_name is the concatenation of ``image_name`` and a uuid1 string
We also remove the url portion of the ``image_name`` before using it.
"""
if getattr(self, "_container_name", NotSpecified) is NotSpecified:
self.container_name... | python | {
"resource": ""
} |
q47403 | Image.container_id | train | def container_id(self):
"""
Find a container id
If one isn't already set, we ask docker for the container whose name is
the same as the recorded container_name
"""
if getattr(self, "_container_id", None):
return self._container_id
try:
co... | python | {
"resource": ""
} |
q47404 | Image.dependencies | train | def dependencies(self, images):
"""Yield just the dependency images"""
for dep in self.commands.dependent_images:
if not isinstance(dep, six.string_types):
yield dep.name
for image, _ in self.dependency_images():
yield image | python | {
"resource": ""
} |
q47405 | Image.dependency_images | train | def dependency_images(self, for_running=False):
"""
What images does this one require
Taking into account parent image, and those in link and volumes.share_with options
"""
candidates = []
detach = dict((candidate, not options.attached) for candidate, options in self.dep... | python | {
"resource": ""
} |
q47406 | Image.shared_volume_containers | train | def shared_volume_containers(self):
"""All the harpoon containers in volumes.share_with for this container"""
for container in self.volumes.share_with:
if not isinstance(container, six.string_types):
yield container.name | python | {
"resource": ""
} |
q47407 | Image.find_missing_env | train | def find_missing_env(self):
"""Find any missing environment variables"""
missing = []
for e in self.env:
if e.default_val is None and e.set_val is None:
if e.env_name not in os.environ:
missing.append(e.env_name)
if missing:
ra... | python | {
"resource": ""
} |
q47408 | Image.display_line | train | def display_line(self):
"""A single line describing this image"""
msg = ["Image {0}".format(self.name)]
if self.image_index:
msg.append("Pushes to {0}".format(self.image_name))
return ' : '.join(msg) | python | {
"resource": ""
} |
q47409 | Image.build_and_run | train | def build_and_run(self, images):
"""Make this image and run it"""
from harpoon.ship.builder import Builder
Builder().make_image(self, images)
try:
Runner().run_container(self, images)
except DockerAPIError as error:
raise BadImage("Failed to start the con... | python | {
"resource": ""
} |
q47410 | Image.add_docker_file_to_tarfile | train | def add_docker_file_to_tarfile(self, docker_file, tar):
"""Add a Dockerfile to a tarfile"""
with hp.a_temp_file() as dockerfile:
log.debug("Context: ./Dockerfile")
dockerfile.write("\n".join(docker_file.docker_lines).encode('utf-8'))
dockerfile.seek(0)
tar... | python | {
"resource": ""
} |
q47411 | Image.make_context | train | def make_context(self, docker_file=None):
"""Determine the docker lines for this image"""
kwargs = {"silent_build": self.harpoon.silent_build, "extra_context": self.commands.extra_context}
if docker_file is None:
docker_file = self.docker_file
with ContextBuilder().make_conte... | python | {
"resource": ""
} |
q47412 | WaitCondition.conditions | train | def conditions(self, start, last_attempt):
"""
Yield lines to execute in a docker context
All conditions must evaluate for the container to be considered ready
"""
if time.time() - start > self.timeout:
yield WaitCondition.Timedout
return
if last... | python | {
"resource": ""
} |
q47413 | Context.git_root | train | def git_root(self):
"""
Find the root git folder
"""
if not getattr(self, "_git_folder", None):
root_folder = os.path.abspath(self.parent_dir)
while not os.path.exists(os.path.join(root_folder, '.git')):
if root_folder == '/':
r... | python | {
"resource": ""
} |
q47414 | Volumes.share_with_names | train | def share_with_names(self):
"""The names of the containers that we share with the running container"""
for container in self.share_with:
if isinstance(container, six.string_types):
yield container
else:
yield container.container_name | python | {
"resource": ""
} |
q47415 | Environment.pair | train | def pair(self):
"""Get the name and value for this environment variable"""
if self.set_val is not None:
return self.env_name, self.set_val
elif self.default_val is not None:
return self.env_name, os.environ.get(self.env_name, self.default_val)
else:
re... | python | {
"resource": ""
} |
q47416 | ContainerPort.port_pair | train | def port_pair(self):
"""The port and it's transport as a pair"""
if self.transport is NotSpecified:
return (self.port, "tcp")
else:
return (self.port, self.transport) | python | {
"resource": ""
} |
q47417 | ContainerPort.port_str | train | def port_str(self):
"""The port and it's transport as a single string"""
if self.transport is NotSpecified:
return str(self.port)
else:
return "{0}/{1}".format(self.port, self.transport) | python | {
"resource": ""
} |
q47418 | get_distance_function | train | def get_distance_function(distance):
"""
Returns the distance function from the string name provided
:param distance: The string name of the distributions
:return:
"""
# If we provided distance function ourselves, use it
if callable(distance):
return distance
try:
return... | python | {
"resource": ""
} |
q47419 | sum_of_squares | train | def sum_of_squares(simulated_trajectories, observed_trajectories_lookup):
"""
Returns the sum-of-squares distance between the simulated_trajectories and observed_trajectories
:param simulated_trajectories: Simulated trajectories
:type simulated_trajectories: list[:class:`means.simulation.Trajectory`]
... | python | {
"resource": ""
} |
q47420 | _distribution_distance | train | def _distribution_distance(simulated_trajectories, observed_trajectories_lookup, distribution):
"""
Returns the distance between the simulated and observed trajectory, w.r.t. the assumed distribution
:param simulated_trajectories: Simulated trajectories
:type simulated_trajectories: list[:class:`means.... | python | {
"resource": ""
} |
q47421 | DB._escape_identifiers | train | def _escape_identifiers(self, item):
"""
This function escapes column and table names
@param item:
"""
if self._escape_char == '':
return item
for field in self._reserved_identifiers:
if item.find('.%s' % field) != -1:
_str = "%s%s... | python | {
"resource": ""
} |
q47422 | CacheBackend.set | train | def set(self, uri, content):
"""
Cache node content for uri.
No return.
"""
key, value = self._prepare_node(uri, content)
self._set(key, value) | python | {
"resource": ""
} |
q47423 | CacheBackend.delete | train | def delete(self, uri):
"""
Remove node uri from cache.
No return.
"""
cache_key = self._build_cache_key(uri)
self._delete(cache_key) | python | {
"resource": ""
} |
q47424 | CacheBackend.delete_many | train | def delete_many(self, uris):
"""
Remove many nodes from cache.
No return.
"""
cache_keys = (self._build_cache_key(uri) for uri in uris)
self._delete_many(cache_keys) | python | {
"resource": ""
} |
q47425 | CacheBackend._build_cache_key | train | def _build_cache_key(self, uri):
"""
Build sha1 hex cache key to handle key length and whitespace to be compatible with Memcached
"""
key = uri.clone(ext=None, version=None)
if six.PY3:
key = key.encode('utf-8')
return sha1(key).hexdigest() | python | {
"resource": ""
} |
q47426 | DatabaseBackend._serialize | train | def _serialize(self, uri, node):
"""
Serialize node result as dict
"""
meta = self._decode_meta(node['meta'], is_published=bool(node['is_published']))
return {
'uri': uri.clone(ext=node['plugin'], version=node['version']),
'content': node['content'],
... | python | {
"resource": ""
} |
q47427 | DatabaseBackend._decode_meta | train | def _decode_meta(self, meta, **extra):
"""
Decode and load underlying meta structure to dict and apply optional extra values.
"""
_meta = json.loads(meta) if meta else {}
_meta.update(extra)
return _meta | python | {
"resource": ""
} |
q47428 | DatabaseBackend._merge_meta | train | def _merge_meta(self, encoded_meta, meta):
"""
Merge new meta dict into encoded meta. Returns new encoded meta.
"""
new_meta = None
if meta:
_meta = self._decode_meta(encoded_meta)
for key, value in six.iteritems(meta):
if value is None:
... | python | {
"resource": ""
} |
q47429 | DatabaseBackend._get_next_version | train | def _get_next_version(self, revisions):
"""
Calculates new version number based on existing numeric ones.
"""
versions = [0]
for v in revisions:
if v.isdigit():
versions.append(int(v))
return six.text_type(sorted(versions)[-1] + 1) | python | {
"resource": ""
} |
q47430 | TranscriptLoci.remove_transcript | train | def remove_transcript(self,tx_id):
"""Remove a transcript from the locus by its id
:param tx_id:
:type tx_id: string
"""
txs = self.get_transcripts()
if tx_id not in [x.id for x in txs]:
return
tx = [x for x in txs if x.id==tx_id][0]
for n in [x for x in self.g.get_nodes()]:
... | python | {
"resource": ""
} |
q47431 | TranscriptLoci.get_depth_per_transcript | train | def get_depth_per_transcript(self,mindepth=1):
""" using all the transcripts find the depth """
bedarray = []
for tx in self.get_transcripts():
for ex in [x.range for x in tx.exons]: bedarray.append(ex)
cov = ranges_to_coverage(bedarray)
results = {}
for tx in self.get_transcripts():
... | python | {
"resource": ""
} |
q47432 | TranscriptLoci.range | train | def range(self):
"""Return the range the transcript loci covers
:return: range
:rtype: GenomicRange
"""
chrs = set([x.range.chr for x in self.get_transcripts()])
if len(chrs) != 1: return None
start = min([x.range.start for x in self.get_transcripts()])
end = max([x.range.end for x in s... | python | {
"resource": ""
} |
q47433 | TranscriptLoci.get_transcripts | train | def get_transcripts(self):
""" a list of the transcripts in the locus"""
txs = []
for pays in [x.payload for x in self.g.get_nodes()]:
for pay in pays:
txs.append(pay)
return txs | python | {
"resource": ""
} |
q47434 | TranscriptLoci.partition_loci | train | def partition_loci(self,verbose=False):
""" break the locus up into unconnected loci
:return: list of loci
:rtype: TranscriptLoci[]
"""
self.g.merge_cycles()
#sys.stderr.write(self.g.get_report()+"\n")
gs = self.g.partition_graph(verbose=verbose)
tls = [] # makea list of transcript loci... | python | {
"resource": ""
} |
q47435 | TranscriptGroup.get_transcript | train | def get_transcript(self,exon_bounds='max'):
"""Return a representative transcript object"""
out = Transcript()
out.junctions = [x.get_junction() for x in self.junction_groups]
# check for single exon transcript
if len(out.junctions) == 0:
leftcoord = min([x.exons[0].range.start for x in self.t... | python | {
"resource": ""
} |
q47436 | parse_noaa_line | train | def parse_noaa_line(line):
"""Parse NOAA stations.
This is an old list, the format is:
NUMBER NAME & STATE/COUNTRY LAT LON ELEV (meters)
010250 TROMSO NO 6941N 01855E 10
"""
station = {}
station['station_name'] = line[7:51].strip()... | python | {
"resource": ""
} |
q47437 | closest_noaa | train | def closest_noaa(latitude, longitude):
"""Find closest station from the old list."""
with open(env.SRC_PATH + '/inswo-stns.txt') as index:
index.readline() # header
index.readline() # whitespace
min_dist = 9999
station_name = ''
station_name = ''
for line in ind... | python | {
"resource": ""
} |
q47438 | eere_station | train | def eere_station(station_code):
"""Station information.
Args:
station_code (str): station code.
Returns (dict): station information
"""
with open(env.SRC_PATH + '/eere_meta.csv') as eere_meta:
stations = csv.DictReader(eere_meta)
for station in stations:
if stat... | python | {
"resource": ""
} |
q47439 | LogEntrySearchResults.get_log_entries | train | def get_log_entries(self):
"""Gets the log entry list resulting from a search.
return: (osid.logging.LogEntryList) - the log entry list
raise: IllegalState - list already retrieved
*compliance: mandatory -- This method must be implemented.*
"""
if self.retrieved:
... | python | {
"resource": ""
} |
q47440 | LogSearchResults.get_logs | train | def get_logs(self):
"""Gets the log list resulting from a search.
return: (osid.logging.LogList) - the log list
raise: IllegalState - list already retrieved
*compliance: mandatory -- This method must be implemented.*
"""
if self.retrieved:
raise errors.Ille... | python | {
"resource": ""
} |
q47441 | show | train | def show():
"""
Shows the URL of the current cloud server or throws an error if no cloud
server is selected
"""
utils.check_for_cloud_server()
click.echo("Using cloud server at \"{}\"".format(
config["cloud_server"]["url"]
))
if config["cloud_server"]["username"]:
click.e... | python | {
"resource": ""
} |
q47442 | deinit | train | def deinit(ctx):
"""
Detach from the current cloud server
"""
utils.check_for_cloud_server()
if config["local_server"]["url"]:
utils.cancel_global_db_replication()
if config["cloud_server"]["username"]:
ctx.invoke(logout_user)
config["cloud_server"]["url"] = None | python | {
"resource": ""
} |
q47443 | ZimbraSoapClient.invoke | train | def invoke(self, ns, request_name, params={}, simplify=False):
"""
Invokes zimbra method using established authentication session.
@param req: zimbra request
@parm params: request params
@param simplify: True to return python object, False to return xml struct
@return: zi... | python | {
"resource": ""
} |
q47444 | Generic.add_filter | train | def add_filter(self, filter_or_string, *args, **kwargs):
"""
Appends a filter.
"""
self.filters.append(build_filter(filter_or_string, *args, **kwargs))
return self | python | {
"resource": ""
} |
q47445 | Dict.to_query | train | def to_query(self):
"""
Iterates over all filters and converts them to an Elastic HTTP API
suitable query.
Note: each :class:`~es_fluent.filters.Filter` is free to set it's own
filter dictionary. ESFluent does not attempt to guard against filters
that may clobber one ano... | python | {
"resource": ""
} |
q47446 | determinize | train | def determinize(m):
"""Determinizes a finite automaton."""
if not m.is_finite():
raise TypeError("machine must be a finite automaton")
transitions = collections.defaultdict(lambda: collections.defaultdict(set))
alphabet = set()
for transition in m.get_transitions():
[[lstate], read]... | python | {
"resource": ""
} |
q47447 | equivalent | train | def equivalent(m1, m2):
"""Hopcroft-Karp algorithm."""
if not m1.is_finite() and m1.is_deterministic():
raise TypeError("machine must be a deterministic finite automaton")
if not m2.is_finite() and m2.is_deterministic():
raise TypeError("machine must be a deterministic finite automaton")
... | python | {
"resource": ""
} |
q47448 | Machine.has_cell | train | def has_cell(self, s):
"""Tests whether store `s` is a cell, that is, it uses exactly one
cell, and there can take on only a finite number of states)."""
for t in self.transitions:
if len(t.lhs[s]) != 1:
return False
if len(t.rhs[s]) != 1:
... | python | {
"resource": ""
} |
q47449 | Machine.has_stack | train | def has_stack(self, s):
"""Tests whether store `s` is a stack, that is, it never moves from
position 0."""
for t in self.transitions:
if t.lhs[s].position != 0:
return False
if t.rhs[s].position != 0:
return False
return True | python | {
"resource": ""
} |
q47450 | Machine.has_readonly | train | def has_readonly(self, s):
"""Tests whether store `s` is read-only."""
for t in self.transitions:
if list(t.lhs[s]) != list(t.rhs[s]):
return False
return True | python | {
"resource": ""
} |
q47451 | Machine.is_finite | train | def is_finite(self):
"""Tests whether machine is a finite automaton."""
return (self.num_stores == 2 and
self.state == 0 and self.has_cell(0) and
self.input == 1 and self.has_input(1)) | python | {
"resource": ""
} |
q47452 | Machine.is_pushdown | train | def is_pushdown(self):
"""Tests whether machine is a pushdown automaton."""
return (self.num_stores == 3 and
self.state == 0 and self.has_cell(0) and
self.input == 1 and self.has_input(1) and
self.has_stack(2)) | python | {
"resource": ""
} |
q47453 | Machine.is_deterministic | train | def is_deterministic(self):
"""Tests whether machine is deterministic."""
# naive quadratic algorithm
patterns = [t.lhs for t in self.transitions] + list(self.accept_configs)
for i, t1 in enumerate(patterns):
for t2 in patterns[:i]:
match = True
... | python | {
"resource": ""
} |
q47454 | RelationshipLookupSession.get_relationships_on_date | train | def get_relationships_on_date(self, from_, to):
"""Gets a ``RelationshipList`` effective during the entire given date range inclusive but not confined to the date range.
arg: from (osid.calendaring.DateTime): starting date
arg: to (osid.calendaring.DateTime): ending date
return: (... | python | {
"resource": ""
} |
q47455 | RelationshipLookupSession.get_relationships_for_source_on_date | train | def get_relationships_for_source_on_date(self, source_id, from_, to):
"""Gets a ``RelationshipList`` corresponding to the given peer ``Id`` and effective during the entire given date range inclusive but not confined to the date range.
arg: source_id (osid.id.Id): a peer ``Id``
arg: from (... | python | {
"resource": ""
} |
q47456 | RelationshipLookupSession.get_relationships_by_genus_type_for_source_on_date | train | def get_relationships_by_genus_type_for_source_on_date(self, source_id, relationship_genus_type, from_, to):
"""Gets a ``RelationshipList`` corresponding to the given peer ``Id`` and relationship genus ``Type`` and effective during the entire given date range inclusive but not confined to the date range.
... | python | {
"resource": ""
} |
q47457 | RelationshipLookupSession.get_relationships_for_destination_on_date | train | def get_relationships_for_destination_on_date(self, destination_id, from_, to):
"""Gets a ``RelationshipList`` corresponding to the given peer ``Id`` with a starting effective date in the given range inclusive.
arg: destination_id (osid.id.Id): a peer ``Id``
arg: from (osid.calendaring.Da... | python | {
"resource": ""
} |
q47458 | RelationshipQuerySession.get_relationships_by_query | train | def get_relationships_by_query(self, relationship_query):
"""Gets a list of ``Relationships`` matching the given relationship query.
arg: relationship_query
(osid.relationship.RelationshipQuery): the relationship
query
return: (osid.relationship.RelationshipLi... | python | {
"resource": ""
} |
q47459 | RelationshipAdminSession.alias_relationship | train | def alias_relationship(self, relationship_id, alias_id):
"""Adds an ``Id`` to a ``Relationship`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Relationship`` is determined by the
provider. The new ``Id`` performs as an alias to the primary
``Id``. If the alias i... | python | {
"resource": ""
} |
q47460 | FamilyAdminSession.can_create_family_with_record_types | train | def can_create_family_with_record_types(self, family_record_types):
"""Tests if this user can create a single ``Family`` using the desired record types.
While ``RelationshipManager.getFamilyRecordTypes()`` can be used
to examine which records are supported, this method tests which
recor... | python | {
"resource": ""
} |
q47461 | FamilyAdminSession.update_family | train | def update_family(self, family_form):
"""Updates an existing family.
arg: family_form (osid.relationship.FamilyForm): the form
containing the elements to be updated
raise: IllegalState - ``family_form`` already used in an update
transaction
raise: In... | python | {
"resource": ""
} |
q47462 | FamilyAdminSession.alias_family | train | def alias_family(self, family_id, alias_id):
"""Adds an ``Id`` to a ``Family`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Family`` is determined by the
provider. The new ``Id`` performs as an alias to the primary
``Id``. If the alias is a pointer to another f... | python | {
"resource": ""
} |
q47463 | FamilyHierarchySession.get_root_families | train | def get_root_families(self):
"""Gets the root families in the family hierarchy.
A node with no parents is an orphan. While all family ``Ids``
are known to the hierarchy, an orphan does not appear in the
hierarchy unless explicitly added as a root node or child of
another node.
... | python | {
"resource": ""
} |
q47464 | FamilyHierarchySession.has_parent_families | train | def has_parent_families(self, family_id):
"""Tests if the ``Family`` has any parents.
arg: family_id (osid.id.Id): the ``Id`` of a family
return: (boolean) - ``true`` if the family has parents,
``false`` otherwise
raise: NotFound - ``family_id`` is not found
... | python | {
"resource": ""
} |
q47465 | FamilyHierarchySession.is_parent_of_family | train | def is_parent_of_family(self, id_, family_id):
"""Tests if an ``Id`` is a direct parent of a family.
arg: id (osid.id.Id): an ``Id``
arg: family_id (osid.id.Id): the ``Id`` of a family
return: (boolean) - ``true`` if this ``id`` is a parent of
``family_id,`` ``fal... | python | {
"resource": ""
} |
q47466 | FamilyHierarchySession.get_parent_family_ids | train | def get_parent_family_ids(self, family_id):
"""Gets the parent ``Ids`` of the given family.
arg: family_id (osid.id.Id): the ``Id`` of a family
return: (osid.id.IdList) - the parent ``Ids`` of the family
raise: NotFound - ``family_id`` is not found
raise: NullArgument - ``f... | python | {
"resource": ""
} |
q47467 | FamilyHierarchySession.get_parent_families | train | def get_parent_families(self, family_id):
"""Gets the parent families of the given ``id``.
arg: family_id (osid.id.Id): the ``Id`` of the ``Family`` to
query
return: (osid.relationship.FamilyList) - the parent families of
the ``id``
raise: NotFound - ... | python | {
"resource": ""
} |
q47468 | FamilyHierarchySession.is_ancestor_of_family | train | def is_ancestor_of_family(self, id_, family_id):
"""Tests if an ``Id`` is an ancestor of a family.
arg: id (osid.id.Id): an ``Id``
arg: family_id (osid.id.Id): the ``Id`` of a family
return: (boolean) - ``true`` if this ``id`` is an ancestor of
``family_id,`` ``fa... | python | {
"resource": ""
} |
q47469 | FamilyHierarchySession.has_child_families | train | def has_child_families(self, family_id):
"""Tests if a family has any children.
arg: family_id (osid.id.Id): the ``Id`` of a family
return: (boolean) - ``true`` if the ``family_id`` has children,
``false`` otherwise
raise: NotFound - ``family_id`` is not found
... | python | {
"resource": ""
} |
q47470 | FamilyHierarchySession.is_child_of_family | train | def is_child_of_family(self, id_, family_id):
"""Tests if a family is a direct child of another.
arg: id (osid.id.Id): an ``Id``
arg: family_id (osid.id.Id): the ``Id`` of a family
return: (boolean) - ``true`` if the ``id`` is a child of
``family_id,`` ``false`` o... | python | {
"resource": ""
} |
q47471 | FamilyHierarchySession.get_child_family_ids | train | def get_child_family_ids(self, family_id):
"""Gets the child ``Ids`` of the given family.
arg: family_id (osid.id.Id): the ``Id`` to query
return: (osid.id.IdList) - the children of the family
raise: NotFound - ``family_id`` is not found
raise: NullArgument - ``family_id`` ... | python | {
"resource": ""
} |
q47472 | FamilyHierarchySession.get_child_families | train | def get_child_families(self, family_id):
"""Gets the child families of the given ``id``.
arg: family_id (osid.id.Id): the ``Id`` of the ``Family`` to
query
return: (osid.relationship.FamilyList) - the child families of
the ``id``
raise: NotFound - a `... | python | {
"resource": ""
} |
q47473 | FamilyHierarchySession.is_descendant_of_family | train | def is_descendant_of_family(self, id_, family_id):
"""Tests if an ``Id`` is a descendant of a family.
arg: id (osid.id.Id): an ``Id``
arg: family_id (osid.id.Id): the ``Id`` of a family
return: (boolean) - ``true`` if the ``id`` is a descendant of
the ``family_id,`... | python | {
"resource": ""
} |
q47474 | FamilyHierarchySession.get_family_nodes | train | def get_family_nodes(self, family_id, ancestor_levels, descendant_levels, include_siblings):
"""Gets a portion of the hierarchy for the given family.
arg: family_id (osid.id.Id): the ``Id`` to query
arg: ancestor_levels (cardinal): the maximum number of
ancestor levels to ... | python | {
"resource": ""
} |
q47475 | FamilyHierarchyDesignSession.add_root_family | train | def add_root_family(self, family_id):
"""Adds a root family.
arg: family_id (osid.id.Id): the ``Id`` of a family
raise: AlreadyExists - ``family_id`` is already in hierarchy
raise: NotFound - ``family_id`` not found
raise: NullArgument - ``family_id`` is ``null``
r... | python | {
"resource": ""
} |
q47476 | FamilyHierarchyDesignSession.remove_root_family | train | def remove_root_family(self, family_id):
"""Removes a root family.
arg: family_id (osid.id.Id): the ``Id`` of a family
raise: NotFound - ``family_id`` not a root
raise: NullArgument - ``family_id`` is ``null``
raise: OperationFailed - unable to complete request
rai... | python | {
"resource": ""
} |
q47477 | FamilyHierarchyDesignSession.add_child_family | train | def add_child_family(self, family_id, child_id):
"""Adds a child to a family.
arg: family_id (osid.id.Id): the ``Id`` of a family
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: AlreadyExists - ``family_id`` is already a parent of
``child_id``
... | python | {
"resource": ""
} |
q47478 | FamilyHierarchyDesignSession.remove_child_family | train | def remove_child_family(self, family_id, child_id):
"""Removes a child from a family.
arg: family_id (osid.id.Id): the ``Id`` of a family
arg: child_id (osid.id.Id): the ``Id`` of the new child
raise: NotFound - ``family_id`` not a parent of ``child_id``
raise: NullArgum... | python | {
"resource": ""
} |
q47479 | FamilyHierarchyDesignSession.remove_child_families | train | def remove_child_families(self, family_id):
"""Removes all children from a family.
arg: family_id (osid.id.Id): the ``Id`` of a family
raise: NotFound - ``family_id`` not in hierarchy
raise: NullArgument - ``family_id`` is ``null``
raise: OperationFailed - unable to comple... | python | {
"resource": ""
} |
q47480 | CatalogNode.get_catalog | train | def get_catalog(self):
"""Gets the ``Catalog`` at this node.
return: (osid.cataloging.Catalog) - the catalog represented by
this node
*compliance: mandatory -- This method must be implemented.*
"""
if self._lookup_session is None:
mgr = get_provider_... | python | {
"resource": ""
} |
q47481 | CatalogNode.get_parent_catalog_nodes | train | def get_parent_catalog_nodes(self):
"""Gets the parents of this catalog.
return: (osid.cataloging.CatalogNodeList) - the parents of the
``id``
*compliance: mandatory -- This method must be implemented.*
"""
parent_catalog_nodes = []
for node in self._my_... | python | {
"resource": ""
} |
q47482 | data_attrs | train | def data_attrs(mapitem):
"""
Generate the data-... attributes for a mapitem.
"""
data_attrs = {}
try:
data_attrs['marker-detail-api-url'] = reverse('fluentcms-googlemaps-marker-detail')
except NoReverseMatch:
pass
data_attrs.update(mapitem.get_map_options())
return mark... | python | {
"resource": ""
} |
q47483 | GradingManager.get_grade_system_query_session | train | def get_grade_system_query_session(self):
"""Gets the ``OsidSession`` associated with the grade system query service.
return: (osid.grading.GradeSystemQuerySession) - a
``GradeSystemQuerySession``
raise: OperationFailed - unable to complete request
raise: Unimplemented... | python | {
"resource": ""
} |
q47484 | GradingManager.get_grade_system_query_session_for_gradebook | train | def get_grade_system_query_session_for_gradebook(self, gradebook_id):
"""Gets the ``OsidSession`` associated with the grade system query service for the given gradebook.
arg: gradebook_id (osid.id.Id): the ``Id`` of the gradebook
return: (osid.grading.GradeSystemQuerySession) - ``a
... | python | {
"resource": ""
} |
q47485 | GradingManager.get_grade_system_admin_session | train | def get_grade_system_admin_session(self):
"""Gets the ``OsidSession`` associated with the grade system administration service.
return: (osid.grading.GradeSystemAdminSession) - a
``GradeSystemAdminSession``
raise: OperationFailed - unable to complete request
raise: Unim... | python | {
"resource": ""
} |
q47486 | GradingManager.get_grade_entry_query_session | train | def get_grade_entry_query_session(self):
"""Gets the ``OsidSession`` associated with the grade entry query service.
return: (osid.grading.GradeEntryQuerySession) - a
``GradeEntryQuerySession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - `... | python | {
"resource": ""
} |
q47487 | GradingManager.get_grade_entry_query_session_for_gradebook | train | def get_grade_entry_query_session_for_gradebook(self, gradebook_id):
"""Gets the ``OsidSession`` associated with the grade entry query service for the given gradebook.
arg: gradebook_id (osid.id.Id): the ``Id`` of the gradebook
return: (osid.grading.GradeEntryQuerySession) - ``a
... | python | {
"resource": ""
} |
q47488 | GradingManager.get_grade_entry_admin_session | train | def get_grade_entry_admin_session(self):
"""Gets the ``OsidSession`` associated with the grade entry administration service.
return: (osid.grading.GradeEntryAdminSession) - a
``GradeEntryAdminSession``
raise: OperationFailed - unable to complete request
raise: Unimplem... | python | {
"resource": ""
} |
q47489 | GradingManager.get_gradebook_column_admin_session | train | def get_gradebook_column_admin_session(self):
"""Gets the ``OsidSession`` associated with the gradebook column administration service.
return: (osid.grading.GradebookColumnAdminSession) - a
``GradebookColumnAdminSession``
raise: OperationFailed - unable to complete request
... | python | {
"resource": ""
} |
q47490 | GradingManager.get_gradebook_column_admin_session_for_gradebook | train | def get_gradebook_column_admin_session_for_gradebook(self, gradebook_id):
"""Gets the ``OsidSession`` associated with the gradebook column admin service for the given gradebook.
arg: gradebook_id (osid.id.Id): the ``Id`` of the gradebook
return: (osid.grading.GradebookColumnAdminSession) - `... | python | {
"resource": ""
} |
q47491 | GradingManager.get_gradebook_column_gradebook_session | train | def get_gradebook_column_gradebook_session(self):
"""Gets the session for retrieving gradebook column to gradebook mappings.
return: (osid.grading.GradebookColumnGradebookSession) - a
``GradebookColumnGradebookSession``
raise: OperationFailed - unable to complete request
... | python | {
"resource": ""
} |
q47492 | GradingProxyManager.get_grade_system_lookup_session | train | def get_grade_system_lookup_session(self, proxy):
"""Gets the ``OsidSession`` associated with the grade system lookup service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.grading.GradeSystemLookupSession) - a
``GradeSystemLookupSession``
raise: NullArgument ... | python | {
"resource": ""
} |
q47493 | GradingProxyManager.get_grade_system_lookup_session_for_gradebook | train | def get_grade_system_lookup_session_for_gradebook(self, gradebook_id, proxy):
"""Gets the ``OsidSession`` associated with the grade system lookup service for the given gradebook.
arg: gradebook_id (osid.id.Id): the ``Id`` of the gradebook
arg: proxy (osid.proxy.Proxy): a proxy
ret... | python | {
"resource": ""
} |
q47494 | GradingProxyManager.get_grade_system_admin_session_for_gradebook | train | def get_grade_system_admin_session_for_gradebook(self, gradebook_id, proxy):
"""Gets the ``OsidSession`` associated with the grade system admin service for the given gradebook.
arg: gradebook_id (osid.id.Id): the ``Id`` of the gradebook
arg: proxy (osid.proxy.Proxy): a proxy
retur... | python | {
"resource": ""
} |
q47495 | GradingProxyManager.get_grade_system_gradebook_session | train | def get_grade_system_gradebook_session(self, proxy):
"""Gets the session for retrieving grade system to gradebook mappings.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.grading.GradeSystemGradebookSession) - a
``GradeSystemGradebookSession``
raise: NullArgume... | python | {
"resource": ""
} |
q47496 | GradingProxyManager.get_grade_system_gradebook_assignment_session | train | def get_grade_system_gradebook_assignment_session(self, proxy):
"""Gets the session for assigning grade system to gradebook mappings.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.grading.GradeSystemGradebookSession) - a
``GradeSystemGradebookAssignmentSession``
... | python | {
"resource": ""
} |
q47497 | GradingProxyManager.get_grade_entry_lookup_session | train | def get_grade_entry_lookup_session(self, proxy):
"""Gets the ``OsidSession`` associated with the grade entry lookup service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.grading.GradeEntryLookupSession) - a
``GradeEntryLookupSession``
raise: NullArgument - ``... | python | {
"resource": ""
} |
q47498 | GradingProxyManager.get_grade_entry_lookup_session_for_gradebook | train | def get_grade_entry_lookup_session_for_gradebook(self, gradebook_id, proxy):
"""Gets the ``OsidSession`` associated with the grade entry lookup service for the given gradebook.
arg: gradebook_id (osid.id.Id): the ``Id`` of the gradebook
arg: proxy (osid.proxy.Proxy): a proxy
retur... | python | {
"resource": ""
} |
q47499 | GradingProxyManager.get_grade_entry_admin_session_for_gradebook | train | def get_grade_entry_admin_session_for_gradebook(self, gradebook_id, proxy):
"""Gets the ``OsidSession`` associated with the grade entry admin service for the given gradebook.
arg: gradebook_id (osid.id.Id): the ``Id`` of the gradebook
arg: proxy (osid.proxy.Proxy): a proxy
return:... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.