repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
mitsei/dlkit | dlkit/json_/assessment/default_mdata.py | get_question_mdata | def get_question_mdata():
"""Return default mdata map for Question"""
return {
'item': {
'element_label': {
'text': 'item',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
'formatTypeId': ... | python | def get_question_mdata():
"""Return default mdata map for Question"""
return {
'item': {
'element_label': {
'text': 'item',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
'formatTypeId': ... | [
"def",
"get_question_mdata",
"(",
")",
":",
"return",
"{",
"'item'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'item'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
":",
"str",
"(",
"DEFAULT_SCRIPT... | Return default mdata map for Question | [
"Return",
"default",
"mdata",
"map",
"for",
"Question"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/default_mdata.py#L11-L35 |
mitsei/dlkit | dlkit/json_/assessment/default_mdata.py | get_answer_mdata | def get_answer_mdata():
"""Return default mdata map for Answer"""
return {
'item': {
'element_label': {
'text': 'item',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
'formatTypeId': str(... | python | def get_answer_mdata():
"""Return default mdata map for Answer"""
return {
'item': {
'element_label': {
'text': 'item',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
'formatTypeId': str(... | [
"def",
"get_answer_mdata",
"(",
")",
":",
"return",
"{",
"'item'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'item'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
":",
"str",
"(",
"DEFAULT_SCRIPT_T... | Return default mdata map for Answer | [
"Return",
"default",
"mdata",
"map",
"for",
"Answer"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/default_mdata.py#L38-L62 |
mitsei/dlkit | dlkit/json_/assessment/default_mdata.py | get_item_mdata | def get_item_mdata():
"""Return default mdata map for Item"""
return {
'learning_objectives': {
'element_label': {
'text': 'learning objectives',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
... | python | def get_item_mdata():
"""Return default mdata map for Item"""
return {
'learning_objectives': {
'element_label': {
'text': 'learning objectives',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
... | [
"def",
"get_item_mdata",
"(",
")",
":",
"return",
"{",
"'learning_objectives'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'learning objectives'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
":",
"str"... | Return default mdata map for Item | [
"Return",
"default",
"mdata",
"map",
"for",
"Item"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/default_mdata.py#L65-L89 |
mitsei/dlkit | dlkit/json_/assessment/default_mdata.py | get_assessment_mdata | def get_assessment_mdata():
"""Return default mdata map for Assessment"""
return {
'rubric': {
'element_label': {
'text': 'rubric',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
'formatT... | python | def get_assessment_mdata():
"""Return default mdata map for Assessment"""
return {
'rubric': {
'element_label': {
'text': 'rubric',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
'formatT... | [
"def",
"get_assessment_mdata",
"(",
")",
":",
"return",
"{",
"'rubric'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'rubric'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
":",
"str",
"(",
"DEFAULT_... | Return default mdata map for Assessment | [
"Return",
"default",
"mdata",
"map",
"for",
"Assessment"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/default_mdata.py#L92-L137 |
mitsei/dlkit | dlkit/json_/assessment/default_mdata.py | get_assessment_offered_mdata | def get_assessment_offered_mdata():
"""Return default mdata map for AssessmentOffered"""
return {
'level': {
'element_label': {
'text': 'level',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
... | python | def get_assessment_offered_mdata():
"""Return default mdata map for AssessmentOffered"""
return {
'level': {
'element_label': {
'text': 'level',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
... | [
"def",
"get_assessment_offered_mdata",
"(",
")",
":",
"return",
"{",
"'level'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'level'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
":",
"str",
"(",
"DE... | Return default mdata map for AssessmentOffered | [
"Return",
"default",
"mdata",
"map",
"for",
"AssessmentOffered"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/default_mdata.py#L140-L330 |
mitsei/dlkit | dlkit/json_/assessment/default_mdata.py | get_assessment_taken_mdata | def get_assessment_taken_mdata():
"""Return default mdata map for AssessmentTaken"""
return {
'assessment_offered': {
'element_label': {
'text': 'assessment offered',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCR... | python | def get_assessment_taken_mdata():
"""Return default mdata map for AssessmentTaken"""
return {
'assessment_offered': {
'element_label': {
'text': 'assessment offered',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCR... | [
"def",
"get_assessment_taken_mdata",
"(",
")",
":",
"return",
"{",
"'assessment_offered'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'assessment offered'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
":... | Return default mdata map for AssessmentTaken | [
"Return",
"default",
"mdata",
"map",
"for",
"AssessmentTaken"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/default_mdata.py#L333-L378 |
mitsei/dlkit | dlkit/json_/assessment/default_mdata.py | get_assessment_section_mdata | def get_assessment_section_mdata():
"""Return default mdata map for AssessmentSection"""
return {
'assessment_taken': {
'element_label': {
'text': 'assessment taken',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCR... | python | def get_assessment_section_mdata():
"""Return default mdata map for AssessmentSection"""
return {
'assessment_taken': {
'element_label': {
'text': 'assessment taken',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCR... | [
"def",
"get_assessment_section_mdata",
"(",
")",
":",
"return",
"{",
"'assessment_taken'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'assessment taken'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
":",... | Return default mdata map for AssessmentSection | [
"Return",
"default",
"mdata",
"map",
"for",
"AssessmentSection"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/default_mdata.py#L381-L405 |
mitsei/dlkit | dlkit/json_/authorization/queries.py | AuthorizationQuery.match_agent_id | def match_agent_id(self, agent_id, match):
"""Matches the agent identified by the given ``Id``.
arg: agent_id (osid.id.Id): the Id of the ``Agent``
arg: match (boolean): ``true`` if a positive match, ``false``
for a negative match
raise: NullArgument - ``agent_id`... | python | def match_agent_id(self, agent_id, match):
"""Matches the agent identified by the given ``Id``.
arg: agent_id (osid.id.Id): the Id of the ``Agent``
arg: match (boolean): ``true`` if a positive match, ``false``
for a negative match
raise: NullArgument - ``agent_id`... | [
"def",
"match_agent_id",
"(",
"self",
",",
"agent_id",
",",
"match",
")",
":",
"self",
".",
"_add_match",
"(",
"'agentId'",
",",
"str",
"(",
"agent_id",
")",
",",
"bool",
"(",
"match",
")",
")"
] | Matches the agent identified by the given ``Id``.
arg: agent_id (osid.id.Id): the Id of the ``Agent``
arg: match (boolean): ``true`` if a positive match, ``false``
for a negative match
raise: NullArgument - ``agent_id`` is ``null``
*compliance: mandatory -- This m... | [
"Matches",
"the",
"agent",
"identified",
"by",
"the",
"given",
"Id",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/authorization/queries.py#L230-L240 |
mitsei/dlkit | dlkit/json_/authorization/queries.py | AuthorizationQuery.match_function_id | def match_function_id(self, function_id, match):
"""Matches the function identified by the given ``Id``.
arg: function_id (osid.id.Id): the Id of the ``Function``
arg: match (boolean): ``true`` if a positive match, ``false``
for a negative match
raise: NullArgumen... | python | def match_function_id(self, function_id, match):
"""Matches the function identified by the given ``Id``.
arg: function_id (osid.id.Id): the Id of the ``Function``
arg: match (boolean): ``true`` if a positive match, ``false``
for a negative match
raise: NullArgumen... | [
"def",
"match_function_id",
"(",
"self",
",",
"function_id",
",",
"match",
")",
":",
"self",
".",
"_add_match",
"(",
"'functionId'",
",",
"str",
"(",
"function_id",
")",
",",
"bool",
"(",
"match",
")",
")"
] | Matches the function identified by the given ``Id``.
arg: function_id (osid.id.Id): the Id of the ``Function``
arg: match (boolean): ``true`` if a positive match, ``false``
for a negative match
raise: NullArgument - ``function_id`` is ``null``
*compliance: mandato... | [
"Matches",
"the",
"function",
"identified",
"by",
"the",
"given",
"Id",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/authorization/queries.py#L300-L310 |
mitsei/dlkit | dlkit/json_/authorization/queries.py | AuthorizationQuery.match_qualifier_id | def match_qualifier_id(self, qualifier_id, match):
"""Matches the qualifier identified by the given ``Id``.
arg: qualifier_id (osid.id.Id): the Id of the ``Qualifier``
arg: match (boolean): ``true`` if a positive match, ``false``
for a negative match
raise: NullAr... | python | def match_qualifier_id(self, qualifier_id, match):
"""Matches the qualifier identified by the given ``Id``.
arg: qualifier_id (osid.id.Id): the Id of the ``Qualifier``
arg: match (boolean): ``true`` if a positive match, ``false``
for a negative match
raise: NullAr... | [
"def",
"match_qualifier_id",
"(",
"self",
",",
"qualifier_id",
",",
"match",
")",
":",
"self",
".",
"_add_match",
"(",
"'qualifierId'",
",",
"str",
"(",
"qualifier_id",
")",
",",
"bool",
"(",
"match",
")",
")"
] | Matches the qualifier identified by the given ``Id``.
arg: qualifier_id (osid.id.Id): the Id of the ``Qualifier``
arg: match (boolean): ``true`` if a positive match, ``false``
for a negative match
raise: NullArgument - ``qualifier_id`` is ``null``
*compliance: man... | [
"Matches",
"the",
"qualifier",
"identified",
"by",
"the",
"given",
"Id",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/authorization/queries.py#L361-L371 |
mitsei/dlkit | dlkit/primordium/locale/types/heading.py | get_type_data | def get_type_data(name):
"""Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type
"""
name = name.upper()
try:
return {
'authority': 'okapia.net',
'namespace': 'heading',
'identifier': name,
'doma... | python | def get_type_data(name):
"""Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type
"""
name = name.upper()
try:
return {
'authority': 'okapia.net',
'namespace': 'heading',
'identifier': name,
'doma... | [
"def",
"get_type_data",
"(",
"name",
")",
":",
"name",
"=",
"name",
".",
"upper",
"(",
")",
"try",
":",
"return",
"{",
"'authority'",
":",
"'okapia.net'",
",",
"'namespace'",
":",
"'heading'",
",",
"'identifier'",
":",
"name",
",",
"'domain'",
":",
"'Hea... | Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type | [
"Return",
"dictionary",
"representation",
"of",
"type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/primordium/locale/types/heading.py#L15-L34 |
AbdealiJK/pycolorname | pycolorname/utilities.py | make_temp | def make_temp(suffix="", prefix="tmp", dir=None):
"""
Creates a temporary file with a closed stream and deletes it when done.
:return: A contextmanager retrieving the file path.
"""
temporary = tempfile.mkstemp(suffix=suffix, prefix=prefix, dir=dir)
os.close(temporary[0])
try:
yield... | python | def make_temp(suffix="", prefix="tmp", dir=None):
"""
Creates a temporary file with a closed stream and deletes it when done.
:return: A contextmanager retrieving the file path.
"""
temporary = tempfile.mkstemp(suffix=suffix, prefix=prefix, dir=dir)
os.close(temporary[0])
try:
yield... | [
"def",
"make_temp",
"(",
"suffix",
"=",
"\"\"",
",",
"prefix",
"=",
"\"tmp\"",
",",
"dir",
"=",
"None",
")",
":",
"temporary",
"=",
"tempfile",
".",
"mkstemp",
"(",
"suffix",
"=",
"suffix",
",",
"prefix",
"=",
"prefix",
",",
"dir",
"=",
"dir",
")",
... | Creates a temporary file with a closed stream and deletes it when done.
:return: A contextmanager retrieving the file path. | [
"Creates",
"a",
"temporary",
"file",
"with",
"a",
"closed",
"stream",
"and",
"deletes",
"it",
"when",
"done",
"."
] | train | https://github.com/AbdealiJK/pycolorname/blob/d535de3d340a1673906cb484cc4c49c87d296ec0/pycolorname/utilities.py#L24-L35 |
andreagrandi/toshl-python | toshl/client.py | ToshlClient._make_request | def _make_request(
self, api_resource, method='GET', params=None, **kwargs):
"""
Shortcut for a generic request to the Toshl API
:param url: The URL resource part
:param method: REST method
:param parameters: Querystring parameters
:return: requests.Response
... | python | def _make_request(
self, api_resource, method='GET', params=None, **kwargs):
"""
Shortcut for a generic request to the Toshl API
:param url: The URL resource part
:param method: REST method
:param parameters: Querystring parameters
:return: requests.Response
... | [
"def",
"_make_request",
"(",
"self",
",",
"api_resource",
",",
"method",
"=",
"'GET'",
",",
"params",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"kwargs",
".",
"get",
"(",
"'json'",
")",
":",
"headers",
"=",
"{",
"'Authorization'",
":",
"'... | Shortcut for a generic request to the Toshl API
:param url: The URL resource part
:param method: REST method
:param parameters: Querystring parameters
:return: requests.Response | [
"Shortcut",
"for",
"a",
"generic",
"request",
"to",
"the",
"Toshl",
"API",
":",
"param",
"url",
":",
"The",
"URL",
"resource",
"part",
":",
"param",
"method",
":",
"REST",
"method",
":",
"param",
"parameters",
":",
"Querystring",
"parameters",
":",
"return... | train | https://github.com/andreagrandi/toshl-python/blob/16a2aef8a0d389db73db3253b0bea3fcc33cc2bf/toshl/client.py#L11-L47 |
andreagrandi/toshl-python | toshl/client.py | ToshlClient._list_response | def _list_response(self, response):
"""
This method check if the response is a dict and wrap it into a list.
If the response is already a list, it returns the response directly.
This workaround is necessary because the API doesn't return a list
if only one item is found.
... | python | def _list_response(self, response):
"""
This method check if the response is a dict and wrap it into a list.
If the response is already a list, it returns the response directly.
This workaround is necessary because the API doesn't return a list
if only one item is found.
... | [
"def",
"_list_response",
"(",
"self",
",",
"response",
")",
":",
"if",
"type",
"(",
"response",
")",
"is",
"list",
":",
"return",
"response",
"if",
"type",
"(",
"response",
")",
"is",
"dict",
":",
"return",
"[",
"response",
"]"
] | This method check if the response is a dict and wrap it into a list.
If the response is already a list, it returns the response directly.
This workaround is necessary because the API doesn't return a list
if only one item is found. | [
"This",
"method",
"check",
"if",
"the",
"response",
"is",
"a",
"dict",
"and",
"wrap",
"it",
"into",
"a",
"list",
".",
"If",
"the",
"response",
"is",
"already",
"a",
"list",
"it",
"returns",
"the",
"response",
"directly",
".",
"This",
"workaround",
"is",
... | train | https://github.com/andreagrandi/toshl-python/blob/16a2aef8a0d389db73db3253b0bea3fcc33cc2bf/toshl/client.py#L49-L59 |
vimalkvn/riboplot | riboplot/ribocount.py | main | def main(args):
"""Main program"""
(ribo_file, transcriptome_fasta, read_lengths, read_offsets, count_five, count_three,
output_path, html_file) = \
(args.ribo_file, args.transcriptome_fasta, args.read_lengths, args.read_offsets,
args.count_five, args.count_three, args.output_path, args.ht... | python | def main(args):
"""Main program"""
(ribo_file, transcriptome_fasta, read_lengths, read_offsets, count_five, count_three,
output_path, html_file) = \
(args.ribo_file, args.transcriptome_fasta, args.read_lengths, args.read_offsets,
args.count_five, args.count_three, args.output_path, args.ht... | [
"def",
"main",
"(",
"args",
")",
":",
"(",
"ribo_file",
",",
"transcriptome_fasta",
",",
"read_lengths",
",",
"read_offsets",
",",
"count_five",
",",
"count_three",
",",
"output_path",
",",
"html_file",
")",
"=",
"(",
"args",
".",
"ribo_file",
",",
"args",
... | Main program | [
"Main",
"program"
] | train | https://github.com/vimalkvn/riboplot/blob/914515df54eccc2e726ba71e751c3260f2066d97/riboplot/ribocount.py#L55-L213 |
mitsei/dlkit | dlkit/handcar/learning/queries.py | ObjectiveQuery.match_ancestor_objective_id | def match_ancestor_objective_id(self, objective_id=None, match=None):
"""Sets the objective ``Id`` for this query to match objectives that have the specified objective as an ancestor.
arg: objective_id (osid.id.Id): an objective ``Id``
arg: match (boolean): ``true`` for a positive match,
... | python | def match_ancestor_objective_id(self, objective_id=None, match=None):
"""Sets the objective ``Id`` for this query to match objectives that have the specified objective as an ancestor.
arg: objective_id (osid.id.Id): an objective ``Id``
arg: match (boolean): ``true`` for a positive match,
... | [
"def",
"match_ancestor_objective_id",
"(",
"self",
",",
"objective_id",
"=",
"None",
",",
"match",
"=",
"None",
")",
":",
"if",
"match",
":",
"self",
".",
"_add_match",
"(",
"'ancestorObjectiveId'",
",",
"objective_id",
")",
"else",
":",
"raise",
"errors",
"... | Sets the objective ``Id`` for this query to match objectives that have the specified objective as an ancestor.
arg: objective_id (osid.id.Id): an objective ``Id``
arg: match (boolean): ``true`` for a positive match,
``false`` for a negative match
raise: NullArgument - ``o... | [
"Sets",
"the",
"objective",
"Id",
"for",
"this",
"query",
"to",
"match",
"objectives",
"that",
"have",
"the",
"specified",
"objective",
"as",
"an",
"ancestor",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/queries.py#L519-L532 |
mitsei/dlkit | dlkit/handcar/learning/queries.py | ObjectiveQuery.match_descendant_objective_id | def match_descendant_objective_id(self, objective_id=None, match=None):
"""Sets the objective ``Id`` for this query to match objectives that have the specified objective as a descendant.
arg: objective_id (osid.id.Id): an objective ``Id``
arg: match (boolean): ``true`` for a positive matc... | python | def match_descendant_objective_id(self, objective_id=None, match=None):
"""Sets the objective ``Id`` for this query to match objectives that have the specified objective as a descendant.
arg: objective_id (osid.id.Id): an objective ``Id``
arg: match (boolean): ``true`` for a positive matc... | [
"def",
"match_descendant_objective_id",
"(",
"self",
",",
"objective_id",
"=",
"None",
",",
"match",
"=",
"None",
")",
":",
"if",
"match",
":",
"self",
".",
"_add_match",
"(",
"'descendantObjectiveId'",
",",
"objective_id",
")",
"else",
":",
"raise",
"errors",... | Sets the objective ``Id`` for this query to match objectives that have the specified objective as a descendant.
arg: objective_id (osid.id.Id): an objective ``Id``
arg: match (boolean): ``true`` for a positive match,
``false`` for a negative match
raise: NullArgument - ``... | [
"Sets",
"the",
"objective",
"Id",
"for",
"this",
"query",
"to",
"match",
"objectives",
"that",
"have",
"the",
"specified",
"objective",
"as",
"a",
"descendant",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/queries.py#L590-L603 |
mitsei/dlkit | dlkit/primordium/transport/objects.py | DataInputStream.skip | def skip(self, n):
"""Skips a specified number of ``bytes`` in the stream.
arg: n (cardinal): the number of ``bytes`` to skip
return: (cardinal) - the actual number of ``bytes`` skipped
raise: IllegalState - this stream has been closed or
``at_end_of_stream()`` is ``... | python | def skip(self, n):
"""Skips a specified number of ``bytes`` in the stream.
arg: n (cardinal): the number of ``bytes`` to skip
return: (cardinal) - the actual number of ``bytes`` skipped
raise: IllegalState - this stream has been closed or
``at_end_of_stream()`` is ``... | [
"def",
"skip",
"(",
"self",
",",
"n",
")",
":",
"if",
"self",
".",
"_my_data",
".",
"closed",
"or",
"self",
".",
"at_end_of_stream",
"(",
")",
":",
"raise",
"IllegalState",
"(",
")",
"if",
"n",
"is",
"not",
"None",
":",
"self",
".",
"_my_data",
"."... | Skips a specified number of ``bytes`` in the stream.
arg: n (cardinal): the number of ``bytes`` to skip
return: (cardinal) - the actual number of ``bytes`` skipped
raise: IllegalState - this stream has been closed or
``at_end_of_stream()`` is ``true``
*compliance: ma... | [
"Skips",
"a",
"specified",
"number",
"of",
"bytes",
"in",
"the",
"stream",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/primordium/transport/objects.py#L63-L76 |
mitsei/dlkit | dlkit/primordium/transport/objects.py | DataInputStream.read_to_buffer | def read_to_buffer(self, buf, n):
"""Reads a specified number of ``bytes`` from this stream.
arg: buf (byte[]): the buffer in which the data is read
arg: n (cardinal): the number of ``bytes`` to read
return: (integer) - the actual number of ``bytes`` read
raise: IllegalSt... | python | def read_to_buffer(self, buf, n):
"""Reads a specified number of ``bytes`` from this stream.
arg: buf (byte[]): the buffer in which the data is read
arg: n (cardinal): the number of ``bytes`` to read
return: (integer) - the actual number of ``bytes`` read
raise: IllegalSt... | [
"def",
"read_to_buffer",
"(",
"self",
",",
"buf",
",",
"n",
")",
":",
"if",
"buf",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"if",
"self",
".",
"_my_data",
".",
"closed",
"or",
"self",
".",
"at_end_of_stream",
"(",
")",
":",
"raise",
"Ill... | Reads a specified number of ``bytes`` from this stream.
arg: buf (byte[]): the buffer in which the data is read
arg: n (cardinal): the number of ``bytes`` to read
return: (integer) - the actual number of ``bytes`` read
raise: IllegalState - this stream has been closed or
... | [
"Reads",
"a",
"specified",
"number",
"of",
"bytes",
"from",
"this",
"stream",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/primordium/transport/objects.py#L81-L101 |
mitsei/dlkit | dlkit/primordium/transport/objects.py | DataInputStream.read | def read(self, buf=None, n=None):
"""Reads a specified number of ``bytes`` from this stream.
arg: n (cardinal): the number of ``bytes`` to read
return: (integer) - the ``bytes`` read
raise: IllegalState - this stream has been closed or
``at_end_of_stream()`` is ``tru... | python | def read(self, buf=None, n=None):
"""Reads a specified number of ``bytes`` from this stream.
arg: n (cardinal): the number of ``bytes`` to read
return: (integer) - the ``bytes`` read
raise: IllegalState - this stream has been closed or
``at_end_of_stream()`` is ``tru... | [
"def",
"read",
"(",
"self",
",",
"buf",
"=",
"None",
",",
"n",
"=",
"None",
")",
":",
"if",
"n",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_my_data",
".",
"read",
"(",
"n",
")",
"else",
":",
"return",
"self",
".",
"_my_data",
".",
"read... | Reads a specified number of ``bytes`` from this stream.
arg: n (cardinal): the number of ``bytes`` to read
return: (integer) - the ``bytes`` read
raise: IllegalState - this stream has been closed or
``at_end_of_stream()`` is ``true``
raise: InvalidArgument - the siz... | [
"Reads",
"a",
"specified",
"number",
"of",
"bytes",
"from",
"this",
"stream",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/primordium/transport/objects.py#L103-L118 |
rembish/cfb | cfb/__init__.py | CfbIO.root | def root(self):
""" Property provides access to root object in CFB. """
sector = self.header.directory_sector_start
position = (sector + 1) << self.header.sector_shift
return RootEntry(self, position) | python | def root(self):
""" Property provides access to root object in CFB. """
sector = self.header.directory_sector_start
position = (sector + 1) << self.header.sector_shift
return RootEntry(self, position) | [
"def",
"root",
"(",
"self",
")",
":",
"sector",
"=",
"self",
".",
"header",
".",
"directory_sector_start",
"position",
"=",
"(",
"sector",
"+",
"1",
")",
"<<",
"self",
".",
"header",
".",
"sector_shift",
"return",
"RootEntry",
"(",
"self",
",",
"position... | Property provides access to root object in CFB. | [
"Property",
"provides",
"access",
"to",
"root",
"object",
"in",
"CFB",
"."
] | train | https://github.com/rembish/cfb/blob/9bcd75caad4353b186ce518d2da78aeeb52d3131/cfb/__init__.py#L37-L41 |
rembish/cfb | cfb/__init__.py | CfbIO.next_fat | def next_fat(self, current):
"""
Helper gives you seekable position of next FAT sector. Should not be
called from external code.
"""
sector_size = self.header.sector_size // 4
block = current // sector_size
difat_position = 76
if block >= 109:
... | python | def next_fat(self, current):
"""
Helper gives you seekable position of next FAT sector. Should not be
called from external code.
"""
sector_size = self.header.sector_size // 4
block = current // sector_size
difat_position = 76
if block >= 109:
... | [
"def",
"next_fat",
"(",
"self",
",",
"current",
")",
":",
"sector_size",
"=",
"self",
".",
"header",
".",
"sector_size",
"//",
"4",
"block",
"=",
"current",
"//",
"sector_size",
"difat_position",
"=",
"76",
"if",
"block",
">=",
"109",
":",
"block",
"-=",... | Helper gives you seekable position of next FAT sector. Should not be
called from external code. | [
"Helper",
"gives",
"you",
"seekable",
"position",
"of",
"next",
"FAT",
"sector",
".",
"Should",
"not",
"be",
"called",
"from",
"external",
"code",
"."
] | train | https://github.com/rembish/cfb/blob/9bcd75caad4353b186ce518d2da78aeeb52d3131/cfb/__init__.py#L43-L68 |
rembish/cfb | cfb/__init__.py | CfbIO.next_minifat | def next_minifat(self, current):
"""
Helpers provides access to next mini-FAT sector and returns it's
seekable position. Should not be called from external code.
"""
position = 0
sector_size = self.header.sector_size // 4
sector = self.header.minifat_sector_start
... | python | def next_minifat(self, current):
"""
Helpers provides access to next mini-FAT sector and returns it's
seekable position. Should not be called from external code.
"""
position = 0
sector_size = self.header.sector_size // 4
sector = self.header.minifat_sector_start
... | [
"def",
"next_minifat",
"(",
"self",
",",
"current",
")",
":",
"position",
"=",
"0",
"sector_size",
"=",
"self",
".",
"header",
".",
"sector_size",
"//",
"4",
"sector",
"=",
"self",
".",
"header",
".",
"minifat_sector_start",
"while",
"sector",
"!=",
"ENDOF... | Helpers provides access to next mini-FAT sector and returns it's
seekable position. Should not be called from external code. | [
"Helpers",
"provides",
"access",
"to",
"next",
"mini",
"-",
"FAT",
"sector",
"and",
"returns",
"it",
"s",
"seekable",
"position",
".",
"Should",
"not",
"be",
"called",
"from",
"external",
"code",
"."
] | train | https://github.com/rembish/cfb/blob/9bcd75caad4353b186ce518d2da78aeeb52d3131/cfb/__init__.py#L70-L89 |
mitsei/dlkit | dlkit/authz_adapter/assessment/sessions.py | ItemSearchSession.get_items_by_search | def get_items_by_search(self, item_query, item_search):
"""Pass through to provider ItemSearchSession.get_items_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
if not self._can('search'):
raise Permi... | python | def get_items_by_search(self, item_query, item_search):
"""Pass through to provider ItemSearchSession.get_items_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
if not self._can('search'):
raise Permi... | [
"def",
"get_items_by_search",
"(",
"self",
",",
"item_query",
",",
"item_search",
")",
":",
"# Implemented from azosid template for -",
"# osid.resource.ResourceSearchSession.get_resources_by_search_template",
"if",
"not",
"self",
".",
"_can",
"(",
"'search'",
")",
":",
"ra... | Pass through to provider ItemSearchSession.get_items_by_search | [
"Pass",
"through",
"to",
"provider",
"ItemSearchSession",
".",
"get_items_by_search"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/assessment/sessions.py#L725-L731 |
mitsei/dlkit | dlkit/authz_adapter/assessment/sessions.py | AssessmentSearchSession.get_assessments_by_search | def get_assessments_by_search(self, assessment_query, assessment_search):
"""Pass through to provider AssessmentSearchSession.get_assessments_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
if not self._can('sea... | python | def get_assessments_by_search(self, assessment_query, assessment_search):
"""Pass through to provider AssessmentSearchSession.get_assessments_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
if not self._can('sea... | [
"def",
"get_assessments_by_search",
"(",
"self",
",",
"assessment_query",
",",
"assessment_search",
")",
":",
"# Implemented from azosid template for -",
"# osid.resource.ResourceSearchSession.get_resources_by_search_template",
"if",
"not",
"self",
".",
"_can",
"(",
"'search'",
... | Pass through to provider AssessmentSearchSession.get_assessments_by_search | [
"Pass",
"through",
"to",
"provider",
"AssessmentSearchSession",
".",
"get_assessments_by_search"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/assessment/sessions.py#L1594-L1600 |
mitsei/dlkit | dlkit/authz_adapter/assessment/sessions.py | AssessmentOfferedSearchSession.get_assessments_offered_by_search | def get_assessments_offered_by_search(self, assessment_offered_query, assessment_offered_search):
"""Pass through to provider AssessmentOfferedSearchSession.get_assessments_offered_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search... | python | def get_assessments_offered_by_search(self, assessment_offered_query, assessment_offered_search):
"""Pass through to provider AssessmentOfferedSearchSession.get_assessments_offered_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search... | [
"def",
"get_assessments_offered_by_search",
"(",
"self",
",",
"assessment_offered_query",
",",
"assessment_offered_search",
")",
":",
"# Implemented from azosid template for -",
"# osid.resource.ResourceSearchSession.get_resources_by_search_template",
"if",
"not",
"self",
".",
"_can"... | Pass through to provider AssessmentOfferedSearchSession.get_assessments_offered_by_search | [
"Pass",
"through",
"to",
"provider",
"AssessmentOfferedSearchSession",
".",
"get_assessments_offered_by_search"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/assessment/sessions.py#L2414-L2420 |
mitsei/dlkit | dlkit/authz_adapter/assessment/sessions.py | AssessmentTakenSearchSession.get_assessments_taken_by_search | def get_assessments_taken_by_search(self, assessment_taken_query, assessment_taken_search):
"""Pass through to provider AssessmentTakenSearchSession.get_assessments_taken_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
... | python | def get_assessments_taken_by_search(self, assessment_taken_query, assessment_taken_search):
"""Pass through to provider AssessmentTakenSearchSession.get_assessments_taken_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
... | [
"def",
"get_assessments_taken_by_search",
"(",
"self",
",",
"assessment_taken_query",
",",
"assessment_taken_search",
")",
":",
"# Implemented from azosid template for -",
"# osid.resource.ResourceSearchSession.get_resources_by_search_template",
"if",
"not",
"self",
".",
"_can",
"(... | Pass through to provider AssessmentTakenSearchSession.get_assessments_taken_by_search | [
"Pass",
"through",
"to",
"provider",
"AssessmentTakenSearchSession",
".",
"get_assessments_taken_by_search"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/assessment/sessions.py#L3240-L3246 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/multi_choice_records.py | MultiChoiceOrthoQuestionRecord.get_choices_files_map | def get_choices_files_map(self):
"""stub"""
files_map = []
for choice in self.get_choices():
choice = dict(choice)
choice['smallOrthoViewSet'] = base64.b64encode(
self._get_asset_content(Id(choice['assetId']),
OV_SET... | python | def get_choices_files_map(self):
"""stub"""
files_map = []
for choice in self.get_choices():
choice = dict(choice)
choice['smallOrthoViewSet'] = base64.b64encode(
self._get_asset_content(Id(choice['assetId']),
OV_SET... | [
"def",
"get_choices_files_map",
"(",
"self",
")",
":",
"files_map",
"=",
"[",
"]",
"for",
"choice",
"in",
"self",
".",
"get_choices",
"(",
")",
":",
"choice",
"=",
"dict",
"(",
"choice",
")",
"choice",
"[",
"'smallOrthoViewSet'",
"]",
"=",
"base64",
".",... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/multi_choice_records.py#L57-L72 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/multi_choice_records.py | MultiChoiceOrthoQuestionRecord.get_choices_file_urls_map | def get_choices_file_urls_map(self):
"""stub"""
file_urls_map = []
for choice in self.get_choices():
choice = dict(choice)
small_asset_content = self._get_asset_content(
Id(choice['assetId']), OV_SET_SMALL_ASSET_CONTENT_TYPE)
choice['smallOrtho... | python | def get_choices_file_urls_map(self):
"""stub"""
file_urls_map = []
for choice in self.get_choices():
choice = dict(choice)
small_asset_content = self._get_asset_content(
Id(choice['assetId']), OV_SET_SMALL_ASSET_CONTENT_TYPE)
choice['smallOrtho... | [
"def",
"get_choices_file_urls_map",
"(",
"self",
")",
":",
"file_urls_map",
"=",
"[",
"]",
"for",
"choice",
"in",
"self",
".",
"get_choices",
"(",
")",
":",
"choice",
"=",
"dict",
"(",
"choice",
")",
"small_asset_content",
"=",
"self",
".",
"_get_asset_conte... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/multi_choice_records.py#L74-L89 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/multi_choice_records.py | MultiChoiceOrthoQuestionRecord.get_files | def get_files(self):
"""stub"""
files_map = {}
try:
files_map['choices'] = self.get_choices_file_urls_map()
try:
files_map.update(self.get_file_urls_map())
except IllegalState:
pass
except Exception:
files_ma... | python | def get_files(self):
"""stub"""
files_map = {}
try:
files_map['choices'] = self.get_choices_file_urls_map()
try:
files_map.update(self.get_file_urls_map())
except IllegalState:
pass
except Exception:
files_ma... | [
"def",
"get_files",
"(",
"self",
")",
":",
"files_map",
"=",
"{",
"}",
"try",
":",
"files_map",
"[",
"'choices'",
"]",
"=",
"self",
".",
"get_choices_file_urls_map",
"(",
")",
"try",
":",
"files_map",
".",
"update",
"(",
"self",
".",
"get_file_urls_map",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/multi_choice_records.py#L93-L108 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/multi_choice_records.py | MultiChoiceOrthoQuestionFormRecord._init_map | def _init_map(self):
"""stub"""
QuestionFilesFormRecord._init_map(self)
FirstAngleProjectionFormRecord._init_map(self)
super(MultiChoiceOrthoQuestionFormRecord, self)._init_map() | python | def _init_map(self):
"""stub"""
QuestionFilesFormRecord._init_map(self)
FirstAngleProjectionFormRecord._init_map(self)
super(MultiChoiceOrthoQuestionFormRecord, self)._init_map() | [
"def",
"_init_map",
"(",
"self",
")",
":",
"QuestionFilesFormRecord",
".",
"_init_map",
"(",
"self",
")",
"FirstAngleProjectionFormRecord",
".",
"_init_map",
"(",
"self",
")",
"super",
"(",
"MultiChoiceOrthoQuestionFormRecord",
",",
"self",
")",
".",
"_init_map",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/multi_choice_records.py#L143-L147 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/multi_choice_records.py | MultiChoiceOrthoQuestionFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
QuestionFilesFormRecord._init_metadata(self)
FirstAngleProjectionFormRecord._init_metadata(self)
super(MultiChoiceOrthoQuestionFormRecord, self)._init_metadata() | python | def _init_metadata(self):
"""stub"""
QuestionFilesFormRecord._init_metadata(self)
FirstAngleProjectionFormRecord._init_metadata(self)
super(MultiChoiceOrthoQuestionFormRecord, self)._init_metadata() | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"QuestionFilesFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"FirstAngleProjectionFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"super",
"(",
"MultiChoiceOrthoQuestionFormRecord",
",",
"self",
")",
".",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/multi_choice_records.py#L149-L153 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/multi_choice_records.py | MultiChoiceOrthoQuestionFormRecord.set_manip_id | def set_manip_id(self, o3d_asset_id):
"""stub"""
if not isinstance(o3d_asset_id, ABCId):
raise InvalidArgument('Argument must be a valid Id')
self.add_asset(o3d_asset_id,
label='manip',
asset_content_type=MANIP_ASSET_CONTENT_TYPE) | python | def set_manip_id(self, o3d_asset_id):
"""stub"""
if not isinstance(o3d_asset_id, ABCId):
raise InvalidArgument('Argument must be a valid Id')
self.add_asset(o3d_asset_id,
label='manip',
asset_content_type=MANIP_ASSET_CONTENT_TYPE) | [
"def",
"set_manip_id",
"(",
"self",
",",
"o3d_asset_id",
")",
":",
"if",
"not",
"isinstance",
"(",
"o3d_asset_id",
",",
"ABCId",
")",
":",
"raise",
"InvalidArgument",
"(",
"'Argument must be a valid Id'",
")",
"self",
".",
"add_asset",
"(",
"o3d_asset_id",
",",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/multi_choice_records.py#L159-L165 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/multi_choice_records.py | MultiChoiceOrthoQuestionFormRecord.create_o3d_asset | def create_o3d_asset(self,
manip=None,
small_ov_set=None,
large_ov_set=None,
display_name='',
description=''):
"""stub"""
if manip and not isinstance(manip, ABCDataInputStream):
... | python | def create_o3d_asset(self,
manip=None,
small_ov_set=None,
large_ov_set=None,
display_name='',
description=''):
"""stub"""
if manip and not isinstance(manip, ABCDataInputStream):
... | [
"def",
"create_o3d_asset",
"(",
"self",
",",
"manip",
"=",
"None",
",",
"small_ov_set",
"=",
"None",
",",
"large_ov_set",
"=",
"None",
",",
"display_name",
"=",
"''",
",",
"description",
"=",
"''",
")",
":",
"if",
"manip",
"and",
"not",
"isinstance",
"("... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/multi_choice_records.py#L167-L201 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/multi_choice_records.py | MultiChoiceOrthoQuestionFormRecord.set_manip | def set_manip(self, manip, ovs_sm=None, ovs_lg=None, name='A manipulatable'):
"""stub"""
o3d_manip_id = self.create_o3d_asset(manip,
small_ov_set=ovs_sm,
large_ov_set=ovs_lg,
... | python | def set_manip(self, manip, ovs_sm=None, ovs_lg=None, name='A manipulatable'):
"""stub"""
o3d_manip_id = self.create_o3d_asset(manip,
small_ov_set=ovs_sm,
large_ov_set=ovs_lg,
... | [
"def",
"set_manip",
"(",
"self",
",",
"manip",
",",
"ovs_sm",
"=",
"None",
",",
"ovs_lg",
"=",
"None",
",",
"name",
"=",
"'A manipulatable'",
")",
":",
"o3d_manip_id",
"=",
"self",
".",
"create_o3d_asset",
"(",
"manip",
",",
"small_ov_set",
"=",
"ovs_sm",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/multi_choice_records.py#L204-L210 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/multi_choice_records.py | MultiChoiceOrthoQuestionFormRecord.set_ortho_choice | def set_ortho_choice(self, small_asset_data, large_asset_data, name='Choice'):
"""stub"""
o3d_asset_id = self.create_o3d_asset(manip=None,
small_ov_set=small_asset_data,
large_ov_set=large_asset_data,
... | python | def set_ortho_choice(self, small_asset_data, large_asset_data, name='Choice'):
"""stub"""
o3d_asset_id = self.create_o3d_asset(manip=None,
small_ov_set=small_asset_data,
large_ov_set=large_asset_data,
... | [
"def",
"set_ortho_choice",
"(",
"self",
",",
"small_asset_data",
",",
"large_asset_data",
",",
"name",
"=",
"'Choice'",
")",
":",
"o3d_asset_id",
"=",
"self",
".",
"create_o3d_asset",
"(",
"manip",
"=",
"None",
",",
"small_ov_set",
"=",
"small_asset_data",
",",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/multi_choice_records.py#L212-L218 |
theosysbio/means | src/means/approximation/mea/dmu_over_dt.py | generate_dmu_over_dt | def generate_dmu_over_dt(species, propensity, n_counter, stoichiometry_matrix):
r"""
Calculate :math:`\frac{d\mu_i}{dt}` in eq. 6 (see Ale et al. 2013).
.. math::
\frac{d\mu_i}{dt} = S \begin{bmatrix} \sum_{l} \sum_{n_1=0}^{\infty} ...
\sum_{n_d=0}^{\infty}
\frac{1}{\mathb... | python | def generate_dmu_over_dt(species, propensity, n_counter, stoichiometry_matrix):
r"""
Calculate :math:`\frac{d\mu_i}{dt}` in eq. 6 (see Ale et al. 2013).
.. math::
\frac{d\mu_i}{dt} = S \begin{bmatrix} \sum_{l} \sum_{n_1=0}^{\infty} ...
\sum_{n_d=0}^{\infty}
\frac{1}{\mathb... | [
"def",
"generate_dmu_over_dt",
"(",
"species",
",",
"propensity",
",",
"n_counter",
",",
"stoichiometry_matrix",
")",
":",
"# compute derivatives :math:`\\frac{\\partial^n \\mathbf{n}a_l(\\mathbf{x})}{\\partial \\mathbf{x^n}}`\r",
"# for EACH REACTION and EACH entry in COUNTER\r",
"deriv... | r"""
Calculate :math:`\frac{d\mu_i}{dt}` in eq. 6 (see Ale et al. 2013).
.. math::
\frac{d\mu_i}{dt} = S \begin{bmatrix} \sum_{l} \sum_{n_1=0}^{\infty} ...
\sum_{n_d=0}^{\infty}
\frac{1}{\mathbf{n!}}
\frac{\partial^n \mathbf{n}a_l(\mathbf{x})}{\partial \mathbf{x^n}} |... | [
"r",
"Calculate",
":",
"math",
":",
"\\",
"frac",
"{",
"d",
"\\",
"mu_i",
"}",
"{",
"dt",
"}",
"in",
"eq",
".",
"6",
"(",
"see",
"Ale",
"et",
"al",
".",
"2013",
")",
".",
"..",
"math",
"::",
"\\",
"frac",
"{",
"d",
"\\",
"mu_i",
"}",
"{",
... | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/dmu_over_dt.py#L6-L37 |
mitsei/dlkit | dlkit/json_/authentication_process/default_mdata.py | get_authentication_mdata | def get_authentication_mdata():
"""Return default mdata map for Authentication"""
return {
'agent': {
'element_label': {
'text': 'agent',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
'f... | python | def get_authentication_mdata():
"""Return default mdata map for Authentication"""
return {
'agent': {
'element_label': {
'text': 'agent',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
'f... | [
"def",
"get_authentication_mdata",
"(",
")",
":",
"return",
"{",
"'agent'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'agent'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
":",
"str",
"(",
"DEFAUL... | Return default mdata map for Authentication | [
"Return",
"default",
"mdata",
"map",
"for",
"Authentication"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/authentication_process/default_mdata.py#L11-L35 |
OpenAgInitiative/openag_python | openag/cli/cloud/user.py | register | def register(username, password):
"""
Create a new user account. Creates a user account with the given
credentials on the selected cloud server.
"""
check_for_cloud_server()
server = Server(config["cloud_server"]["url"])
server.create_user(username, password) | python | def register(username, password):
"""
Create a new user account. Creates a user account with the given
credentials on the selected cloud server.
"""
check_for_cloud_server()
server = Server(config["cloud_server"]["url"])
server.create_user(username, password) | [
"def",
"register",
"(",
"username",
",",
"password",
")",
":",
"check_for_cloud_server",
"(",
")",
"server",
"=",
"Server",
"(",
"config",
"[",
"\"cloud_server\"",
"]",
"[",
"\"url\"",
"]",
")",
"server",
".",
"create_user",
"(",
"username",
",",
"password",... | Create a new user account. Creates a user account with the given
credentials on the selected cloud server. | [
"Create",
"a",
"new",
"user",
"account",
".",
"Creates",
"a",
"user",
"account",
"with",
"the",
"given",
"credentials",
"on",
"the",
"selected",
"cloud",
"server",
"."
] | train | https://github.com/OpenAgInitiative/openag_python/blob/f6202340292bbf7185e1a7d4290188c0dacbb8d0/openag/cli/cloud/user.py#L14-L21 |
OpenAgInitiative/openag_python | openag/cli/cloud/user.py | login | def login(username, password):
""" Log into your user account """
check_for_cloud_server()
old_username = config["cloud_server"]["username"]
if old_username and old_username != username:
raise click.ClickException(
"Already logged in as user \"{}\". Run `openag cloud user logout` "
... | python | def login(username, password):
""" Log into your user account """
check_for_cloud_server()
old_username = config["cloud_server"]["username"]
if old_username and old_username != username:
raise click.ClickException(
"Already logged in as user \"{}\". Run `openag cloud user logout` "
... | [
"def",
"login",
"(",
"username",
",",
"password",
")",
":",
"check_for_cloud_server",
"(",
")",
"old_username",
"=",
"config",
"[",
"\"cloud_server\"",
"]",
"[",
"\"username\"",
"]",
"if",
"old_username",
"and",
"old_username",
"!=",
"username",
":",
"raise",
... | Log into your user account | [
"Log",
"into",
"your",
"user",
"account"
] | train | https://github.com/OpenAgInitiative/openag_python/blob/f6202340292bbf7185e1a7d4290188c0dacbb8d0/openag/cli/cloud/user.py#L28-L42 |
OpenAgInitiative/openag_python | openag/cli/cloud/user.py | logout | def logout(ctx):
""" Log out of your user account """
check_for_cloud_server()
check_for_cloud_user()
if config["cloud_server"]["farm_name"]:
ctx.invoke(deinit_farm)
config["cloud_server"]["username"] = None
config["cloud_server"]["password"] = None | python | def logout(ctx):
""" Log out of your user account """
check_for_cloud_server()
check_for_cloud_user()
if config["cloud_server"]["farm_name"]:
ctx.invoke(deinit_farm)
config["cloud_server"]["username"] = None
config["cloud_server"]["password"] = None | [
"def",
"logout",
"(",
"ctx",
")",
":",
"check_for_cloud_server",
"(",
")",
"check_for_cloud_user",
"(",
")",
"if",
"config",
"[",
"\"cloud_server\"",
"]",
"[",
"\"farm_name\"",
"]",
":",
"ctx",
".",
"invoke",
"(",
"deinit_farm",
")",
"config",
"[",
"\"cloud_... | Log out of your user account | [
"Log",
"out",
"of",
"your",
"user",
"account"
] | train | https://github.com/OpenAgInitiative/openag_python/blob/f6202340292bbf7185e1a7d4290188c0dacbb8d0/openag/cli/cloud/user.py#L46-L53 |
delfick/harpoon | harpoon/option_spec/command_objs.py | Command.instruction | def instruction(self, val):
"""Set the action and command from an instruction"""
self._instruction = val
if isinstance(val, tuple):
if len(val) is 2:
self._action, self.command = val
else:
self._action, self.command, self.extra = val
... | python | def instruction(self, val):
"""Set the action and command from an instruction"""
self._instruction = val
if isinstance(val, tuple):
if len(val) is 2:
self._action, self.command = val
else:
self._action, self.command, self.extra = val
... | [
"def",
"instruction",
"(",
"self",
",",
"val",
")",
":",
"self",
".",
"_instruction",
"=",
"val",
"if",
"isinstance",
"(",
"val",
",",
"tuple",
")",
":",
"if",
"len",
"(",
"val",
")",
"is",
"2",
":",
"self",
".",
"_action",
",",
"self",
".",
"com... | Set the action and command from an instruction | [
"Set",
"the",
"action",
"and",
"command",
"from",
"an",
"instruction"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/option_spec/command_objs.py#L36-L52 |
delfick/harpoon | harpoon/option_spec/command_objs.py | Command.as_string | def as_string(self):
"""Return the command as a single string for the docker file"""
if type(self.instruction) is str:
return self.instruction
if self.action == "FROM" and not isinstance(self.command, six.string_types):
extra = "" if self.extra is NotSpecified else " {0}... | python | def as_string(self):
"""Return the command as a single string for the docker file"""
if type(self.instruction) is str:
return self.instruction
if self.action == "FROM" and not isinstance(self.command, six.string_types):
extra = "" if self.extra is NotSpecified else " {0}... | [
"def",
"as_string",
"(",
"self",
")",
":",
"if",
"type",
"(",
"self",
".",
"instruction",
")",
"is",
"str",
":",
"return",
"self",
".",
"instruction",
"if",
"self",
".",
"action",
"==",
"\"FROM\"",
"and",
"not",
"isinstance",
"(",
"self",
".",
"command... | Return the command as a single string for the docker file | [
"Return",
"the",
"command",
"as",
"a",
"single",
"string",
"for",
"the",
"docker",
"file"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/option_spec/command_objs.py#L55-L64 |
delfick/harpoon | harpoon/option_spec/command_objs.py | Commands.commands | def commands(self):
"""Memoize and return the flattened list of commands"""
if not getattr(self, "_commands", None):
self._commands = []
for command in self.orig_commands:
if isinstance(command, Command):
command = [command]
for... | python | def commands(self):
"""Memoize and return the flattened list of commands"""
if not getattr(self, "_commands", None):
self._commands = []
for command in self.orig_commands:
if isinstance(command, Command):
command = [command]
for... | [
"def",
"commands",
"(",
"self",
")",
":",
"if",
"not",
"getattr",
"(",
"self",
",",
"\"_commands\"",
",",
"None",
")",
":",
"self",
".",
"_commands",
"=",
"[",
"]",
"for",
"command",
"in",
"self",
".",
"orig_commands",
":",
"if",
"isinstance",
"(",
"... | Memoize and return the flattened list of commands | [
"Memoize",
"and",
"return",
"the",
"flattened",
"list",
"of",
"commands"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/option_spec/command_objs.py#L71-L80 |
delfick/harpoon | harpoon/option_spec/command_objs.py | Commands.external_dependencies | def external_dependencies(self):
"""
Return all the external images this Dockerfile will depend on
These are images from self.dependent_images that aren't defined in this configuration.
"""
found = []
for dep in self.dependent_images:
if isinstance(dep, six.s... | python | def external_dependencies(self):
"""
Return all the external images this Dockerfile will depend on
These are images from self.dependent_images that aren't defined in this configuration.
"""
found = []
for dep in self.dependent_images:
if isinstance(dep, six.s... | [
"def",
"external_dependencies",
"(",
"self",
")",
":",
"found",
"=",
"[",
"]",
"for",
"dep",
"in",
"self",
".",
"dependent_images",
":",
"if",
"isinstance",
"(",
"dep",
",",
"six",
".",
"string_types",
")",
":",
"if",
"dep",
"not",
"in",
"found",
":",
... | Return all the external images this Dockerfile will depend on
These are images from self.dependent_images that aren't defined in this configuration. | [
"Return",
"all",
"the",
"external",
"images",
"this",
"Dockerfile",
"will",
"depend",
"on"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/option_spec/command_objs.py#L83-L94 |
delfick/harpoon | harpoon/option_spec/command_objs.py | Commands.dependent_images | def dependent_images(self):
"""
Determine the dependent images from these commands
This includes all the FROM statements
and any external image from a complex ADD instruction that copies from another container
"""
found = []
for command in self.commands:
... | python | def dependent_images(self):
"""
Determine the dependent images from these commands
This includes all the FROM statements
and any external image from a complex ADD instruction that copies from another container
"""
found = []
for command in self.commands:
... | [
"def",
"dependent_images",
"(",
"self",
")",
":",
"found",
"=",
"[",
"]",
"for",
"command",
"in",
"self",
".",
"commands",
":",
"dep",
"=",
"command",
".",
"dependent_image",
"if",
"dep",
":",
"if",
"dep",
"not",
"in",
"found",
":",
"yield",
"dep",
"... | Determine the dependent images from these commands
This includes all the FROM statements
and any external image from a complex ADD instruction that copies from another container | [
"Determine",
"the",
"dependent",
"images",
"from",
"these",
"commands"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/option_spec/command_objs.py#L97-L110 |
theosysbio/means | src/means/core/problems.py | ODEProblem.validate | def validate(self):
"""
Validates whether the ODE equations provided make sense i.e. the number of right-hand side equations
match the number of left-hand side equations.
"""
if self.left_hand_side.rows != self.right_hand_side.rows:
raise ValueError("There are {0} le... | python | def validate(self):
"""
Validates whether the ODE equations provided make sense i.e. the number of right-hand side equations
match the number of left-hand side equations.
"""
if self.left_hand_side.rows != self.right_hand_side.rows:
raise ValueError("There are {0} le... | [
"def",
"validate",
"(",
"self",
")",
":",
"if",
"self",
".",
"left_hand_side",
".",
"rows",
"!=",
"self",
".",
"right_hand_side",
".",
"rows",
":",
"raise",
"ValueError",
"(",
"\"There are {0} left hand side equations and {1} right hand side equations. \"",
"\"The same ... | Validates whether the ODE equations provided make sense i.e. the number of right-hand side equations
match the number of left-hand side equations. | [
"Validates",
"whether",
"the",
"ODE",
"equations",
"provided",
"make",
"sense",
"i",
".",
"e",
".",
"the",
"number",
"of",
"right",
"-",
"hand",
"side",
"equations",
"match",
"the",
"number",
"of",
"left",
"-",
"hand",
"side",
"equations",
"."
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/core/problems.py#L70-L77 |
theosysbio/means | src/means/core/problems.py | ODEProblem.right_hand_side_as_function | def right_hand_side_as_function(self):
"""
Generates and returns the right hand side of the model as a callable function that takes two parameters:
values for variables and values for constants,
e.g. `f(values_for_variables=[1,2,3], values_for_constants=[3,4,5])
This function is... | python | def right_hand_side_as_function(self):
"""
Generates and returns the right hand side of the model as a callable function that takes two parameters:
values for variables and values for constants,
e.g. `f(values_for_variables=[1,2,3], values_for_constants=[3,4,5])
This function is... | [
"def",
"right_hand_side_as_function",
"(",
"self",
")",
":",
"wrapped_functions",
"=",
"self",
".",
"_right_hand_side_as_numeric_functions",
"def",
"f",
"(",
"values_for_variables",
",",
"values_for_constants",
")",
":",
"all_values",
"=",
"np",
".",
"concatenate",
"(... | Generates and returns the right hand side of the model as a callable function that takes two parameters:
values for variables and values for constants,
e.g. `f(values_for_variables=[1,2,3], values_for_constants=[3,4,5])
This function is directly used in `means.simulation.Simulation`
:re... | [
"Generates",
"and",
"returns",
"the",
"right",
"hand",
"side",
"of",
"the",
"model",
"as",
"a",
"callable",
"function",
"that",
"takes",
"two",
"parameters",
":",
"values",
"for",
"variables",
"and",
"values",
"for",
"constants",
"e",
".",
"g",
".",
"f",
... | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/core/problems.py#L131-L148 |
theosysbio/means | src/means/core/problems.py | ODEProblem.descriptor_for_symbol | def descriptor_for_symbol(self, symbol):
"""
Given the symbol associated with the problem.
Returns the :class:`~means.core.descriptors.Descriptor` associated with that symbol
:param symbol: Symbol
:type symbol: basestring|:class:`sympy.Symbol`
:return:
"""
... | python | def descriptor_for_symbol(self, symbol):
"""
Given the symbol associated with the problem.
Returns the :class:`~means.core.descriptors.Descriptor` associated with that symbol
:param symbol: Symbol
:type symbol: basestring|:class:`sympy.Symbol`
:return:
"""
... | [
"def",
"descriptor_for_symbol",
"(",
"self",
",",
"symbol",
")",
":",
"if",
"isinstance",
"(",
"symbol",
",",
"basestring",
")",
":",
"symbol",
"=",
"sympy",
".",
"Symbol",
"(",
"symbol",
")",
"try",
":",
"return",
"self",
".",
"_descriptions_dict",
"[",
... | Given the symbol associated with the problem.
Returns the :class:`~means.core.descriptors.Descriptor` associated with that symbol
:param symbol: Symbol
:type symbol: basestring|:class:`sympy.Symbol`
:return: | [
"Given",
"the",
"symbol",
"associated",
"with",
"the",
"problem",
".",
"Returns",
"the",
":",
"class",
":",
"~means",
".",
"core",
".",
"descriptors",
".",
"Descriptor",
"associated",
"with",
"that",
"symbol"
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/core/problems.py#L150-L165 |
theosysbio/means | src/means/core/problems.py | ODEProblem._repr_latex_ | def _repr_latex_(self):
"""
This is used in IPython notebook it allows us to render the ODEProblem object in LaTeX.
How Cool is this?
"""
# TODO: we're mixing HTML with latex here. That is not necessarily a good idea, but works
# with IPython 1.2.0. Once IPython 2.0 is re... | python | def _repr_latex_(self):
"""
This is used in IPython notebook it allows us to render the ODEProblem object in LaTeX.
How Cool is this?
"""
# TODO: we're mixing HTML with latex here. That is not necessarily a good idea, but works
# with IPython 1.2.0. Once IPython 2.0 is re... | [
"def",
"_repr_latex_",
"(",
"self",
")",
":",
"# TODO: we're mixing HTML with latex here. That is not necessarily a good idea, but works",
"# with IPython 1.2.0. Once IPython 2.0 is released, this needs to be changed to _ipython_display_",
"lines",
"=",
"[",
"]",
"lines",
".",
"append",
... | This is used in IPython notebook it allows us to render the ODEProblem object in LaTeX.
How Cool is this? | [
"This",
"is",
"used",
"in",
"IPython",
"notebook",
"it",
"allows",
"us",
"to",
"render",
"the",
"ODEProblem",
"object",
"in",
"LaTeX",
".",
"How",
"Cool",
"is",
"this?"
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/core/problems.py#L185-L206 |
mirukan/pydecensooru | pydecensooru/main.py | decensor_iter | def decensor_iter(posts_info: Iterable[dict], site_url: str = DEFAULT_SITE
) -> Generator[dict, None, None]:
"""Apply decensoring on an iterable of posts info dicts from Danbooru API.
Any censored post is automatically decensored if needed."""
for info in posts_info:
yield decensor(... | python | def decensor_iter(posts_info: Iterable[dict], site_url: str = DEFAULT_SITE
) -> Generator[dict, None, None]:
"""Apply decensoring on an iterable of posts info dicts from Danbooru API.
Any censored post is automatically decensored if needed."""
for info in posts_info:
yield decensor(... | [
"def",
"decensor_iter",
"(",
"posts_info",
":",
"Iterable",
"[",
"dict",
"]",
",",
"site_url",
":",
"str",
"=",
"DEFAULT_SITE",
")",
"->",
"Generator",
"[",
"dict",
",",
"None",
",",
"None",
"]",
":",
"for",
"info",
"in",
"posts_info",
":",
"yield",
"d... | Apply decensoring on an iterable of posts info dicts from Danbooru API.
Any censored post is automatically decensored if needed. | [
"Apply",
"decensoring",
"on",
"an",
"iterable",
"of",
"posts",
"info",
"dicts",
"from",
"Danbooru",
"API",
".",
"Any",
"censored",
"post",
"is",
"automatically",
"decensored",
"if",
"needed",
"."
] | train | https://github.com/mirukan/pydecensooru/blob/2a2bec93c40ed2d3e359ee203eceabf42ef1755d/pydecensooru/main.py#L27-L32 |
mirukan/pydecensooru | pydecensooru/main.py | decensor | def decensor(post_info: dict, site_url: str = DEFAULT_SITE) -> dict:
"Decensor a post info dict from Danbooru API if needed."
return post_info \
if "md5" in post_info else fill_missing_info(post_info, site_url) | python | def decensor(post_info: dict, site_url: str = DEFAULT_SITE) -> dict:
"Decensor a post info dict from Danbooru API if needed."
return post_info \
if "md5" in post_info else fill_missing_info(post_info, site_url) | [
"def",
"decensor",
"(",
"post_info",
":",
"dict",
",",
"site_url",
":",
"str",
"=",
"DEFAULT_SITE",
")",
"->",
"dict",
":",
"return",
"post_info",
"if",
"\"md5\"",
"in",
"post_info",
"else",
"fill_missing_info",
"(",
"post_info",
",",
"site_url",
")"
] | Decensor a post info dict from Danbooru API if needed. | [
"Decensor",
"a",
"post",
"info",
"dict",
"from",
"Danbooru",
"API",
"if",
"needed",
"."
] | train | https://github.com/mirukan/pydecensooru/blob/2a2bec93c40ed2d3e359ee203eceabf42ef1755d/pydecensooru/main.py#L35-L38 |
mirukan/pydecensooru | pydecensooru/main.py | fill_missing_info | def fill_missing_info(info: dict, site_url: str = DEFAULT_SITE) -> dict:
"Add missing info in a censored post info dict."
try:
md5, ext = find_censored_md5ext(info["id"])
except TypeError: # None returned by find_..
return info
sample_ext = "jpg" if ext != "zip" else "webm"
if inf... | python | def fill_missing_info(info: dict, site_url: str = DEFAULT_SITE) -> dict:
"Add missing info in a censored post info dict."
try:
md5, ext = find_censored_md5ext(info["id"])
except TypeError: # None returned by find_..
return info
sample_ext = "jpg" if ext != "zip" else "webm"
if inf... | [
"def",
"fill_missing_info",
"(",
"info",
":",
"dict",
",",
"site_url",
":",
"str",
"=",
"DEFAULT_SITE",
")",
"->",
"dict",
":",
"try",
":",
"md5",
",",
"ext",
"=",
"find_censored_md5ext",
"(",
"info",
"[",
"\"id\"",
"]",
")",
"except",
"TypeError",
":",
... | Add missing info in a censored post info dict. | [
"Add",
"missing",
"info",
"in",
"a",
"censored",
"post",
"info",
"dict",
"."
] | train | https://github.com/mirukan/pydecensooru/blob/2a2bec93c40ed2d3e359ee203eceabf42ef1755d/pydecensooru/main.py#L42-L72 |
mirukan/pydecensooru | pydecensooru/main.py | find_censored_md5ext | def find_censored_md5ext(post_id: int) -> Optional[str]:
"Find MD5 for a censored post's ID, return None if can't find."
try:
last_pull_date = LAST_PULL_DATE_FILE.read_text().strip()
except FileNotFoundError:
last_pull_date = ""
date = datetime.utcnow()
date = f"{date.year}{date.mon... | python | def find_censored_md5ext(post_id: int) -> Optional[str]:
"Find MD5 for a censored post's ID, return None if can't find."
try:
last_pull_date = LAST_PULL_DATE_FILE.read_text().strip()
except FileNotFoundError:
last_pull_date = ""
date = datetime.utcnow()
date = f"{date.year}{date.mon... | [
"def",
"find_censored_md5ext",
"(",
"post_id",
":",
"int",
")",
"->",
"Optional",
"[",
"str",
"]",
":",
"try",
":",
"last_pull_date",
"=",
"LAST_PULL_DATE_FILE",
".",
"read_text",
"(",
")",
".",
"strip",
"(",
")",
"except",
"FileNotFoundError",
":",
"last_pu... | Find MD5 for a censored post's ID, return None if can't find. | [
"Find",
"MD5",
"for",
"a",
"censored",
"post",
"s",
"ID",
"return",
"None",
"if",
"can",
"t",
"find",
"."
] | train | https://github.com/mirukan/pydecensooru/blob/2a2bec93c40ed2d3e359ee203eceabf42ef1755d/pydecensooru/main.py#L82-L108 |
mirukan/pydecensooru | pydecensooru/main.py | update_batches | def update_batches() -> None:
"Update id:md5.ext batches from Dencensooru's repository."
batches_data = requests.get(BATCHES_API_URL).json()
batches_url = {i["name"]: i["download_url"] for i in batches_data
if i["type"] == "file"}
order_batches = sorted(batches_url, key=int)
... | python | def update_batches() -> None:
"Update id:md5.ext batches from Dencensooru's repository."
batches_data = requests.get(BATCHES_API_URL).json()
batches_url = {i["name"]: i["download_url"] for i in batches_data
if i["type"] == "file"}
order_batches = sorted(batches_url, key=int)
... | [
"def",
"update_batches",
"(",
")",
"->",
"None",
":",
"batches_data",
"=",
"requests",
".",
"get",
"(",
"BATCHES_API_URL",
")",
".",
"json",
"(",
")",
"batches_url",
"=",
"{",
"i",
"[",
"\"name\"",
"]",
":",
"i",
"[",
"\"download_url\"",
"]",
"for",
"i... | Update id:md5.ext batches from Dencensooru's repository. | [
"Update",
"id",
":",
"md5",
".",
"ext",
"batches",
"from",
"Dencensooru",
"s",
"repository",
"."
] | train | https://github.com/mirukan/pydecensooru/blob/2a2bec93c40ed2d3e359ee203eceabf42ef1755d/pydecensooru/main.py#L111-L137 |
mitsei/dlkit | dlkit/records/assessment/analytic/irt.py | IRTItemFormRecord._init_map | def _init_map(self):
"""stub"""
super(IRTItemFormRecord, self)._init_map()
self.my_osid_object_form._my_map['decimalValues']['difficulty'] = \
self._decimal_value_metadata['default_decimal_values'][1]
self.my_osid_object_form._my_map['decimalValues']['discrimination'] = \
... | python | def _init_map(self):
"""stub"""
super(IRTItemFormRecord, self)._init_map()
self.my_osid_object_form._my_map['decimalValues']['difficulty'] = \
self._decimal_value_metadata['default_decimal_values'][1]
self.my_osid_object_form._my_map['decimalValues']['discrimination'] = \
... | [
"def",
"_init_map",
"(",
"self",
")",
":",
"super",
"(",
"IRTItemFormRecord",
",",
"self",
")",
".",
"_init_map",
"(",
")",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"'decimalValues'",
"]",
"[",
"'difficulty'",
"]",
"=",
"self",
".",
"_decim... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/analytic/irt.py#L99-L107 |
mitsei/dlkit | dlkit/records/assessment/analytic/irt.py | IRTItemFormRecord.set_difficulty_value | def set_difficulty_value(self, difficulty):
"""stub"""
if not isinstance(difficulty, float):
raise InvalidArgument('difficulty value must be a decimal')
self.add_decimal_value(difficulty, 'difficulty') | python | def set_difficulty_value(self, difficulty):
"""stub"""
if not isinstance(difficulty, float):
raise InvalidArgument('difficulty value must be a decimal')
self.add_decimal_value(difficulty, 'difficulty') | [
"def",
"set_difficulty_value",
"(",
"self",
",",
"difficulty",
")",
":",
"if",
"not",
"isinstance",
"(",
"difficulty",
",",
"float",
")",
":",
"raise",
"InvalidArgument",
"(",
"'difficulty value must be a decimal'",
")",
"self",
".",
"add_decimal_value",
"(",
"dif... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/analytic/irt.py#L121-L125 |
mitsei/dlkit | dlkit/records/assessment/analytic/irt.py | IRTItemFormRecord.set_discrimination_value | def set_discrimination_value(self, discrimination):
"""stub"""
if not isinstance(discrimination, float):
raise InvalidArgument('discrimination value must be a decimal')
self.add_decimal_value(discrimination, 'discrimination') | python | def set_discrimination_value(self, discrimination):
"""stub"""
if not isinstance(discrimination, float):
raise InvalidArgument('discrimination value must be a decimal')
self.add_decimal_value(discrimination, 'discrimination') | [
"def",
"set_discrimination_value",
"(",
"self",
",",
"discrimination",
")",
":",
"if",
"not",
"isinstance",
"(",
"discrimination",
",",
"float",
")",
":",
"raise",
"InvalidArgument",
"(",
"'discrimination value must be a decimal'",
")",
"self",
".",
"add_decimal_value... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/analytic/irt.py#L127-L131 |
mitsei/dlkit | dlkit/records/assessment/analytic/irt.py | IRTItemFormRecord.set_pseudo_guessing_value | def set_pseudo_guessing_value(self, pseudo_guessing):
"""stub"""
if not isinstance(pseudo_guessing, float):
raise InvalidArgument('pseudo-guessing value must be a decimal')
self.add_decimal_value(pseudo_guessing, 'pseudoGuessing') | python | def set_pseudo_guessing_value(self, pseudo_guessing):
"""stub"""
if not isinstance(pseudo_guessing, float):
raise InvalidArgument('pseudo-guessing value must be a decimal')
self.add_decimal_value(pseudo_guessing, 'pseudoGuessing') | [
"def",
"set_pseudo_guessing_value",
"(",
"self",
",",
"pseudo_guessing",
")",
":",
"if",
"not",
"isinstance",
"(",
"pseudo_guessing",
",",
"float",
")",
":",
"raise",
"InvalidArgument",
"(",
"'pseudo-guessing value must be a decimal'",
")",
"self",
".",
"add_decimal_v... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/analytic/irt.py#L133-L137 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartLookupSession._view_filter | def _view_filter(self):
"""
Overrides OsidSession._view_filter to add sequestering filter.
"""
view_filter = OsidSession._view_filter(self)
if self._sequestered_view == SEQUESTERED:
view_filter['sequestered'] = False
return view_filter | python | def _view_filter(self):
"""
Overrides OsidSession._view_filter to add sequestering filter.
"""
view_filter = OsidSession._view_filter(self)
if self._sequestered_view == SEQUESTERED:
view_filter['sequestered'] = False
return view_filter | [
"def",
"_view_filter",
"(",
"self",
")",
":",
"view_filter",
"=",
"OsidSession",
".",
"_view_filter",
"(",
"self",
")",
"if",
"self",
".",
"_sequestered_view",
"==",
"SEQUESTERED",
":",
"view_filter",
"[",
"'sequestered'",
"]",
"=",
"False",
"return",
"view_fi... | Overrides OsidSession._view_filter to add sequestering filter. | [
"Overrides",
"OsidSession",
".",
"_view_filter",
"to",
"add",
"sequestering",
"filter",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L72-L80 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartLookupSession.get_assessment_part | def get_assessment_part(self, assessment_part_id):
"""Gets the ``AssessmentPart`` specified by its ``Id``.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart`` to retrieve
return: (osid.assessment.authoring.AssessmentPart) - the
returned ... | python | def get_assessment_part(self, assessment_part_id):
"""Gets the ``AssessmentPart`` specified by its ``Id``.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart`` to retrieve
return: (osid.assessment.authoring.AssessmentPart) - the
returned ... | [
"def",
"get_assessment_part",
"(",
"self",
",",
"assessment_part_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resource",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated",
"(",
"'assess... | Gets the ``AssessmentPart`` specified by its ``Id``.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart`` to retrieve
return: (osid.assessment.authoring.AssessmentPart) - the
returned ``AssessmentPart``
raise: NotFound - no ``AssessmentP... | [
"Gets",
"the",
"AssessmentPart",
"specified",
"by",
"its",
"Id",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L223-L247 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartLookupSession.get_assessment_parts_by_ids | def get_assessment_parts_by_ids(self, assessment_part_ids):
"""Gets an ``AssessmentPartList`` corresponding to the given ``IdList``.
arg: assessment_part_ids (osid.id.IdList): the list of
``Ids`` to retrieve
return: (osid.assessment.authoring.AssessmentPartList) - the
... | python | def get_assessment_parts_by_ids(self, assessment_part_ids):
"""Gets an ``AssessmentPartList`` corresponding to the given ``IdList``.
arg: assessment_part_ids (osid.id.IdList): the list of
``Ids`` to retrieve
return: (osid.assessment.authoring.AssessmentPartList) - the
... | [
"def",
"get_assessment_parts_by_ids",
"(",
"self",
",",
"assessment_part_ids",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resources_by_ids",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated",
... | Gets an ``AssessmentPartList`` corresponding to the given ``IdList``.
arg: assessment_part_ids (osid.id.IdList): the list of
``Ids`` to retrieve
return: (osid.assessment.authoring.AssessmentPartList) - the
returned ``AssessmentPart`` list
raise: NotFound - an... | [
"Gets",
"an",
"AssessmentPartList",
"corresponding",
"to",
"the",
"given",
"IdList",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L250-L283 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartLookupSession.get_assessment_parts_by_genus_type | def get_assessment_parts_by_genus_type(self, assessment_part_genus_type):
"""Gets an ``AssessmentPartList`` corresponding to the given assessment part genus ``Type`` which does not include assessment parts of types derived from the specified ``Type``.
arg: assessment_part_genus_type (osid.type.Type)... | python | def get_assessment_parts_by_genus_type(self, assessment_part_genus_type):
"""Gets an ``AssessmentPartList`` corresponding to the given assessment part genus ``Type`` which does not include assessment parts of types derived from the specified ``Type``.
arg: assessment_part_genus_type (osid.type.Type)... | [
"def",
"get_assessment_parts_by_genus_type",
"(",
"self",
",",
"assessment_part_genus_type",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resources_by_genus_type",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"J... | Gets an ``AssessmentPartList`` corresponding to the given assessment part genus ``Type`` which does not include assessment parts of types derived from the specified ``Type``.
arg: assessment_part_genus_type (osid.type.Type): an
assessment part genus type
return: (osid.assessment.auth... | [
"Gets",
"an",
"AssessmentPartList",
"corresponding",
"to",
"the",
"given",
"assessment",
"part",
"genus",
"Type",
"which",
"does",
"not",
"include",
"assessment",
"parts",
"of",
"types",
"derived",
"from",
"the",
"specified",
"Type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L286-L309 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartLookupSession.get_assessment_parts_for_assessment | def get_assessment_parts_for_assessment(self, assessment_id):
"""Gets an ``AssessmentPart`` for the given assessment.
arg: assessment_id (osid.id.Id): an assessment ``Id``
return: (osid.assessment.authoring.AssessmentPartList) - the
returned ``AssessmentPart`` list
ra... | python | def get_assessment_parts_for_assessment(self, assessment_id):
"""Gets an ``AssessmentPart`` for the given assessment.
arg: assessment_id (osid.id.Id): an assessment ``Id``
return: (osid.assessment.authoring.AssessmentPartList) - the
returned ``AssessmentPart`` list
ra... | [
"def",
"get_assessment_parts_for_assessment",
"(",
"self",
",",
"assessment_id",
")",
":",
"# Implemented from template for",
"# osid.learning.ActivityLookupSession.get_activities_for_objective_template",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSO... | Gets an ``AssessmentPart`` for the given assessment.
arg: assessment_id (osid.id.Id): an assessment ``Id``
return: (osid.assessment.authoring.AssessmentPartList) - the
returned ``AssessmentPart`` list
raise: NullArgument - ``assessment_id`` is ``null``
raise: Operat... | [
"Gets",
"an",
"AssessmentPart",
"for",
"the",
"given",
"assessment",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L352-L373 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartLookupSession.get_assessment_parts | def get_assessment_parts(self):
"""Gets all ``AssessmentParts``.
return: (osid.assessment.authoring.AssessmentPartList) - a list
of ``AssessmentParts``
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure
*complian... | python | def get_assessment_parts(self):
"""Gets all ``AssessmentParts``.
return: (osid.assessment.authoring.AssessmentPartList) - a list
of ``AssessmentParts``
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure
*complian... | [
"def",
"get_assessment_parts",
"(",
"self",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resources",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment_authoring'",
",",
"c... | Gets all ``AssessmentParts``.
return: (osid.assessment.authoring.AssessmentPartList) - a list
of ``AssessmentParts``
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure
*compliance: mandatory -- This method must be implem... | [
"Gets",
"all",
"AssessmentParts",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L375-L392 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartLookupSession.get_assessment_parts_for_assessment_part | def get_assessment_parts_for_assessment_part(self, assessment_part_id):
"""Gets an ``AssessmentPart`` for the given assessment part.
arg: assessment_part_id (osid.id.Id): an assessment part ``Id``
return: (osid.assessment.authoring.AssessmentPartList) - the
returned ``Assessm... | python | def get_assessment_parts_for_assessment_part(self, assessment_part_id):
"""Gets an ``AssessmentPart`` for the given assessment part.
arg: assessment_part_id (osid.id.Id): an assessment part ``Id``
return: (osid.assessment.authoring.AssessmentPartList) - the
returned ``Assessm... | [
"def",
"get_assessment_parts_for_assessment_part",
"(",
"self",
",",
"assessment_part_id",
")",
":",
"# NOT IN SPEC - Implemented from",
"# osid.assessment_authoring.AssessmentPartLookupSession.additional_methods",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"... | Gets an ``AssessmentPart`` for the given assessment part.
arg: assessment_part_id (osid.id.Id): an assessment part ``Id``
return: (osid.assessment.authoring.AssessmentPartList) - the
returned ``AssessmentPart`` list
raise: NullArgument - ``assessment_part_id`` is ``null``
... | [
"Gets",
"an",
"AssessmentPart",
"for",
"the",
"given",
"assessment",
"part",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L397-L418 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartQuerySession.get_assessment_parts_by_query | def get_assessment_parts_by_query(self, assessment_part_query):
"""Gets a list of ``AssessmentParts`` matching the given assessment part query.
arg: assessment_part_query
(osid.assessment.authoring.AssessmentPartQuery): the
assessment part query
return: (osid.... | python | def get_assessment_parts_by_query(self, assessment_part_query):
"""Gets a list of ``AssessmentParts`` matching the given assessment part query.
arg: assessment_part_query
(osid.assessment.authoring.AssessmentPartQuery): the
assessment part query
return: (osid.... | [
"def",
"get_assessment_parts_by_query",
"(",
"self",
",",
"assessment_part_query",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceQuerySession.get_resources_by_query",
"and_list",
"=",
"list",
"(",
")",
"or_list",
"=",
"list",
"(",
")",
"for",
"term",... | Gets a list of ``AssessmentParts`` matching the given assessment part query.
arg: assessment_part_query
(osid.assessment.authoring.AssessmentPartQuery): the
assessment part query
return: (osid.assessment.authoring.AssessmentPartList) - the
returned ``A... | [
"Gets",
"a",
"list",
"of",
"AssessmentParts",
"matching",
"the",
"given",
"assessment",
"part",
"query",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L577-L619 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartAdminSession.get_assessment_part_form_for_create_for_assessment | def get_assessment_part_form_for_create_for_assessment(self, assessment_id, assessment_part_record_types):
"""Gets the assessment part form for creating new assessment parts for an assessment.
A new form should be requested for each create transaction.
arg: assessment_id (osid.id.Id): an as... | python | def get_assessment_part_form_for_create_for_assessment(self, assessment_id, assessment_part_record_types):
"""Gets the assessment part form for creating new assessment parts for an assessment.
A new form should be requested for each create transaction.
arg: assessment_id (osid.id.Id): an as... | [
"def",
"get_assessment_part_form_for_create_for_assessment",
"(",
"self",
",",
"assessment_id",
",",
"assessment_part_record_types",
")",
":",
"# Implemented from template for",
"# osid.learning.ActivityAdminSession.get_activity_form_for_create_template",
"if",
"not",
"isinstance",
"("... | Gets the assessment part form for creating new assessment parts for an assessment.
A new form should be requested for each create transaction.
arg: assessment_id (osid.id.Id): an assessment ``Id``
arg: assessment_part_record_types (osid.type.Type[]): array
of assessment p... | [
"Gets",
"the",
"assessment",
"part",
"form",
"for",
"creating",
"new",
"assessment",
"parts",
"for",
"an",
"assessment",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L745-L792 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartAdminSession.create_assessment_part_for_assessment | def create_assessment_part_for_assessment(self, assessment_part_form):
"""Creates a new assessment part.
arg: assessment_part_form
(osid.assessment.authoring.AssessmentPartForm):
assessment part form
return: (osid.assessment.authoring.AssessmentPart) - the new... | python | def create_assessment_part_for_assessment(self, assessment_part_form):
"""Creates a new assessment part.
arg: assessment_part_form
(osid.assessment.authoring.AssessmentPartForm):
assessment part form
return: (osid.assessment.authoring.AssessmentPart) - the new... | [
"def",
"create_assessment_part_for_assessment",
"(",
"self",
",",
"assessment_part_form",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.create_resource_template",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment_authoring'",
",",
"colle... | Creates a new assessment part.
arg: assessment_part_form
(osid.assessment.authoring.AssessmentPartForm):
assessment part form
return: (osid.assessment.authoring.AssessmentPart) - the new
part
raise: IllegalState - ``assessment_part_form`` alre... | [
"Creates",
"a",
"new",
"assessment",
"part",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L796-L840 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartAdminSession.get_assessment_part_form_for_create_for_assessment_part | def get_assessment_part_form_for_create_for_assessment_part(self, assessment_part_id, assessment_part_record_types):
"""Gets the assessment part form for creating new assessment parts under another assessment part.
A new form should be requested for each create transaction.
arg: assessment_... | python | def get_assessment_part_form_for_create_for_assessment_part(self, assessment_part_id, assessment_part_record_types):
"""Gets the assessment part form for creating new assessment parts under another assessment part.
A new form should be requested for each create transaction.
arg: assessment_... | [
"def",
"get_assessment_part_form_for_create_for_assessment_part",
"(",
"self",
",",
"assessment_part_id",
",",
"assessment_part_record_types",
")",
":",
"if",
"not",
"isinstance",
"(",
"assessment_part_id",
",",
"ABCId",
")",
":",
"raise",
"errors",
".",
"InvalidArgument"... | Gets the assessment part form for creating new assessment parts under another assessment part.
A new form should be requested for each create transaction.
arg: assessment_part_id (osid.id.Id): an assessment part
``Id``
arg: assessment_part_record_types (osid.type.Type[]):... | [
"Gets",
"the",
"assessment",
"part",
"form",
"for",
"creating",
"new",
"assessment",
"parts",
"under",
"another",
"assessment",
"part",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L843-L897 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartAdminSession.get_assessment_part_form_for_update | def get_assessment_part_form_for_update(self, assessment_part_id):
"""Gets the assessment part form for updating an existing assessment part.
A new assessment part form should be requested for each update
transaction.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
... | python | def get_assessment_part_form_for_update(self, assessment_part_id):
"""Gets the assessment part form for updating an existing assessment part.
A new assessment part form should be requested for each update
transaction.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
... | [
"def",
"get_assessment_part_form_for_update",
"(",
"self",
",",
"assessment_part_id",
")",
":",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment_authoring'",
",",
"collection",
"=",
"'AssessmentPart'",
",",
"runtime",
"=",
"self",
".",
"_runtime",
")",
"if"... | Gets the assessment part form for updating an existing assessment part.
A new assessment part form should be requested for each update
transaction.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
return: (osid.assessment.authoring.Assessmen... | [
"Gets",
"the",
"assessment",
"part",
"form",
"for",
"updating",
"an",
"existing",
"assessment",
"part",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L968-L1011 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartAdminSession.update_assessment_part | def update_assessment_part(self, assessment_part_id, assessment_part_form):
"""Updates an existing assessment part.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
arg: assessment_part_form
(osid.assessment.authoring.AssessmentPar... | python | def update_assessment_part(self, assessment_part_id, assessment_part_form):
"""Updates an existing assessment part.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
arg: assessment_part_form
(osid.assessment.authoring.AssessmentPar... | [
"def",
"update_assessment_part",
"(",
"self",
",",
"assessment_part_id",
",",
"assessment_part_form",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.update_resource_template",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment_authoring'",... | Updates an existing assessment part.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
arg: assessment_part_form
(osid.assessment.authoring.AssessmentPartForm): part
form
raise: NotFound - ``assessment_part_id`` not... | [
"Updates",
"an",
"existing",
"assessment",
"part",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1014-L1055 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartAdminSession.delete_assessment_part | def delete_assessment_part(self, assessment_part_id):
"""Removes an asessment part and all mapped items.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
raise: NotFound - ``assessment_part_id`` not found
raise: NullArgument - ``assessment_... | python | def delete_assessment_part(self, assessment_part_id):
"""Removes an asessment part and all mapped items.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
raise: NotFound - ``assessment_part_id`` not found
raise: NullArgument - ``assessment_... | [
"def",
"delete_assessment_part",
"(",
"self",
",",
"assessment_part_id",
")",
":",
"# Should be implemented from template for",
"# osid.learning.ObjectiveAdminSession.delete_objective_template",
"# but need to handle magic part delete ...",
"if",
"not",
"isinstance",
"(",
"assessment_p... | Removes an asessment part and all mapped items.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
raise: NotFound - ``assessment_part_id`` not found
raise: NullArgument - ``assessment_part_id`` is ``null``
raise: OperationFailed - unable to... | [
"Removes",
"an",
"asessment",
"part",
"and",
"all",
"mapped",
"items",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1079-L1114 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartAdminSession.alias_assessment_part | def alias_assessment_part(self, assessment_part_id, alias_id):
"""Adds an ``Id`` to an ``AssessmentPart`` for the purpose of creating compatibility.
The primary ``Id`` of the ``AssessmentPart`` is determined by
the provider. The new ``Id`` is an alias to the primary ``Id``.
If the alias... | python | def alias_assessment_part(self, assessment_part_id, alias_id):
"""Adds an ``Id`` to an ``AssessmentPart`` for the purpose of creating compatibility.
The primary ``Id`` of the ``AssessmentPart`` is determined by
the provider. The new ``Id`` is an alias to the primary ``Id``.
If the alias... | [
"def",
"alias_assessment_part",
"(",
"self",
",",
"assessment_part_id",
",",
"alias_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.alias_resources_template",
"self",
".",
"_alias_id",
"(",
"primary_id",
"=",
"assessment_part_id",
",",
... | Adds an ``Id`` to an ``AssessmentPart`` for the purpose of creating compatibility.
The primary ``Id`` of the ``AssessmentPart`` is determined by
the provider. The new ``Id`` is an alias to the primary ``Id``.
If the alias is a pointer to another assessment part, it is
reassigned to the ... | [
"Adds",
"an",
"Id",
"to",
"an",
"AssessmentPart",
"for",
"the",
"purpose",
"of",
"creating",
"compatibility",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1135-L1158 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartBankSession.get_assessment_part_ids_by_bank | def get_assessment_part_ids_by_bank(self, bank_id):
"""Gets the list of ``AssessmentPartIds`` associated with an ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.id.IdList) - list of related assessment part
``Ids``
raise: NotFound - ``bank_id... | python | def get_assessment_part_ids_by_bank(self, bank_id):
"""Gets the list of ``AssessmentPartIds`` associated with an ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.id.IdList) - list of related assessment part
``Ids``
raise: NotFound - ``bank_id... | [
"def",
"get_assessment_part_ids_by_bank",
"(",
"self",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_resource_ids_by_bin",
"id_list",
"=",
"[",
"]",
"for",
"assessment_part",
"in",
"self",
".",
"get_assessment_parts_by_bank... | Gets the list of ``AssessmentPartIds`` associated with an ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.id.IdList) - list of related assessment part
``Ids``
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is `... | [
"Gets",
"the",
"list",
"of",
"AssessmentPartIds",
"associated",
"with",
"an",
"Bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1234-L1252 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartBankSession.get_assessment_parts_by_bank | def get_assessment_parts_by_bank(self, bank_id):
"""Gets the list of assessment parts associated with an ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.assessment.authoring.AssessmentPartList) - list of
related assessment parts
raise: NotFo... | python | def get_assessment_parts_by_bank(self, bank_id):
"""Gets the list of assessment parts associated with an ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.assessment.authoring.AssessmentPartList) - list of
related assessment parts
raise: NotFo... | [
"def",
"get_assessment_parts_by_bank",
"(",
"self",
",",
"bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_resources_by_bin",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'ASSESSMENT_AUTHORING'",
",",
"local",
"=",
"Tru... | Gets the list of assessment parts associated with an ``Bank``.
arg: bank_id (osid.id.Id): ``Id`` of the ``Bank``
return: (osid.assessment.authoring.AssessmentPartList) - list of
related assessment parts
raise: NotFound - ``bank_id`` is not found
raise: NullArgument ... | [
"Gets",
"the",
"list",
"of",
"assessment",
"parts",
"associated",
"with",
"an",
"Bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1255-L1273 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartBankSession.get_assessment_part_ids_by_banks | def get_assessment_part_ids_by_banks(self, bank_ids):
"""Gets the list of ``AssessmentPart Ids`` corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.id.IdList) - list of assessment part ``Ids``
raise: NullArgument - ``bank_ids`` i... | python | def get_assessment_part_ids_by_banks(self, bank_ids):
"""Gets the list of ``AssessmentPart Ids`` corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.id.IdList) - list of assessment part ``Ids``
raise: NullArgument - ``bank_ids`` i... | [
"def",
"get_assessment_part_ids_by_banks",
"(",
"self",
",",
"bank_ids",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_resource_ids_by_bins",
"id_list",
"=",
"[",
"]",
"for",
"assessment_part",
"in",
"self",
".",
"get_assessment_parts_by_b... | Gets the list of ``AssessmentPart Ids`` corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.id.IdList) - list of assessment part ``Ids``
raise: NullArgument - ``bank_ids`` is ``null``
raise: OperationFailed - unable to complete r... | [
"Gets",
"the",
"list",
"of",
"AssessmentPart",
"Ids",
"corresponding",
"to",
"a",
"list",
"of",
"Banks",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1276-L1292 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartBankSession.get_assessment_parts_by_banks | def get_assessment_parts_by_banks(self, bank_ids):
"""Gets the list of assessment part corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.assessment.authoring.AssessmentPartList) - list of
assessment parts
raise: ... | python | def get_assessment_parts_by_banks(self, bank_ids):
"""Gets the list of assessment part corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.assessment.authoring.AssessmentPartList) - list of
assessment parts
raise: ... | [
"def",
"get_assessment_parts_by_banks",
"(",
"self",
",",
"bank_ids",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_resources_by_bins",
"assessment_part_list",
"=",
"[",
"]",
"for",
"bank_id",
"in",
"bank_ids",
":",
"assessment_part_list",... | Gets the list of assessment part corresponding to a list of ``Banks``.
arg: bank_ids (osid.id.IdList): list of bank ``Ids``
return: (osid.assessment.authoring.AssessmentPartList) - list of
assessment parts
raise: NullArgument - ``bank_ids`` is ``null``
raise: Operat... | [
"Gets",
"the",
"list",
"of",
"assessment",
"part",
"corresponding",
"to",
"a",
"list",
"of",
"Banks",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1295-L1313 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartBankSession.get_bank_ids_by_assessment_part | def get_bank_ids_by_assessment_part(self, assessment_part_id):
"""Gets the ``Bank`` ``Ids`` mapped to an ``AssessmentPart``.
arg: assessment_part_id (osid.id.Id): ``Id`` of an
``AssessmentPart``
return: (osid.id.IdList) - list of banks
raise: NotFound - ``assessment... | python | def get_bank_ids_by_assessment_part(self, assessment_part_id):
"""Gets the ``Bank`` ``Ids`` mapped to an ``AssessmentPart``.
arg: assessment_part_id (osid.id.Id): ``Id`` of an
``AssessmentPart``
return: (osid.id.IdList) - list of banks
raise: NotFound - ``assessment... | [
"def",
"get_bank_ids_by_assessment_part",
"(",
"self",
",",
"assessment_part_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinSession.get_bin_ids_by_resource",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'ASSESSMENT_AUTHORING'",
",",
"loca... | Gets the ``Bank`` ``Ids`` mapped to an ``AssessmentPart``.
arg: assessment_part_id (osid.id.Id): ``Id`` of an
``AssessmentPart``
return: (osid.id.IdList) - list of banks
raise: NotFound - ``assessment_part_id`` is not found
raise: NullArgument - ``assessment_part_i... | [
"Gets",
"the",
"Bank",
"Ids",
"mapped",
"to",
"an",
"AssessmentPart",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1316-L1338 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartBankSession.get_banks_by_assessment_part | def get_banks_by_assessment_part(self, assessment_part_id):
"""Gets the ``Banks`` mapped to an ``AssessmentPart``.
arg: assessment_part_id (osid.id.Id): ``Id`` of an
``AssessmentPart``
return: (osid.assessment.BankList) - list of banks
raise: NotFound - ``assessment_... | python | def get_banks_by_assessment_part(self, assessment_part_id):
"""Gets the ``Banks`` mapped to an ``AssessmentPart``.
arg: assessment_part_id (osid.id.Id): ``Id`` of an
``AssessmentPart``
return: (osid.assessment.BankList) - list of banks
raise: NotFound - ``assessment_... | [
"def",
"get_banks_by_assessment_part",
"(",
"self",
",",
"assessment_part_id",
")",
":",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'ASSESSMENT'",
",",
"local",
"=",
"True",
")",
"lookup_session",
"=",
"mgr",
".",
"get_bank_lookup_session",
"(",
"prox... | Gets the ``Banks`` mapped to an ``AssessmentPart``.
arg: assessment_part_id (osid.id.Id): ``Id`` of an
``AssessmentPart``
return: (osid.assessment.BankList) - list of banks
raise: NotFound - ``assessment_part_id`` is not found
raise: NullArgument - ``assessment_part... | [
"Gets",
"the",
"Banks",
"mapped",
"to",
"an",
"AssessmentPart",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1341-L1357 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartBankAssignmentSession.get_assignable_bank_ids | def get_assignable_bank_ids(self, bank_id):
"""Gets a list of bank including and under the given bank node in which any assessment part can be assigned.
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
return: (osid.id.IdList) - list of assignable bank ``Ids``
raise: NullArgume... | python | def get_assignable_bank_ids(self, bank_id):
"""Gets a list of bank including and under the given bank node in which any assessment part can be assigned.
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
return: (osid.id.IdList) - list of assignable bank ``Ids``
raise: NullArgume... | [
"def",
"get_assignable_bank_ids",
"(",
"self",
",",
"bank_id",
")",
":",
"# This will likely be overridden by an authorization adapter",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'ASSESSMENT'",
",",
"local",
"=",
"True",
")",
"lookup_session",
"=",
"mgr",
... | Gets a list of bank including and under the given bank node in which any assessment part can be assigned.
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
return: (osid.id.IdList) - list of assignable bank ``Ids``
raise: NullArgument - ``bank_id`` is ``null``
raise: OperationF... | [
"Gets",
"a",
"list",
"of",
"bank",
"including",
"and",
"under",
"the",
"given",
"bank",
"node",
"in",
"which",
"any",
"assessment",
"part",
"can",
"be",
"assigned",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1426-L1443 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartBankAssignmentSession.assign_assessment_part_to_bank | def assign_assessment_part_to_bank(self, assessment_part_id, bank_id):
"""Adds an existing ``AssessmentPart`` to an ``Bank``.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise: Al... | python | def assign_assessment_part_to_bank(self, assessment_part_id, bank_id):
"""Adds an existing ``AssessmentPart`` to an ``Bank``.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise: Al... | [
"def",
"assign_assessment_part_to_bank",
"(",
"self",
",",
"assessment_part_id",
",",
"bank_id",
")",
":",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'ASSESSMENT'",
",",
"local",
"=",
"True",
")",
"lookup_session",
"=",
"mgr",
".",
"get_bank_lookup_se... | Adds an existing ``AssessmentPart`` to an ``Bank``.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise: AlreadyExists - ``assessment_part_id`` is already
assigned to ``bank... | [
"Adds",
"an",
"existing",
"AssessmentPart",
"to",
"an",
"Bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1465-L1485 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartBankAssignmentSession.unassign_assessment_part_from_bank | def unassign_assessment_part_from_bank(self, assessment_part_id, bank_id):
"""Removes an ``AssessmentPart`` from an ``Bank``.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise: No... | python | def unassign_assessment_part_from_bank(self, assessment_part_id, bank_id):
"""Removes an ``AssessmentPart`` from an ``Bank``.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise: No... | [
"def",
"unassign_assessment_part_from_bank",
"(",
"self",
",",
"assessment_part_id",
",",
"bank_id",
")",
":",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'ASSESSMENT'",
",",
"local",
"=",
"True",
")",
"lookup_session",
"=",
"mgr",
".",
"get_bank_looku... | Removes an ``AssessmentPart`` from an ``Bank``.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank``
raise: NotFound - ``assessment_part_id`` or ``bank_id`` not
found or ``assessme... | [
"Removes",
"an",
"AssessmentPart",
"from",
"an",
"Bank",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1488-L1507 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartBankAssignmentSession.reassign_assessment_part_to_bank | def reassign_assessment_part_to_bank(self, assessment_part_id, from_biank_id, to_bank_id):
"""Moves an ``AssessmentPart`` from one ``Bank`` to another.
Mappings to other ``Banks`` are unaffected.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
... | python | def reassign_assessment_part_to_bank(self, assessment_part_id, from_biank_id, to_bank_id):
"""Moves an ``AssessmentPart`` from one ``Bank`` to another.
Mappings to other ``Banks`` are unaffected.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
... | [
"def",
"reassign_assessment_part_to_bank",
"(",
"self",
",",
"assessment_part_id",
",",
"from_biank_id",
",",
"to_bank_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceBinAssignmentSession.reassign_resource_to_bin",
"self",
".",
"assign_assessment_part_to_ba... | Moves an ``AssessmentPart`` from one ``Bank`` to another.
Mappings to other ``Banks`` are unaffected.
arg: assessment_part_id (osid.id.Id): the ``Id`` of the
``AssessmentPart``
arg: from_biank_id (osid.id.Id): the ``Id`` of the current
``Bank``
arg... | [
"Moves",
"an",
"AssessmentPart",
"from",
"one",
"Bank",
"to",
"another",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1510-L1538 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartItemSession.get_assessment_part_items | def get_assessment_part_items(self, assessment_part_id):
"""Gets the list of items mapped to the given ``AssessmentPart``.
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 throu... | python | def get_assessment_part_items(self, assessment_part_id):
"""Gets the list of items mapped to the given ``AssessmentPart``.
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 throu... | [
"def",
"get_assessment_part_items",
"(",
"self",
",",
"assessment_part_id",
")",
":",
"mgr",
"=",
"self",
".",
"_get_provider_manager",
"(",
"'ASSESSMENT_AUTHORING'",
",",
"local",
"=",
"True",
")",
"lookup_session",
"=",
"mgr",
".",
"get_assessment_part_lookup_sessio... | Gets the list of items mapped to the given ``AssessmentPart``.
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.
arg: assessment_part_id (osid.id.Id): `... | [
"Gets",
"the",
"list",
"of",
"items",
"mapped",
"to",
"the",
"given",
"AssessmentPart",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1658-L1685 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartItemSession.get_assessment_parts_by_item | def get_assessment_parts_by_item(self, item_id):
"""Gets the assessment parts containing the given item.
In plenary mode, the returned list contains all known assessment
parts or an error results. Otherwise, the returned list may
contain only those assessment parts that are accessible t... | python | def get_assessment_parts_by_item(self, item_id):
"""Gets the assessment parts containing the given item.
In plenary mode, the returned list contains all known assessment
parts or an error results. Otherwise, the returned list may
contain only those assessment parts that are accessible t... | [
"def",
"get_assessment_parts_by_item",
"(",
"self",
",",
"item_id",
")",
":",
"# Implemented from template for",
"# osid.repository.AssetCompositionSession.get_compositions_by_asset",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment_authoring'",
",",
"collection",
"=",
... | Gets the assessment parts containing the given item.
In plenary mode, the returned list contains all known assessment
parts or an error results. Otherwise, the returned list may
contain only those assessment parts that are accessible through
this session.
arg: item_id (osid.... | [
"Gets",
"the",
"assessment",
"parts",
"containing",
"the",
"given",
"item",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1688-L1714 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartItemDesignSession.add_item | def add_item(self, item_id, assessment_part_id):
"""Appends an item to an assessment part.
arg: item_id (osid.id.Id): ``Id`` of the ``Item``
arg: assessment_part_id (osid.id.Id): ``Id`` of the
``AssessmentPart``
raise: AlreadyExists - ``item_id`` already part of
... | python | def add_item(self, item_id, assessment_part_id):
"""Appends an item to an assessment part.
arg: item_id (osid.id.Id): ``Id`` of the ``Item``
arg: assessment_part_id (osid.id.Id): ``Id`` of the
``AssessmentPart``
raise: AlreadyExists - ``item_id`` already part of
... | [
"def",
"add_item",
"(",
"self",
",",
"item_id",
",",
"assessment_part_id",
")",
":",
"# The item found check may want to be run through _get_provider_manager",
"# so as to ensure access control:",
"from",
"dlkit",
".",
"abstract_osid",
".",
"id",
".",
"primitives",
"import",
... | Appends an item to an assessment part.
arg: item_id (osid.id.Id): ``Id`` of the ``Item``
arg: assessment_part_id (osid.id.Id): ``Id`` of the
``AssessmentPart``
raise: AlreadyExists - ``item_id`` already part of
``assessment_part_id``
raise: NotFou... | [
"Appends",
"an",
"item",
"to",
"an",
"assessment",
"part",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1789-L1834 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartItemDesignSession.move_item_ahead | def move_item_ahead(self, item_id, assessment_part_id, reference_id):
"""Reorders items in an assessment part by moving the specified item in front of a reference item.
arg: item_id (osid.id.Id): ``Id`` of the ``Item``
arg: assessment_part_id (osid.id.Id): ``Id`` of the
``... | python | def move_item_ahead(self, item_id, assessment_part_id, reference_id):
"""Reorders items in an assessment part by moving the specified item in front of a reference item.
arg: item_id (osid.id.Id): ``Id`` of the ``Item``
arg: assessment_part_id (osid.id.Id): ``Id`` of the
``... | [
"def",
"move_item_ahead",
"(",
"self",
",",
"item_id",
",",
"assessment_part_id",
",",
"reference_id",
")",
":",
"if",
"(",
"not",
"isinstance",
"(",
"assessment_part_id",
",",
"ABCId",
")",
"and",
"assessment_part_id",
".",
"get_identifier_namespace",
"(",
")",
... | Reorders items in an assessment part by moving the specified item in front of a reference item.
arg: item_id (osid.id.Id): ``Id`` of the ``Item``
arg: assessment_part_id (osid.id.Id): ``Id`` of the
``AssessmentPartId``
arg: reference_id (osid.id.Id): ``Id`` of the refer... | [
"Reorders",
"items",
"in",
"an",
"assessment",
"part",
"by",
"moving",
"the",
"specified",
"item",
"in",
"front",
"of",
"a",
"reference",
"item",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1837-L1859 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartItemDesignSession.move_item_behind | def move_item_behind(self, item_id, assessment_part_id, reference_id):
"""Reorders items in an assessment part by moving the specified item behind of a reference item.
arg: item_id (osid.id.Id): ``Id`` of the ``Item``
arg: assessment_part_id (osid.id.Id): ``Id of the
Asses... | python | def move_item_behind(self, item_id, assessment_part_id, reference_id):
"""Reorders items in an assessment part by moving the specified item behind of a reference item.
arg: item_id (osid.id.Id): ``Id`` of the ``Item``
arg: assessment_part_id (osid.id.Id): ``Id of the
Asses... | [
"def",
"move_item_behind",
"(",
"self",
",",
"item_id",
",",
"assessment_part_id",
",",
"reference_id",
")",
":",
"if",
"(",
"not",
"isinstance",
"(",
"assessment_part_id",
",",
"ABCId",
")",
"and",
"assessment_part_id",
".",
"get_identifier_namespace",
"(",
")",
... | Reorders items in an assessment part by moving the specified item behind of a reference item.
arg: item_id (osid.id.Id): ``Id`` of the ``Item``
arg: assessment_part_id (osid.id.Id): ``Id of the
AssessmentPartId``
arg: reference_id (osid.id.Id): ``Id`` of the reference
... | [
"Reorders",
"items",
"in",
"an",
"assessment",
"part",
"by",
"moving",
"the",
"specified",
"item",
"behind",
"of",
"a",
"reference",
"item",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1862-L1884 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartItemDesignSession.order_items | def order_items(self, item_ids, assessment_part_id):
"""Reorders a set of items in an assessment part.
arg: item_ids (osid.id.Id[]): ``Ids`` for a set of ``Items``
arg: assessment_part_id (osid.id.Id): ``Id`` of the
``AssessmentPartId``
raise: NotFound - ``assessm... | python | def order_items(self, item_ids, assessment_part_id):
"""Reorders a set of items in an assessment part.
arg: item_ids (osid.id.Id[]): ``Ids`` for a set of ``Items``
arg: assessment_part_id (osid.id.Id): ``Id`` of the
``AssessmentPartId``
raise: NotFound - ``assessm... | [
"def",
"order_items",
"(",
"self",
",",
"item_ids",
",",
"assessment_part_id",
")",
":",
"if",
"(",
"not",
"isinstance",
"(",
"assessment_part_id",
",",
"ABCId",
")",
"and",
"assessment_part_id",
".",
"get_identifier_namespace",
"(",
")",
"!=",
"'assessment_author... | Reorders a set of items in an assessment part.
arg: item_ids (osid.id.Id[]): ``Ids`` for a set of ``Items``
arg: assessment_part_id (osid.id.Id): ``Id`` of the
``AssessmentPartId``
raise: NotFound - ``assessment_part_id`` not found or, an
``item_id`` not r... | [
"Reorders",
"a",
"set",
"of",
"items",
"in",
"an",
"assessment",
"part",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1887-L1906 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartItemDesignSession.remove_item | def remove_item(self, item_id, assessment_part_id):
"""Removes an ``Item`` from an ``AssessmentPartId``.
arg: item_id (osid.id.Id): ``Id`` of the ``Item``
arg: assessment_part_id (osid.id.Id): ``Id`` of the
``AssessmentPartId``
raise: NotFound - ``item_id`` ``not... | python | def remove_item(self, item_id, assessment_part_id):
"""Removes an ``Item`` from an ``AssessmentPartId``.
arg: item_id (osid.id.Id): ``Id`` of the ``Item``
arg: assessment_part_id (osid.id.Id): ``Id`` of the
``AssessmentPartId``
raise: NotFound - ``item_id`` ``not... | [
"def",
"remove_item",
"(",
"self",
",",
"item_id",
",",
"assessment_part_id",
")",
":",
"if",
"(",
"not",
"isinstance",
"(",
"assessment_part_id",
",",
"ABCId",
")",
"and",
"assessment_part_id",
".",
"get_identifier_namespace",
"(",
")",
"!=",
"'assessment_authori... | Removes an ``Item`` from an ``AssessmentPartId``.
arg: item_id (osid.id.Id): ``Id`` of the ``Item``
arg: assessment_part_id (osid.id.Id): ``Id`` of the
``AssessmentPartId``
raise: NotFound - ``item_id`` ``not found in
assessment_part_id``
raise: ... | [
"Removes",
"an",
"Item",
"from",
"an",
"AssessmentPartId",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1909-L1932 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | AssessmentPartItemDesignSession._get_assessment_part_collection | def _get_assessment_part_collection(self, assessment_part_id):
"""Returns a Mongo Collection and AssessmentPart given a AssessmentPart Id"""
collection = JSONClientValidated('assessment_authoring',
collection='AssessmentPart',
... | python | def _get_assessment_part_collection(self, assessment_part_id):
"""Returns a Mongo Collection and AssessmentPart given a AssessmentPart Id"""
collection = JSONClientValidated('assessment_authoring',
collection='AssessmentPart',
... | [
"def",
"_get_assessment_part_collection",
"(",
"self",
",",
"assessment_part_id",
")",
":",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment_authoring'",
",",
"collection",
"=",
"'AssessmentPart'",
",",
"runtime",
"=",
"self",
".",
"_runtime",
")",
"assessm... | Returns a Mongo Collection and AssessmentPart given a AssessmentPart Id | [
"Returns",
"a",
"Mongo",
"Collection",
"and",
"AssessmentPart",
"given",
"a",
"AssessmentPart",
"Id"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L1934-L1942 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | SequenceRuleLookupSession.get_sequence_rule | def get_sequence_rule(self, sequence_rule_id):
"""Gets the ``SequenceRule`` specified by its ``Id``.
arg: sequence_rule_id (osid.id.Id): ``Id`` of the
``SequenceRule``
return: (osid.assessment.authoring.SequenceRule) - the sequence
rule
raise: NotFoun... | python | def get_sequence_rule(self, sequence_rule_id):
"""Gets the ``SequenceRule`` specified by its ``Id``.
arg: sequence_rule_id (osid.id.Id): ``Id`` of the
``SequenceRule``
return: (osid.assessment.authoring.SequenceRule) - the sequence
rule
raise: NotFoun... | [
"def",
"get_sequence_rule",
"(",
"self",
",",
"sequence_rule_id",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resource",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment... | Gets the ``SequenceRule`` specified by its ``Id``.
arg: sequence_rule_id (osid.id.Id): ``Id`` of the
``SequenceRule``
return: (osid.assessment.authoring.SequenceRule) - the sequence
rule
raise: NotFound - ``sequence_rule_id`` not found
raise: NullArg... | [
"Gets",
"the",
"SequenceRule",
"specified",
"by",
"its",
"Id",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L2081-L2104 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | SequenceRuleLookupSession.get_sequence_rules_by_ids | def get_sequence_rules_by_ids(self, sequence_rule_ids):
"""Gets a ``SequenceRuleList`` corresponding to the given ``IdList``.
arg: sequence_rule_ids (osid.id.IdList): the list of ``Ids``
to retrieve
return: (osid.assessment.authoring.SequenceRuleList) - the
re... | python | def get_sequence_rules_by_ids(self, sequence_rule_ids):
"""Gets a ``SequenceRuleList`` corresponding to the given ``IdList``.
arg: sequence_rule_ids (osid.id.IdList): the list of ``Ids``
to retrieve
return: (osid.assessment.authoring.SequenceRuleList) - the
re... | [
"def",
"get_sequence_rules_by_ids",
"(",
"self",
",",
"sequence_rule_ids",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resources_by_ids",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated",
"(... | Gets a ``SequenceRuleList`` corresponding to the given ``IdList``.
arg: sequence_rule_ids (osid.id.IdList): the list of ``Ids``
to retrieve
return: (osid.assessment.authoring.SequenceRuleList) - the
returned ``SequenceRule`` list
raise: NotFound - a ``Id was`... | [
"Gets",
"a",
"SequenceRuleList",
"corresponding",
"to",
"the",
"given",
"IdList",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L2107-L2140 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | SequenceRuleLookupSession.get_sequence_rules_by_genus_type | def get_sequence_rules_by_genus_type(self, sequence_rule_genus_type):
"""Gets a ``SequenceRuleList`` corresponding to the given sequence rule genus ``Type`` which does not include sequence rule of genus types derived from the specified ``Type``.
arg: sequence_rule_genus_type (osid.type.Type): a sequ... | python | def get_sequence_rules_by_genus_type(self, sequence_rule_genus_type):
"""Gets a ``SequenceRuleList`` corresponding to the given sequence rule genus ``Type`` which does not include sequence rule of genus types derived from the specified ``Type``.
arg: sequence_rule_genus_type (osid.type.Type): a sequ... | [
"def",
"get_sequence_rules_by_genus_type",
"(",
"self",
",",
"sequence_rule_genus_type",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resources_by_genus_type",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONC... | Gets a ``SequenceRuleList`` corresponding to the given sequence rule genus ``Type`` which does not include sequence rule of genus types derived from the specified ``Type``.
arg: sequence_rule_genus_type (osid.type.Type): a sequence
rule genus type
return: (osid.assessment.authoring.S... | [
"Gets",
"a",
"SequenceRuleList",
"corresponding",
"to",
"the",
"given",
"sequence",
"rule",
"genus",
"Type",
"which",
"does",
"not",
"include",
"sequence",
"rule",
"of",
"genus",
"types",
"derived",
"from",
"the",
"specified",
"Type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L2143-L2165 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | SequenceRuleLookupSession.get_sequence_rules_for_assessment_part | def get_sequence_rules_for_assessment_part(self, assessment_part_id):
"""Gets a ``SequenceRuleList`` for the given source assessment part.
arg: assessment_part_id (osid.id.Id): an assessment part
``Id``
return: (osid.assessment.authoring.SequenceRuleList) - the
... | python | def get_sequence_rules_for_assessment_part(self, assessment_part_id):
"""Gets a ``SequenceRuleList`` for the given source assessment part.
arg: assessment_part_id (osid.id.Id): an assessment part
``Id``
return: (osid.assessment.authoring.SequenceRuleList) - the
... | [
"def",
"get_sequence_rules_for_assessment_part",
"(",
"self",
",",
"assessment_part_id",
")",
":",
"# Implemented from template for",
"# osid.learning.ActivityLookupSession.get_activities_for_objective_template",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"="... | Gets a ``SequenceRuleList`` for the given source assessment part.
arg: assessment_part_id (osid.id.Id): an assessment part
``Id``
return: (osid.assessment.authoring.SequenceRuleList) - the
returned ``SequenceRule`` list
raise: NullArgument - ``assessment_part... | [
"Gets",
"a",
"SequenceRuleList",
"for",
"the",
"given",
"source",
"assessment",
"part",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L2206-L2228 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | SequenceRuleLookupSession.get_sequence_rules_for_assessment | def get_sequence_rules_for_assessment(self, assessment_id):
"""Gets a ``SequenceRuleList`` for an entire assessment.
arg: assessment_id (osid.id.Id): an assessment ``Id``
return: (osid.assessment.authoring.SequenceRuleList) - the
returned ``SequenceRule`` list
raise: ... | python | def get_sequence_rules_for_assessment(self, assessment_id):
"""Gets a ``SequenceRuleList`` for an entire assessment.
arg: assessment_id (osid.id.Id): an assessment ``Id``
return: (osid.assessment.authoring.SequenceRuleList) - the
returned ``SequenceRule`` list
raise: ... | [
"def",
"get_sequence_rules_for_assessment",
"(",
"self",
",",
"assessment_id",
")",
":",
"# First, recursively get all the partIds for the assessment",
"def",
"get_all_children_part_ids",
"(",
"part",
")",
":",
"child_ids",
"=",
"[",
"]",
"if",
"part",
".",
"has_children"... | Gets a ``SequenceRuleList`` for an entire assessment.
arg: assessment_id (osid.id.Id): an assessment ``Id``
return: (osid.assessment.authoring.SequenceRuleList) - the
returned ``SequenceRule`` list
raise: NullArgument - ``assessment_id`` is ``null``
raise: Operation... | [
"Gets",
"a",
"SequenceRuleList",
"for",
"an",
"entire",
"assessment",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L2266-L2310 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | SequenceRuleLookupSession.get_sequence_rules | def get_sequence_rules(self):
"""Gets all ``SequenceRules``.
return: (osid.assessment.authoring.SequenceRuleList) - the
returned ``SequenceRule`` list
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure
*complianc... | python | def get_sequence_rules(self):
"""Gets all ``SequenceRules``.
return: (osid.assessment.authoring.SequenceRuleList) - the
returned ``SequenceRule`` list
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure
*complianc... | [
"def",
"get_sequence_rules",
"(",
"self",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceLookupSession.get_resources",
"# NOTE: This implementation currently ignores plenary view",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment_authoring'",
",",
"col... | Gets all ``SequenceRules``.
return: (osid.assessment.authoring.SequenceRuleList) - the
returned ``SequenceRule`` list
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure
*compliance: mandatory -- This method must be imple... | [
"Gets",
"all",
"SequenceRules",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L2312-L2329 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | SequenceRuleAdminSession.get_sequence_rule_form_for_create | def get_sequence_rule_form_for_create(self, assessment_part_id, next_assessment_part_id, sequence_rule_record_types):
"""Gets the sequence rule form for creating new sequence rules between two assessment parts.
A new form should be requested for each create transaction.
arg: assessment_part... | python | def get_sequence_rule_form_for_create(self, assessment_part_id, next_assessment_part_id, sequence_rule_record_types):
"""Gets the sequence rule form for creating new sequence rules between two assessment parts.
A new form should be requested for each create transaction.
arg: assessment_part... | [
"def",
"get_sequence_rule_form_for_create",
"(",
"self",
",",
"assessment_part_id",
",",
"next_assessment_part_id",
",",
"sequence_rule_record_types",
")",
":",
"for",
"arg",
"in",
"sequence_rule_record_types",
":",
"if",
"not",
"isinstance",
"(",
"arg",
",",
"ABCId",
... | Gets the sequence rule form for creating new sequence rules between two assessment parts.
A new form should be requested for each create transaction.
arg: assessment_part_id (osid.id.Id): the source assessment
part ``Id``
arg: next_assessment_part_id (osid.id.Id): the tar... | [
"Gets",
"the",
"sequence",
"rule",
"form",
"for",
"creating",
"new",
"sequence",
"rules",
"between",
"two",
"assessment",
"parts",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L2431-L2479 |
mitsei/dlkit | dlkit/json_/assessment_authoring/sessions.py | SequenceRuleAdminSession.create_sequence_rule | def create_sequence_rule(self, sequence_rule_form):
"""Creates a new ``SequenceRule``.
arg: sequence_rule_form
(osid.assessment.authoring.SequenceRuleForm): the form
for this ``SequenceRule``
return: (osid.assessment.authoring.SequenceRule) - the new
... | python | def create_sequence_rule(self, sequence_rule_form):
"""Creates a new ``SequenceRule``.
arg: sequence_rule_form
(osid.assessment.authoring.SequenceRuleForm): the form
for this ``SequenceRule``
return: (osid.assessment.authoring.SequenceRule) - the new
... | [
"def",
"create_sequence_rule",
"(",
"self",
",",
"sequence_rule_form",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceAdminSession.create_resource_template",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment_authoring'",
",",
"collection",
"=",
"'... | Creates a new ``SequenceRule``.
arg: sequence_rule_form
(osid.assessment.authoring.SequenceRuleForm): the form
for this ``SequenceRule``
return: (osid.assessment.authoring.SequenceRule) - the new
``SequenceRule``
raise: IllegalState - ``sequen... | [
"Creates",
"a",
"new",
"SequenceRule",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/sessions.py#L2482-L2526 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.