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/handcar/repository/sessions.py | RepositoryAdminSession.can_delete_repositories | def can_delete_repositories(self):
"""Tests if this user can delete ``Repositories``.
A return of true does not guarantee successful authorization. A
return of false indicates that it is known deleting a
``Repository`` will result in a ``PermissionDenied``. This is
intended as a... | python | def can_delete_repositories(self):
"""Tests if this user can delete ``Repositories``.
A return of true does not guarantee successful authorization. A
return of false indicates that it is known deleting a
``Repository`` will result in a ``PermissionDenied``. This is
intended as a... | [
"def",
"can_delete_repositories",
"(",
"self",
")",
":",
"url_path",
"=",
"construct_url",
"(",
"'authorization'",
",",
"bank_id",
"=",
"self",
".",
"_catalog_idstr",
")",
"return",
"self",
".",
"_get_request",
"(",
"url_path",
")",
"[",
"'objectiveBankHints'",
... | Tests if this user can delete ``Repositories``.
A return of true does not guarantee successful authorization. A
return of false indicates that it is known deleting a
``Repository`` will result in a ``PermissionDenied``. This is
intended as a hint to an application that may not wish to o... | [
"Tests",
"if",
"this",
"user",
"can",
"delete",
"Repositories",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1947-L1965 |
mitsei/dlkit | dlkit/handcar/repository/sessions.py | RepositoryAdminSession.delete_repository | def delete_repository(self, repository_id=None):
"""Deletes a ``Repository``.
:param repository_id: the ``Id`` of the ``Repository`` to remove
:type repository_id: ``osid.id.Id``
:raise: ``NotFound`` -- ``repository_id`` not found
:raise: ``NullArgument`` -- ``repository_id`` is... | python | def delete_repository(self, repository_id=None):
"""Deletes a ``Repository``.
:param repository_id: the ``Id`` of the ``Repository`` to remove
:type repository_id: ``osid.id.Id``
:raise: ``NotFound`` -- ``repository_id`` not found
:raise: ``NullArgument`` -- ``repository_id`` is... | [
"def",
"delete_repository",
"(",
"self",
",",
"repository_id",
"=",
"None",
")",
":",
"if",
"repository_id",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"if",
"not",
"isinstance",
"(",
"repository_id",
",",
"Id",
")",
":",
"raise",
"InvalidArgument... | Deletes a ``Repository``.
:param repository_id: the ``Id`` of the ``Repository`` to remove
:type repository_id: ``osid.id.Id``
:raise: ``NotFound`` -- ``repository_id`` not found
:raise: ``NullArgument`` -- ``repository_id`` is ``null``
:raise: ``OperationFailed`` -- unable to c... | [
"Deletes",
"a",
"Repository",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/sessions.py#L1967-L1997 |
rembish/cfb | cfb/exceptions.py | MaybeDefected.raise_if | def raise_if(self, exception, message, *args, **kwargs):
"""
If current exception has smaller priority than minimum, subclass of
this class only warns user, otherwise normal exception will be raised.
"""
if issubclass(exception, self.minimum_defect):
raise exception(*... | python | def raise_if(self, exception, message, *args, **kwargs):
"""
If current exception has smaller priority than minimum, subclass of
this class only warns user, otherwise normal exception will be raised.
"""
if issubclass(exception, self.minimum_defect):
raise exception(*... | [
"def",
"raise_if",
"(",
"self",
",",
"exception",
",",
"message",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"issubclass",
"(",
"exception",
",",
"self",
".",
"minimum_defect",
")",
":",
"raise",
"exception",
"(",
"*",
"args",
",",
"*... | If current exception has smaller priority than minimum, subclass of
this class only warns user, otherwise normal exception will be raised. | [
"If",
"current",
"exception",
"has",
"smaller",
"priority",
"than",
"minimum",
"subclass",
"of",
"this",
"class",
"only",
"warns",
"user",
"otherwise",
"normal",
"exception",
"will",
"be",
"raised",
"."
] | train | https://github.com/rembish/cfb/blob/9bcd75caad4353b186ce518d2da78aeeb52d3131/cfb/exceptions.py#L48-L55 |
svetlyak40wt/python-cl-conditions | src/conditions/signals.py | signal | def signal(e):
"""
Some docstrings.
"""
callback = find_handler(e)
if callback is None:
if _activate_debugger:
print 'Handler for error {0} not found'.format(type(e))
traceback.print_stack()
set_trace()
raise e
else:
return callback(e) | python | def signal(e):
"""
Some docstrings.
"""
callback = find_handler(e)
if callback is None:
if _activate_debugger:
print 'Handler for error {0} not found'.format(type(e))
traceback.print_stack()
set_trace()
raise e
else:
return callback(e) | [
"def",
"signal",
"(",
"e",
")",
":",
"callback",
"=",
"find_handler",
"(",
"e",
")",
"if",
"callback",
"is",
"None",
":",
"if",
"_activate_debugger",
":",
"print",
"'Handler for error {0} not found'",
".",
"format",
"(",
"type",
"(",
"e",
")",
")",
"traceb... | Some docstrings. | [
"Some",
"docstrings",
"."
] | train | https://github.com/svetlyak40wt/python-cl-conditions/blob/709dfd55f2b8cf7eb9b7d86a6b70c8a3feed4b10/src/conditions/signals.py#L19-L31 |
mitsei/dlkit | dlkit/records/assessment/basic/wrong_answers.py | WrongAnswerItemRecord.get_answers | def get_answers(self):
""" override this so only right answers are returned
:return:
"""
all_answers = self.my_osid_object._my_map['answers']
right_answers = [a for a in all_answers
if a['genusTypeId'] != str(WRONG_ANSWER_GENUS_TYPE)]
return Answe... | python | def get_answers(self):
""" override this so only right answers are returned
:return:
"""
all_answers = self.my_osid_object._my_map['answers']
right_answers = [a for a in all_answers
if a['genusTypeId'] != str(WRONG_ANSWER_GENUS_TYPE)]
return Answe... | [
"def",
"get_answers",
"(",
"self",
")",
":",
"all_answers",
"=",
"self",
".",
"my_osid_object",
".",
"_my_map",
"[",
"'answers'",
"]",
"right_answers",
"=",
"[",
"a",
"for",
"a",
"in",
"all_answers",
"if",
"a",
"[",
"'genusTypeId'",
"]",
"!=",
"str",
"("... | override this so only right answers are returned
:return: | [
"override",
"this",
"so",
"only",
"right",
"answers",
"are",
"returned",
":",
"return",
":"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/wrong_answers.py#L26-L35 |
mitsei/dlkit | dlkit/records/assessment/basic/wrong_answers.py | WrongAnswerItemRecord.get_answer_ids | def get_answer_ids(self):
""" override this so only right answer ids are returned
:return:
"""
id_list = []
for answer in self.get_answers():
id_list.append(answer.get_id())
return IdList(id_list) | python | def get_answer_ids(self):
""" override this so only right answer ids are returned
:return:
"""
id_list = []
for answer in self.get_answers():
id_list.append(answer.get_id())
return IdList(id_list) | [
"def",
"get_answer_ids",
"(",
"self",
")",
":",
"id_list",
"=",
"[",
"]",
"for",
"answer",
"in",
"self",
".",
"get_answers",
"(",
")",
":",
"id_list",
".",
"append",
"(",
"answer",
".",
"get_id",
"(",
")",
")",
"return",
"IdList",
"(",
"id_list",
")"... | override this so only right answer ids are returned
:return: | [
"override",
"this",
"so",
"only",
"right",
"answer",
"ids",
"are",
"returned",
":",
"return",
":"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/wrong_answers.py#L39-L46 |
mitsei/dlkit | dlkit/records/assessment/basic/wrong_answers.py | WrongAnswerItemRecord.get_wrong_answers | def get_wrong_answers(self):
""" provide this method to return only wrong answers
:return:
"""
all_answers = self.my_osid_object._my_map['answers']
wrong_answers = [a for a in all_answers
if a['genusTypeId'] == str(WRONG_ANSWER_GENUS_TYPE)]
return... | python | def get_wrong_answers(self):
""" provide this method to return only wrong answers
:return:
"""
all_answers = self.my_osid_object._my_map['answers']
wrong_answers = [a for a in all_answers
if a['genusTypeId'] == str(WRONG_ANSWER_GENUS_TYPE)]
return... | [
"def",
"get_wrong_answers",
"(",
"self",
")",
":",
"all_answers",
"=",
"self",
".",
"my_osid_object",
".",
"_my_map",
"[",
"'answers'",
"]",
"wrong_answers",
"=",
"[",
"a",
"for",
"a",
"in",
"all_answers",
"if",
"a",
"[",
"'genusTypeId'",
"]",
"==",
"str",... | provide this method to return only wrong answers
:return: | [
"provide",
"this",
"method",
"to",
"return",
"only",
"wrong",
"answers",
":",
"return",
":"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/wrong_answers.py#L50-L59 |
mitsei/dlkit | dlkit/records/assessment/basic/wrong_answers.py | WrongAnswerItemRecord.get_wrong_answer_ids | def get_wrong_answer_ids(self):
"""provide this method to return only wrong answer ids"""
id_list = []
for answer in self.get_wrong_answers():
id_list.append(answer.get_id())
return IdList(id_list) | python | def get_wrong_answer_ids(self):
"""provide this method to return only wrong answer ids"""
id_list = []
for answer in self.get_wrong_answers():
id_list.append(answer.get_id())
return IdList(id_list) | [
"def",
"get_wrong_answer_ids",
"(",
"self",
")",
":",
"id_list",
"=",
"[",
"]",
"for",
"answer",
"in",
"self",
".",
"get_wrong_answers",
"(",
")",
":",
"id_list",
".",
"append",
"(",
"answer",
".",
"get_id",
"(",
")",
")",
"return",
"IdList",
"(",
"id_... | provide this method to return only wrong answer ids | [
"provide",
"this",
"method",
"to",
"return",
"only",
"wrong",
"answer",
"ids"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/wrong_answers.py#L63-L68 |
delfick/harpoon | harpoon/collector.py | Collector.extra_prepare | def extra_prepare(self, configuration, args_dict):
"""
Called before the configuration.converters are activated
Here we make sure that we have harpoon options from ``args_dict`` in
the configuration.
We then load all the harpoon modules as specified by the
``harpoon.add... | python | def extra_prepare(self, configuration, args_dict):
"""
Called before the configuration.converters are activated
Here we make sure that we have harpoon options from ``args_dict`` in
the configuration.
We then load all the harpoon modules as specified by the
``harpoon.add... | [
"def",
"extra_prepare",
"(",
"self",
",",
"configuration",
",",
"args_dict",
")",
":",
"harpoon",
"=",
"self",
".",
"find_harpoon_options",
"(",
"configuration",
",",
"args_dict",
")",
"self",
".",
"register",
"=",
"self",
".",
"setup_addon_register",
"(",
"ha... | Called before the configuration.converters are activated
Here we make sure that we have harpoon options from ``args_dict`` in
the configuration.
We then load all the harpoon modules as specified by the
``harpoon.addons`` setting.
Finally we inject into the configuration:
... | [
"Called",
"before",
"the",
"configuration",
".",
"converters",
"are",
"activated"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/collector.py#L64-L108 |
delfick/harpoon | harpoon/collector.py | Collector.find_harpoon_options | def find_harpoon_options(self, configuration, args_dict):
"""Return us all the harpoon options"""
d = lambda r: {} if r in (None, "", NotSpecified) else r
return MergedOptions.using(
dict(d(configuration.get('harpoon')).items())
, dict(d(args_dict.get("harpoon")).items(... | python | def find_harpoon_options(self, configuration, args_dict):
"""Return us all the harpoon options"""
d = lambda r: {} if r in (None, "", NotSpecified) else r
return MergedOptions.using(
dict(d(configuration.get('harpoon')).items())
, dict(d(args_dict.get("harpoon")).items(... | [
"def",
"find_harpoon_options",
"(",
"self",
",",
"configuration",
",",
"args_dict",
")",
":",
"d",
"=",
"lambda",
"r",
":",
"{",
"}",
"if",
"r",
"in",
"(",
"None",
",",
"\"\"",
",",
"NotSpecified",
")",
"else",
"r",
"return",
"MergedOptions",
".",
"usi... | Return us all the harpoon options | [
"Return",
"us",
"all",
"the",
"harpoon",
"options"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/collector.py#L110-L116 |
delfick/harpoon | harpoon/collector.py | Collector.setup_addon_register | def setup_addon_register(self, harpoon):
"""Setup our addon register"""
# Create the addon getter and register the crosshairs namespace
self.addon_getter = AddonGetter()
self.addon_getter.add_namespace("harpoon.crosshairs", Result.FieldSpec(), Addon.FieldSpec())
# Initiate the a... | python | def setup_addon_register(self, harpoon):
"""Setup our addon register"""
# Create the addon getter and register the crosshairs namespace
self.addon_getter = AddonGetter()
self.addon_getter.add_namespace("harpoon.crosshairs", Result.FieldSpec(), Addon.FieldSpec())
# Initiate the a... | [
"def",
"setup_addon_register",
"(",
"self",
",",
"harpoon",
")",
":",
"# Create the addon getter and register the crosshairs namespace",
"self",
".",
"addon_getter",
"=",
"AddonGetter",
"(",
")",
"self",
".",
"addon_getter",
".",
"add_namespace",
"(",
"\"harpoon.crosshair... | Setup our addon register | [
"Setup",
"our",
"addon",
"register"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/collector.py#L118-L141 |
delfick/harpoon | harpoon/collector.py | Collector.extra_prepare_after_activation | def extra_prepare_after_activation(self, configuration, args_dict):
"""
Called after the configuration.converters are activated
Here we create our ``task_maker`` helper that we pass into ``post_register``
for our ``option_merge_addon_hook`` functions.
We also create a ``task_fi... | python | def extra_prepare_after_activation(self, configuration, args_dict):
"""
Called after the configuration.converters are activated
Here we create our ``task_maker`` helper that we pass into ``post_register``
for our ``option_merge_addon_hook`` functions.
We also create a ``task_fi... | [
"def",
"extra_prepare_after_activation",
"(",
"self",
",",
"configuration",
",",
"args_dict",
")",
":",
"def",
"task_maker",
"(",
"name",
",",
"description",
"=",
"None",
",",
"action",
"=",
"None",
",",
"label",
"=",
"\"Project\"",
",",
"*",
"*",
"options",... | Called after the configuration.converters are activated
Here we create our ``task_maker`` helper that we pass into ``post_register``
for our ``option_merge_addon_hook`` functions.
We also create a ``task_finder`` for doing task finding related duties. | [
"Called",
"after",
"the",
"configuration",
".",
"converters",
"are",
"activated"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/collector.py#L143-L165 |
delfick/harpoon | harpoon/collector.py | Collector.add_configuration | def add_configuration(self, configuration, collect_another_source, done, result, src):
"""
Used to add a file to the configuration, result here is the yaml.load
of the src.
If the configuration we're reading in has ``harpoon.extra_files``
then this is treated as a list of string... | python | def add_configuration(self, configuration, collect_another_source, done, result, src):
"""
Used to add a file to the configuration, result here is the yaml.load
of the src.
If the configuration we're reading in has ``harpoon.extra_files``
then this is treated as a list of string... | [
"def",
"add_configuration",
"(",
"self",
",",
"configuration",
",",
"collect_another_source",
",",
"done",
",",
"result",
",",
"src",
")",
":",
"# Make sure to maintain the original config_root",
"if",
"\"config_root\"",
"in",
"configuration",
":",
"# if we already have a... | Used to add a file to the configuration, result here is the yaml.load
of the src.
If the configuration we're reading in has ``harpoon.extra_files``
then this is treated as a list of strings of other files to collect.
We also take extra files to collector from result["images"]["__images... | [
"Used",
"to",
"add",
"a",
"file",
"to",
"the",
"configuration",
"result",
"here",
"is",
"the",
"yaml",
".",
"load",
"of",
"the",
"src",
"."
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/collector.py#L185-L246 |
delfick/harpoon | harpoon/collector.py | Collector.extra_configuration_collection | def extra_configuration_collection(self, configuration):
"""
Hook to do any extra configuration collection or converter registration
"""
harpoon_spec = HarpoonSpec()
for image in configuration.get('images', {}).keys():
self.make_image_converters(image, configuration,... | python | def extra_configuration_collection(self, configuration):
"""
Hook to do any extra configuration collection or converter registration
"""
harpoon_spec = HarpoonSpec()
for image in configuration.get('images', {}).keys():
self.make_image_converters(image, configuration,... | [
"def",
"extra_configuration_collection",
"(",
"self",
",",
"configuration",
")",
":",
"harpoon_spec",
"=",
"HarpoonSpec",
"(",
")",
"for",
"image",
"in",
"configuration",
".",
"get",
"(",
"'images'",
",",
"{",
"}",
")",
".",
"keys",
"(",
")",
":",
"self",
... | Hook to do any extra configuration collection or converter registration | [
"Hook",
"to",
"do",
"any",
"extra",
"configuration",
"collection",
"or",
"converter",
"registration"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/collector.py#L248-L267 |
delfick/harpoon | harpoon/collector.py | Collector.make_image_converters | def make_image_converters(self, image, configuration, harpoon_spec):
"""Make converters for this image and add them to the configuration"""
def convert_image(path, val):
log.info("Converting %s", path)
everything = path.configuration.root().wrapped()
meta = Meta(every... | python | def make_image_converters(self, image, configuration, harpoon_spec):
"""Make converters for this image and add them to the configuration"""
def convert_image(path, val):
log.info("Converting %s", path)
everything = path.configuration.root().wrapped()
meta = Meta(every... | [
"def",
"make_image_converters",
"(",
"self",
",",
"image",
",",
"configuration",
",",
"harpoon_spec",
")",
":",
"def",
"convert_image",
"(",
"path",
",",
"val",
")",
":",
"log",
".",
"info",
"(",
"\"Converting %s\"",
",",
"path",
")",
"everything",
"=",
"p... | Make converters for this image and add them to the configuration | [
"Make",
"converters",
"for",
"this",
"image",
"and",
"add",
"them",
"to",
"the",
"configuration"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/collector.py#L269-L301 |
immstudios/nxtools | nxtools/media/fffilters.py | filter_arc | def filter_arc(w, h, aspect):
"""Aspect ratio convertor. you must specify output size and source aspect ratio (as float)"""
taspect = float(w)/h
if abs(taspect - aspect) < 0.01:
return "scale=%s:%s"%(w,h)
if taspect > aspect: # pillarbox
pt = 0
ph = h
pw = int (h*aspect)
... | python | def filter_arc(w, h, aspect):
"""Aspect ratio convertor. you must specify output size and source aspect ratio (as float)"""
taspect = float(w)/h
if abs(taspect - aspect) < 0.01:
return "scale=%s:%s"%(w,h)
if taspect > aspect: # pillarbox
pt = 0
ph = h
pw = int (h*aspect)
... | [
"def",
"filter_arc",
"(",
"w",
",",
"h",
",",
"aspect",
")",
":",
"taspect",
"=",
"float",
"(",
"w",
")",
"/",
"h",
"if",
"abs",
"(",
"taspect",
"-",
"aspect",
")",
"<",
"0.01",
":",
"return",
"\"scale=%s:%s\"",
"%",
"(",
"w",
",",
"h",
")",
"i... | Aspect ratio convertor. you must specify output size and source aspect ratio (as float) | [
"Aspect",
"ratio",
"convertor",
".",
"you",
"must",
"specify",
"output",
"size",
"and",
"source",
"aspect",
"ratio",
"(",
"as",
"float",
")"
] | train | https://github.com/immstudios/nxtools/blob/8c30213c61aec460c648d5e9ae7ce79dfb7b4b9a/nxtools/media/fffilters.py#L34-L49 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetLookupSession.get_asset | def get_asset(self, asset_id=None):
"""Gets the ``Asset`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``Asset`` may have a different
``Id`` than requested, such as the case where a duplicate ``Id``
was as... | python | def get_asset(self, asset_id=None):
"""Gets the ``Asset`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``Asset`` may have a different
``Id`` than requested, such as the case where a duplicate ``Id``
was as... | [
"def",
"get_asset",
"(",
"self",
",",
"asset_id",
"=",
"None",
")",
":",
"return",
"Asset",
"(",
"self",
".",
"_provider_session",
".",
"get_asset",
"(",
"asset_id",
")",
",",
"self",
".",
"_config_map",
")"
] | Gets the ``Asset`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``Asset`` may have a different
``Id`` than requested, such as the case where a duplicate ``Id``
was assigned to an ``Asset`` and retained for compati... | [
"Gets",
"the",
"Asset",
"specified",
"by",
"its",
"Id",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L145-L163 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetLookupSession.get_assets_by_ids | def get_assets_by_ids(self, asset_ids=None):
"""Gets an ``AssetList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the assets
specified in the ``Id`` list, in the order of the list,
including duplicates, or an error results if an ``Id`` in th... | python | def get_assets_by_ids(self, asset_ids=None):
"""Gets an ``AssetList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the assets
specified in the ``Id`` list, in the order of the list,
including duplicates, or an error results if an ``Id`` in th... | [
"def",
"get_assets_by_ids",
"(",
"self",
",",
"asset_ids",
"=",
"None",
")",
":",
"return",
"AssetList",
"(",
"self",
".",
"_provider_session",
".",
"get_assets_by_ids",
"(",
"asset_ids",
")",
",",
"self",
".",
"_config_map",
")"
] | Gets an ``AssetList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the assets
specified in the ``Id`` list, in the order of the list,
including duplicates, or an error results if an ``Id`` in the
supplied list is not found or inaccessible. Ot... | [
"Gets",
"an",
"AssetList",
"corresponding",
"to",
"the",
"given",
"IdList",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L185-L208 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetLookupSession.get_assets_by_genus_type | def get_assets_by_genus_type(self, asset_genus_type=None):
"""Gets an ``AssetList`` corresponding to the given asset genus ``Type``
which does not include assets of types derived from the specified ``Type``.
In plenary mode, the returned list contains all known assets or
an error result... | python | def get_assets_by_genus_type(self, asset_genus_type=None):
"""Gets an ``AssetList`` corresponding to the given asset genus ``Type``
which does not include assets of types derived from the specified ``Type``.
In plenary mode, the returned list contains all known assets or
an error result... | [
"def",
"get_assets_by_genus_type",
"(",
"self",
",",
"asset_genus_type",
"=",
"None",
")",
":",
"return",
"AssetList",
"(",
"self",
".",
"_provider_session",
".",
"get_assets_by_genus_type",
"(",
"asset_genus_type",
")",
",",
"self",
".",
"_config_map",
")"
] | Gets an ``AssetList`` corresponding to the given asset genus ``Type``
which does not include assets of types derived from the specified ``Type``.
In plenary mode, the returned list contains all known assets or
an error results. Otherwise, the returned list may contain only
those assets ... | [
"Gets",
"an",
"AssetList",
"corresponding",
"to",
"the",
"given",
"asset",
"genus",
"Type",
"which",
"does",
"not",
"include",
"assets",
"of",
"types",
"derived",
"from",
"the",
"specified",
"Type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L210-L228 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetLookupSession.get_assets_by_parent_genus_type | def get_assets_by_parent_genus_type(self, asset_genus_type=None):
"""Gets an ``AssetList`` corresponding to the given asset genus ``Type``
and include any additional assets with genus types derived from the specified
``Type``.
In plenary mode, the returned list contains all known assets... | python | def get_assets_by_parent_genus_type(self, asset_genus_type=None):
"""Gets an ``AssetList`` corresponding to the given asset genus ``Type``
and include any additional assets with genus types derived from the specified
``Type``.
In plenary mode, the returned list contains all known assets... | [
"def",
"get_assets_by_parent_genus_type",
"(",
"self",
",",
"asset_genus_type",
"=",
"None",
")",
":",
"return",
"AssetList",
"(",
"self",
".",
"_provider_session",
".",
"get_assets_by_parent_genus_type",
"(",
"asset_genus_type",
")",
",",
"self",
".",
"_config_map",
... | Gets an ``AssetList`` corresponding to the given asset genus ``Type``
and include any additional assets with genus types derived from the specified
``Type``.
In plenary mode, the returned list contains all known assets or
an error results. Otherwise, the returned list may contain only
... | [
"Gets",
"an",
"AssetList",
"corresponding",
"to",
"the",
"given",
"asset",
"genus",
"Type",
"and",
"include",
"any",
"additional",
"assets",
"with",
"genus",
"types",
"derived",
"from",
"the",
"specified",
"Type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L230-L249 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetLookupSession.get_assets_by_record_type | def get_assets_by_record_type(self, asset_record_type=None):
"""Gets an ``AssetList`` containing the given asset record ``Type``.
In plenary mode, the returned list contains all known assets or
an error results. Otherwise, the returned list may contain only
those assets that are accessi... | python | def get_assets_by_record_type(self, asset_record_type=None):
"""Gets an ``AssetList`` containing the given asset record ``Type``.
In plenary mode, the returned list contains all known assets or
an error results. Otherwise, the returned list may contain only
those assets that are accessi... | [
"def",
"get_assets_by_record_type",
"(",
"self",
",",
"asset_record_type",
"=",
"None",
")",
":",
"return",
"AssetList",
"(",
"self",
".",
"_provider_session",
".",
"get_assets_by_record_type",
"(",
"asset_record_type",
")",
",",
"self",
".",
"_config_map",
")"
] | Gets an ``AssetList`` containing the given asset record ``Type``.
In plenary mode, the returned list contains all known assets or
an error results. Otherwise, the returned list may contain only
those assets that are accessible through this session.
arg: asset_record_type (osid.type.... | [
"Gets",
"an",
"AssetList",
"containing",
"the",
"given",
"asset",
"record",
"Type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L251-L268 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetLookupSession.get_assets_by_provider | def get_assets_by_provider(self, resource_id=None):
"""Gets an ``AssetList`` from the given provider.
In plenary mode, the returned list contains all known assets or
an error results. Otherwise, the returned list may contain only
those assets that are accessible through this session.
... | python | def get_assets_by_provider(self, resource_id=None):
"""Gets an ``AssetList`` from the given provider.
In plenary mode, the returned list contains all known assets or
an error results. Otherwise, the returned list may contain only
those assets that are accessible through this session.
... | [
"def",
"get_assets_by_provider",
"(",
"self",
",",
"resource_id",
"=",
"None",
")",
":",
"return",
"AssetList",
"(",
"self",
".",
"_provider_session",
".",
"get_assets_by_provider",
"(",
"resource_id",
")",
",",
"self",
".",
"_config_map",
")"
] | Gets an ``AssetList`` from the given provider.
In plenary mode, the returned list contains all known assets or
an error results. Otherwise, the returned list may contain only
those assets that are accessible through this session.
arg: resource_id (osid.id.Id): a resource ``Id``
... | [
"Gets",
"an",
"AssetList",
"from",
"the",
"given",
"provider",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L270-L287 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetContentLookupSession.get_asset_content | def get_asset_content(self, asset_content_id):
"""Gets the ``AssetContent`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``AssetContent`` may have a different
``Id`` than requested, such as the case where a duplic... | python | def get_asset_content(self, asset_content_id):
"""Gets the ``AssetContent`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``AssetContent`` may have a different
``Id`` than requested, such as the case where a duplic... | [
"def",
"get_asset_content",
"(",
"self",
",",
"asset_content_id",
")",
":",
"return",
"AssetContent",
"(",
"self",
".",
"_provider_session",
".",
"get_asset_content",
"(",
"asset_content_id",
")",
",",
"self",
".",
"_config_map",
")"
] | Gets the ``AssetContent`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``AssetContent`` may have a different
``Id`` than requested, such as the case where a duplicate ``Id``
was assigned to an ``AssetContent`` and... | [
"Gets",
"the",
"AssetContent",
"specified",
"by",
"its",
"Id",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L440-L460 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetContentLookupSession.get_asset_contents_by_ids | def get_asset_contents_by_ids(self, asset_content_ids):
"""Gets an ``AssetList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the asset contents
specified in the ``Id`` list, in the order of the list,
including duplicates, or an error results... | python | def get_asset_contents_by_ids(self, asset_content_ids):
"""Gets an ``AssetList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the asset contents
specified in the ``Id`` list, in the order of the list,
including duplicates, or an error results... | [
"def",
"get_asset_contents_by_ids",
"(",
"self",
",",
"asset_content_ids",
")",
":",
"return",
"AssetContentList",
"(",
"self",
".",
"_provider_session",
".",
"get_asset_contents_by_ids",
"(",
"asset_content_ids",
")",
",",
"self",
".",
"_config_map",
")"
] | Gets an ``AssetList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the asset contents
specified in the ``Id`` list, in the order of the list,
including duplicates, or an error results if an ``Id`` in the
supplied list is not found or inaccess... | [
"Gets",
"an",
"AssetList",
"corresponding",
"to",
"the",
"given",
"IdList",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L463-L486 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetContentLookupSession.get_asset_contents_by_genus_type | def get_asset_contents_by_genus_type(self, asset_content_genus_type):
"""Gets an ``AssetContentList`` corresponding to the given asset content genus ``Type`` which does not include asset contents of types derived from the specified ``Type``.
In plenary mode, the returned list contains all known asset c... | python | def get_asset_contents_by_genus_type(self, asset_content_genus_type):
"""Gets an ``AssetContentList`` corresponding to the given asset content genus ``Type`` which does not include asset contents of types derived from the specified ``Type``.
In plenary mode, the returned list contains all known asset c... | [
"def",
"get_asset_contents_by_genus_type",
"(",
"self",
",",
"asset_content_genus_type",
")",
":",
"return",
"AssetContentList",
"(",
"self",
".",
"_provider_session",
".",
"get_asset_contents_by_genus_type",
"(",
"asset_content_genus_type",
")",
",",
"self",
".",
"_confi... | Gets an ``AssetContentList`` corresponding to the given asset content genus ``Type`` which does not include asset contents of types derived from the specified ``Type``.
In plenary mode, the returned list contains all known asset contents or
an error results. Otherwise, the returned list may contain onl... | [
"Gets",
"an",
"AssetContentList",
"corresponding",
"to",
"the",
"given",
"asset",
"content",
"genus",
"Type",
"which",
"does",
"not",
"include",
"asset",
"contents",
"of",
"types",
"derived",
"from",
"the",
"specified",
"Type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L489-L507 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetContentLookupSession.get_asset_contents_by_parent_genus_type | def get_asset_contents_by_parent_genus_type(self, asset_content_genus_type):
"""Gets an ``AssetContentList`` corresponding to the given asset content genus ``Type`` and include any additional asset contents with genus types derived from the specified ``Type``.
In plenary mode, the returned list contain... | python | def get_asset_contents_by_parent_genus_type(self, asset_content_genus_type):
"""Gets an ``AssetContentList`` corresponding to the given asset content genus ``Type`` and include any additional asset contents with genus types derived from the specified ``Type``.
In plenary mode, the returned list contain... | [
"def",
"get_asset_contents_by_parent_genus_type",
"(",
"self",
",",
"asset_content_genus_type",
")",
":",
"return",
"AssetContentList",
"(",
"self",
".",
"_provider_session",
".",
"get_asset_contents_by_parent_genus_type",
"(",
"asset_content_genus_type",
")",
",",
"self",
... | Gets an ``AssetContentList`` corresponding to the given asset content genus ``Type`` and include any additional asset contents with genus types derived from the specified ``Type``.
In plenary mode, the returned list contains all known asset contents or
an error results. Otherwise, the returned list may... | [
"Gets",
"an",
"AssetContentList",
"corresponding",
"to",
"the",
"given",
"asset",
"content",
"genus",
"Type",
"and",
"include",
"any",
"additional",
"asset",
"contents",
"with",
"genus",
"types",
"derived",
"from",
"the",
"specified",
"Type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L510-L528 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetContentLookupSession.get_asset_contents_by_record_type | def get_asset_contents_by_record_type(self, asset_content_record_type):
"""Gets an ``AssetContentList`` containing the given asset record ``Type``.
In plenary mode, the returned list contains all known asset contents or
an error results. Otherwise, the returned list may contain only
tho... | python | def get_asset_contents_by_record_type(self, asset_content_record_type):
"""Gets an ``AssetContentList`` containing the given asset record ``Type``.
In plenary mode, the returned list contains all known asset contents or
an error results. Otherwise, the returned list may contain only
tho... | [
"def",
"get_asset_contents_by_record_type",
"(",
"self",
",",
"asset_content_record_type",
")",
":",
"return",
"AssetContentList",
"(",
"self",
".",
"_provider_session",
".",
"get_asset_contents_by_record_type",
"(",
"asset_content_record_type",
")",
",",
"self",
".",
"_c... | Gets an ``AssetContentList`` containing the given asset record ``Type``.
In plenary mode, the returned list contains all known asset contents or
an error results. Otherwise, the returned list may contain only
those asset contents that are accessible through this session.
:param asset_c... | [
"Gets",
"an",
"AssetContentList",
"containing",
"the",
"given",
"asset",
"record",
"Type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L531-L549 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetContentLookupSession.get_asset_contents_for_asset | def get_asset_contents_for_asset(self, asset_id):
"""Gets an ``AssetList`` from the given Asset.
In plenary mode, the returned list contains all known asset contents or
an error results. Otherwise, the returned list may contain only
those asset contents that are accessible through this ... | python | def get_asset_contents_for_asset(self, asset_id):
"""Gets an ``AssetList`` from the given Asset.
In plenary mode, the returned list contains all known asset contents or
an error results. Otherwise, the returned list may contain only
those asset contents that are accessible through this ... | [
"def",
"get_asset_contents_for_asset",
"(",
"self",
",",
"asset_id",
")",
":",
"return",
"AssetContentList",
"(",
"self",
".",
"_provider_session",
".",
"get_asset_contents_for_asset",
"(",
"asset_id",
")",
",",
"self",
".",
"_config_map",
")"
] | Gets an ``AssetList`` from the given Asset.
In plenary mode, the returned list contains all known asset contents or
an error results. Otherwise, the returned list may contain only
those asset contents that are accessible through this session.
:param asset_id: an asset ``Id``
:t... | [
"Gets",
"an",
"AssetList",
"from",
"the",
"given",
"Asset",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L552-L570 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetContentLookupSession.get_asset_contents_by_genus_type_for_asset | def get_asset_contents_by_genus_type_for_asset(self, asset_content_genus_type, asset_id):
"""Gets an ``AssetContentList`` from the given GenusType and Asset Id.
In plenary mode, the returned list contains all known asset contents or
an error results. Otherwise, the returned list may contain onl... | python | def get_asset_contents_by_genus_type_for_asset(self, asset_content_genus_type, asset_id):
"""Gets an ``AssetContentList`` from the given GenusType and Asset Id.
In plenary mode, the returned list contains all known asset contents or
an error results. Otherwise, the returned list may contain onl... | [
"def",
"get_asset_contents_by_genus_type_for_asset",
"(",
"self",
",",
"asset_content_genus_type",
",",
"asset_id",
")",
":",
"return",
"AssetContentList",
"(",
"self",
".",
"_provider_session",
".",
"get_asset_contents_by_genus_type_for_asset",
"(",
"asset_content_genus_type",... | Gets an ``AssetContentList`` from the given GenusType and Asset Id.
In plenary mode, the returned list contains all known asset contents or
an error results. Otherwise, the returned list may contain only
those asset contents that are accessible through this session.
:param asset_conten... | [
"Gets",
"an",
"AssetContentList",
"from",
"the",
"given",
"GenusType",
"and",
"Asset",
"Id",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L573-L593 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetQuerySession.get_assets_by_query | def get_assets_by_query(self, asset_query=None):
"""Gets a list of ``Assets`` matching the given asset query.
arg: asset_query (osid.repository.AssetQuery): the asset
query
return: (osid.repository.AssetList) - the returned ``AssetList``
raise: NullArgument - ``asset... | python | def get_assets_by_query(self, asset_query=None):
"""Gets a list of ``Assets`` matching the given asset query.
arg: asset_query (osid.repository.AssetQuery): the asset
query
return: (osid.repository.AssetList) - the returned ``AssetList``
raise: NullArgument - ``asset... | [
"def",
"get_assets_by_query",
"(",
"self",
",",
"asset_query",
"=",
"None",
")",
":",
"return",
"AssetList",
"(",
"self",
".",
"_provider_session",
".",
"get_assets_by_query",
"(",
"asset_query",
")",
",",
"self",
".",
"_config_map",
")"
] | Gets a list of ``Assets`` matching the given asset query.
arg: asset_query (osid.repository.AssetQuery): the asset
query
return: (osid.repository.AssetList) - the returned ``AssetList``
raise: NullArgument - ``asset_query`` is ``null``
raise: OperationFailed - unabl... | [
"Gets",
"a",
"list",
"of",
"Assets",
"matching",
"the",
"given",
"asset",
"query",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L703-L717 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetQuerySession.get_asset_contents_by_query | def get_asset_contents_by_query(self, asset_content_query=None):
"""Gets a list of ``AssetContents`` matching the given asset content query.
arg: asset_content_query (osid.repository.AssetContentQuery): the asset
content query
return: (osid.repository.AssetContentList) - the ... | python | def get_asset_contents_by_query(self, asset_content_query=None):
"""Gets a list of ``AssetContents`` matching the given asset content query.
arg: asset_content_query (osid.repository.AssetContentQuery): the asset
content query
return: (osid.repository.AssetContentList) - the ... | [
"def",
"get_asset_contents_by_query",
"(",
"self",
",",
"asset_content_query",
"=",
"None",
")",
":",
"return",
"AssetContentList",
"(",
"self",
".",
"_provider_session",
".",
"get_asset_contents_by_query",
"(",
"asset_content_query",
")",
",",
"self",
".",
"_config_m... | Gets a list of ``AssetContents`` matching the given asset content query.
arg: asset_content_query (osid.repository.AssetContentQuery): the asset
content query
return: (osid.repository.AssetContentList) - the returned ``AssetContentList``
raise: NullArgument - ``asset_content... | [
"Gets",
"a",
"list",
"of",
"AssetContents",
"matching",
"the",
"given",
"asset",
"content",
"query",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L730-L744 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetAdminSession.update_asset | def update_asset(self, asset_form=None):
"""Updates an existing asset.
arg: asset_form (osid.repository.AssetForm): the form
containing the elements to be updated
raise: IllegalState - ``asset_form`` already used in anupdate
transaction
raise: Invali... | python | def update_asset(self, asset_form=None):
"""Updates an existing asset.
arg: asset_form (osid.repository.AssetForm): the form
containing the elements to be updated
raise: IllegalState - ``asset_form`` already used in anupdate
transaction
raise: Invali... | [
"def",
"update_asset",
"(",
"self",
",",
"asset_form",
"=",
"None",
")",
":",
"return",
"Asset",
"(",
"self",
".",
"_provider_session",
".",
"update_asset",
"(",
"asset_form",
")",
",",
"self",
".",
"_config_map",
")"
] | Updates an existing asset.
arg: asset_form (osid.repository.AssetForm): the form
containing the elements to be updated
raise: IllegalState - ``asset_form`` already used in anupdate
transaction
raise: InvalidArgument - the form contains an invalid value
... | [
"Updates",
"an",
"existing",
"asset",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L986-L1002 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetAdminSession.delete_asset | def delete_asset(self, asset_id=None):
"""Deletes an ``Asset``.
arg: asset_id (osid.id.Id): the ``Id`` of the ``Asset`` to
remove
raise: NotFound - ``asset_id`` not found
raise: NullArgument - ``asset_id`` is ``null``
raise: OperationFailed - unable to comp... | python | def delete_asset(self, asset_id=None):
"""Deletes an ``Asset``.
arg: asset_id (osid.id.Id): the ``Id`` of the ``Asset`` to
remove
raise: NotFound - ``asset_id`` not found
raise: NullArgument - ``asset_id`` is ``null``
raise: OperationFailed - unable to comp... | [
"def",
"delete_asset",
"(",
"self",
",",
"asset_id",
"=",
"None",
")",
":",
"# Implemented from awsosid template for -",
"# osid.resource.ResourceAdminSession.delete_resource_template",
"# clean up AWS",
"asset",
"=",
"self",
".",
"_asset_lookup_session",
".",
"get_asset",
"(... | Deletes an ``Asset``.
arg: asset_id (osid.id.Id): the ``Id`` of the ``Asset`` to
remove
raise: NotFound - ``asset_id`` not found
raise: NullArgument - ``asset_id`` is ``null``
raise: OperationFailed - unable to complete request
raise: PermissionDenied - au... | [
"Deletes",
"an",
"Asset",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1022-L1040 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetAdminSession.get_asset_content_form_for_create | def get_asset_content_form_for_create(self,
asset_id=None,
asset_content_record_types=None):
"""Gets an asset content form for creating new assets.
arg: asset_id (osid.id.Id): the ``Id`` of an ``Asset``
arg: ... | python | def get_asset_content_form_for_create(self,
asset_id=None,
asset_content_record_types=None):
"""Gets an asset content form for creating new assets.
arg: asset_id (osid.id.Id): the ``Id`` of an ``Asset``
arg: ... | [
"def",
"get_asset_content_form_for_create",
"(",
"self",
",",
"asset_id",
"=",
"None",
",",
"asset_content_record_types",
"=",
"None",
")",
":",
"if",
"AWS_ASSET_CONTENT_RECORD_TYPE",
"in",
"asset_content_record_types",
":",
"asset_content_record_types",
".",
"remove",
"(... | Gets an asset content form for creating new assets.
arg: asset_id (osid.id.Id): the ``Id`` of an ``Asset``
arg: asset_content_record_types (osid.type.Type[]): array of
asset content record types
return: (osid.repository.AssetContentForm) - the asset content
... | [
"Gets",
"an",
"asset",
"content",
"form",
"for",
"creating",
"new",
"assets",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1120-L1151 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetAdminSession.create_asset_content | def create_asset_content(self, asset_content_form=None):
"""Creates new ``AssetContent`` for a given asset.
arg: asset_content_form (osid.repository.AssetContentForm):
the form for this ``AssetContent``
return: (osid.repository.AssetContent) - the new
``AssetC... | python | def create_asset_content(self, asset_content_form=None):
"""Creates new ``AssetContent`` for a given asset.
arg: asset_content_form (osid.repository.AssetContentForm):
the form for this ``AssetContent``
return: (osid.repository.AssetContent) - the new
``AssetC... | [
"def",
"create_asset_content",
"(",
"self",
",",
"asset_content_form",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"asset_content_form",
",",
"AssetContentForm",
")",
":",
"asset_content",
"=",
"self",
".",
"_provider_session",
".",
"create_asset_content",
"(",
... | Creates new ``AssetContent`` for a given asset.
arg: asset_content_form (osid.repository.AssetContentForm):
the form for this ``AssetContent``
return: (osid.repository.AssetContent) - the new
``AssetContent``
raise: IllegalState - ``asset_content_form`` alrea... | [
"Creates",
"new",
"AssetContent",
"for",
"a",
"given",
"asset",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1153-L1183 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetAdminSession.get_asset_content_form_for_update | def get_asset_content_form_for_update(self, asset_content_id=None):
"""Gets the asset content form for updating an existing asset content.
A new asset content form should be requested for each update
transaction.
arg: asset_content_id (osid.id.Id): the ``Id`` of the
... | python | def get_asset_content_form_for_update(self, asset_content_id=None):
"""Gets the asset content form for updating an existing asset content.
A new asset content form should be requested for each update
transaction.
arg: asset_content_id (osid.id.Id): the ``Id`` of the
... | [
"def",
"get_asset_content_form_for_update",
"(",
"self",
",",
"asset_content_id",
"=",
"None",
")",
":",
"asset_content_form",
"=",
"self",
".",
"_provider_session",
".",
"get_asset_content_form_for_update",
"(",
"asset_content_id",
")",
"if",
"'amazonaws.com'",
"in",
"... | Gets the asset content form for updating an existing asset content.
A new asset content form should be requested for each update
transaction.
arg: asset_content_id (osid.id.Id): the ``Id`` of the
``AssetContent``
return: (osid.repository.AssetContentForm) - the asset... | [
"Gets",
"the",
"asset",
"content",
"form",
"for",
"updating",
"an",
"existing",
"asset",
"content",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1203-L1225 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetAdminSession.update_asset_content | def update_asset_content(self, asset_content_form=None):
"""Updates an existing asset content.
arg: asset_content_form (osid.repository.AssetContentForm):
the form containing the elements to be updated
raise: IllegalState - ``asset_content_form`` already used in an
... | python | def update_asset_content(self, asset_content_form=None):
"""Updates an existing asset content.
arg: asset_content_form (osid.repository.AssetContentForm):
the form containing the elements to be updated
raise: IllegalState - ``asset_content_form`` already used in an
... | [
"def",
"update_asset_content",
"(",
"self",
",",
"asset_content_form",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"asset_content_form",
",",
"AssetContentForm",
")",
":",
"asset_content",
"=",
"self",
".",
"_provider_session",
".",
"update_asset_content",
"(",
... | Updates an existing asset content.
arg: asset_content_form (osid.repository.AssetContentForm):
the form containing the elements to be updated
raise: IllegalState - ``asset_content_form`` already used in an
update transaction
raise: InvalidArgument - the form... | [
"Updates",
"an",
"existing",
"asset",
"content",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1227-L1252 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetAdminSession.delete_asset_content | def delete_asset_content(self, asset_content_id=None):
"""Deletes content from an ``Asset``.
arg: asset_content_id (osid.id.Id): the ``Id`` of the
``AssetContent``
raise: NotFound - ``asset_content_id`` is not found
raise: NullArgument - ``asset_content_id`` is ``nu... | python | def delete_asset_content(self, asset_content_id=None):
"""Deletes content from an ``Asset``.
arg: asset_content_id (osid.id.Id): the ``Id`` of the
``AssetContent``
raise: NotFound - ``asset_content_id`` is not found
raise: NullArgument - ``asset_content_id`` is ``nu... | [
"def",
"delete_asset_content",
"(",
"self",
",",
"asset_content_id",
"=",
"None",
")",
":",
"asset_content",
"=",
"self",
".",
"_get_asset_content",
"(",
"asset_content_id",
")",
"if",
"asset_content",
".",
"has_url",
"(",
")",
"and",
"'amazonaws.com'",
"in",
"a... | Deletes content from an ``Asset``.
arg: asset_content_id (osid.id.Id): the ``Id`` of the
``AssetContent``
raise: NotFound - ``asset_content_id`` is not found
raise: NullArgument - ``asset_content_id`` is ``null``
raise: OperationFailed - unable to complete request
... | [
"Deletes",
"content",
"from",
"an",
"Asset",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1272-L1291 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetAdminSession._get_asset_content | def _get_asset_content(self, asset_content_id):
"""stub"""
asset_content = None
for asset in self._asset_lookup_session.get_assets():
for content in asset.get_asset_contents():
if content.get_id() == asset_content_id:
asset_content = content
... | python | def _get_asset_content(self, asset_content_id):
"""stub"""
asset_content = None
for asset in self._asset_lookup_session.get_assets():
for content in asset.get_asset_contents():
if content.get_id() == asset_content_id:
asset_content = content
... | [
"def",
"_get_asset_content",
"(",
"self",
",",
"asset_content_id",
")",
":",
"asset_content",
"=",
"None",
"for",
"asset",
"in",
"self",
".",
"_asset_lookup_session",
".",
"get_assets",
"(",
")",
":",
"for",
"content",
"in",
"asset",
".",
"get_asset_contents",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1296-L1309 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | RepositoryLookupSession.get_repository | def get_repository(self, repository_id=None):
"""Gets the ``Repository`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``Repository`` may have a
different ``Id`` than requested, such as the case where a
dup... | python | def get_repository(self, repository_id=None):
"""Gets the ``Repository`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``Repository`` may have a
different ``Id`` than requested, such as the case where a
dup... | [
"def",
"get_repository",
"(",
"self",
",",
"repository_id",
"=",
"None",
")",
":",
"# Implemented from awsosid template for -",
"# osid.resource.BinLookupSession.get_bin_template",
"if",
"not",
"self",
".",
"_can",
"(",
"'lookup'",
")",
":",
"raise",
"PermissionDenied",
... | Gets the ``Repository`` specified by its ``Id``.
In plenary mode, the exact ``Id`` is found or a ``NotFound``
results. Otherwise, the returned ``Repository`` may have a
different ``Id`` than requested, such as the case where a
duplicate ``Id`` was assigned to a ``Repository`` and retain... | [
"Gets",
"the",
"Repository",
"specified",
"by",
"its",
"Id",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1391-L1414 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | RepositoryLookupSession.get_repositories_by_ids | def get_repositories_by_ids(self, repository_ids=None):
"""Gets a ``RepositoryList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the
repositories specified in the ``Id`` list, in the order of the
list, including duplicates, or an error resul... | python | def get_repositories_by_ids(self, repository_ids=None):
"""Gets a ``RepositoryList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the
repositories specified in the ``Id`` list, in the order of the
list, including duplicates, or an error resul... | [
"def",
"get_repositories_by_ids",
"(",
"self",
",",
"repository_ids",
"=",
"None",
")",
":",
"# Implemented from awsosid template for -",
"# osid.resource.BinLookupSession.get_bins_by_ids_template",
"if",
"not",
"self",
".",
"_can",
"(",
"'lookup'",
")",
":",
"raise",
"Pe... | Gets a ``RepositoryList`` corresponding to the given ``IdList``.
In plenary mode, the returned list contains all of the
repositories specified in the ``Id`` list, in the order of the
list, including duplicates, or an error results if an ``Id`` in
the supplied list is not found or inacce... | [
"Gets",
"a",
"RepositoryList",
"corresponding",
"to",
"the",
"given",
"IdList",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1416-L1443 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | RepositoryAdminSession.get_repository_form_for_create | def get_repository_form_for_create(self, repository_record_types=None):
"""Gets the repository form for creating new repositories.
A new form should be requested for each create transaction.
arg: repository_record_types (osid.type.Type[]): array of
repository record types
... | python | def get_repository_form_for_create(self, repository_record_types=None):
"""Gets the repository form for creating new repositories.
A new form should be requested for each create transaction.
arg: repository_record_types (osid.type.Type[]): array of
repository record types
... | [
"def",
"get_repository_form_for_create",
"(",
"self",
",",
"repository_record_types",
"=",
"None",
")",
":",
"# Implemented from awsosid template for -",
"# osid.resource.BinAdminSession.get_bin_form_for_create_template",
"if",
"not",
"self",
".",
"_can",
"(",
"'create'",
")",
... | Gets the repository form for creating new repositories.
A new form should be requested for each create transaction.
arg: repository_record_types (osid.type.Type[]): array of
repository record types
return: (osid.repository.RepositoryForm) - the repository form
raise:... | [
"Gets",
"the",
"repository",
"form",
"for",
"creating",
"new",
"repositories",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1633-L1654 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | RepositoryAdminSession.get_repository_form_for_update | def get_repository_form_for_update(self, repository_id=None):
"""Gets the repository form for updating an existing repository.
A new repository form should be requested for each update
transaction.
arg: repository_id (osid.id.Id): the ``Id`` of the
``Repository``
... | python | def get_repository_form_for_update(self, repository_id=None):
"""Gets the repository form for updating an existing repository.
A new repository form should be requested for each update
transaction.
arg: repository_id (osid.id.Id): the ``Id`` of the
``Repository``
... | [
"def",
"get_repository_form_for_update",
"(",
"self",
",",
"repository_id",
"=",
"None",
")",
":",
"# Implemented from awsosid template for -",
"# osid.resource.BinAdminSession.get_bin_form_for_update_template",
"if",
"not",
"self",
".",
"_can",
"(",
"'update'",
")",
":",
"... | Gets the repository form for updating an existing repository.
A new repository form should be requested for each update
transaction.
arg: repository_id (osid.id.Id): the ``Id`` of the
``Repository``
return: (osid.repository.RepositoryForm) - the repository form
... | [
"Gets",
"the",
"repository",
"form",
"for",
"updating",
"an",
"existing",
"repository",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1699-L1720 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | RepositoryAdminSession.update_repository | def update_repository(self, repository_form=None):
"""Updates an existing repository.
arg: repository_form (osid.repository.RepositoryForm): the
form containing the elements to be updated
raise: IllegalState - ``repository_form`` already used in an
update tra... | python | def update_repository(self, repository_form=None):
"""Updates an existing repository.
arg: repository_form (osid.repository.RepositoryForm): the
form containing the elements to be updated
raise: IllegalState - ``repository_form`` already used in an
update tra... | [
"def",
"update_repository",
"(",
"self",
",",
"repository_form",
"=",
"None",
")",
":",
"# Implemented from awsosid template for -",
"# osid.resource.BinAdminSession.update_bin_template",
"if",
"not",
"self",
".",
"_can",
"(",
"'update'",
")",
":",
"raise",
"PermissionDen... | Updates an existing repository.
arg: repository_form (osid.repository.RepositoryForm): the
form containing the elements to be updated
raise: IllegalState - ``repository_form`` already used in an
update transaction
raise: InvalidArgument - the form contains a... | [
"Updates",
"an",
"existing",
"repository",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1722-L1743 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | RepositoryAdminSession.delete_repository | def delete_repository(self, repository_id=None):
"""Deletes a ``Repository``.
arg: repository_id (osid.id.Id): the ``Id`` of the
``Repository`` to remove
raise: NotFound - ``repository_id`` not found
raise: NullArgument - ``repository_id`` is ``null``
raise:... | python | def delete_repository(self, repository_id=None):
"""Deletes a ``Repository``.
arg: repository_id (osid.id.Id): the ``Id`` of the
``Repository`` to remove
raise: NotFound - ``repository_id`` not found
raise: NullArgument - ``repository_id`` is ``null``
raise:... | [
"def",
"delete_repository",
"(",
"self",
",",
"repository_id",
"=",
"None",
")",
":",
"# Implemented from awsosid template for -",
"# osid.resource.BinAdminSession.delete_bin_template",
"if",
"not",
"self",
".",
"_can",
"(",
"'delete'",
")",
":",
"raise",
"PermissionDenie... | Deletes a ``Repository``.
arg: repository_id (osid.id.Id): the ``Id`` of the
``Repository`` to remove
raise: NotFound - ``repository_id`` not found
raise: NullArgument - ``repository_id`` is ``null``
raise: OperationFailed - unable to complete request
raise... | [
"Deletes",
"a",
"Repository",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1763-L1780 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | RepositoryAdminSession.alias_repository | def alias_repository(self, repository_id=None, alias_id=None):
"""Adds an ``Id`` to a ``Repository`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Repository`` is determined by the
provider. The new ``Id`` is an alias to the primary ``Id``. If
the alias is a poi... | python | def alias_repository(self, repository_id=None, alias_id=None):
"""Adds an ``Id`` to a ``Repository`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Repository`` is determined by the
provider. The new ``Id`` is an alias to the primary ``Id``. If
the alias is a poi... | [
"def",
"alias_repository",
"(",
"self",
",",
"repository_id",
"=",
"None",
",",
"alias_id",
"=",
"None",
")",
":",
"# Implemented from awsosid template for -",
"# osid.resource.BinAdminSession.alias_bin_template",
"if",
"not",
"self",
".",
"_can",
"(",
"'alias'",
")",
... | Adds an ``Id`` to a ``Repository`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Repository`` is determined by the
provider. The new ``Id`` is an alias to the primary ``Id``. If
the alias is a pointer to another repository, it is reassigned
to the given reposito... | [
"Adds",
"an",
"Id",
"to",
"a",
"Repository",
"for",
"the",
"purpose",
"of",
"creating",
"compatibility",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L1798-L1824 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetCompositionDesignSession.add_asset | def add_asset(self, asset_id, composition_id):
"""Appends an asset to a composition.
arg: asset_id (osid.id.Id): ``Id`` of the ``Asset``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composition``
raise: AlreadyExists - ``asset_id`` already part
... | python | def add_asset(self, asset_id, composition_id):
"""Appends an asset to a composition.
arg: asset_id (osid.id.Id): ``Id`` of the ``Asset``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composition``
raise: AlreadyExists - ``asset_id`` already part
... | [
"def",
"add_asset",
"(",
"self",
",",
"asset_id",
",",
"composition_id",
")",
":",
"self",
".",
"_provider_session",
".",
"add_asset",
"(",
"self",
",",
"asset_id",
",",
"composition_id",
")"
] | Appends an asset to a composition.
arg: asset_id (osid.id.Id): ``Id`` of the ``Asset``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composition``
raise: AlreadyExists - ``asset_id`` already part
``composition_id``
raise: NotFound - ``asset_id... | [
"Appends",
"an",
"asset",
"to",
"a",
"composition",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L2038-L2054 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetCompositionDesignSession.move_asset_ahead | def move_asset_ahead(self, asset_id, composition_id, reference_id):
"""Reorders assets in a composition by moving the specified asset in front of a reference asset.
arg: asset_id (osid.id.Id): ``Id`` of the ``Asset``
arg: composition_id (osid.id.Id): ``Id`` of the
``Compos... | python | def move_asset_ahead(self, asset_id, composition_id, reference_id):
"""Reorders assets in a composition by moving the specified asset in front of a reference asset.
arg: asset_id (osid.id.Id): ``Id`` of the ``Asset``
arg: composition_id (osid.id.Id): ``Id`` of the
``Compos... | [
"def",
"move_asset_ahead",
"(",
"self",
",",
"asset_id",
",",
"composition_id",
",",
"reference_id",
")",
":",
"self",
".",
"_provider_session",
".",
"move_asset_ahead",
"(",
"self",
",",
"asset_id",
",",
"composition_id",
",",
"reference_id",
")"
] | Reorders assets in a composition by moving the specified asset in front of a reference asset.
arg: asset_id (osid.id.Id): ``Id`` of the ``Asset``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composition``
arg: reference_id (osid.id.Id): ``Id`` of the reference
... | [
"Reorders",
"assets",
"in",
"a",
"composition",
"by",
"moving",
"the",
"specified",
"asset",
"in",
"front",
"of",
"a",
"reference",
"asset",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L2057-L2074 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetCompositionDesignSession.move_asset_behind | def move_asset_behind(self, asset_id, composition_id, reference_id):
"""Reorders assets in a composition by moving the specified asset behind of a reference asset.
arg: asset_id (osid.id.Id): ``Id`` of the ``Asset``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composi... | python | def move_asset_behind(self, asset_id, composition_id, reference_id):
"""Reorders assets in a composition by moving the specified asset behind of a reference asset.
arg: asset_id (osid.id.Id): ``Id`` of the ``Asset``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composi... | [
"def",
"move_asset_behind",
"(",
"self",
",",
"asset_id",
",",
"composition_id",
",",
"reference_id",
")",
":",
"self",
".",
"_provider_session",
".",
"move_asset_behind",
"(",
"self",
",",
"asset_id",
",",
"composition_id",
",",
"reference_id",
")"
] | Reorders assets in a composition by moving the specified asset behind of a reference asset.
arg: asset_id (osid.id.Id): ``Id`` of the ``Asset``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composition``
arg: reference_id (osid.id.Id): ``Id`` of the reference
... | [
"Reorders",
"assets",
"in",
"a",
"composition",
"by",
"moving",
"the",
"specified",
"asset",
"behind",
"of",
"a",
"reference",
"asset",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L2077-L2094 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetCompositionDesignSession.order_assets | def order_assets(self, asset_ids, composition_id):
"""Reorders a set of assets in a composition.
arg: asset_ids (osid.id.Id[]): ``Ids`` for a set of
``Assets``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composition``
raise: NotFound - ``comp... | python | def order_assets(self, asset_ids, composition_id):
"""Reorders a set of assets in a composition.
arg: asset_ids (osid.id.Id[]): ``Ids`` for a set of
``Assets``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composition``
raise: NotFound - ``comp... | [
"def",
"order_assets",
"(",
"self",
",",
"asset_ids",
",",
"composition_id",
")",
":",
"self",
".",
"_provider_session",
".",
"order_assets",
"(",
"self",
",",
"asset_ids",
",",
"composition_id",
")"
] | Reorders a set of assets in a composition.
arg: asset_ids (osid.id.Id[]): ``Ids`` for a set of
``Assets``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composition``
raise: NotFound - ``composition_id`` not found or, an
``asset_id`` not... | [
"Reorders",
"a",
"set",
"of",
"assets",
"in",
"a",
"composition",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L2097-L2113 |
mitsei/dlkit | dlkit/aws_adapter/repository/sessions.py | AssetCompositionDesignSession.remove_asset | def remove_asset(self, asset_id, composition_id):
"""Removes an ``Asset`` from a ``Composition``.
arg: asset_id (osid.id.Id): ``Id`` of the ``Asset``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composition``
raise: NotFound - ``asset_id`` ``not found in com... | python | def remove_asset(self, asset_id, composition_id):
"""Removes an ``Asset`` from a ``Composition``.
arg: asset_id (osid.id.Id): ``Id`` of the ``Asset``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composition``
raise: NotFound - ``asset_id`` ``not found in com... | [
"def",
"remove_asset",
"(",
"self",
",",
"asset_id",
",",
"composition_id",
")",
":",
"self",
".",
"_provider_session",
".",
"remove_asset",
"(",
"self",
",",
"asset_id",
",",
"composition_id",
")"
] | Removes an ``Asset`` from a ``Composition``.
arg: asset_id (osid.id.Id): ``Id`` of the ``Asset``
arg: composition_id (osid.id.Id): ``Id`` of the
``Composition``
raise: NotFound - ``asset_id`` ``not found in composition_id``
raise: NullArgument - ``asset_id`` or ... | [
"Removes",
"an",
"Asset",
"from",
"a",
"Composition",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/repository/sessions.py#L2116-L2130 |
delfick/harpoon | harpoon/executor.py | docker_context | def docker_context():
"""Make a docker context"""
try:
client = docker.from_env(
version = "auto"
, timeout = int(os.environ.get("DOCKER_CLIENT_TIMEOUT", 180))
, assert_hostname = False
)
info = client.info()
log.info("Connected to docke... | python | def docker_context():
"""Make a docker context"""
try:
client = docker.from_env(
version = "auto"
, timeout = int(os.environ.get("DOCKER_CLIENT_TIMEOUT", 180))
, assert_hostname = False
)
info = client.info()
log.info("Connected to docke... | [
"def",
"docker_context",
"(",
")",
":",
"try",
":",
"client",
"=",
"docker",
".",
"from_env",
"(",
"version",
"=",
"\"auto\"",
",",
"timeout",
"=",
"int",
"(",
"os",
".",
"environ",
".",
"get",
"(",
"\"DOCKER_CLIENT_TIMEOUT\"",
",",
"180",
")",
")",
",... | Make a docker context | [
"Make",
"a",
"docker",
"context"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/executor.py#L19-L33 |
mitsei/dlkit | dlkit/primordium/locale/types/time_format.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': 'birdland.mit.edu',
'namespace': 'time format',
'identifier': name,
... | 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': 'birdland.mit.edu',
'namespace': 'time format',
'identifier': name,
... | [
"def",
"get_type_data",
"(",
"name",
")",
":",
"name",
"=",
"name",
".",
"upper",
"(",
")",
"try",
":",
"return",
"{",
"'authority'",
":",
"'birdland.mit.edu'",
",",
"'namespace'",
":",
"'time format'",
",",
"'identifier'",
":",
"name",
",",
"'domain'",
":... | 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/time_format.py#L16-L35 |
mitsei/dlkit | dlkit/json_/hierarchy/managers.py | HierarchyProxyManager.get_hierarchy_traversal_session | def get_hierarchy_traversal_session(self, proxy):
"""Gets the ``OsidSession`` associated with the hierarchy traversal service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyTraversalSession) - a
``HierarchyTraversalSession``
raise: NullArgum... | python | def get_hierarchy_traversal_session(self, proxy):
"""Gets the ``OsidSession`` associated with the hierarchy traversal service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyTraversalSession) - a
``HierarchyTraversalSession``
raise: NullArgum... | [
"def",
"get_hierarchy_traversal_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_hierarchy_traversal",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"Hi... | Gets the ``OsidSession`` associated with the hierarchy traversal service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyTraversalSession) - a
``HierarchyTraversalSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed -... | [
"Gets",
"the",
"OsidSession",
"associated",
"with",
"the",
"hierarchy",
"traversal",
"service",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/hierarchy/managers.py#L297-L314 |
mitsei/dlkit | dlkit/json_/hierarchy/managers.py | HierarchyProxyManager.get_hierarchy_traversal_session_for_hierarchy | def get_hierarchy_traversal_session_for_hierarchy(self, hierarchy_id, proxy):
"""Gets the ``OsidSession`` associated with the hierarchy traversal service for the given hierarchy.
arg: hierarchy_id (osid.id.Id): the ``Id`` of the hierarchy
arg: proxy (osid.proxy.Proxy): a proxy
ret... | python | def get_hierarchy_traversal_session_for_hierarchy(self, hierarchy_id, proxy):
"""Gets the ``OsidSession`` associated with the hierarchy traversal service for the given hierarchy.
arg: hierarchy_id (osid.id.Id): the ``Id`` of the hierarchy
arg: proxy (osid.proxy.Proxy): a proxy
ret... | [
"def",
"get_hierarchy_traversal_session_for_hierarchy",
"(",
"self",
",",
"hierarchy_id",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_hierarchy_traversal",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"##",
"# Also include check ... | Gets the ``OsidSession`` associated with the hierarchy traversal service for the given hierarchy.
arg: hierarchy_id (osid.id.Id): the ``Id`` of the hierarchy
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyTraversalSession) - a
``HierarchyTraversalS... | [
"Gets",
"the",
"OsidSession",
"associated",
"with",
"the",
"hierarchy",
"traversal",
"service",
"for",
"the",
"given",
"hierarchy",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/hierarchy/managers.py#L317-L340 |
mitsei/dlkit | dlkit/json_/hierarchy/managers.py | HierarchyProxyManager.get_hierarchy_design_session | def get_hierarchy_design_session(self, proxy):
"""Gets the ``OsidSession`` associated with the hierarchy design service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyDesignSession) - a
``HierarchyDesignSession``
raise: NullArgument - ``prox... | python | def get_hierarchy_design_session(self, proxy):
"""Gets the ``OsidSession`` associated with the hierarchy design service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyDesignSession) - a
``HierarchyDesignSession``
raise: NullArgument - ``prox... | [
"def",
"get_hierarchy_design_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_hierarchy_design",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"Hierarch... | Gets the ``OsidSession`` associated with the hierarchy design service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyDesignSession) - a
``HierarchyDesignSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable t... | [
"Gets",
"the",
"OsidSession",
"associated",
"with",
"the",
"hierarchy",
"design",
"service",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/hierarchy/managers.py#L343-L360 |
mitsei/dlkit | dlkit/json_/hierarchy/managers.py | HierarchyProxyManager.get_hierarchy_design_session_for_hierarchy | def get_hierarchy_design_session_for_hierarchy(self, hierarchy_id, proxy):
"""Gets the ``OsidSession`` associated with the topology design service using for the given hierarchy.
arg: hierarchy_id (osid.id.Id): the ``Id`` of the hierarchy
arg: proxy (osid.proxy.Proxy): a proxy
retu... | python | def get_hierarchy_design_session_for_hierarchy(self, hierarchy_id, proxy):
"""Gets the ``OsidSession`` associated with the topology design service using for the given hierarchy.
arg: hierarchy_id (osid.id.Id): the ``Id`` of the hierarchy
arg: proxy (osid.proxy.Proxy): a proxy
retu... | [
"def",
"get_hierarchy_design_session_for_hierarchy",
"(",
"self",
",",
"hierarchy_id",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_hierarchy_design",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"##",
"# Also include check to see... | Gets the ``OsidSession`` associated with the topology design service using for the given hierarchy.
arg: hierarchy_id (osid.id.Id): the ``Id`` of the hierarchy
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyDesignSession) - a
``HierarchyDesignSessi... | [
"Gets",
"the",
"OsidSession",
"associated",
"with",
"the",
"topology",
"design",
"service",
"using",
"for",
"the",
"given",
"hierarchy",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/hierarchy/managers.py#L363-L386 |
mitsei/dlkit | dlkit/json_/hierarchy/managers.py | HierarchyProxyManager.get_hierarchy_lookup_session | def get_hierarchy_lookup_session(self, proxy):
"""Gets the ``OsidSession`` associated with the hierarchy lookup service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyLookupSession) - a
``HierarchyLookupSession``
raise: NullArgument - ``prox... | python | def get_hierarchy_lookup_session(self, proxy):
"""Gets the ``OsidSession`` associated with the hierarchy lookup service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyLookupSession) - a
``HierarchyLookupSession``
raise: NullArgument - ``prox... | [
"def",
"get_hierarchy_lookup_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_hierarchy_lookup",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"Hierarch... | Gets the ``OsidSession`` associated with the hierarchy lookup service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyLookupSession) - a
``HierarchyLookupSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable t... | [
"Gets",
"the",
"OsidSession",
"associated",
"with",
"the",
"hierarchy",
"lookup",
"service",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/hierarchy/managers.py#L389-L406 |
mitsei/dlkit | dlkit/json_/hierarchy/managers.py | HierarchyProxyManager.get_hierarchy_admin_session | def get_hierarchy_admin_session(self, proxy):
"""Gets the hierarchy administrative session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyAdminSession) - a
``HierarchyAdminSession``
raise: NullArgument - ``proxy`` is ``null``
raise: ... | python | def get_hierarchy_admin_session(self, proxy):
"""Gets the hierarchy administrative session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyAdminSession) - a
``HierarchyAdminSession``
raise: NullArgument - ``proxy`` is ``null``
raise: ... | [
"def",
"get_hierarchy_admin_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_hierarchy_admin",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"HierarchyA... | Gets the hierarchy administrative session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.hierarchy.HierarchyAdminSession) - a
``HierarchyAdminSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to complete request
rai... | [
"Gets",
"the",
"hierarchy",
"administrative",
"session",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/hierarchy/managers.py#L409-L426 |
kylef/maintain | maintain/changelog.py | ast_to_headings | def ast_to_headings(node):
"""
Walks AST and returns a list of headings
"""
Heading = namedtuple('Heading', ['level', 'title'])
level = None
walker = node.walker()
headings = []
event = walker.nxt()
while event is not None:
entering = event['entering']
node = event... | python | def ast_to_headings(node):
"""
Walks AST and returns a list of headings
"""
Heading = namedtuple('Heading', ['level', 'title'])
level = None
walker = node.walker()
headings = []
event = walker.nxt()
while event is not None:
entering = event['entering']
node = event... | [
"def",
"ast_to_headings",
"(",
"node",
")",
":",
"Heading",
"=",
"namedtuple",
"(",
"'Heading'",
",",
"[",
"'level'",
",",
"'title'",
"]",
")",
"level",
"=",
"None",
"walker",
"=",
"node",
".",
"walker",
"(",
")",
"headings",
"=",
"[",
"]",
"event",
... | Walks AST and returns a list of headings | [
"Walks",
"AST",
"and",
"returns",
"a",
"list",
"of",
"headings"
] | train | https://github.com/kylef/maintain/blob/4b60e6c52accb4a7faf0d7255a7079087d3ecee0/maintain/changelog.py#L30-L59 |
dictatorlib/dictator | dictator/__init__.py | Dictator.copy | def copy(self):
"""Convert ``Dictator`` to standard ``dict`` object
>>> dc = Dictator()
>>> dc['l0'] = [1, 2]
>>> dc['1'] = 'abc'
>>> d = dc.copy()
>>> type(d)
dict
>>> d
{'l0': ['1', '2'], '1': 'abc'}
>>> dc.clear()
:return: Pyth... | python | def copy(self):
"""Convert ``Dictator`` to standard ``dict`` object
>>> dc = Dictator()
>>> dc['l0'] = [1, 2]
>>> dc['1'] = 'abc'
>>> d = dc.copy()
>>> type(d)
dict
>>> d
{'l0': ['1', '2'], '1': 'abc'}
>>> dc.clear()
:return: Pyth... | [
"def",
"copy",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"'call to_dict'",
")",
"return",
"{",
"key",
":",
"self",
".",
"get",
"(",
"key",
")",
"for",
"key",
"in",
"self",
".",
"keys",
"(",
")",
"}"
] | Convert ``Dictator`` to standard ``dict`` object
>>> dc = Dictator()
>>> dc['l0'] = [1, 2]
>>> dc['1'] = 'abc'
>>> d = dc.copy()
>>> type(d)
dict
>>> d
{'l0': ['1', '2'], '1': 'abc'}
>>> dc.clear()
:return: Python's dict object
:r... | [
"Convert",
"Dictator",
"to",
"standard",
"dict",
"object"
] | train | https://github.com/dictatorlib/dictator/blob/b77b1709b6fff174f13b0f0c5dbe740b4c07d712/dictator/__init__.py#L160-L177 |
dictatorlib/dictator | dictator/__init__.py | Dictator.get | def get(self, key, default=None):
"""Return the value at key ``key``, or default value ``default``
which is None by default.
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc.get('l0')
['1', '2', '3', '4']
>>> dc['l0']
['1', '2', '3', '4']
>>... | python | def get(self, key, default=None):
"""Return the value at key ``key``, or default value ``default``
which is None by default.
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc.get('l0')
['1', '2', '3', '4']
>>> dc['l0']
['1', '2', '3', '4']
>>... | [
"def",
"get",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"try",
":",
"value",
"=",
"self",
".",
"__getitem__",
"(",
"key",
")",
"except",
"KeyError",
":",
"value",
"=",
"None",
"# Py3 Redis compatibiility",
"if",
"isinstance",
"(",
... | Return the value at key ``key``, or default value ``default``
which is None by default.
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc.get('l0')
['1', '2', '3', '4']
>>> dc['l0']
['1', '2', '3', '4']
>>> dc.clear()
:param key: key of valu... | [
"Return",
"the",
"value",
"at",
"key",
"key",
"or",
"default",
"value",
"default",
"which",
"is",
"None",
"by",
"default",
"."
] | train | https://github.com/dictatorlib/dictator/blob/b77b1709b6fff174f13b0f0c5dbe740b4c07d712/dictator/__init__.py#L208-L235 |
dictatorlib/dictator | dictator/__init__.py | Dictator.pop | def pop(self, key, default=None):
"""Remove and return the last item of the list ``key``.
If key doesn't exists it return ``default``.
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc.pop('l0')
['1', '2', '3', '4']
>>> dc.pop('l1', 'empty')
'empty'
... | python | def pop(self, key, default=None):
"""Remove and return the last item of the list ``key``.
If key doesn't exists it return ``default``.
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc.pop('l0')
['1', '2', '3', '4']
>>> dc.pop('l1', 'empty')
'empty'
... | [
"def",
"pop",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"logger",
".",
"debug",
"(",
"'call pop %s'",
",",
"key",
")",
"value",
"=",
"self",
".",
"get",
"(",
"key",
")",
"self",
".",
"_redis",
".",
"delete",
"(",
"key",
")",... | Remove and return the last item of the list ``key``.
If key doesn't exists it return ``default``.
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc.pop('l0')
['1', '2', '3', '4']
>>> dc.pop('l1', 'empty')
'empty'
:param key: key name to pop
... | [
"Remove",
"and",
"return",
"the",
"last",
"item",
"of",
"the",
"list",
"key",
".",
"If",
"key",
"doesn",
"t",
"exists",
"it",
"return",
"default",
"."
] | train | https://github.com/dictatorlib/dictator/blob/b77b1709b6fff174f13b0f0c5dbe740b4c07d712/dictator/__init__.py#L252-L273 |
dictatorlib/dictator | dictator/__init__.py | Dictator.keys | def keys(self, pattern=None):
"""Returns a list of keys matching ``pattern``.
By default return all keys.
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc['s0'] = 'string value'
>>> dc.keys()
['l0', 's0']
>>> dc.keys('h*')
[]
>>> dc.... | python | def keys(self, pattern=None):
"""Returns a list of keys matching ``pattern``.
By default return all keys.
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc['s0'] = 'string value'
>>> dc.keys()
['l0', 's0']
>>> dc.keys('h*')
[]
>>> dc.... | [
"def",
"keys",
"(",
"self",
",",
"pattern",
"=",
"None",
")",
":",
"logger",
".",
"debug",
"(",
"'call pop %s'",
",",
"pattern",
")",
"if",
"pattern",
"is",
"None",
":",
"pattern",
"=",
"'*'",
"return",
"self",
".",
"_redis",
".",
"keys",
"(",
"patte... | Returns a list of keys matching ``pattern``.
By default return all keys.
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc['s0'] = 'string value'
>>> dc.keys()
['l0', 's0']
>>> dc.keys('h*')
[]
>>> dc.clear()
:param pattern: key patt... | [
"Returns",
"a",
"list",
"of",
"keys",
"matching",
"pattern",
".",
"By",
"default",
"return",
"all",
"keys",
"."
] | train | https://github.com/dictatorlib/dictator/blob/b77b1709b6fff174f13b0f0c5dbe740b4c07d712/dictator/__init__.py#L275-L296 |
dictatorlib/dictator | dictator/__init__.py | Dictator.items | def items(self):
"""Return list of tuples of keys and values in db
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc.items()
[('l0', ['1', '2', '3', '4'])]
>>> dc.clear()
:return: list of (key, value) pairs
:rtype: list of tuple
"""
... | python | def items(self):
"""Return list of tuples of keys and values in db
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc.items()
[('l0', ['1', '2', '3', '4'])]
>>> dc.clear()
:return: list of (key, value) pairs
:rtype: list of tuple
"""
... | [
"def",
"items",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"'call items'",
")",
"return",
"[",
"(",
"key",
",",
"self",
".",
"get",
"(",
"key",
")",
")",
"for",
"key",
"in",
"self",
".",
"keys",
"(",
")",
"]"
] | Return list of tuples of keys and values in db
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc.items()
[('l0', ['1', '2', '3', '4'])]
>>> dc.clear()
:return: list of (key, value) pairs
:rtype: list of tuple | [
"Return",
"list",
"of",
"tuples",
"of",
"keys",
"and",
"values",
"in",
"db"
] | train | https://github.com/dictatorlib/dictator/blob/b77b1709b6fff174f13b0f0c5dbe740b4c07d712/dictator/__init__.py#L298-L311 |
dictatorlib/dictator | dictator/__init__.py | Dictator.values | def values(self):
"""Return list of values in db
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc.items()
[('l0', ['1', '2', '3', '4'])]
>>> dc.clear()
:return: list of tuple
:rtype: list
"""
logger.debug('call values')
retu... | python | def values(self):
"""Return list of values in db
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc.items()
[('l0', ['1', '2', '3', '4'])]
>>> dc.clear()
:return: list of tuple
:rtype: list
"""
logger.debug('call values')
retu... | [
"def",
"values",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"'call values'",
")",
"return",
"[",
"self",
".",
"get",
"(",
"key",
")",
"for",
"key",
"in",
"self",
".",
"keys",
"(",
")",
"]"
] | Return list of values in db
>>> dc = Dictator()
>>> dc['l0'] = [1, 2, 3, 4]
>>> dc.items()
[('l0', ['1', '2', '3', '4'])]
>>> dc.clear()
:return: list of tuple
:rtype: list | [
"Return",
"list",
"of",
"values",
"in",
"db"
] | train | https://github.com/dictatorlib/dictator/blob/b77b1709b6fff174f13b0f0c5dbe740b4c07d712/dictator/__init__.py#L313-L326 |
dictatorlib/dictator | dictator/__init__.py | Dictator.iterkeys | def iterkeys(self, match=None, count=1):
"""Return an iterator over the db's keys.
``match`` allows for filtering the keys by pattern.
``count`` allows for hint the minimum number of returns.
>>> dc = Dictator()
>>> dc['1'] = 'abc'
>>> dc['2'] = 'def'
>>> dc['3']... | python | def iterkeys(self, match=None, count=1):
"""Return an iterator over the db's keys.
``match`` allows for filtering the keys by pattern.
``count`` allows for hint the minimum number of returns.
>>> dc = Dictator()
>>> dc['1'] = 'abc'
>>> dc['2'] = 'def'
>>> dc['3']... | [
"def",
"iterkeys",
"(",
"self",
",",
"match",
"=",
"None",
",",
"count",
"=",
"1",
")",
":",
"logger",
".",
"debug",
"(",
"'call iterkeys %s'",
",",
"match",
")",
"if",
"match",
"is",
"None",
":",
"match",
"=",
"'*'",
"for",
"key",
"in",
"self",
".... | Return an iterator over the db's keys.
``match`` allows for filtering the keys by pattern.
``count`` allows for hint the minimum number of returns.
>>> dc = Dictator()
>>> dc['1'] = 'abc'
>>> dc['2'] = 'def'
>>> dc['3'] = 'ghi'
>>> itr = dc.iterkeys()
>>>... | [
"Return",
"an",
"iterator",
"over",
"the",
"db",
"s",
"keys",
".",
"match",
"allows",
"for",
"filtering",
"the",
"keys",
"by",
"pattern",
".",
"count",
"allows",
"for",
"hint",
"the",
"minimum",
"number",
"of",
"returns",
"."
] | train | https://github.com/dictatorlib/dictator/blob/b77b1709b6fff174f13b0f0c5dbe740b4c07d712/dictator/__init__.py#L328-L355 |
dictatorlib/dictator | dictator/__init__.py | Dictator.iteritems | def iteritems(self, match=None, count=1):
"""Return an iterator over the db's (key, value) pairs.
``match`` allows for filtering the keys by pattern.
``count`` allows for hint the minimum number of returns.
>>> dc = Dictator()
>>> dc['1'] = 'abc'
>>> dc['2'] = 'def'
... | python | def iteritems(self, match=None, count=1):
"""Return an iterator over the db's (key, value) pairs.
``match`` allows for filtering the keys by pattern.
``count`` allows for hint the minimum number of returns.
>>> dc = Dictator()
>>> dc['1'] = 'abc'
>>> dc['2'] = 'def'
... | [
"def",
"iteritems",
"(",
"self",
",",
"match",
"=",
"None",
",",
"count",
"=",
"1",
")",
":",
"logger",
".",
"debug",
"(",
"'call iteritems %s'",
",",
"match",
")",
"if",
"match",
"is",
"None",
":",
"match",
"=",
"'*'",
"for",
"key",
"in",
"self",
... | Return an iterator over the db's (key, value) pairs.
``match`` allows for filtering the keys by pattern.
``count`` allows for hint the minimum number of returns.
>>> dc = Dictator()
>>> dc['1'] = 'abc'
>>> dc['2'] = 'def'
>>> dc['3'] = 'ghi'
>>> itr = dc.iteritem... | [
"Return",
"an",
"iterator",
"over",
"the",
"db",
"s",
"(",
"key",
"value",
")",
"pairs",
".",
"match",
"allows",
"for",
"filtering",
"the",
"keys",
"by",
"pattern",
".",
"count",
"allows",
"for",
"hint",
"the",
"minimum",
"number",
"of",
"returns",
"."
] | train | https://github.com/dictatorlib/dictator/blob/b77b1709b6fff174f13b0f0c5dbe740b4c07d712/dictator/__init__.py#L357-L384 |
dictatorlib/dictator | dictator/__init__.py | Dictator.update | def update(self, other=None, **kwargs):
"""D.update([other, ]**kwargs) -> None.
Update D From dict/iterable ``other`` and ``kwargs``.
If ``other`` present and has a .keys() method, does:
for k in other: D[k] = other[k]
If ``other`` present and lacks .keys() method, does:
... | python | def update(self, other=None, **kwargs):
"""D.update([other, ]**kwargs) -> None.
Update D From dict/iterable ``other`` and ``kwargs``.
If ``other`` present and has a .keys() method, does:
for k in other: D[k] = other[k]
If ``other`` present and lacks .keys() method, does:
... | [
"def",
"update",
"(",
"self",
",",
"other",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"logger",
".",
"debug",
"(",
"'call update %s'",
",",
"other",
")",
"if",
"other",
":",
"if",
"hasattr",
"(",
"other",
",",
"'keys'",
")",
":",
"for",
"key"... | D.update([other, ]**kwargs) -> None.
Update D From dict/iterable ``other`` and ``kwargs``.
If ``other`` present and has a .keys() method, does:
for k in other: D[k] = other[k]
If ``other`` present and lacks .keys() method, does:
for (k, v) in other: D[k] = v
In ei... | [
"D",
".",
"update",
"(",
"[",
"other",
"]",
"**",
"kwargs",
")",
"-",
">",
"None",
".",
"Update",
"D",
"From",
"dict",
"/",
"iterable",
"other",
"and",
"kwargs",
".",
"If",
"other",
"present",
"and",
"has",
"a",
".",
"keys",
"()",
"method",
"does",... | train | https://github.com/dictatorlib/dictator/blob/b77b1709b6fff174f13b0f0c5dbe740b4c07d712/dictator/__init__.py#L386-L419 |
mitsei/dlkit | dlkit/authz_adapter/resource/sessions.py | ResourceSearchSession.get_resources_by_search | def get_resources_by_search(self, resource_query, resource_search):
"""Pass through to provider ResourceSearchSession.get_resources_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
if not self._can('search'):
... | python | def get_resources_by_search(self, resource_query, resource_search):
"""Pass through to provider ResourceSearchSession.get_resources_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
if not self._can('search'):
... | [
"def",
"get_resources_by_search",
"(",
"self",
",",
"resource_query",
",",
"resource_search",
")",
":",
"# Implemented from azosid template for -",
"# osid.resource.ResourceSearchSession.get_resources_by_search_template",
"if",
"not",
"self",
".",
"_can",
"(",
"'search'",
")",
... | Pass through to provider ResourceSearchSession.get_resources_by_search | [
"Pass",
"through",
"to",
"provider",
"ResourceSearchSession",
".",
"get_resources_by_search"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/resource/sessions.py#L327-L333 |
mitsei/dlkit | dlkit/authz_adapter/resource/sessions.py | ResourceRelationshipLookupSession.get_resource_relationships_for_source_resource_on_date | def get_resource_relationships_for_source_resource_on_date(self, source_resource_id, from_, to):
"""Pass through to provider ResourceRelationshipLookupSession.get_resource_relationships_for_source_resource_on_date"""
# Implemented from azosid template for -
# osid.relationship.RelationshipLookup... | python | def get_resource_relationships_for_source_resource_on_date(self, source_resource_id, from_, to):
"""Pass through to provider ResourceRelationshipLookupSession.get_resource_relationships_for_source_resource_on_date"""
# Implemented from azosid template for -
# osid.relationship.RelationshipLookup... | [
"def",
"get_resource_relationships_for_source_resource_on_date",
"(",
"self",
",",
"source_resource_id",
",",
"from_",
",",
"to",
")",
":",
"# Implemented from azosid template for -",
"# osid.relationship.RelationshipLookupSession.get_relationships_for_source_on_date_template",
"if",
"... | Pass through to provider ResourceRelationshipLookupSession.get_resource_relationships_for_source_resource_on_date | [
"Pass",
"through",
"to",
"provider",
"ResourceRelationshipLookupSession",
".",
"get_resource_relationships_for_source_resource_on_date"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/resource/sessions.py#L1341-L1351 |
mitsei/dlkit | dlkit/authz_adapter/resource/sessions.py | ResourceRelationshipSearchSession.get_resource_relationships_by_search | def get_resource_relationships_by_search(self, resource_relationship_query, resource_relationship_search):
"""Pass through to provider ResourceRelationshipSearchSession.get_resource_relationships_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_reso... | python | def get_resource_relationships_by_search(self, resource_relationship_query, resource_relationship_search):
"""Pass through to provider ResourceRelationshipSearchSession.get_resource_relationships_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_reso... | [
"def",
"get_resource_relationships_by_search",
"(",
"self",
",",
"resource_relationship_query",
",",
"resource_relationship_search",
")",
":",
"# Implemented from azosid template for -",
"# osid.resource.ResourceSearchSession.get_resources_by_search_template",
"if",
"not",
"self",
".",... | Pass through to provider ResourceRelationshipSearchSession.get_resource_relationships_by_search | [
"Pass",
"through",
"to",
"provider",
"ResourceRelationshipSearchSession",
".",
"get_resource_relationships_by_search"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/resource/sessions.py#L1542-L1548 |
OpenAgInitiative/openag_python | openag/cli/firmware/base.py | FlowManager | def FlowManager(start_string, end_string):
"""
A factory for creating context managers for standard code constructions,
such as if statements and functions.
:param str start_string: A format string for the beginning of this code
structure
:param str end_string: A format string for the end of th... | python | def FlowManager(start_string, end_string):
"""
A factory for creating context managers for standard code constructions,
such as if statements and functions.
:param str start_string: A format string for the beginning of this code
structure
:param str end_string: A format string for the end of th... | [
"def",
"FlowManager",
"(",
"start_string",
",",
"end_string",
")",
":",
"class",
"Inner",
"(",
"object",
")",
":",
"def",
"__init__",
"(",
"self",
",",
"f",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"f",
"=",
"f",
"self",
".",
"kwargs",
"=",
... | A factory for creating context managers for standard code constructions,
such as if statements and functions.
:param str start_string: A format string for the beginning of this code
structure
:param str end_string: A format string for the end of this code structure
The constructor of the returned ... | [
"A",
"factory",
"for",
"creating",
"context",
"managers",
"for",
"standard",
"code",
"constructions",
"such",
"as",
"if",
"statements",
"and",
"functions",
"."
] | train | https://github.com/OpenAgInitiative/openag_python/blob/f6202340292bbf7185e1a7d4290188c0dacbb8d0/openag/cli/firmware/base.py#L7-L32 |
OpenAgInitiative/openag_python | openag/cli/firmware/base.py | CodeWriter.writeln | def writeln(self, data):
"""
Write a line of text to the file
:param data: The text to write
"""
self.f.write(" "*self.indent_level)
self.f.write(data + "\n") | python | def writeln(self, data):
"""
Write a line of text to the file
:param data: The text to write
"""
self.f.write(" "*self.indent_level)
self.f.write(data + "\n") | [
"def",
"writeln",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"f",
".",
"write",
"(",
"\" \"",
"*",
"self",
".",
"indent_level",
")",
"self",
".",
"f",
".",
"write",
"(",
"data",
"+",
"\"\\n\"",
")"
] | Write a line of text to the file
:param data: The text to write | [
"Write",
"a",
"line",
"of",
"text",
"to",
"the",
"file"
] | train | https://github.com/OpenAgInitiative/openag_python/blob/f6202340292bbf7185e1a7d4290188c0dacbb8d0/openag/cli/firmware/base.py#L49-L56 |
OpenAgInitiative/openag_python | openag/cli/firmware/base.py | CodeWriter._function | def _function(self, type, name, args=""):
"""
Returns a context manager for writing a function.
:param str type: The return type of the function
:param str name: The name of the functino
:param str args: The argument specification for the function
"""
return Func... | python | def _function(self, type, name, args=""):
"""
Returns a context manager for writing a function.
:param str type: The return type of the function
:param str name: The name of the functino
:param str args: The argument specification for the function
"""
return Func... | [
"def",
"_function",
"(",
"self",
",",
"type",
",",
"name",
",",
"args",
"=",
"\"\"",
")",
":",
"return",
"FunctionManager",
"(",
"self",
",",
"type",
"=",
"type",
",",
"name",
"=",
"name",
",",
"args",
"=",
"args",
")"
] | Returns a context manager for writing a function.
:param str type: The return type of the function
:param str name: The name of the functino
:param str args: The argument specification for the function | [
"Returns",
"a",
"context",
"manager",
"for",
"writing",
"a",
"function",
"."
] | train | https://github.com/OpenAgInitiative/openag_python/blob/f6202340292bbf7185e1a7d4290188c0dacbb8d0/openag/cli/firmware/base.py#L78-L86 |
OpenAgInitiative/openag_python | openag/cli/firmware/base.py | CodeGen.write_to | def write_to(self, f):
"""
Generates code based on the given module configuration and writes it to
the file object `f`.
"""
f = CodeWriter(f)
# Write all header files
headers = set()
for plugin in self.plugins:
headers = headers.union(plugin.h... | python | def write_to(self, f):
"""
Generates code based on the given module configuration and writes it to
the file object `f`.
"""
f = CodeWriter(f)
# Write all header files
headers = set()
for plugin in self.plugins:
headers = headers.union(plugin.h... | [
"def",
"write_to",
"(",
"self",
",",
"f",
")",
":",
"f",
"=",
"CodeWriter",
"(",
"f",
")",
"# Write all header files",
"headers",
"=",
"set",
"(",
")",
"for",
"plugin",
"in",
"self",
".",
"plugins",
":",
"headers",
"=",
"headers",
".",
"union",
"(",
... | Generates code based on the given module configuration and writes it to
the file object `f`. | [
"Generates",
"code",
"based",
"on",
"the",
"given",
"module",
"configuration",
"and",
"writes",
"it",
"to",
"the",
"file",
"object",
"f",
"."
] | train | https://github.com/OpenAgInitiative/openag_python/blob/f6202340292bbf7185e1a7d4290188c0dacbb8d0/openag/cli/firmware/base.py#L255-L319 |
mitsei/dlkit | dlkit/handcar/osid/objects.py | OsidObject._record_extension | def _record_extension(self, key, value):
"""
To structure a record extension property bean
"""
record_bean = {
'value': value,
'displayName': self._text_bean(key),
'description': self._text_bean(key),
'displayLabel': self._text_bean(key),
... | python | def _record_extension(self, key, value):
"""
To structure a record extension property bean
"""
record_bean = {
'value': value,
'displayName': self._text_bean(key),
'description': self._text_bean(key),
'displayLabel': self._text_bean(key),
... | [
"def",
"_record_extension",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"record_bean",
"=",
"{",
"'value'",
":",
"value",
",",
"'displayName'",
":",
"self",
".",
"_text_bean",
"(",
"key",
")",
",",
"'description'",
":",
"self",
".",
"_text_bean",
"(... | To structure a record extension property bean | [
"To",
"structure",
"a",
"record",
"extension",
"property",
"bean"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/objects.py#L144-L155 |
mitsei/dlkit | dlkit/handcar/osid/objects.py | OsidObject.get_genus_type | def get_genus_type(self):
"""Gets the genus type of this object.
return: (osid.type.Type) - the genus type of this object
compliance: mandatory - This method must be implemented.
"""
if self._my_genus_type_map is None:
url_path = '/handcar/services/learning/types/' ... | python | def get_genus_type(self):
"""Gets the genus type of this object.
return: (osid.type.Type) - the genus type of this object
compliance: mandatory - This method must be implemented.
"""
if self._my_genus_type_map is None:
url_path = '/handcar/services/learning/types/' ... | [
"def",
"get_genus_type",
"(",
"self",
")",
":",
"if",
"self",
".",
"_my_genus_type_map",
"is",
"None",
":",
"url_path",
"=",
"'/handcar/services/learning/types/'",
"+",
"self",
".",
"_my_map",
"[",
"'genusTypeId'",
"]",
"# url_str = self._base_url + '/types/'... | Gets the genus type of this object.
return: (osid.type.Type) - the genus type of this object
compliance: mandatory - This method must be implemented. | [
"Gets",
"the",
"genus",
"type",
"of",
"this",
"object",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/objects.py#L293-L305 |
mitsei/dlkit | dlkit/handcar/osid/objects.py | OsidObject.is_of_genus_type | def is_of_genus_type(self, genus_type=None):
"""Tests if this object is of the given genus Type.
The given genus type may be supported by the object through the
type hierarchy.
| arg: ``genus_type`` (``osid.type.Type``): a genus type
| return: (``boolean``) - true if this ob... | python | def is_of_genus_type(self, genus_type=None):
"""Tests if this object is of the given genus Type.
The given genus type may be supported by the object through the
type hierarchy.
| arg: ``genus_type`` (``osid.type.Type``): a genus type
| return: (``boolean``) - true if this ob... | [
"def",
"is_of_genus_type",
"(",
"self",
",",
"genus_type",
"=",
"None",
")",
":",
"if",
"genus_type",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"else",
":",
"my_genus_type",
"=",
"self",
".",
"get_genus_type",
"(",
")",
"return",
"(",
"genus_ty... | Tests if this object is of the given genus Type.
The given genus type may be supported by the object through the
type hierarchy.
| arg: ``genus_type`` (``osid.type.Type``): a genus type
| return: (``boolean``) - true if this object is of the given genus
Type, false ... | [
"Tests",
"if",
"this",
"object",
"is",
"of",
"the",
"given",
"genus",
"Type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/objects.py#L307-L326 |
mitsei/dlkit | dlkit/handcar/osid/objects.py | OsidForm.set_journal_comment | def set_journal_comment(self, comment=None):
"""Sets a comment.
arg: comment (string): the new comment
raise: InvalidArgument - comment is invalid
raise: NoAccess - metadata.is_readonly() is true
raise: NullArgument - comment is null
compliance: mandatory - This me... | python | def set_journal_comment(self, comment=None):
"""Sets a comment.
arg: comment (string): the new comment
raise: InvalidArgument - comment is invalid
raise: NoAccess - metadata.is_readonly() is true
raise: NullArgument - comment is null
compliance: mandatory - This me... | [
"def",
"set_journal_comment",
"(",
"self",
",",
"comment",
"=",
"None",
")",
":",
"if",
"comment",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"metadata",
"=",
"Metadata",
"(",
"*",
"*",
"settings",
".",
"METADATA",
"[",
"'comment'",
"]",
")",
... | Sets a comment.
arg: comment (string): the new comment
raise: InvalidArgument - comment is invalid
raise: NoAccess - metadata.is_readonly() is true
raise: NullArgument - comment is null
compliance: mandatory - This method must be implemented. | [
"Sets",
"a",
"comment",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/objects.py#L632-L650 |
mitsei/dlkit | dlkit/handcar/osid/objects.py | OsidForm.is_valid | def is_valid(self):
"""Tests if ths form is in a valid state for submission.
A form is valid if all required data has been supplied compliant
with any constraints.
return: (boolean) - false if there is a known error in this
form, true otherwise
raise: Operation... | python | def is_valid(self):
"""Tests if ths form is in a valid state for submission.
A form is valid if all required data has been supplied compliant
with any constraints.
return: (boolean) - false if there is a known error in this
form, true otherwise
raise: Operation... | [
"def",
"is_valid",
"(",
"self",
")",
":",
"validity",
"=",
"True",
"for",
"element",
"in",
"self",
".",
"_validity_map",
":",
"if",
"self",
".",
"_validity_map",
"[",
"element",
"]",
"is",
"not",
"VALID",
":",
"validity",
"=",
"False",
"return",
"validit... | Tests if ths form is in a valid state for submission.
A form is valid if all required data has been supplied compliant
with any constraints.
return: (boolean) - false if there is a known error in this
form, true otherwise
raise: OperationFailed - attempt to perform val... | [
"Tests",
"if",
"ths",
"form",
"is",
"in",
"a",
"valid",
"state",
"for",
"submission",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/objects.py#L652-L668 |
mitsei/dlkit | dlkit/handcar/osid/objects.py | OsidObjectForm.set_display_name | def set_display_name(self, display_name=None):
"""Sets a display name.
A display name is required and if not set, will be set by the
provider.
arg: displayName (string): the new display name
raise: InvalidArgument - displayName is invalid
raise: NoAccess - metadata... | python | def set_display_name(self, display_name=None):
"""Sets a display name.
A display name is required and if not set, will be set by the
provider.
arg: displayName (string): the new display name
raise: InvalidArgument - displayName is invalid
raise: NoAccess - metadata... | [
"def",
"set_display_name",
"(",
"self",
",",
"display_name",
"=",
"None",
")",
":",
"if",
"display_name",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"metadata",
"=",
"Metadata",
"(",
"*",
"*",
"settings",
".",
"METADATA",
"[",
"'display_name'",
... | Sets a display name.
A display name is required and if not set, will be set by the
provider.
arg: displayName (string): the new display name
raise: InvalidArgument - displayName is invalid
raise: NoAccess - metadata.is_readonly() is true
raise: NullArgument - disp... | [
"Sets",
"a",
"display",
"name",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/objects.py#L984-L1005 |
mitsei/dlkit | dlkit/handcar/osid/objects.py | OsidObjectForm.set_description | def set_description(self, description=None):
"""Sets a description.
arg: description (string): the new description
raise: InvalidArgument - description is invalid
raise: NoAccess - metadata.is_readonly() is true
raise: NullArgument - description is null
compliance:... | python | def set_description(self, description=None):
"""Sets a description.
arg: description (string): the new description
raise: InvalidArgument - description is invalid
raise: NoAccess - metadata.is_readonly() is true
raise: NullArgument - description is null
compliance:... | [
"def",
"set_description",
"(",
"self",
",",
"description",
"=",
"None",
")",
":",
"if",
"description",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"metadata",
"=",
"Metadata",
"(",
"*",
"*",
"settings",
".",
"METADATA",
"[",
"'description'",
"]",... | Sets a description.
arg: description (string): the new description
raise: InvalidArgument - description is invalid
raise: NoAccess - metadata.is_readonly() is true
raise: NullArgument - description is null
compliance: mandatory - This method must be implemented. | [
"Sets",
"a",
"description",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/objects.py#L1029-L1047 |
mitsei/dlkit | dlkit/handcar/osid/objects.py | OsidObjectForm.set_genus_type | def set_genus_type(self, genus_type=None):
"""Sets a genus.
A genus cannot be cleared because all objects have at minimum a
root genus.
arg: genusType (osid.type.Type): the new genus
raise: InvalidArgument - genusType is invalid
raise: NoAccess - metadata.is_readon... | python | def set_genus_type(self, genus_type=None):
"""Sets a genus.
A genus cannot be cleared because all objects have at minimum a
root genus.
arg: genusType (osid.type.Type): the new genus
raise: InvalidArgument - genusType is invalid
raise: NoAccess - metadata.is_readon... | [
"def",
"set_genus_type",
"(",
"self",
",",
"genus_type",
"=",
"None",
")",
":",
"if",
"genus_type",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"metadata",
"=",
"Metadata",
"(",
"*",
"*",
"settings",
".",
"METADATA",
"[",
"'genus_type'",
"]",
"... | Sets a genus.
A genus cannot be cleared because all objects have at minimum a
root genus.
arg: genusType (osid.type.Type): the new genus
raise: InvalidArgument - genusType is invalid
raise: NoAccess - metadata.is_readonly() is true
raise: NullArgument - genusType ... | [
"Sets",
"a",
"genus",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/objects.py#L1071-L1097 |
MacHu-GWU/docfly-project | docfly/directives/autotoctree.py | AutoTocTree.derive_toctree_rst | def derive_toctree_rst(self, current_file):
"""
Generate the rst content::
.. toctree::
args ...
example.rst
...
:param current_file:
:return:
"""
TAB = " " * 4
lines = list()
lines.append(".. ... | python | def derive_toctree_rst(self, current_file):
"""
Generate the rst content::
.. toctree::
args ...
example.rst
...
:param current_file:
:return:
"""
TAB = " " * 4
lines = list()
lines.append(".. ... | [
"def",
"derive_toctree_rst",
"(",
"self",
",",
"current_file",
")",
":",
"TAB",
"=",
"\" \"",
"*",
"4",
"lines",
"=",
"list",
"(",
")",
"lines",
".",
"append",
"(",
"\".. toctree::\"",
")",
"for",
"opt",
"in",
"TocTree",
".",
"option_spec",
":",
"value",... | Generate the rst content::
.. toctree::
args ...
example.rst
...
:param current_file:
:return: | [
"Generate",
"the",
"rst",
"content",
"::"
] | train | https://github.com/MacHu-GWU/docfly-project/blob/46da8a9793211301c3ebc12d195228dbf79fdfec/docfly/directives/autotoctree.py#L51-L89 |
willyg302/clip.py | clip.py | confirm | def confirm(prompt, default=None, show_default=True, abort=False, input_function=None):
'''Prompts for confirmation from the user.
'''
valid = {
'yes': True,
'y': True,
'no': False,
'n': False
}
input_function = get_input_fn(input_function)
if default not in ['yes', 'no', None]:
default = None
if show_... | python | def confirm(prompt, default=None, show_default=True, abort=False, input_function=None):
'''Prompts for confirmation from the user.
'''
valid = {
'yes': True,
'y': True,
'no': False,
'n': False
}
input_function = get_input_fn(input_function)
if default not in ['yes', 'no', None]:
default = None
if show_... | [
"def",
"confirm",
"(",
"prompt",
",",
"default",
"=",
"None",
",",
"show_default",
"=",
"True",
",",
"abort",
"=",
"False",
",",
"input_function",
"=",
"None",
")",
":",
"valid",
"=",
"{",
"'yes'",
":",
"True",
",",
"'y'",
":",
"True",
",",
"'no'",
... | Prompts for confirmation from the user. | [
"Prompts",
"for",
"confirmation",
"from",
"the",
"user",
"."
] | train | https://github.com/willyg302/clip.py/blob/4429559adf26e6a2ce22175b5b12f40378427bf1/clip.py#L116-L139 |
willyg302/clip.py | clip.py | prompt | def prompt(text, default=None, show_default=True, invisible=False,
confirm=False, skip=False, type=None, input_function=None):
'''Prompts for input from the user.
'''
t = determine_type(type, default)
input_function = get_input_fn(input_function, invisible)
if default is not None and show_default:
tex... | python | def prompt(text, default=None, show_default=True, invisible=False,
confirm=False, skip=False, type=None, input_function=None):
'''Prompts for input from the user.
'''
t = determine_type(type, default)
input_function = get_input_fn(input_function, invisible)
if default is not None and show_default:
tex... | [
"def",
"prompt",
"(",
"text",
",",
"default",
"=",
"None",
",",
"show_default",
"=",
"True",
",",
"invisible",
"=",
"False",
",",
"confirm",
"=",
"False",
",",
"skip",
"=",
"False",
",",
"type",
"=",
"None",
",",
"input_function",
"=",
"None",
")",
"... | Prompts for input from the user. | [
"Prompts",
"for",
"input",
"from",
"the",
"user",
"."
] | train | https://github.com/willyg302/clip.py/blob/4429559adf26e6a2ce22175b5b12f40378427bf1/clip.py#L141-L155 |
willyg302/clip.py | clip.py | Parameter.consume | def consume(self, tokens):
'''Have this parameter consume some tokens.
This stores the consumed value for later use and returns the
modified tokens array for further processing.
'''
n = len(tokens) if self._nargs == -1 else self._nargs
if n > len(tokens):
exit('Error: Not enough arguments for "{}".'.for... | python | def consume(self, tokens):
'''Have this parameter consume some tokens.
This stores the consumed value for later use and returns the
modified tokens array for further processing.
'''
n = len(tokens) if self._nargs == -1 else self._nargs
if n > len(tokens):
exit('Error: Not enough arguments for "{}".'.for... | [
"def",
"consume",
"(",
"self",
",",
"tokens",
")",
":",
"n",
"=",
"len",
"(",
"tokens",
")",
"if",
"self",
".",
"_nargs",
"==",
"-",
"1",
"else",
"self",
".",
"_nargs",
"if",
"n",
">",
"len",
"(",
"tokens",
")",
":",
"exit",
"(",
"'Error: Not eno... | Have this parameter consume some tokens.
This stores the consumed value for later use and returns the
modified tokens array for further processing. | [
"Have",
"this",
"parameter",
"consume",
"some",
"tokens",
"."
] | train | https://github.com/willyg302/clip.py/blob/4429559adf26e6a2ce22175b5b12f40378427bf1/clip.py#L262-L279 |
willyg302/clip.py | clip.py | App.parse | def parse(self, tokens):
'''Parses a list of tokens into a JSON-serializable object.
The parsing proceeds from left to right and is greedy.
Precedence order:
1. Parameters with active context. For example, an Option with
nargs=-1 will gobble all the remaining tokens.
2. Subcommands.
3. Parame... | python | def parse(self, tokens):
'''Parses a list of tokens into a JSON-serializable object.
The parsing proceeds from left to right and is greedy.
Precedence order:
1. Parameters with active context. For example, an Option with
nargs=-1 will gobble all the remaining tokens.
2. Subcommands.
3. Parame... | [
"def",
"parse",
"(",
"self",
",",
"tokens",
")",
":",
"self",
".",
"_ping_main",
"(",
")",
"# Pre-parsing:",
"# 1. Expand globbed options: -abc --> -a -b -c",
"def",
"is_globbed",
"(",
"s",
")",
":",
"return",
"len",
"(",
"s",
")",
">",
"2",
"and",
"s",
... | Parses a list of tokens into a JSON-serializable object.
The parsing proceeds from left to right and is greedy.
Precedence order:
1. Parameters with active context. For example, an Option with
nargs=-1 will gobble all the remaining tokens.
2. Subcommands.
3. Parameters.
The keys of the retur... | [
"Parses",
"a",
"list",
"of",
"tokens",
"into",
"a",
"JSON",
"-",
"serializable",
"object",
"."
] | train | https://github.com/willyg302/clip.py/blob/4429559adf26e6a2ce22175b5b12f40378427bf1/clip.py#L603-L628 |
mitsei/dlkit | dlkit/json_/resource/default_mdata.py | get_resource_mdata | def get_resource_mdata():
"""Return default mdata map for Resource"""
return {
'group': {
'element_label': {
'text': 'group',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
'formatTypeId'... | python | def get_resource_mdata():
"""Return default mdata map for Resource"""
return {
'group': {
'element_label': {
'text': 'group',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
'formatTypeId'... | [
"def",
"get_resource_mdata",
"(",
")",
":",
"return",
"{",
"'group'",
":",
"{",
"'element_label'",
":",
"{",
"'text'",
":",
"'group'",
",",
"'languageTypeId'",
":",
"str",
"(",
"DEFAULT_LANGUAGE_TYPE",
")",
",",
"'scriptTypeId'",
":",
"str",
"(",
"DEFAULT_SCRI... | Return default mdata map for Resource | [
"Return",
"default",
"mdata",
"map",
"for",
"Resource"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/default_mdata.py#L11-L55 |
erkghlerngm44/malaffinity | malaffinity/__init__.py | calculate_affinity | def calculate_affinity(user1, user2, round=False): # pragma: no cover
"""
Quick one-off affinity calculations.
Creates an instance of the ``MALAffinity`` class with ``user1``,
then calculates affinity with ``user2``.
:param str user1: First user
:param str user2: Second user
:param round:... | python | def calculate_affinity(user1, user2, round=False): # pragma: no cover
"""
Quick one-off affinity calculations.
Creates an instance of the ``MALAffinity`` class with ``user1``,
then calculates affinity with ``user2``.
:param str user1: First user
:param str user2: Second user
:param round:... | [
"def",
"calculate_affinity",
"(",
"user1",
",",
"user2",
",",
"round",
"=",
"False",
")",
":",
"# pragma: no cover",
"return",
"MALAffinity",
"(",
"base_user",
"=",
"user1",
",",
"round",
"=",
"round",
")",
".",
"calculate_affinity",
"(",
"user2",
")"
] | Quick one-off affinity calculations.
Creates an instance of the ``MALAffinity`` class with ``user1``,
then calculates affinity with ``user2``.
:param str user1: First user
:param str user2: Second user
:param round: Decimal places to round affinity values to.
Specify ``False`` for no round... | [
"Quick",
"one",
"-",
"off",
"affinity",
"calculations",
"."
] | train | https://github.com/erkghlerngm44/malaffinity/blob/d866b9198b668333f0b86567b2faebdb20587e30/malaffinity/__init__.py#L29-L44 |
immstudios/nxtools | nxtools/timeutils.py | s2time | def s2time(secs, show_secs=True, show_fracs=True):
"""Converts seconds to time"""
try:
secs = float(secs)
except:
return "--:--:--.--"
wholesecs = int(secs)
centisecs = int((secs - wholesecs) * 100)
hh = int(wholesecs / 3600)
hd = int(hh % 24)
mm = int((wholesecs / 60) - ... | python | def s2time(secs, show_secs=True, show_fracs=True):
"""Converts seconds to time"""
try:
secs = float(secs)
except:
return "--:--:--.--"
wholesecs = int(secs)
centisecs = int((secs - wholesecs) * 100)
hh = int(wholesecs / 3600)
hd = int(hh % 24)
mm = int((wholesecs / 60) - ... | [
"def",
"s2time",
"(",
"secs",
",",
"show_secs",
"=",
"True",
",",
"show_fracs",
"=",
"True",
")",
":",
"try",
":",
"secs",
"=",
"float",
"(",
"secs",
")",
"except",
":",
"return",
"\"--:--:--.--\"",
"wholesecs",
"=",
"int",
"(",
"secs",
")",
"centisecs... | Converts seconds to time | [
"Converts",
"seconds",
"to",
"time"
] | train | https://github.com/immstudios/nxtools/blob/8c30213c61aec460c648d5e9ae7ce79dfb7b4b9a/nxtools/timeutils.py#L47-L64 |
immstudios/nxtools | nxtools/timeutils.py | f2tc | def f2tc(f,base=25):
"""Converts frames to timecode"""
try:
f = int(f)
except:
return "--:--:--:--"
hh = int((f / base) / 3600)
mm = int(((f / base) / 60) - (hh*60))
ss = int((f/base) - (hh*3600) - (mm*60))
ff = int(f - (hh*3600*base) - (mm*60*base) - (ss*base))
return "{... | python | def f2tc(f,base=25):
"""Converts frames to timecode"""
try:
f = int(f)
except:
return "--:--:--:--"
hh = int((f / base) / 3600)
mm = int(((f / base) / 60) - (hh*60))
ss = int((f/base) - (hh*3600) - (mm*60))
ff = int(f - (hh*3600*base) - (mm*60*base) - (ss*base))
return "{... | [
"def",
"f2tc",
"(",
"f",
",",
"base",
"=",
"25",
")",
":",
"try",
":",
"f",
"=",
"int",
"(",
"f",
")",
"except",
":",
"return",
"\"--:--:--:--\"",
"hh",
"=",
"int",
"(",
"(",
"f",
"/",
"base",
")",
"/",
"3600",
")",
"mm",
"=",
"int",
"(",
"... | Converts frames to timecode | [
"Converts",
"frames",
"to",
"timecode"
] | train | https://github.com/immstudios/nxtools/blob/8c30213c61aec460c648d5e9ae7ce79dfb7b4b9a/nxtools/timeutils.py#L67-L77 |
immstudios/nxtools | nxtools/timeutils.py | s2tc | def s2tc(s,base=25):
"""Converts seconds to timecode"""
try:
f = int(s*base)
except:
return "--:--:--:--"
hh = int((f / base) / 3600)
hhd = int((hh % 24))
mm = int(((f / base) / 60) - (hh*60))
ss = int((f/base) - (hh*3600) - (mm*60))
ff = int(f - (hh*3600*base) - (mm*... | python | def s2tc(s,base=25):
"""Converts seconds to timecode"""
try:
f = int(s*base)
except:
return "--:--:--:--"
hh = int((f / base) / 3600)
hhd = int((hh % 24))
mm = int(((f / base) / 60) - (hh*60))
ss = int((f/base) - (hh*3600) - (mm*60))
ff = int(f - (hh*3600*base) - (mm*... | [
"def",
"s2tc",
"(",
"s",
",",
"base",
"=",
"25",
")",
":",
"try",
":",
"f",
"=",
"int",
"(",
"s",
"*",
"base",
")",
"except",
":",
"return",
"\"--:--:--:--\"",
"hh",
"=",
"int",
"(",
"(",
"f",
"/",
"base",
")",
"/",
"3600",
")",
"hhd",
"=",
... | Converts seconds to timecode | [
"Converts",
"seconds",
"to",
"timecode"
] | train | https://github.com/immstudios/nxtools/blob/8c30213c61aec460c648d5e9ae7ce79dfb7b4b9a/nxtools/timeutils.py#L80-L91 |
immstudios/nxtools | nxtools/timeutils.py | format_time | def format_time(timestamp, time_format="%Y-%m-%d %H:%M:%S", never_placeholder="never", gmt=False):
"""strftime/localtime shortcut"""
if not timestamp:
return never_placeholder
return time.strftime(time_format, time.gmtime(timestamp) if gmt else time.localtime(timestamp)) | python | def format_time(timestamp, time_format="%Y-%m-%d %H:%M:%S", never_placeholder="never", gmt=False):
"""strftime/localtime shortcut"""
if not timestamp:
return never_placeholder
return time.strftime(time_format, time.gmtime(timestamp) if gmt else time.localtime(timestamp)) | [
"def",
"format_time",
"(",
"timestamp",
",",
"time_format",
"=",
"\"%Y-%m-%d %H:%M:%S\"",
",",
"never_placeholder",
"=",
"\"never\"",
",",
"gmt",
"=",
"False",
")",
":",
"if",
"not",
"timestamp",
":",
"return",
"never_placeholder",
"return",
"time",
".",
"strfti... | strftime/localtime shortcut | [
"strftime",
"/",
"localtime",
"shortcut"
] | train | https://github.com/immstudios/nxtools/blob/8c30213c61aec460c648d5e9ae7ce79dfb7b4b9a/nxtools/timeutils.py#L106-L110 |
jason-weirather/py-seq-tools | seqtools/cli/utilities/fastq_to_salmon_quant.py | main | def main(args):
""" First read the genome """
sys.stderr.write("reading reference genome\n")
ref = FASTAData(open(args.genome).read())
sys.stderr.write("read in "+str(len(ref.keys()))+" chromosomes\n")
""" Next make the transcriptome """
txome = {}
sys.stderr.write("write the transcriptome\n")
inf = N... | python | def main(args):
""" First read the genome """
sys.stderr.write("reading reference genome\n")
ref = FASTAData(open(args.genome).read())
sys.stderr.write("read in "+str(len(ref.keys()))+" chromosomes\n")
""" Next make the transcriptome """
txome = {}
sys.stderr.write("write the transcriptome\n")
inf = N... | [
"def",
"main",
"(",
"args",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"\"reading reference genome\\n\"",
")",
"ref",
"=",
"FASTAData",
"(",
"open",
"(",
"args",
".",
"genome",
")",
".",
"read",
"(",
")",
")",
"sys",
".",
"stderr",
".",
"writ... | First read the genome | [
"First",
"read",
"the",
"genome"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/cli/utilities/fastq_to_salmon_quant.py#L33-L114 |
delfick/harpoon | harpoon/ship/context.py | ContextWrapper.clone_with_new_dockerfile | def clone_with_new_dockerfile(self, conf, docker_file):
"""Clone this tarfile and add in another filename before closing the new tar and returning"""
log.info("Copying context to add a different dockerfile")
self.close()
with a_temp_file() as tmpfile:
old_t = os.stat(self.tmp... | python | def clone_with_new_dockerfile(self, conf, docker_file):
"""Clone this tarfile and add in another filename before closing the new tar and returning"""
log.info("Copying context to add a different dockerfile")
self.close()
with a_temp_file() as tmpfile:
old_t = os.stat(self.tmp... | [
"def",
"clone_with_new_dockerfile",
"(",
"self",
",",
"conf",
",",
"docker_file",
")",
":",
"log",
".",
"info",
"(",
"\"Copying context to add a different dockerfile\"",
")",
"self",
".",
"close",
"(",
")",
"with",
"a_temp_file",
"(",
")",
"as",
"tmpfile",
":",
... | Clone this tarfile and add in another filename before closing the new tar and returning | [
"Clone",
"this",
"tarfile",
"and",
"add",
"in",
"another",
"filename",
"before",
"closing",
"the",
"new",
"tar",
"and",
"returning"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/ship/context.py#L62-L73 |
delfick/harpoon | harpoon/ship/context.py | ContextBuilder.make_context | def make_context(self, context, silent_build=False, extra_context=None):
"""
Context manager for creating the context of the image
Arguments:
context - ``harpoon.option_spec.image_objs.Context``
Knows all the context related options
silent_build - boolean
... | python | def make_context(self, context, silent_build=False, extra_context=None):
"""
Context manager for creating the context of the image
Arguments:
context - ``harpoon.option_spec.image_objs.Context``
Knows all the context related options
silent_build - boolean
... | [
"def",
"make_context",
"(",
"self",
",",
"context",
",",
"silent_build",
"=",
"False",
",",
"extra_context",
"=",
"None",
")",
":",
"with",
"a_temp_file",
"(",
")",
"as",
"tmpfile",
":",
"t",
"=",
"tarfile",
".",
"open",
"(",
"mode",
"=",
"'w'",
",",
... | Context manager for creating the context of the image
Arguments:
context - ``harpoon.option_spec.image_objs.Context``
Knows all the context related options
silent_build - boolean
If True, then suppress printing out information
extra_context - List of (content,... | [
"Context",
"manager",
"for",
"creating",
"the",
"context",
"of",
"the",
"image"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/ship/context.py#L82-L116 |
delfick/harpoon | harpoon/ship/context.py | ContextBuilder.the_context | def the_context(self, content, silent_build=False):
"""Return either a file with the content written to it, or a whole new context tar"""
if isinstance(content, six.string_types):
with a_temp_file() as fle:
fle.write(content.encode('utf-8'))
fle.seek(0)
... | python | def the_context(self, content, silent_build=False):
"""Return either a file with the content written to it, or a whole new context tar"""
if isinstance(content, six.string_types):
with a_temp_file() as fle:
fle.write(content.encode('utf-8'))
fle.seek(0)
... | [
"def",
"the_context",
"(",
"self",
",",
"content",
",",
"silent_build",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"content",
",",
"six",
".",
"string_types",
")",
":",
"with",
"a_temp_file",
"(",
")",
"as",
"fle",
":",
"fle",
".",
"write",
"(",
... | Return either a file with the content written to it, or a whole new context tar | [
"Return",
"either",
"a",
"file",
"with",
"the",
"content",
"written",
"to",
"it",
"or",
"a",
"whole",
"new",
"context",
"tar"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/ship/context.py#L119-L175 |
delfick/harpoon | harpoon/ship/context.py | ContextBuilder.find_files_for_tar | def find_files_for_tar(self, context, silent_build):
"""
Return [(filename, arcname), ...] for all the files.
"""
if not context.enabled:
return
files = self.find_files(context, silent_build)
for path in files:
relname = os.path.relpath(path, con... | python | def find_files_for_tar(self, context, silent_build):
"""
Return [(filename, arcname), ...] for all the files.
"""
if not context.enabled:
return
files = self.find_files(context, silent_build)
for path in files:
relname = os.path.relpath(path, con... | [
"def",
"find_files_for_tar",
"(",
"self",
",",
"context",
",",
"silent_build",
")",
":",
"if",
"not",
"context",
".",
"enabled",
":",
"return",
"files",
"=",
"self",
".",
"find_files",
"(",
"context",
",",
"silent_build",
")",
"for",
"path",
"in",
"files",... | Return [(filename, arcname), ...] for all the files. | [
"Return",
"[",
"(",
"filename",
"arcname",
")",
"...",
"]",
"for",
"all",
"the",
"files",
"."
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/ship/context.py#L177-L190 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.