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 |
|---|---|---|---|---|---|---|---|---|---|---|
mulkieran/justbases | src/justbases/_division.py | NatDivision.undivision | def undivision(
cls,
integer_part,
non_repeating_part,
repeating_part,
base
):
"""
Find divisor and dividend that yield component parts.
:param integer_part: the integer part
:type integer_part: list of int
:param non_repeating_part: the no... | python | def undivision(
cls,
integer_part,
non_repeating_part,
repeating_part,
base
):
"""
Find divisor and dividend that yield component parts.
:param integer_part: the integer part
:type integer_part: list of int
:param non_repeating_part: the no... | [
"def",
"undivision",
"(",
"cls",
",",
"integer_part",
",",
"non_repeating_part",
",",
"repeating_part",
",",
"base",
")",
":",
"if",
"base",
"<",
"2",
":",
"raise",
"BasesValueError",
"(",
"base",
",",
"\"base\"",
",",
"\"must be at least 2\"",
")",
"if",
"a... | Find divisor and dividend that yield component parts.
:param integer_part: the integer part
:type integer_part: list of int
:param non_repeating_part: the non_repeating_part
:type non_repeating_part: list of int
:param repeating_part: the repeating part
:type repeating_p... | [
"Find",
"divisor",
"and",
"dividend",
"that",
"yield",
"component",
"parts",
"."
] | train | https://github.com/mulkieran/justbases/blob/dd52ff4b3d11609f54b2673599ee4eeb20f9734f/src/justbases/_division.py#L297-L369 |
mitsei/dlkit | dlkit/json_/cataloging/managers.py | CatalogingManager.get_catalog_lookup_session | def get_catalog_lookup_session(self):
"""Gets the catalog lookup session.
return: (osid.cataloging.CatalogLookupSession) - a
``CatalogLookupSession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_catalog_lookup()`` is
... | python | def get_catalog_lookup_session(self):
"""Gets the catalog lookup session.
return: (osid.cataloging.CatalogLookupSession) - a
``CatalogLookupSession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_catalog_lookup()`` is
... | [
"def",
"get_catalog_lookup_session",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"supports_catalog_lookup",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"CatalogLookupSession",
"(",
... | Gets the catalog lookup session.
return: (osid.cataloging.CatalogLookupSession) - a
``CatalogLookupSession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_catalog_lookup()`` is
``false``
*compliance: optional -- T... | [
"Gets",
"the",
"catalog",
"lookup",
"session",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/cataloging/managers.py#L156-L171 |
mitsei/dlkit | dlkit/json_/cataloging/managers.py | CatalogingManager.get_catalog_query_session | def get_catalog_query_session(self):
"""Gets the catalog query session.
return: (osid.cataloging.CatalogQuerySession) - a
``CatalogQuerySession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_catalog_query()`` is
... | python | def get_catalog_query_session(self):
"""Gets the catalog query session.
return: (osid.cataloging.CatalogQuerySession) - a
``CatalogQuerySession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_catalog_query()`` is
... | [
"def",
"get_catalog_query_session",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"supports_catalog_query",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"CatalogQuerySession",
"(",
"... | Gets the catalog query session.
return: (osid.cataloging.CatalogQuerySession) - a
``CatalogQuerySession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_catalog_query()`` is
``false``
*compliance: optional -- This ... | [
"Gets",
"the",
"catalog",
"query",
"session",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/cataloging/managers.py#L176-L191 |
mitsei/dlkit | dlkit/json_/cataloging/managers.py | CatalogingProxyManager.get_catalog_admin_session | def get_catalog_admin_session(self, proxy):
"""Gets the catalog administrative session for creating, updating and deleting catalogs.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.cataloging.CatalogAdminSession) - a
``CatalogAdminSession``
raise: NullArgument -... | python | def get_catalog_admin_session(self, proxy):
"""Gets the catalog administrative session for creating, updating and deleting catalogs.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.cataloging.CatalogAdminSession) - a
``CatalogAdminSession``
raise: NullArgument -... | [
"def",
"get_catalog_admin_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_catalog_admin",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"CatalogAdminSe... | Gets the catalog administrative session for creating, updating and deleting catalogs.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.cataloging.CatalogAdminSession) - a
``CatalogAdminSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed ... | [
"Gets",
"the",
"catalog",
"administrative",
"session",
"for",
"creating",
"updating",
"and",
"deleting",
"catalogs",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/cataloging/managers.py#L344-L361 |
mitsei/dlkit | dlkit/json_/cataloging/managers.py | CatalogingProxyManager.get_catalog_hierarchy_session | def get_catalog_hierarchy_session(self, proxy):
"""Gets the catalog hierarchy traversal session.
arg: proxy (osid.proxy.Proxy): proxy
return: (osid.cataloging.CatalogHierarchySession) - a
``CatalogHierarchySession``
raise: NullArgument - ``proxy`` is null
rai... | python | def get_catalog_hierarchy_session(self, proxy):
"""Gets the catalog hierarchy traversal session.
arg: proxy (osid.proxy.Proxy): proxy
return: (osid.cataloging.CatalogHierarchySession) - a
``CatalogHierarchySession``
raise: NullArgument - ``proxy`` is null
rai... | [
"def",
"get_catalog_hierarchy_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_catalog_hierarchy",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"Catalo... | Gets the catalog hierarchy traversal session.
arg: proxy (osid.proxy.Proxy): proxy
return: (osid.cataloging.CatalogHierarchySession) - a
``CatalogHierarchySession``
raise: NullArgument - ``proxy`` is null
raise: OperationFailed - unable to complete request
r... | [
"Gets",
"the",
"catalog",
"hierarchy",
"traversal",
"session",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/cataloging/managers.py#L364-L381 |
mitsei/dlkit | dlkit/json_/cataloging/managers.py | CatalogingProxyManager.get_catalog_hierarchy_design_session | def get_catalog_hierarchy_design_session(self, proxy):
"""Gets the catalog hierarchy design session.
arg: proxy (osid.proxy.Proxy): proxy
return: (osid.cataloging.CatalogHierarchyDesignSession) - a
``CatalogHierarchyDesignSession``
raise: NullArgument - ``proxy`` is ... | python | def get_catalog_hierarchy_design_session(self, proxy):
"""Gets the catalog hierarchy design session.
arg: proxy (osid.proxy.Proxy): proxy
return: (osid.cataloging.CatalogHierarchyDesignSession) - a
``CatalogHierarchyDesignSession``
raise: NullArgument - ``proxy`` is ... | [
"def",
"get_catalog_hierarchy_design_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_catalog_hierarchy_design",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
... | Gets the catalog hierarchy design session.
arg: proxy (osid.proxy.Proxy): proxy
return: (osid.cataloging.CatalogHierarchyDesignSession) - a
``CatalogHierarchyDesignSession``
raise: NullArgument - ``proxy`` is null
raise: OperationFailed - unable to complete request
... | [
"Gets",
"the",
"catalog",
"hierarchy",
"design",
"session",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/cataloging/managers.py#L384-L401 |
mitsei/dlkit | dlkit/records/repository/edx/edx_assets.py | edXAssetContentRecord.get_edxml_with_aws_urls | def get_edxml_with_aws_urls(self):
"""stub"""
edxml = self.get_text().text
soup = BeautifulSoup(edxml, 'xml').find('html')
if soup is None:
soup = BeautifulSoup('', 'xml')
soup.append(BeautifulSoup(edxml, 'html5lib'))
attrs = {
'draggable': [... | python | def get_edxml_with_aws_urls(self):
"""stub"""
edxml = self.get_text().text
soup = BeautifulSoup(edxml, 'xml').find('html')
if soup is None:
soup = BeautifulSoup('', 'xml')
soup.append(BeautifulSoup(edxml, 'html5lib'))
attrs = {
'draggable': [... | [
"def",
"get_edxml_with_aws_urls",
"(",
"self",
")",
":",
"edxml",
"=",
"self",
".",
"get_text",
"(",
")",
".",
"text",
"soup",
"=",
"BeautifulSoup",
"(",
"edxml",
",",
"'xml'",
")",
".",
"find",
"(",
"'html'",
")",
"if",
"soup",
"is",
"None",
":",
"s... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/repository/edx/edx_assets.py#L121-L157 |
mitsei/dlkit | dlkit/records/repository/edx/edx_assets.py | edXAssetContentFormRecord._init_map | def _init_map(self):
"""stub"""
super(edXAssetContentFormRecord, self)._init_map()
AssetContentTextFormRecord._init_map(self)
FilesFormRecord._init_map(self)
ProvenanceFormRecord._init_map(self) | python | def _init_map(self):
"""stub"""
super(edXAssetContentFormRecord, self)._init_map()
AssetContentTextFormRecord._init_map(self)
FilesFormRecord._init_map(self)
ProvenanceFormRecord._init_map(self) | [
"def",
"_init_map",
"(",
"self",
")",
":",
"super",
"(",
"edXAssetContentFormRecord",
",",
"self",
")",
".",
"_init_map",
"(",
")",
"AssetContentTextFormRecord",
".",
"_init_map",
"(",
"self",
")",
"FilesFormRecord",
".",
"_init_map",
"(",
"self",
")",
"Proven... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/repository/edx/edx_assets.py#L180-L185 |
mitsei/dlkit | dlkit/records/repository/edx/edx_assets.py | edXAssetContentFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
super(edXAssetContentFormRecord, self)._init_metadata()
AssetContentTextFormRecord._init_metadata(self)
FilesFormRecord._init_metadata(self)
ProvenanceFormRecord._init_metadata(self) | python | def _init_metadata(self):
"""stub"""
super(edXAssetContentFormRecord, self)._init_metadata()
AssetContentTextFormRecord._init_metadata(self)
FilesFormRecord._init_metadata(self)
ProvenanceFormRecord._init_metadata(self) | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"super",
"(",
"edXAssetContentFormRecord",
",",
"self",
")",
".",
"_init_metadata",
"(",
")",
"AssetContentTextFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"FilesFormRecord",
".",
"_init_metadata",
"(",
"sel... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/repository/edx/edx_assets.py#L187-L192 |
mitsei/dlkit | dlkit/records/repository/edx/edx_assets.py | edXAssetRecord.clone_to | def clone_to(self, target_repo):
"""stub"""
new_asset = target_repo.duplicate_asset(self.my_osid_object.ident)
form = target_repo.get_asset_form_for_update(new_asset.ident)
form.set_provenance(str(self.my_osid_object.ident))
return target_repo.update_asset(form) | python | def clone_to(self, target_repo):
"""stub"""
new_asset = target_repo.duplicate_asset(self.my_osid_object.ident)
form = target_repo.get_asset_form_for_update(new_asset.ident)
form.set_provenance(str(self.my_osid_object.ident))
return target_repo.update_asset(form) | [
"def",
"clone_to",
"(",
"self",
",",
"target_repo",
")",
":",
"new_asset",
"=",
"target_repo",
".",
"duplicate_asset",
"(",
"self",
".",
"my_osid_object",
".",
"ident",
")",
"form",
"=",
"target_repo",
".",
"get_asset_form_for_update",
"(",
"new_asset",
".",
"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/repository/edx/edx_assets.py#L207-L212 |
ayust/kitnirc | kitnirc/contrib/commands.py | CommandsModule.regenerate_prefixes | def regenerate_prefixes(self, *args):
"""Regenerate the cache of command prefixes based on nick etc."""
nick = self.controller.client.user.nick
self.prefixes = set([
nick + ": ",
nick + ", ",
nick + " - ",
])
# Include lower-case versions as we... | python | def regenerate_prefixes(self, *args):
"""Regenerate the cache of command prefixes based on nick etc."""
nick = self.controller.client.user.nick
self.prefixes = set([
nick + ": ",
nick + ", ",
nick + " - ",
])
# Include lower-case versions as we... | [
"def",
"regenerate_prefixes",
"(",
"self",
",",
"*",
"args",
")",
":",
"nick",
"=",
"self",
".",
"controller",
".",
"client",
".",
"user",
".",
"nick",
"self",
".",
"prefixes",
"=",
"set",
"(",
"[",
"nick",
"+",
"\": \"",
",",
"nick",
"+",
"\", \"",
... | Regenerate the cache of command prefixes based on nick etc. | [
"Regenerate",
"the",
"cache",
"of",
"command",
"prefixes",
"based",
"on",
"nick",
"etc",
"."
] | train | https://github.com/ayust/kitnirc/blob/cf19fe39219da75f053e1a3976bf21331b6fefea/kitnirc/contrib/commands.py#L71-L82 |
ayust/kitnirc | kitnirc/contrib/commands.py | CommandsModule.check_for_interest | def check_for_interest(self, client, recipient, message):
"""Determine whether this line is addressing us."""
for prefix in self.prefixes:
if message.startswith(prefix):
return True, message[len(prefix):]
# Don't require a prefix if addressed in PM.
# This co... | python | def check_for_interest(self, client, recipient, message):
"""Determine whether this line is addressing us."""
for prefix in self.prefixes:
if message.startswith(prefix):
return True, message[len(prefix):]
# Don't require a prefix if addressed in PM.
# This co... | [
"def",
"check_for_interest",
"(",
"self",
",",
"client",
",",
"recipient",
",",
"message",
")",
":",
"for",
"prefix",
"in",
"self",
".",
"prefixes",
":",
"if",
"message",
".",
"startswith",
"(",
"prefix",
")",
":",
"return",
"True",
",",
"message",
"[",
... | Determine whether this line is addressing us. | [
"Determine",
"whether",
"this",
"line",
"is",
"addressing",
"us",
"."
] | train | https://github.com/ayust/kitnirc/blob/cf19fe39219da75f053e1a3976bf21331b6fefea/kitnirc/contrib/commands.py#L84-L97 |
ayust/kitnirc | kitnirc/contrib/commands.py | CommandsModule.parse_command | def parse_command(self, string):
"""Parse out any possible valid command from an input string."""
possible_command, _, rest = string.partition(" ")
# Commands are case-insensitive, stored as lowercase
possible_command = possible_command.lower()
if possible_command not in self.com... | python | def parse_command(self, string):
"""Parse out any possible valid command from an input string."""
possible_command, _, rest = string.partition(" ")
# Commands are case-insensitive, stored as lowercase
possible_command = possible_command.lower()
if possible_command not in self.com... | [
"def",
"parse_command",
"(",
"self",
",",
"string",
")",
":",
"possible_command",
",",
"_",
",",
"rest",
"=",
"string",
".",
"partition",
"(",
"\" \"",
")",
"# Commands are case-insensitive, stored as lowercase",
"possible_command",
"=",
"possible_command",
".",
"lo... | Parse out any possible valid command from an input string. | [
"Parse",
"out",
"any",
"possible",
"valid",
"command",
"from",
"an",
"input",
"string",
"."
] | train | https://github.com/ayust/kitnirc/blob/cf19fe39219da75f053e1a3976bf21331b6fefea/kitnirc/contrib/commands.py#L99-L109 |
pyroscope/auvyon | src/auvyon/imaging/waveforms.py | waveform_image | def waveform_image(mediafile, xy_size, outdir=None, center_color=None, outer_color=None, bg_color=None):
""" Create waveform image from audio data.
Return path to created image file.
"""
try:
import waveform
except ImportError, exc:
raise ImportError("%s [get it at https://github... | python | def waveform_image(mediafile, xy_size, outdir=None, center_color=None, outer_color=None, bg_color=None):
""" Create waveform image from audio data.
Return path to created image file.
"""
try:
import waveform
except ImportError, exc:
raise ImportError("%s [get it at https://github... | [
"def",
"waveform_image",
"(",
"mediafile",
",",
"xy_size",
",",
"outdir",
"=",
"None",
",",
"center_color",
"=",
"None",
",",
"outer_color",
"=",
"None",
",",
"bg_color",
"=",
"None",
")",
":",
"try",
":",
"import",
"waveform",
"except",
"ImportError",
","... | Create waveform image from audio data.
Return path to created image file. | [
"Create",
"waveform",
"image",
"from",
"audio",
"data",
".",
"Return",
"path",
"to",
"created",
"image",
"file",
"."
] | train | https://github.com/pyroscope/auvyon/blob/5115c26f966df03df92a9934580b66c72e23d4e8/src/auvyon/imaging/waveforms.py#L23-L42 |
pyroscope/auvyon | src/auvyon/imaging/waveforms.py | waveform_stack | def waveform_stack(mediafiles, xy_size, output=None, label_style=None,
center_color=None, outer_color=None, bg_color=None):
""" Create a stack of waveform images from audio data.
Return path to created image file.
"""
img_files = []
output = output or os.path.abspath(os.path.dirname(os.... | python | def waveform_stack(mediafiles, xy_size, output=None, label_style=None,
center_color=None, outer_color=None, bg_color=None):
""" Create a stack of waveform images from audio data.
Return path to created image file.
"""
img_files = []
output = output or os.path.abspath(os.path.dirname(os.... | [
"def",
"waveform_stack",
"(",
"mediafiles",
",",
"xy_size",
",",
"output",
"=",
"None",
",",
"label_style",
"=",
"None",
",",
"center_color",
"=",
"None",
",",
"outer_color",
"=",
"None",
",",
"bg_color",
"=",
"None",
")",
":",
"img_files",
"=",
"[",
"]"... | Create a stack of waveform images from audio data.
Return path to created image file. | [
"Create",
"a",
"stack",
"of",
"waveform",
"images",
"from",
"audio",
"data",
".",
"Return",
"path",
"to",
"created",
"image",
"file",
"."
] | train | https://github.com/pyroscope/auvyon/blob/5115c26f966df03df92a9934580b66c72e23d4e8/src/auvyon/imaging/waveforms.py#L45-L71 |
pyroscope/auvyon | src/auvyon/imaging/waveforms.py | _main | def _main():
""" Command line interface for testing.
"""
if len(sys.argv) <= 1:
print("Usage: python -m auvyon.imaging.waveforms <mediafile>...")
else:
try:
print("Created %s" % waveform_stack(sys.argv[1:], (640, 48)))
except subprocess.CalledProcessError, exc:
... | python | def _main():
""" Command line interface for testing.
"""
if len(sys.argv) <= 1:
print("Usage: python -m auvyon.imaging.waveforms <mediafile>...")
else:
try:
print("Created %s" % waveform_stack(sys.argv[1:], (640, 48)))
except subprocess.CalledProcessError, exc:
... | [
"def",
"_main",
"(",
")",
":",
"if",
"len",
"(",
"sys",
".",
"argv",
")",
"<=",
"1",
":",
"print",
"(",
"\"Usage: python -m auvyon.imaging.waveforms <mediafile>...\"",
")",
"else",
":",
"try",
":",
"print",
"(",
"\"Created %s\"",
"%",
"waveform_stack",
"(",
... | Command line interface for testing. | [
"Command",
"line",
"interface",
"for",
"testing",
"."
] | train | https://github.com/pyroscope/auvyon/blob/5115c26f966df03df92a9934580b66c72e23d4e8/src/auvyon/imaging/waveforms.py#L74-L83 |
mdiener/grace | grace/py27/slimit/mangler.py | mangle | def mangle(tree, toplevel=False):
"""Mangle names.
Args:
toplevel: defaults to False. Defines if global
scope should be mangled or not.
"""
sym_table = SymbolTable()
visitor = ScopeTreeVisitor(sym_table)
visitor.visit(tree)
fill_scope_references(tree)
mangle_scope_tree(... | python | def mangle(tree, toplevel=False):
"""Mangle names.
Args:
toplevel: defaults to False. Defines if global
scope should be mangled or not.
"""
sym_table = SymbolTable()
visitor = ScopeTreeVisitor(sym_table)
visitor.visit(tree)
fill_scope_references(tree)
mangle_scope_tree(... | [
"def",
"mangle",
"(",
"tree",
",",
"toplevel",
"=",
"False",
")",
":",
"sym_table",
"=",
"SymbolTable",
"(",
")",
"visitor",
"=",
"ScopeTreeVisitor",
"(",
"sym_table",
")",
"visitor",
".",
"visit",
"(",
"tree",
")",
"fill_scope_references",
"(",
"tree",
")... | Mangle names.
Args:
toplevel: defaults to False. Defines if global
scope should be mangled or not. | [
"Mangle",
"names",
"."
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/mangler.py#L36-L51 |
mitsei/dlkit | dlkit/aws_adapter/osid/queries.py | OsidQuery._get_string_match_value | def _get_string_match_value(self, string, string_match_type):
"""Gets the match value"""
if string_match_type == Type(**get_type_data('EXACT')):
return string
elif string_match_type == Type(**get_type_data('IGNORECASE')):
return re.compile('^' + string, re.I)
elif... | python | def _get_string_match_value(self, string, string_match_type):
"""Gets the match value"""
if string_match_type == Type(**get_type_data('EXACT')):
return string
elif string_match_type == Type(**get_type_data('IGNORECASE')):
return re.compile('^' + string, re.I)
elif... | [
"def",
"_get_string_match_value",
"(",
"self",
",",
"string",
",",
"string_match_type",
")",
":",
"if",
"string_match_type",
"==",
"Type",
"(",
"*",
"*",
"get_type_data",
"(",
"'EXACT'",
")",
")",
":",
"return",
"string",
"elif",
"string_match_type",
"==",
"Ty... | Gets the match value | [
"Gets",
"the",
"match",
"value"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/osid/queries.py#L68-L77 |
mitsei/dlkit | dlkit/aws_adapter/osid/queries.py | OsidQuery._add_match | def _add_match(self, match_key, match_value, match):
"""Adds a match key/value"""
if match_key is None:
raise NullArgument()
if match is None:
match = True
if match:
inin = '$in'
else:
inin = '$nin'
if match_key in self._que... | python | def _add_match(self, match_key, match_value, match):
"""Adds a match key/value"""
if match_key is None:
raise NullArgument()
if match is None:
match = True
if match:
inin = '$in'
else:
inin = '$nin'
if match_key in self._que... | [
"def",
"_add_match",
"(",
"self",
",",
"match_key",
",",
"match_value",
",",
"match",
")",
":",
"if",
"match_key",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"if",
"match",
"is",
"None",
":",
"match",
"=",
"True",
"if",
"match",
":",
"inin",... | Adds a match key/value | [
"Adds",
"a",
"match",
"key",
"/",
"value"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/osid/queries.py#L79-L95 |
mitsei/dlkit | dlkit/aws_adapter/osid/queries.py | OsidQuery._match_display_text | def _match_display_text(self, element_key, string, string_match_type, match):
"""Matches a display text value"""
if string is None or string_match_type is None:
raise NullArgument()
match_value = self._get_string_match_value(string, string_match_type)
self._add_match(element_... | python | def _match_display_text(self, element_key, string, string_match_type, match):
"""Matches a display text value"""
if string is None or string_match_type is None:
raise NullArgument()
match_value = self._get_string_match_value(string, string_match_type)
self._add_match(element_... | [
"def",
"_match_display_text",
"(",
"self",
",",
"element_key",
",",
"string",
",",
"string_match_type",
",",
"match",
")",
":",
"if",
"string",
"is",
"None",
"or",
"string_match_type",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"match_value",
"=",
... | Matches a display text value | [
"Matches",
"a",
"display",
"text",
"value"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/osid/queries.py#L97-L102 |
mitsei/dlkit | dlkit/aws_adapter/osid/queries.py | OsidQuery._match_minimum_decimal | def _match_minimum_decimal(self, match_key, decimal_value, match):
"""Matches a minimum decimal value"""
if decimal_value is None:
raise NullArgument()
if match is None:
match = True
if match:
gtelt = '$gte'
else:
gtelt = '$lt'
... | python | def _match_minimum_decimal(self, match_key, decimal_value, match):
"""Matches a minimum decimal value"""
if decimal_value is None:
raise NullArgument()
if match is None:
match = True
if match:
gtelt = '$gte'
else:
gtelt = '$lt'
... | [
"def",
"_match_minimum_decimal",
"(",
"self",
",",
"match_key",
",",
"decimal_value",
",",
"match",
")",
":",
"if",
"decimal_value",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"if",
"match",
"is",
"None",
":",
"match",
"=",
"True",
"if",
"match"... | Matches a minimum decimal value | [
"Matches",
"a",
"minimum",
"decimal",
"value"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/osid/queries.py#L104-L117 |
mitsei/dlkit | dlkit/aws_adapter/osid/queries.py | OsidQuery._match_maximum_decimal | def _match_maximum_decimal(self, match_key, decimal_value, match):
"""Matches a minimum decimal value"""
if decimal_value is None:
raise NullArgument()
if match is None:
match = True
if match:
ltegt = '$lte'
else:
ltegt = '$gt'
... | python | def _match_maximum_decimal(self, match_key, decimal_value, match):
"""Matches a minimum decimal value"""
if decimal_value is None:
raise NullArgument()
if match is None:
match = True
if match:
ltegt = '$lte'
else:
ltegt = '$gt'
... | [
"def",
"_match_maximum_decimal",
"(",
"self",
",",
"match_key",
",",
"decimal_value",
",",
"match",
")",
":",
"if",
"decimal_value",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"if",
"match",
"is",
"None",
":",
"match",
"=",
"True",
"if",
"match"... | Matches a minimum decimal value | [
"Matches",
"a",
"minimum",
"decimal",
"value"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/osid/queries.py#L119-L132 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/__init__.py | _filter_settings | def _filter_settings(settings, prefix):
"""
Filter all settings to only return settings that start with a certain
prefix.
:param dict settings: A settings dictionary.
:param str prefix: A prefix.
"""
ret = {}
for skey in settings.keys():
if skey.startswith(prefix):
k... | python | def _filter_settings(settings, prefix):
"""
Filter all settings to only return settings that start with a certain
prefix.
:param dict settings: A settings dictionary.
:param str prefix: A prefix.
"""
ret = {}
for skey in settings.keys():
if skey.startswith(prefix):
k... | [
"def",
"_filter_settings",
"(",
"settings",
",",
"prefix",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"skey",
"in",
"settings",
".",
"keys",
"(",
")",
":",
"if",
"skey",
".",
"startswith",
"(",
"prefix",
")",
":",
"key",
"=",
"skey",
"[",
"len",
"(",
... | Filter all settings to only return settings that start with a certain
prefix.
:param dict settings: A settings dictionary.
:param str prefix: A prefix. | [
"Filter",
"all",
"settings",
"to",
"only",
"return",
"settings",
"that",
"start",
"with",
"a",
"certain",
"prefix",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/__init__.py#L78-L91 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/__init__.py | get_capakey | def get_capakey(registry):
"""
Get the Capakey Gateway
:rtype: :class:`crabpy.gateway.capakey.CapakeyRestGateway`
"""
# argument might be a config or a request
regis = getattr(registry, 'registry', None)
if regis is None:
regis = registry
return regis.queryUtility(ICapakey) | python | def get_capakey(registry):
"""
Get the Capakey Gateway
:rtype: :class:`crabpy.gateway.capakey.CapakeyRestGateway`
"""
# argument might be a config or a request
regis = getattr(registry, 'registry', None)
if regis is None:
regis = registry
return regis.queryUtility(ICapakey) | [
"def",
"get_capakey",
"(",
"registry",
")",
":",
"# argument might be a config or a request",
"regis",
"=",
"getattr",
"(",
"registry",
",",
"'registry'",
",",
"None",
")",
"if",
"regis",
"is",
"None",
":",
"regis",
"=",
"registry",
"return",
"regis",
".",
"qu... | Get the Capakey Gateway
:rtype: :class:`crabpy.gateway.capakey.CapakeyRestGateway` | [
"Get",
"the",
"Capakey",
"Gateway"
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/__init__.py#L125-L136 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/__init__.py | get_crab | def get_crab(registry):
"""
Get the Crab Gateway
:rtype: :class:`crabpy.gateway.crab.CrabGateway`
# argument might be a config or a request
"""
# argument might be a config or a request
regis = getattr(registry, 'registry', None)
if regis is None:
regis = registry
return re... | python | def get_crab(registry):
"""
Get the Crab Gateway
:rtype: :class:`crabpy.gateway.crab.CrabGateway`
# argument might be a config or a request
"""
# argument might be a config or a request
regis = getattr(registry, 'registry', None)
if regis is None:
regis = registry
return re... | [
"def",
"get_crab",
"(",
"registry",
")",
":",
"# argument might be a config or a request",
"regis",
"=",
"getattr",
"(",
"registry",
",",
"'registry'",
",",
"None",
")",
"if",
"regis",
"is",
"None",
":",
"regis",
"=",
"registry",
"return",
"regis",
".",
"query... | Get the Crab Gateway
:rtype: :class:`crabpy.gateway.crab.CrabGateway`
# argument might be a config or a request | [
"Get",
"the",
"Crab",
"Gateway"
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/__init__.py#L139-L151 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/__init__.py | add_route | def add_route(config, name, pattern, *args, **kwargs):
"""
Adds a pyramid route to the config. All args and kwargs will be
passed on to config.add_route.
This exists so the default behaviour of including crabpy will still be to
cache all crabpy routes.
"""
config.add_route(name, pattern, *a... | python | def add_route(config, name, pattern, *args, **kwargs):
"""
Adds a pyramid route to the config. All args and kwargs will be
passed on to config.add_route.
This exists so the default behaviour of including crabpy will still be to
cache all crabpy routes.
"""
config.add_route(name, pattern, *a... | [
"def",
"add_route",
"(",
"config",
",",
"name",
",",
"pattern",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
".",
"add_route",
"(",
"name",
",",
"pattern",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"GENERATE_ETAG_ROUTE_NAMES",
... | Adds a pyramid route to the config. All args and kwargs will be
passed on to config.add_route.
This exists so the default behaviour of including crabpy will still be to
cache all crabpy routes. | [
"Adds",
"a",
"pyramid",
"route",
"to",
"the",
"config",
".",
"All",
"args",
"and",
"kwargs",
"will",
"be",
"passed",
"on",
"to",
"config",
".",
"add_route",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/__init__.py#L169-L178 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/__init__.py | conditional_http_tween_factory | def conditional_http_tween_factory(handler, registry):
"""
Tween that adds ETag headers and tells Pyramid to enable
conditional responses where appropriate.
"""
settings = registry.settings if hasattr(registry, 'settings') else {}
if 'generate_etag_for.list' in settings:
route_names = s... | python | def conditional_http_tween_factory(handler, registry):
"""
Tween that adds ETag headers and tells Pyramid to enable
conditional responses where appropriate.
"""
settings = registry.settings if hasattr(registry, 'settings') else {}
if 'generate_etag_for.list' in settings:
route_names = s... | [
"def",
"conditional_http_tween_factory",
"(",
"handler",
",",
"registry",
")",
":",
"settings",
"=",
"registry",
".",
"settings",
"if",
"hasattr",
"(",
"registry",
",",
"'settings'",
")",
"else",
"{",
"}",
"if",
"'generate_etag_for.list'",
"in",
"settings",
":",... | Tween that adds ETag headers and tells Pyramid to enable
conditional responses where appropriate. | [
"Tween",
"that",
"adds",
"ETag",
"headers",
"and",
"tells",
"Pyramid",
"to",
"enable",
"conditional",
"responses",
"where",
"appropriate",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/__init__.py#L181-L213 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/__init__.py | includeme | def includeme(config):
"""
Include `crabpy_pyramid` in this `Pyramid` application.
:param pyramid.config.Configurator config: A Pyramid configurator.
"""
settings = _parse_settings(config.registry.settings)
base_settings = _get_proxy_settings(settings)
# http caching tween
if not sett... | python | def includeme(config):
"""
Include `crabpy_pyramid` in this `Pyramid` application.
:param pyramid.config.Configurator config: A Pyramid configurator.
"""
settings = _parse_settings(config.registry.settings)
base_settings = _get_proxy_settings(settings)
# http caching tween
if not sett... | [
"def",
"includeme",
"(",
"config",
")",
":",
"settings",
"=",
"_parse_settings",
"(",
"config",
".",
"registry",
".",
"settings",
")",
"base_settings",
"=",
"_get_proxy_settings",
"(",
"settings",
")",
"# http caching tween",
"if",
"not",
"settings",
".",
"get",... | Include `crabpy_pyramid` in this `Pyramid` application.
:param pyramid.config.Configurator config: A Pyramid configurator. | [
"Include",
"crabpy_pyramid",
"in",
"this",
"Pyramid",
"application",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/__init__.py#L216-L259 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/__init__.py | main | def main(global_config, **settings):
"""
This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
includeme(config)
return config.make_wsgi_app() | python | def main(global_config, **settings):
"""
This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
includeme(config)
return config.make_wsgi_app() | [
"def",
"main",
"(",
"global_config",
",",
"*",
"*",
"settings",
")",
":",
"config",
"=",
"Configurator",
"(",
"settings",
"=",
"settings",
")",
"includeme",
"(",
"config",
")",
"return",
"config",
".",
"make_wsgi_app",
"(",
")"
] | This function returns a Pyramid WSGI application. | [
"This",
"function",
"returns",
"a",
"Pyramid",
"WSGI",
"application",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/__init__.py#L262-L269 |
mitsei/dlkit | dlkit/json_/assessment_authoring/searches.py | AssessmentPartSearchResults.get_assessment_parts | def get_assessment_parts(self):
"""Gets the ``AssessmentPartList`` resulting from a search.
return: (osid.assessment.authoring.AssessmentPartList) - the
assessment part list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must... | python | def get_assessment_parts(self):
"""Gets the ``AssessmentPartList`` resulting from a search.
return: (osid.assessment.authoring.AssessmentPartList) - the
assessment part list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must... | [
"def",
"get_assessment_parts",
"(",
"self",
")",
":",
"if",
"self",
".",
"retrieved",
":",
"raise",
"errors",
".",
"IllegalState",
"(",
"'List has already been retrieved.'",
")",
"self",
".",
"retrieved",
"=",
"True",
"return",
"objects",
".",
"AssessmentPartList"... | Gets the ``AssessmentPartList`` resulting from a search.
return: (osid.assessment.authoring.AssessmentPartList) - the
assessment part list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"AssessmentPartList",
"resulting",
"from",
"a",
"search",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/searches.py#L99-L111 |
mitsei/dlkit | dlkit/json_/assessment_authoring/searches.py | SequenceRuleSearchResults.get_sequence_rules | def get_sequence_rules(self):
"""Gets the ``SequenceRuleList`` resulting from a search.
return: (osid.assessment.authoring.SequenceRuleList) - the
sequence rule list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be impl... | python | def get_sequence_rules(self):
"""Gets the ``SequenceRuleList`` resulting from a search.
return: (osid.assessment.authoring.SequenceRuleList) - the
sequence rule list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be impl... | [
"def",
"get_sequence_rules",
"(",
"self",
")",
":",
"if",
"self",
".",
"retrieved",
":",
"raise",
"errors",
".",
"IllegalState",
"(",
"'List has already been retrieved.'",
")",
"self",
".",
"retrieved",
"=",
"True",
"return",
"objects",
".",
"SequenceRuleList",
... | Gets the ``SequenceRuleList`` resulting from a search.
return: (osid.assessment.authoring.SequenceRuleList) - the
sequence rule list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"SequenceRuleList",
"resulting",
"from",
"a",
"search",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment_authoring/searches.py#L228-L240 |
theosysbio/means | src/means/inference/results.py | InferenceResultsCollection.plot_distance_landscape_projection | def plot_distance_landscape_projection(self, x_axis, y_axis, ax=None, *args, **kwargs):
"""
Plots the distance landscape jointly-generated from all the results
:param x_axis: symbol to plot on x axis
:param y_axis: symbol to plot on y axis
:param ax: axis object to plot onto
... | python | def plot_distance_landscape_projection(self, x_axis, y_axis, ax=None, *args, **kwargs):
"""
Plots the distance landscape jointly-generated from all the results
:param x_axis: symbol to plot on x axis
:param y_axis: symbol to plot on y axis
:param ax: axis object to plot onto
... | [
"def",
"plot_distance_landscape_projection",
"(",
"self",
",",
"x_axis",
",",
"y_axis",
",",
"ax",
"=",
"None",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Gather all x, y, z's to plot first as this would make the gradient landscape better",
"x_all",
",",
... | Plots the distance landscape jointly-generated from all the results
:param x_axis: symbol to plot on x axis
:param y_axis: symbol to plot on y axis
:param ax: axis object to plot onto
:param args: arguments to pass to :func:`matplotlib.pyplot.contourf`
:param kwargs: keyword arg... | [
"Plots",
"the",
"distance",
"landscape",
"jointly",
"-",
"generated",
"from",
"all",
"the",
"results"
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/inference/results.py#L210-L231 |
theosysbio/means | src/means/inference/results.py | InferenceResultsCollection.plot_trajectory_projection | def plot_trajectory_projection(self, x_axis, y_axis,
*args, **kwargs):
"""
Plots trajectory projection on the specified x and y axes
See :meth:`InferenceResult.plot_trajectory_projection()` for information on the arguments and keyword arguments
:param ... | python | def plot_trajectory_projection(self, x_axis, y_axis,
*args, **kwargs):
"""
Plots trajectory projection on the specified x and y axes
See :meth:`InferenceResult.plot_trajectory_projection()` for information on the arguments and keyword arguments
:param ... | [
"def",
"plot_trajectory_projection",
"(",
"self",
",",
"x_axis",
",",
"y_axis",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Just plot all of the trajectories",
"for",
"result",
"in",
"self",
".",
"results",
":",
"result",
".",
"plot_trajectory_projec... | Plots trajectory projection on the specified x and y axes
See :meth:`InferenceResult.plot_trajectory_projection()` for information on the arguments and keyword arguments
:param x_axis: variable to be plotted on the x axis of the projection
:param y_axis: variable to be plotted on the y axis of ... | [
"Plots",
"trajectory",
"projection",
"on",
"the",
"specified",
"x",
"and",
"y",
"axes",
"See",
":",
"meth",
":",
"InferenceResult",
".",
"plot_trajectory_projection",
"()",
"for",
"information",
"on",
"the",
"arguments",
"and",
"keyword",
"arguments"
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/inference/results.py#L234-L248 |
theosysbio/means | src/means/inference/results.py | InferenceResult.distance_landscape_as_3d_data | def distance_landscape_as_3d_data(self, x_axis, y_axis):
"""
Returns the distance landscape as three-dimensional data for the specified projection.
:param x_axis: variable to be plotted on the x axis of projection
:param y_axis: variable to be plotted on the y axis of projection
... | python | def distance_landscape_as_3d_data(self, x_axis, y_axis):
"""
Returns the distance landscape as three-dimensional data for the specified projection.
:param x_axis: variable to be plotted on the x axis of projection
:param y_axis: variable to be plotted on the y axis of projection
... | [
"def",
"distance_landscape_as_3d_data",
"(",
"self",
",",
"x_axis",
",",
"y_axis",
")",
":",
"if",
"not",
"self",
".",
"distance_landscape",
":",
"raise",
"Exception",
"(",
"'No distance landscape returned. Re-run inference with return_distance_landscape=True'",
")",
"index... | Returns the distance landscape as three-dimensional data for the specified projection.
:param x_axis: variable to be plotted on the x axis of projection
:param y_axis: variable to be plotted on the y axis of projection
:return: a 3-tuple (x, y, z) where x and y are the lists of coordinates and ... | [
"Returns",
"the",
"distance",
"landscape",
"as",
"three",
"-",
"dimensional",
"data",
"for",
"the",
"specified",
"projection",
"."
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/inference/results.py#L358-L382 |
theosysbio/means | src/means/inference/results.py | InferenceResult.plot_distance_landscape_projection | def plot_distance_landscape_projection(self, x_axis, y_axis, ax=None, *args, **kwargs):
"""
Plots the projection of distance landscape (if it was returned), onto the
parameters specified
:param x_axis: symbol to plot on x axis
:param y_axis: symbol to plot on y axis
:par... | python | def plot_distance_landscape_projection(self, x_axis, y_axis, ax=None, *args, **kwargs):
"""
Plots the projection of distance landscape (if it was returned), onto the
parameters specified
:param x_axis: symbol to plot on x axis
:param y_axis: symbol to plot on y axis
:par... | [
"def",
"plot_distance_landscape_projection",
"(",
"self",
",",
"x_axis",
",",
"y_axis",
",",
"ax",
"=",
"None",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"x",
",",
"y",
",",
"z",
"=",
"self",
".",
"distance_landscape_as_3d_data",
"(",
"x_axis"... | Plots the projection of distance landscape (if it was returned), onto the
parameters specified
:param x_axis: symbol to plot on x axis
:param y_axis: symbol to plot on y axis
:param ax: axis object to plot onto
:param args: arguments to pass to :func:`matplotlib.pyplot.contourf`... | [
"Plots",
"the",
"projection",
"of",
"distance",
"landscape",
"(",
"if",
"it",
"was",
"returned",
")",
"onto",
"the",
"parameters",
"specified"
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/inference/results.py#L384-L397 |
theosysbio/means | src/means/inference/results.py | InferenceResult.solutions_as_2d_trajectories | def solutions_as_2d_trajectories(self, x_axis, y_axis):
"""
Returns the :attr:`InferenceResult.solutions` as a plottable 2d trajectory.
:param x_axis: the variable to be on the x axis of projection
:param y_axis: the variable to be on the y axis of preojection
:return: a tuple x... | python | def solutions_as_2d_trajectories(self, x_axis, y_axis):
"""
Returns the :attr:`InferenceResult.solutions` as a plottable 2d trajectory.
:param x_axis: the variable to be on the x axis of projection
:param y_axis: the variable to be on the y axis of preojection
:return: a tuple x... | [
"def",
"solutions_as_2d_trajectories",
"(",
"self",
",",
"x_axis",
",",
"y_axis",
")",
":",
"if",
"not",
"self",
".",
"solutions",
":",
"raise",
"Exception",
"(",
"'No intermediate solutions returned. '",
"'Re-run inference with return_intermediate_solutions=True'",
")",
... | Returns the :attr:`InferenceResult.solutions` as a plottable 2d trajectory.
:param x_axis: the variable to be on the x axis of projection
:param y_axis: the variable to be on the y axis of preojection
:return: a tuple x, y specifying lists of x and y coordinates of projection | [
"Returns",
"the",
":",
"attr",
":",
"InferenceResult",
".",
"solutions",
"as",
"a",
"plottable",
"2d",
"trajectory",
"."
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/inference/results.py#L399-L420 |
theosysbio/means | src/means/inference/results.py | InferenceResult.plot_trajectory_projection | def plot_trajectory_projection(self, x_axis, y_axis,
legend=False, ax=None,
start_and_end_locations_only=False,
start_marker='bo',
end_marker='rx',
... | python | def plot_trajectory_projection(self, x_axis, y_axis,
legend=False, ax=None,
start_and_end_locations_only=False,
start_marker='bo',
end_marker='rx',
... | [
"def",
"plot_trajectory_projection",
"(",
"self",
",",
"x_axis",
",",
"y_axis",
",",
"legend",
"=",
"False",
",",
"ax",
"=",
"None",
",",
"start_and_end_locations_only",
"=",
"False",
",",
"start_marker",
"=",
"'bo'",
",",
"end_marker",
"=",
"'rx'",
",",
"*"... | Plots the projection of the trajectory through the parameter space the minimisation algorithm took.
Since parameter space is often high-dimensional and paper can realistically represent only two,
one needs to specify the ``x_axis``, and ``y_axis`` arguments with the variable names to project the
... | [
"Plots",
"the",
"projection",
"of",
"the",
"trajectory",
"through",
"the",
"parameter",
"space",
"the",
"minimisation",
"algorithm",
"took",
"."
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/inference/results.py#L422-L458 |
theosysbio/means | src/means/inference/results.py | InferenceResult.plot | def plot(self, plot_intermediate_solutions=True,
plot_observed_data=True, plot_starting_trajectory=True, plot_optimal_trajectory=True,
filter_plots_function=None, legend=True,
kwargs_observed_data=None, kwargs_starting_trajectories=None, kwargs_optimal_trajectories=None,
... | python | def plot(self, plot_intermediate_solutions=True,
plot_observed_data=True, plot_starting_trajectory=True, plot_optimal_trajectory=True,
filter_plots_function=None, legend=True,
kwargs_observed_data=None, kwargs_starting_trajectories=None, kwargs_optimal_trajectories=None,
... | [
"def",
"plot",
"(",
"self",
",",
"plot_intermediate_solutions",
"=",
"True",
",",
"plot_observed_data",
"=",
"True",
",",
"plot_starting_trajectory",
"=",
"True",
",",
"plot_optimal_trajectory",
"=",
"True",
",",
"filter_plots_function",
"=",
"None",
",",
"legend",
... | Plot the inference result.
:param plot_intermediate_solutions: plot the trajectories resulting from the intermediate solutions as well
:param filter_plots_function: A function that takes a trajectory object and returns True if it should be
plotted and false if not.... | [
"Plot",
"the",
"inference",
"result",
"."
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/inference/results.py#L508-L637 |
mitsei/dlkit | dlkit/primordium/locale/types/coordinate_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': 'coordinate 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': 'coordinate format',
'identifier': name,
... | [
"def",
"get_type_data",
"(",
"name",
")",
":",
"name",
"=",
"name",
".",
"upper",
"(",
")",
"try",
":",
"return",
"{",
"'authority'",
":",
"'birdland.mit.edu'",
",",
"'namespace'",
":",
"'coordinate 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/coordinate_format.py#L15-L35 |
mitsei/dlkit | dlkit/runtime/impls/type/objects.py | TypeList.get_next_type | def get_next_type(self):
"""Gets the next ``Type`` in this list.
return: (osid.type.Type) - the next ``Type`` in this list. The
``has_next()`` method should be used to test that a next
``Type`` is available before calling this method.
raise: IllegalState - no mo... | python | def get_next_type(self):
"""Gets the next ``Type`` in this list.
return: (osid.type.Type) - the next ``Type`` in this list. The
``has_next()`` method should be used to test that a next
``Type`` is available before calling this method.
raise: IllegalState - no mo... | [
"def",
"get_next_type",
"(",
"self",
")",
":",
"import",
"sys",
"from",
".",
".",
"osid",
".",
"osid_errors",
"import",
"IllegalState",
",",
"OperationFailed",
"try",
":",
"next_item",
"=",
"self",
".",
"next",
"(",
")",
"except",
"StopIteration",
":",
"ra... | Gets the next ``Type`` in this list.
return: (osid.type.Type) - the next ``Type`` in this list. The
``has_next()`` method should be used to test that a next
``Type`` is available before calling this method.
raise: IllegalState - no more elements available in this list
... | [
"Gets",
"the",
"next",
"Type",
"in",
"this",
"list",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/runtime/impls/type/objects.py#L17-L37 |
mitsei/dlkit | dlkit/runtime/impls/type/objects.py | TypeList.get_next_types | def get_next_types(self, n=None):
"""Gets the next set of ``Types`` in this list.
The specified amount must be less than or equal to the return
from ``available()``.
arg: n (cardinal): the number of ``Type`` elements requested
which must be less than or equal to ``av... | python | def get_next_types(self, n=None):
"""Gets the next set of ``Types`` in this list.
The specified amount must be less than or equal to the return
from ``available()``.
arg: n (cardinal): the number of ``Type`` elements requested
which must be less than or equal to ``av... | [
"def",
"get_next_types",
"(",
"self",
",",
"n",
"=",
"None",
")",
":",
"import",
"sys",
"from",
".",
".",
"osid",
".",
"osid_errors",
"import",
"IllegalState",
",",
"OperationFailed",
"if",
"n",
">",
"self",
".",
"available",
"(",
")",
":",
"# !!! This i... | Gets the next set of ``Types`` in this list.
The specified amount must be less than or equal to the return
from ``available()``.
arg: n (cardinal): the number of ``Type`` elements requested
which must be less than or equal to ``available()``
return: (osid.type.Type) ... | [
"Gets",
"the",
"next",
"set",
"of",
"Types",
"in",
"this",
"list",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/runtime/impls/type/objects.py#L54-L84 |
jason-weirather/py-seq-tools | seqtools/cli/utilities/simulate_tx.py | get_short_reads | def get_short_reads(vals):
(args,txome,seed,chunk) = vals
#fast forward some ammount
"""Emit the short reads first"""
txe = TranscriptomeEmitter(txome,TranscriptomeEmitter.Options(seed=seed))
if args.weights:
weights = {}
if args.weights[-3:]=='.gz': inf = gzip.open(args.weights)
else: ... | python | def get_short_reads(vals):
(args,txome,seed,chunk) = vals
#fast forward some ammount
"""Emit the short reads first"""
txe = TranscriptomeEmitter(txome,TranscriptomeEmitter.Options(seed=seed))
if args.weights:
weights = {}
if args.weights[-3:]=='.gz': inf = gzip.open(args.weights)
else: ... | [
"def",
"get_short_reads",
"(",
"vals",
")",
":",
"(",
"args",
",",
"txome",
",",
"seed",
",",
"chunk",
")",
"=",
"vals",
"#fast forward some ammount",
"txe",
"=",
"TranscriptomeEmitter",
"(",
"txome",
",",
"TranscriptomeEmitter",
".",
"Options",
"(",
"seed",
... | Emit the short reads first | [
"Emit",
"the",
"short",
"reads",
"first"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/cli/utilities/simulate_tx.py#L118-L150 |
delfick/harpoon | harpoon/ship/builder.py | Builder.make_image | def make_image(self, conf, images, chain=None, parent_chain=None, made=None, ignore_deps=False, ignore_parent=False, pushing=False):
"""Make us an image"""
made = {} if made is None else made
chain = [] if chain is None else chain
parent_chain = [] if parent_chain is None else parent_cha... | python | def make_image(self, conf, images, chain=None, parent_chain=None, made=None, ignore_deps=False, ignore_parent=False, pushing=False):
"""Make us an image"""
made = {} if made is None else made
chain = [] if chain is None else chain
parent_chain = [] if parent_chain is None else parent_cha... | [
"def",
"make_image",
"(",
"self",
",",
"conf",
",",
"images",
",",
"chain",
"=",
"None",
",",
"parent_chain",
"=",
"None",
",",
"made",
"=",
"None",
",",
"ignore_deps",
"=",
"False",
",",
"ignore_parent",
"=",
"False",
",",
"pushing",
"=",
"False",
")"... | Make us an image | [
"Make",
"us",
"an",
"image"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/ship/builder.py#L104-L135 |
delfick/harpoon | harpoon/ship/builder.py | Builder.build_image | def build_image(self, conf, pushing=False):
"""Build this image"""
with conf.make_context() as context:
try:
stream = BuildProgressStream(conf.harpoon.silent_build)
with self.remove_replaced_images(conf) as info:
cached = NormalBuilder().bu... | python | def build_image(self, conf, pushing=False):
"""Build this image"""
with conf.make_context() as context:
try:
stream = BuildProgressStream(conf.harpoon.silent_build)
with self.remove_replaced_images(conf) as info:
cached = NormalBuilder().bu... | [
"def",
"build_image",
"(",
"self",
",",
"conf",
",",
"pushing",
"=",
"False",
")",
":",
"with",
"conf",
".",
"make_context",
"(",
")",
"as",
"context",
":",
"try",
":",
"stream",
"=",
"BuildProgressStream",
"(",
"conf",
".",
"harpoon",
".",
"silent_build... | Build this image | [
"Build",
"this",
"image"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/ship/builder.py#L137-L163 |
delfick/harpoon | harpoon/ship/builder.py | Builder.layered | def layered(self, images, only_pushable=False):
"""Yield layers of images"""
if only_pushable:
operate_on = dict((image, instance) for image, instance in images.items() if instance.image_index)
else:
operate_on = images
layers = Layers(operate_on, all_images=imag... | python | def layered(self, images, only_pushable=False):
"""Yield layers of images"""
if only_pushable:
operate_on = dict((image, instance) for image, instance in images.items() if instance.image_index)
else:
operate_on = images
layers = Layers(operate_on, all_images=imag... | [
"def",
"layered",
"(",
"self",
",",
"images",
",",
"only_pushable",
"=",
"False",
")",
":",
"if",
"only_pushable",
":",
"operate_on",
"=",
"dict",
"(",
"(",
"image",
",",
"instance",
")",
"for",
"image",
",",
"instance",
"in",
"images",
".",
"items",
"... | Yield layers of images | [
"Yield",
"layers",
"of",
"images"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/ship/builder.py#L165-L180 |
mitsei/dlkit | dlkit/records/assessment/qti/basic.py | QTIQuestionFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
self._shuffle_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'shuffle'),
'element_label': 'Shuffle',
'instructions':... | python | def _init_metadata(self):
"""stub"""
self._shuffle_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'shuffle'),
'element_label': 'Shuffle',
'instructions':... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"self",
".",
"_shuffle_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_object_form",
".",
"_authority",
",",
"self",
".",
"my_osid_object_form",
".",
"_namespace",
",",
"'shuffle'",
")"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/basic.py#L668-L682 |
mitsei/dlkit | dlkit/records/assessment/qti/basic.py | QTIQuestionFormRecord.set_shuffle | def set_shuffle(self, shuffle):
"""stub"""
if not self.my_osid_object_form._is_valid_boolean(
shuffle):
raise InvalidArgument('shuffle')
self.my_osid_object_form._my_map['shuffle'] = shuffle | python | def set_shuffle(self, shuffle):
"""stub"""
if not self.my_osid_object_form._is_valid_boolean(
shuffle):
raise InvalidArgument('shuffle')
self.my_osid_object_form._my_map['shuffle'] = shuffle | [
"def",
"set_shuffle",
"(",
"self",
",",
"shuffle",
")",
":",
"if",
"not",
"self",
".",
"my_osid_object_form",
".",
"_is_valid_boolean",
"(",
"shuffle",
")",
":",
"raise",
"InvalidArgument",
"(",
"'shuffle'",
")",
"self",
".",
"my_osid_object_form",
".",
"_my_m... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/basic.py#L688-L693 |
mitsei/dlkit | dlkit/records/assessment/qti/basic.py | QTIItemRecord._is_match | def _is_match(self, response, answer):
"""For MC, can call through to MultiChoice Item Record?"""
# TODO: this varies depending on question type
if self._only_generic_right_feedback():
return str(answer.genus_type) == str(RIGHT_ANSWER_GENUS)
elif self._is_multiple_choice():
... | python | def _is_match(self, response, answer):
"""For MC, can call through to MultiChoice Item Record?"""
# TODO: this varies depending on question type
if self._only_generic_right_feedback():
return str(answer.genus_type) == str(RIGHT_ANSWER_GENUS)
elif self._is_multiple_choice():
... | [
"def",
"_is_match",
"(",
"self",
",",
"response",
",",
"answer",
")",
":",
"# TODO: this varies depending on question type",
"if",
"self",
".",
"_only_generic_right_feedback",
"(",
")",
":",
"return",
"str",
"(",
"answer",
".",
"genus_type",
")",
"==",
"str",
"(... | For MC, can call through to MultiChoice Item Record? | [
"For",
"MC",
"can",
"call",
"through",
"to",
"MultiChoice",
"Item",
"Record?"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/basic.py#L1350-L1363 |
mitsei/dlkit | dlkit/json_/authorization/searches.py | AuthorizationSearchResults.get_authorizations | def get_authorizations(self):
"""Gets the authorization list resulting from the search.
return: (osid.authorization.AuthorizationList) - the
authorization list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemente... | python | def get_authorizations(self):
"""Gets the authorization list resulting from the search.
return: (osid.authorization.AuthorizationList) - the
authorization list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemente... | [
"def",
"get_authorizations",
"(",
"self",
")",
":",
"if",
"self",
".",
"retrieved",
":",
"raise",
"errors",
".",
"IllegalState",
"(",
"'List has already been retrieved.'",
")",
"self",
".",
"retrieved",
"=",
"True",
"return",
"objects",
".",
"AuthorizationList",
... | Gets the authorization list resulting from the search.
return: (osid.authorization.AuthorizationList) - the
authorization list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"authorization",
"list",
"resulting",
"from",
"the",
"search",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/authorization/searches.py#L99-L111 |
mitsei/dlkit | dlkit/json_/authorization/searches.py | VaultSearchResults.get_vaults | def get_vaults(self):
"""Gets the vault list resulting from the search.
return: (osid.authorization.VaultList) - the vault list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.*
"""
if self.retrieved:
... | python | def get_vaults(self):
"""Gets the vault list resulting from the search.
return: (osid.authorization.VaultList) - the vault list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.*
"""
if self.retrieved:
... | [
"def",
"get_vaults",
"(",
"self",
")",
":",
"if",
"self",
".",
"retrieved",
":",
"raise",
"errors",
".",
"IllegalState",
"(",
"'List has already been retrieved.'",
")",
"self",
".",
"retrieved",
"=",
"True",
"return",
"objects",
".",
"VaultList",
"(",
"self",
... | Gets the vault list resulting from the search.
return: (osid.authorization.VaultList) - the vault list
raise: IllegalState - list has already been retrieved
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"vault",
"list",
"resulting",
"from",
"the",
"search",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/authorization/searches.py#L224-L235 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | Objective.get_knowledge_category | def get_knowledge_category(self):
"""Gets the grade associated with the knowledge dimension.
return: (osid.grading.Grade) - the grade
raise: IllegalState - has_knowledge_category() is false
raise: OperationFailed - unable to complete request
compliance: mandatory - This method... | python | def get_knowledge_category(self):
"""Gets the grade associated with the knowledge dimension.
return: (osid.grading.Grade) - the grade
raise: IllegalState - has_knowledge_category() is false
raise: OperationFailed - unable to complete request
compliance: mandatory - This method... | [
"def",
"get_knowledge_category",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"has_knowledge_category",
"(",
")",
":",
"raise",
"IllegalState",
"(",
")",
"else",
":",
"return",
"Grade",
"(",
"self",
".",
"_get_grade_map",
"(",
"self",
".",
"_my_map",
"... | Gets the grade associated with the knowledge dimension.
return: (osid.grading.Grade) - the grade
raise: IllegalState - has_knowledge_category() is false
raise: OperationFailed - unable to complete request
compliance: mandatory - This method must be implemented. | [
"Gets",
"the",
"grade",
"associated",
"with",
"the",
"knowledge",
"dimension",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L97-L109 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | Objective.get_cognitive_process | def get_cognitive_process(self):
"""Gets the grade associated with the cognitive process.
return: (osid.grading.Grade) - the grade
raise: IllegalState - has_cognitive_process() is false
raise: OperationFailed - unable to complete request
compliance: mandatory - This method mus... | python | def get_cognitive_process(self):
"""Gets the grade associated with the cognitive process.
return: (osid.grading.Grade) - the grade
raise: IllegalState - has_cognitive_process() is false
raise: OperationFailed - unable to complete request
compliance: mandatory - This method mus... | [
"def",
"get_cognitive_process",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"has_cognitive_process",
"(",
")",
":",
"raise",
"IllegalState",
"(",
")",
"else",
":",
"return",
"Grade",
"(",
"self",
".",
"_get_grade_map",
"(",
"self",
".",
"_my_map",
"["... | Gets the grade associated with the cognitive process.
return: (osid.grading.Grade) - the grade
raise: IllegalState - has_cognitive_process() is false
raise: OperationFailed - unable to complete request
compliance: mandatory - This method must be implemented. | [
"Gets",
"the",
"grade",
"associated",
"with",
"the",
"cognitive",
"process",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L134-L146 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | ObjectiveForm.set_assessment | def set_assessment(self, assessment_id=None):
"""Sets the assessment.
arg: assessmentId (osid.id.Id): the new assessment
raise: INVALID_ARGUMENT - assessmentId is invalid
raise: NoAccess - assessmentId cannot be modified
raise: NullArgument - assessmentId is null
c... | python | def set_assessment(self, assessment_id=None):
"""Sets the assessment.
arg: assessmentId (osid.id.Id): the new assessment
raise: INVALID_ARGUMENT - assessmentId is invalid
raise: NoAccess - assessmentId cannot be modified
raise: NullArgument - assessmentId is null
c... | [
"def",
"set_assessment",
"(",
"self",
",",
"assessment_id",
"=",
"None",
")",
":",
"if",
"assessment_id",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"metadata",
"=",
"Metadata",
"(",
"*",
"*",
"settings",
".",
"METADATA",
"[",
"'assessment_id'",
... | Sets the assessment.
arg: assessmentId (osid.id.Id): the new assessment
raise: INVALID_ARGUMENT - assessmentId is invalid
raise: NoAccess - assessmentId cannot be modified
raise: NullArgument - assessmentId is null
compliance: mandatory - This method must be implemented. | [
"Sets",
"the",
"assessment",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L211-L229 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | ObjectiveForm.set_cognitive_process | def set_cognitive_process(self, grade_id=None):
"""Sets the cognitive process.
arg: gradeId (osid.id.Id): the new cognitive process
raise: INVALID_ARGUMENT - gradeId is invalid
raise: NoAccess - gradeId cannot be modified
raise: NullArgument - gradeId is null
compl... | python | def set_cognitive_process(self, grade_id=None):
"""Sets the cognitive process.
arg: gradeId (osid.id.Id): the new cognitive process
raise: INVALID_ARGUMENT - gradeId is invalid
raise: NoAccess - gradeId cannot be modified
raise: NullArgument - gradeId is null
compl... | [
"def",
"set_cognitive_process",
"(",
"self",
",",
"grade_id",
"=",
"None",
")",
":",
"if",
"grade_id",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"metadata",
"=",
"Metadata",
"(",
"*",
"*",
"settings",
".",
"METADATA",
"[",
"'cognitive_process_id'... | Sets the cognitive process.
arg: gradeId (osid.id.Id): the new cognitive process
raise: INVALID_ARGUMENT - gradeId is invalid
raise: NoAccess - gradeId cannot be modified
raise: NullArgument - gradeId is null
compliance: mandatory - This method must be implemented. | [
"Sets",
"the",
"cognitive",
"process",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L295-L313 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | ObjectiveList.get_next_objective | def get_next_objective(self):
"""Gets the next Objective in this list.
return: (osid.learning.Objective) - the next Objective in this
list. The has_next() method should be used to test that
a next Objective is available before calling this
method.
... | python | def get_next_objective(self):
"""Gets the next Objective in this list.
return: (osid.learning.Objective) - the next Objective in this
list. The has_next() method should be used to test that
a next Objective is available before calling this
method.
... | [
"def",
"get_next_objective",
"(",
"self",
")",
":",
"try",
":",
"next_object",
"=",
"next",
"(",
"self",
")",
"except",
"StopIteration",
":",
"raise",
"IllegalState",
"(",
"'no more elements available in this list'",
")",
"except",
"Exception",
":",
"# Need to speci... | Gets the next Objective in this list.
return: (osid.learning.Objective) - the next Objective in this
list. The has_next() method should be used to test that
a next Objective is available before calling this
method.
raise: IllegalState - no more elements ... | [
"Gets",
"the",
"next",
"Objective",
"in",
"this",
"list",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L371-L390 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | Activity.get_objective | def get_objective(self):
"""Gets the related objective.
return: (osid.learning.Objective) - the related objective
raise: OperationFailed - unable to complete request
compliance: mandatory - This method must be implemented.
"""
# Note that this makes the generic objecti... | python | def get_objective(self):
"""Gets the related objective.
return: (osid.learning.Objective) - the related objective
raise: OperationFailed - unable to complete request
compliance: mandatory - This method must be implemented.
"""
# Note that this makes the generic objecti... | [
"def",
"get_objective",
"(",
"self",
")",
":",
"# Note that this makes the generic objectives call to Handcar",
"# without specifying the objectiveBank:",
"url_str",
"=",
"(",
"self",
".",
"_base_url",
"+",
"'/objectives/'",
"+",
"self",
".",
"_my_map",
"[",
"'objectiveId'"... | Gets the related objective.
return: (osid.learning.Objective) - the related objective
raise: OperationFailed - unable to complete request
compliance: mandatory - This method must be implemented. | [
"Gets",
"the",
"related",
"objective",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L468-L480 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | Activity.get_asset_ids | def get_asset_ids(self):
"""Gets the Ids of any assets associated with this activity.
return: (osid.id.IdList) - list of asset Ids
raise: IllegalState - is_asset_based_activity() is false
compliance: mandatory - This method must be implemented.
"""
if not self.is_asset... | python | def get_asset_ids(self):
"""Gets the Ids of any assets associated with this activity.
return: (osid.id.IdList) - list of asset Ids
raise: IllegalState - is_asset_based_activity() is false
compliance: mandatory - This method must be implemented.
"""
if not self.is_asset... | [
"def",
"get_asset_ids",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_asset_based_activity",
"(",
")",
":",
"raise",
"IllegalState",
"(",
")",
"else",
":",
"ids",
"=",
"[",
"]",
"for",
"i",
"in",
"self",
".",
"_my_map",
"[",
"'assetIds'",
"]",
... | Gets the Ids of any assets associated with this activity.
return: (osid.id.IdList) - list of asset Ids
raise: IllegalState - is_asset_based_activity() is false
compliance: mandatory - This method must be implemented. | [
"Gets",
"the",
"Ids",
"of",
"any",
"assets",
"associated",
"with",
"this",
"activity",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L492-L506 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | Activity.get_assets | def get_assets(self):
"""Gets any assets associated with this activity.
return: (osid.repository.AssetList) - list of assets
raise: IllegalState - is_asset_based_activity() is false
raise: OperationFailed - unable to complete request
compliance: mandatory - This method must be... | python | def get_assets(self):
"""Gets any assets associated with this activity.
return: (osid.repository.AssetList) - list of assets
raise: IllegalState - is_asset_based_activity() is false
raise: OperationFailed - unable to complete request
compliance: mandatory - This method must be... | [
"def",
"get_assets",
"(",
"self",
")",
":",
"# This includes a kludge to get the objectiveBankId directly from",
"# this Activity's Objective's private _my_map :o",
"from",
".",
".",
"repository",
".",
"objects",
"import",
"AssetList",
"if",
"not",
"self",
".",
"is_asset_base... | Gets any assets associated with this activity.
return: (osid.repository.AssetList) - list of assets
raise: IllegalState - is_asset_based_activity() is false
raise: OperationFailed - unable to complete request
compliance: mandatory - This method must be implemented. | [
"Gets",
"any",
"assets",
"associated",
"with",
"this",
"activity",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L508-L525 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | Activity.get_assessment_ids | def get_assessment_ids(self):
"""Gets the Ids of any assessments associated with this activity.
return: (osid.id.IdList) - list of assessment Ids
raise: IllegalState - is_assessment_based_activity() is false
compliance: mandatory - This method must be implemented.
"""
... | python | def get_assessment_ids(self):
"""Gets the Ids of any assessments associated with this activity.
return: (osid.id.IdList) - list of assessment Ids
raise: IllegalState - is_assessment_based_activity() is false
compliance: mandatory - This method must be implemented.
"""
... | [
"def",
"get_assessment_ids",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_assessment_based_activity",
"(",
")",
":",
"raise",
"IllegalState",
"(",
")",
"else",
":",
"return",
"[",
"Id",
"(",
"a",
")",
"for",
"a",
"in",
"self",
".",
"_my_map",
"... | Gets the Ids of any assessments associated with this activity.
return: (osid.id.IdList) - list of assessment Ids
raise: IllegalState - is_assessment_based_activity() is false
compliance: mandatory - This method must be implemented. | [
"Gets",
"the",
"Ids",
"of",
"any",
"assessments",
"associated",
"with",
"this",
"activity",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L575-L586 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | ActivityForm.set_assets | def set_assets(self, asset_ids=None):
"""Sets the assets.
arg: assetIds (osid.id.Id): the asset Ids
raise: INVALID_ARGUMENT - assetIds is invalid
raise: NullArgument - assetIds is null
raise: NoAccess - metadata.is_read_only() is true
compliance: mandatory - This m... | python | def set_assets(self, asset_ids=None):
"""Sets the assets.
arg: assetIds (osid.id.Id): the asset Ids
raise: INVALID_ARGUMENT - assetIds is invalid
raise: NullArgument - assetIds is null
raise: NoAccess - metadata.is_read_only() is true
compliance: mandatory - This m... | [
"def",
"set_assets",
"(",
"self",
",",
"asset_ids",
"=",
"None",
")",
":",
"if",
"asset_ids",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"metadata",
"=",
"Metadata",
"(",
"*",
"*",
"settings",
".",
"METADATA",
"[",
"'asset_ids'",
"]",
")",
"... | Sets the assets.
arg: assetIds (osid.id.Id): the asset Ids
raise: INVALID_ARGUMENT - assetIds is invalid
raise: NullArgument - assetIds is null
raise: NoAccess - metadata.is_read_only() is true
compliance: mandatory - This method must be implemented. | [
"Sets",
"the",
"assets",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L668-L687 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | ActivityForm.set_courses | def set_courses(self, course_ids=None):
"""Sets the courses.
arg: courseIds (osid.id.Id): the course Ids
raise: INVALID_ARGUMENT - courseIds is invalid
raise: NullArgument - courseIds is null
raise: NoAccess - metadata.is_read_only() is true
compliance: mandatory -... | python | def set_courses(self, course_ids=None):
"""Sets the courses.
arg: courseIds (osid.id.Id): the course Ids
raise: INVALID_ARGUMENT - courseIds is invalid
raise: NullArgument - courseIds is null
raise: NoAccess - metadata.is_read_only() is true
compliance: mandatory -... | [
"def",
"set_courses",
"(",
"self",
",",
"course_ids",
"=",
"None",
")",
":",
"if",
"course_ids",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"metadata",
"=",
"Metadata",
"(",
"*",
"*",
"settings",
".",
"METADATA",
"[",
"'course_ids'",
"]",
")",... | Sets the courses.
arg: courseIds (osid.id.Id): the course Ids
raise: INVALID_ARGUMENT - courseIds is invalid
raise: NullArgument - courseIds is null
raise: NoAccess - metadata.is_read_only() is true
compliance: mandatory - This method must be implemented. | [
"Sets",
"the",
"courses",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L711-L730 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | ActivityForm.set_assessments | def set_assessments(self, assessment_ids=None):
"""Sets the assessments.
arg: assessmentIds (osid.id.Id): the assessment Ids
raise: INVALID_ARGUMENT - assessmentIds is invalid
raise: NullArgument - assessmentIds is null
raise: NoAccess - metadata.is_read_only() is true
... | python | def set_assessments(self, assessment_ids=None):
"""Sets the assessments.
arg: assessmentIds (osid.id.Id): the assessment Ids
raise: INVALID_ARGUMENT - assessmentIds is invalid
raise: NullArgument - assessmentIds is null
raise: NoAccess - metadata.is_read_only() is true
... | [
"def",
"set_assessments",
"(",
"self",
",",
"assessment_ids",
"=",
"None",
")",
":",
"if",
"assessment_ids",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"metadata",
"=",
"Metadata",
"(",
"*",
"*",
"settings",
".",
"METADATA",
"[",
"'assessment_ids'... | Sets the assessments.
arg: assessmentIds (osid.id.Id): the assessment Ids
raise: INVALID_ARGUMENT - assessmentIds is invalid
raise: NullArgument - assessmentIds is null
raise: NoAccess - metadata.is_read_only() is true
compliance: mandatory - This method must be implemente... | [
"Sets",
"the",
"assessments",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L754-L773 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | ActivityList.get_next_activity | def get_next_activity(self):
"""Gets the next Activity in this list.
return: (osid.learning.Activity) - the next Activity in this
list. The has_next() method should be used to test that
a next Activity is available before calling this method.
raise: IllegalState... | python | def get_next_activity(self):
"""Gets the next Activity in this list.
return: (osid.learning.Activity) - the next Activity in this
list. The has_next() method should be used to test that
a next Activity is available before calling this method.
raise: IllegalState... | [
"def",
"get_next_activity",
"(",
"self",
")",
":",
"try",
":",
"next_object",
"=",
"next",
"(",
"self",
")",
"except",
"StopIteration",
":",
"raise",
"IllegalState",
"(",
"'no more elements available in this list'",
")",
"except",
"Exception",
":",
"# Need to specif... | Gets the next Activity in this list.
return: (osid.learning.Activity) - the next Activity in this
list. The has_next() method should be used to test that
a next Activity is available before calling this method.
raise: IllegalState - no more elements available in this li... | [
"Gets",
"the",
"next",
"Activity",
"in",
"this",
"list",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L829-L847 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | ObjectiveBankList.get_next_objective_bank | def get_next_objective_bank(self):
"""Gets the next ObjectiveBank in this list.
return: (osid.learning.ObjectiveBank) - the next ObjectiveBank
in this list. The has_next() method should be used to
test that a next ObjectiveBank is available before
calling... | python | def get_next_objective_bank(self):
"""Gets the next ObjectiveBank in this list.
return: (osid.learning.ObjectiveBank) - the next ObjectiveBank
in this list. The has_next() method should be used to
test that a next ObjectiveBank is available before
calling... | [
"def",
"get_next_objective_bank",
"(",
"self",
")",
":",
"try",
":",
"next_object",
"=",
"next",
"(",
"self",
")",
"except",
"StopIteration",
":",
"raise",
"IllegalState",
"(",
"'no more elements available in this list'",
")",
"except",
"Exception",
":",
"# Need to ... | Gets the next ObjectiveBank in this list.
return: (osid.learning.ObjectiveBank) - the next ObjectiveBank
in this list. The has_next() method should be used to
test that a next ObjectiveBank is available before
calling this method.
raise: IllegalState - n... | [
"Gets",
"the",
"next",
"ObjectiveBank",
"in",
"this",
"list",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L984-L1003 |
mitsei/dlkit | dlkit/handcar/learning/objects.py | ObjectiveBankList.get_next_objective_banks | def get_next_objective_banks(self, n=None):
"""Gets the next set of ObjectiveBank elements in this list which
must be less than or equal to the return from available().
arg: n (cardinal): the number of ObjectiveBank elements
requested which must be less than or equal to
... | python | def get_next_objective_banks(self, n=None):
"""Gets the next set of ObjectiveBank elements in this list which
must be less than or equal to the return from available().
arg: n (cardinal): the number of ObjectiveBank elements
requested which must be less than or equal to
... | [
"def",
"get_next_objective_banks",
"(",
"self",
",",
"n",
"=",
"None",
")",
":",
"if",
"n",
">",
"self",
".",
"available",
"(",
")",
":",
"# !!! This is not quite as specified (see method docs) !!!",
"raise",
"IllegalState",
"(",
"'not enough elements available in this ... | Gets the next set of ObjectiveBank elements in this list which
must be less than or equal to the return from available().
arg: n (cardinal): the number of ObjectiveBank elements
requested which must be less than or equal to
available()
return: (osid.learning.O... | [
"Gets",
"the",
"next",
"set",
"of",
"ObjectiveBank",
"elements",
"in",
"this",
"list",
"which",
"must",
"be",
"less",
"than",
"or",
"equal",
"to",
"the",
"return",
"from",
"available",
"()",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/learning/objects.py#L1018-L1045 |
jason-weirather/py-seq-tools | seqtools/old_graph.py | get_report | def get_report(self):
""" describe the graph
:returns: report
:rtype: string
"""
ostr = ''
ostr += "Nodes: "+str(len(self.__nodes.keys()))+"\n"
ostr += "Edges: "+str(len(self.__edges.keys()))+"\n"
return ostr | python | def get_report(self):
""" describe the graph
:returns: report
:rtype: string
"""
ostr = ''
ostr += "Nodes: "+str(len(self.__nodes.keys()))+"\n"
ostr += "Edges: "+str(len(self.__edges.keys()))+"\n"
return ostr | [
"def",
"get_report",
"(",
"self",
")",
":",
"ostr",
"=",
"''",
"ostr",
"+=",
"\"Nodes: \"",
"+",
"str",
"(",
"len",
"(",
"self",
".",
"__nodes",
".",
"keys",
"(",
")",
")",
")",
"+",
"\"\\n\"",
"ostr",
"+=",
"\"Edges: \"",
"+",
"str",
"(",
"len",
... | describe the graph
:returns: report
:rtype: string | [
"describe",
"the",
"graph"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/old_graph.py#L25-L34 |
jason-weirather/py-seq-tools | seqtools/old_graph.py | get_node_edges | def get_node_edges(self,node,type="both"):
""" given a node return the edges attached, by default get both incoming and outgoing
:param node:
:param type:
:type node: Node
:type type: string - default 'both'
:returns: edge list
:rtype: Edge[] edge list
"""
if type == "both":
r... | python | def get_node_edges(self,node,type="both"):
""" given a node return the edges attached, by default get both incoming and outgoing
:param node:
:param type:
:type node: Node
:type type: string - default 'both'
:returns: edge list
:rtype: Edge[] edge list
"""
if type == "both":
r... | [
"def",
"get_node_edges",
"(",
"self",
",",
"node",
",",
"type",
"=",
"\"both\"",
")",
":",
"if",
"type",
"==",
"\"both\"",
":",
"return",
"[",
"self",
".",
"__edges",
"[",
"x",
"]",
"for",
"x",
"in",
"self",
".",
"__edges",
"if",
"node",
".",
"id",... | given a node return the edges attached, by default get both incoming and outgoing
:param node:
:param type:
:type node: Node
:type type: string - default 'both'
:returns: edge list
:rtype: Edge[] edge list | [
"given",
"a",
"node",
"return",
"the",
"edges",
"attached",
"by",
"default",
"get",
"both",
"incoming",
"and",
"outgoing"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/old_graph.py#L45-L62 |
jason-weirather/py-seq-tools | seqtools/old_graph.py | get_children | def get_children(self,node):
""" Find all the children of a node. must be a undirectional graph with no cycles
:param node:
:type node: Node
:returns: list of nodes
:rtype: Node[]
"""
if self.find_cycle() or self.__directionless:
sys.stderr.write("ERROR: do cannot find a branch when ... | python | def get_children(self,node):
""" Find all the children of a node. must be a undirectional graph with no cycles
:param node:
:type node: Node
:returns: list of nodes
:rtype: Node[]
"""
if self.find_cycle() or self.__directionless:
sys.stderr.write("ERROR: do cannot find a branch when ... | [
"def",
"get_children",
"(",
"self",
",",
"node",
")",
":",
"if",
"self",
".",
"find_cycle",
"(",
")",
"or",
"self",
".",
"__directionless",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"\"ERROR: do cannot find a branch when there are cycles in the graph\\n\"",
")... | Find all the children of a node. must be a undirectional graph with no cycles
:param node:
:type node: Node
:returns: list of nodes
:rtype: Node[] | [
"Find",
"all",
"the",
"children",
"of",
"a",
"node",
".",
"must",
"be",
"a",
"undirectional",
"graph",
"with",
"no",
"cycles"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/old_graph.py#L85-L97 |
jason-weirather/py-seq-tools | seqtools/old_graph.py | get_roots | def get_roots(self):
"""get the roots of a graph. must be a directed graph
:returns: root list of nodes
:rtype: Node[]
"""
if self.__directionless:
sys.stderr.write("ERROR: can't get roots of an undirected graph\n")
sys.exit()
outputids = self.__nodes.keys()
#print outputids
... | python | def get_roots(self):
"""get the roots of a graph. must be a directed graph
:returns: root list of nodes
:rtype: Node[]
"""
if self.__directionless:
sys.stderr.write("ERROR: can't get roots of an undirected graph\n")
sys.exit()
outputids = self.__nodes.keys()
#print outputids
... | [
"def",
"get_roots",
"(",
"self",
")",
":",
"if",
"self",
".",
"__directionless",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"\"ERROR: can't get roots of an undirected graph\\n\"",
")",
"sys",
".",
"exit",
"(",
")",
"outputids",
"=",
"self",
".",
"__nodes",
... | get the roots of a graph. must be a directed graph
:returns: root list of nodes
:rtype: Node[] | [
"get",
"the",
"roots",
"of",
"a",
"graph",
".",
"must",
"be",
"a",
"directed",
"graph"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/old_graph.py#L111-L124 |
jason-weirather/py-seq-tools | seqtools/old_graph.py | root_and_children_to_graph | def root_and_children_to_graph(self,root):
"""Take a root node and its children and make them into graphs"""
g = Graph()
g.add_node(root)
edges = []
edges += self.get_node_edges(root,"outgoing")
for c in self.get_children(root):
g.add_node(c)
edges += self.get_node_ed... | python | def root_and_children_to_graph(self,root):
"""Take a root node and its children and make them into graphs"""
g = Graph()
g.add_node(root)
edges = []
edges += self.get_node_edges(root,"outgoing")
for c in self.get_children(root):
g.add_node(c)
edges += self.get_node_ed... | [
"def",
"root_and_children_to_graph",
"(",
"self",
",",
"root",
")",
":",
"g",
"=",
"Graph",
"(",
")",
"g",
".",
"add_node",
"(",
"root",
")",
"edges",
"=",
"[",
"]",
"edges",
"+=",
"self",
".",
"get_node_edges",
"(",
"root",
",",
"\"outgoing\"",
")",
... | Take a root node and its children and make them into graphs | [
"Take",
"a",
"root",
"node",
"and",
"its",
"children",
"and",
"make",
"them",
"into",
"graphs"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/old_graph.py#L126-L136 |
theosysbio/means | src/means/core/model.py | Model.validate | def validate(self):
"""
Validates whether the particular model is created properly
"""
if self.stoichiometry_matrix.cols != self.propensities.rows:
raise ValueError('There must be a column in stoichiometry matrix '
'for each row in propensities ma... | python | def validate(self):
"""
Validates whether the particular model is created properly
"""
if self.stoichiometry_matrix.cols != self.propensities.rows:
raise ValueError('There must be a column in stoichiometry matrix '
'for each row in propensities ma... | [
"def",
"validate",
"(",
"self",
")",
":",
"if",
"self",
".",
"stoichiometry_matrix",
".",
"cols",
"!=",
"self",
".",
"propensities",
".",
"rows",
":",
"raise",
"ValueError",
"(",
"'There must be a column in stoichiometry matrix '",
"'for each row in propensities matrix.... | Validates whether the particular model is created properly | [
"Validates",
"whether",
"the",
"particular",
"model",
"is",
"created",
"properly"
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/core/model.py#L78-L118 |
mitsei/dlkit | dlkit/json_/osid/markers.py | Identifiable.get_id | def get_id(self):
"""Gets the Id associated with this instance of this OSID object.
Persisting any reference to this object is done by persisting
the Id returned from this method. The Id returned may be
different than the Id used to query this object. In this case,
the new Id sh... | python | def get_id(self):
"""Gets the Id associated with this instance of this OSID object.
Persisting any reference to this object is done by persisting
the Id returned from this method. The Id returned may be
different than the Id used to query this object. In this case,
the new Id sh... | [
"def",
"get_id",
"(",
"self",
")",
":",
"return",
"Id",
"(",
"identifier",
"=",
"str",
"(",
"self",
".",
"_my_map",
"[",
"'_id'",
"]",
")",
",",
"namespace",
"=",
"self",
".",
"_namespace",
",",
"authority",
"=",
"self",
".",
"_authority",
")"
] | Gets the Id associated with this instance of this OSID object.
Persisting any reference to this object is done by persisting
the Id returned from this method. The Id returned may be
different than the Id used to query this object. In this case,
the new Id should be preferred over the ol... | [
"Gets",
"the",
"Id",
"associated",
"with",
"this",
"instance",
"of",
"this",
"OSID",
"object",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/markers.py#L58-L92 |
mitsei/dlkit | dlkit/json_/osid/markers.py | Extensible._get_record | def _get_record(self, record_type):
"""Get the record string type value given the record_type."""
if not self.has_record_type(record_type):
raise errors.Unsupported()
if str(record_type) not in self._records:
raise errors.Unimplemented()
return self._records[str(r... | python | def _get_record(self, record_type):
"""Get the record string type value given the record_type."""
if not self.has_record_type(record_type):
raise errors.Unsupported()
if str(record_type) not in self._records:
raise errors.Unimplemented()
return self._records[str(r... | [
"def",
"_get_record",
"(",
"self",
",",
"record_type",
")",
":",
"if",
"not",
"self",
".",
"has_record_type",
"(",
"record_type",
")",
":",
"raise",
"errors",
".",
"Unsupported",
"(",
")",
"if",
"str",
"(",
"record_type",
")",
"not",
"in",
"self",
".",
... | Get the record string type value given the record_type. | [
"Get",
"the",
"record",
"string",
"type",
"value",
"given",
"the",
"record_type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/markers.py#L159-L165 |
mitsei/dlkit | dlkit/json_/osid/markers.py | Extensible._init_records | def _init_records(self, record_types):
"""Initalize all records for this form."""
for record_type in record_types:
# This conditional was inserted on 7/11/14. It may prove problematic:
if str(record_type) not in self._my_map['recordTypeIds']:
record_initialized = ... | python | def _init_records(self, record_types):
"""Initalize all records for this form."""
for record_type in record_types:
# This conditional was inserted on 7/11/14. It may prove problematic:
if str(record_type) not in self._my_map['recordTypeIds']:
record_initialized = ... | [
"def",
"_init_records",
"(",
"self",
",",
"record_types",
")",
":",
"for",
"record_type",
"in",
"record_types",
":",
"# This conditional was inserted on 7/11/14. It may prove problematic:",
"if",
"str",
"(",
"record_type",
")",
"not",
"in",
"self",
".",
"_my_map",
"["... | Initalize all records for this form. | [
"Initalize",
"all",
"records",
"for",
"this",
"form",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/markers.py#L172-L179 |
mitsei/dlkit | dlkit/json_/osid/markers.py | Extensible._delete | def _delete(self):
"""Override this method in inheriting objects to perform special clearing operations."""
try:
for record in self._records:
try:
self._records[record]._delete()
except AttributeError:
pass
excep... | python | def _delete(self):
"""Override this method in inheriting objects to perform special clearing operations."""
try:
for record in self._records:
try:
self._records[record]._delete()
except AttributeError:
pass
excep... | [
"def",
"_delete",
"(",
"self",
")",
":",
"try",
":",
"for",
"record",
"in",
"self",
".",
"_records",
":",
"try",
":",
"self",
".",
"_records",
"[",
"record",
"]",
".",
"_delete",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"except",
"AttributeEr... | Override this method in inheriting objects to perform special clearing operations. | [
"Override",
"this",
"method",
"in",
"inheriting",
"objects",
"to",
"perform",
"special",
"clearing",
"operations",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/markers.py#L195-L204 |
mitsei/dlkit | dlkit/json_/osid/markers.py | Extensible._get_provider_manager | def _get_provider_manager(self, osid, local=False):
"""Gets the most appropriate provider manager depending on config."""
return get_provider_manager(osid,
runtime=self._runtime,
proxy=getattr(self, '_proxy', None),
... | python | def _get_provider_manager(self, osid, local=False):
"""Gets the most appropriate provider manager depending on config."""
return get_provider_manager(osid,
runtime=self._runtime,
proxy=getattr(self, '_proxy', None),
... | [
"def",
"_get_provider_manager",
"(",
"self",
",",
"osid",
",",
"local",
"=",
"False",
")",
":",
"return",
"get_provider_manager",
"(",
"osid",
",",
"runtime",
"=",
"self",
".",
"_runtime",
",",
"proxy",
"=",
"getattr",
"(",
"self",
",",
"'_proxy'",
",",
... | Gets the most appropriate provider manager depending on config. | [
"Gets",
"the",
"most",
"appropriate",
"provider",
"manager",
"depending",
"on",
"config",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/markers.py#L206-L211 |
mitsei/dlkit | dlkit/json_/osid/markers.py | Extensible.get_record_types | def get_record_types(self):
"""Gets the record types available in this object.
A record ``Type`` explicitly indicates the specification of an
interface to the record. A record may or may not inherit other
record interfaces through interface inheritance in which case
support of a... | python | def get_record_types(self):
"""Gets the record types available in this object.
A record ``Type`` explicitly indicates the specification of an
interface to the record. A record may or may not inherit other
record interfaces through interface inheritance in which case
support of a... | [
"def",
"get_record_types",
"(",
"self",
")",
":",
"from",
".",
".",
"type",
".",
"objects",
"import",
"TypeList",
"type_list",
"=",
"[",
"]",
"for",
"type_idstr",
"in",
"self",
".",
"_supported_record_type_ids",
":",
"type_list",
".",
"append",
"(",
"Type",
... | Gets the record types available in this object.
A record ``Type`` explicitly indicates the specification of an
interface to the record. A record may or may not inherit other
record interfaces through interface inheritance in which case
support of a record type may not be explicit in the... | [
"Gets",
"the",
"record",
"types",
"available",
"in",
"this",
"object",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/markers.py#L213-L231 |
mitsei/dlkit | dlkit/json_/osid/markers.py | Temporal.is_effective | def is_effective(self):
"""Tests if the current date is within the start end end dates inclusive.
return: (boolean) - ``true`` if this is effective, ``false``
otherwise
*compliance: mandatory -- This method must be implemented.*
"""
now = DateTime.utcnow()
... | python | def is_effective(self):
"""Tests if the current date is within the start end end dates inclusive.
return: (boolean) - ``true`` if this is effective, ``false``
otherwise
*compliance: mandatory -- This method must be implemented.*
"""
now = DateTime.utcnow()
... | [
"def",
"is_effective",
"(",
"self",
")",
":",
"now",
"=",
"DateTime",
".",
"utcnow",
"(",
")",
"return",
"self",
".",
"get_start_date",
"(",
")",
"<=",
"now",
"and",
"self",
".",
"get_end_date",
"(",
")",
">=",
"now"
] | Tests if the current date is within the start end end dates inclusive.
return: (boolean) - ``true`` if this is effective, ``false``
otherwise
*compliance: mandatory -- This method must be implemented.* | [
"Tests",
"if",
"the",
"current",
"date",
"is",
"within",
"the",
"start",
"end",
"end",
"dates",
"inclusive",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/markers.py#L309-L318 |
mitsei/dlkit | dlkit/json_/osid/markers.py | Temporal.get_start_date | def get_start_date(self):
"""Gets the start date.
return: (osid.calendaring.DateTime) - the start date
*compliance: mandatory -- This method must be implemented.*
"""
sdate = self._my_map['startDate']
return DateTime(
sdate.year,
sdate.month,
... | python | def get_start_date(self):
"""Gets the start date.
return: (osid.calendaring.DateTime) - the start date
*compliance: mandatory -- This method must be implemented.*
"""
sdate = self._my_map['startDate']
return DateTime(
sdate.year,
sdate.month,
... | [
"def",
"get_start_date",
"(",
"self",
")",
":",
"sdate",
"=",
"self",
".",
"_my_map",
"[",
"'startDate'",
"]",
"return",
"DateTime",
"(",
"sdate",
".",
"year",
",",
"sdate",
".",
"month",
",",
"sdate",
".",
"day",
",",
"sdate",
".",
"hour",
",",
"sda... | Gets the start date.
return: (osid.calendaring.DateTime) - the start date
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"start",
"date",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/markers.py#L320-L335 |
mitsei/dlkit | dlkit/json_/osid/markers.py | Sourceable.get_provider_id | def get_provider_id(self):
"""Gets the ``Id`` of the provider.
return: (osid.id.Id) - the provider ``Id``
*compliance: mandatory -- This method must be implemented.*
"""
if 'providerId' not in self._my_map or not self._my_map['providerId']:
raise errors.IllegalState... | python | def get_provider_id(self):
"""Gets the ``Id`` of the provider.
return: (osid.id.Id) - the provider ``Id``
*compliance: mandatory -- This method must be implemented.*
"""
if 'providerId' not in self._my_map or not self._my_map['providerId']:
raise errors.IllegalState... | [
"def",
"get_provider_id",
"(",
"self",
")",
":",
"if",
"'providerId'",
"not",
"in",
"self",
".",
"_my_map",
"or",
"not",
"self",
".",
"_my_map",
"[",
"'providerId'",
"]",
":",
"raise",
"errors",
".",
"IllegalState",
"(",
"'this sourceable object has no provider ... | Gets the ``Id`` of the provider.
return: (osid.id.Id) - the provider ``Id``
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"Id",
"of",
"the",
"provider",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/markers.py#L418-L427 |
mitsei/dlkit | dlkit/json_/osid/markers.py | Sourceable.get_provider | def get_provider(self):
"""Gets the ``Resource`` representing the provider.
return: (osid.resource.Resource) - the provider
raise: OperationFailed - unable to complete request
*compliance: mandatory -- This method must be implemented.*
"""
if 'providerId' not in self._... | python | def get_provider(self):
"""Gets the ``Resource`` representing the provider.
return: (osid.resource.Resource) - the provider
raise: OperationFailed - unable to complete request
*compliance: mandatory -- This method must be implemented.*
"""
if 'providerId' not in self._... | [
"def",
"get_provider",
"(",
"self",
")",
":",
"if",
"'providerId'",
"not",
"in",
"self",
".",
"_my_map",
"or",
"not",
"self",
".",
"_my_map",
"[",
"'providerId'",
"]",
":",
"raise",
"errors",
".",
"IllegalState",
"(",
"'this sourceable object has no provider set... | Gets the ``Resource`` representing the provider.
return: (osid.resource.Resource) - the provider
raise: OperationFailed - unable to complete request
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"Resource",
"representing",
"the",
"provider",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/markers.py#L431-L444 |
mitsei/dlkit | dlkit/json_/osid/markers.py | Sourceable.get_branding_ids | def get_branding_ids(self):
"""Gets the branding asset ``Ids``.
return: (osid.id.IdList) - a list of asset ``Ids``
*compliance: mandatory -- This method must be implemented.*
"""
from ..id.objects import IdList
if 'brandingIds' not in self._my_map:
return Id... | python | def get_branding_ids(self):
"""Gets the branding asset ``Ids``.
return: (osid.id.IdList) - a list of asset ``Ids``
*compliance: mandatory -- This method must be implemented.*
"""
from ..id.objects import IdList
if 'brandingIds' not in self._my_map:
return Id... | [
"def",
"get_branding_ids",
"(",
"self",
")",
":",
"from",
".",
".",
"id",
".",
"objects",
"import",
"IdList",
"if",
"'brandingIds'",
"not",
"in",
"self",
".",
"_my_map",
":",
"return",
"IdList",
"(",
"[",
"]",
")",
"id_list",
"=",
"[",
"]",
"for",
"i... | Gets the branding asset ``Ids``.
return: (osid.id.IdList) - a list of asset ``Ids``
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"branding",
"asset",
"Ids",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/markers.py#L448-L461 |
mitsei/dlkit | dlkit/json_/osid/markers.py | Sourceable.get_license | def get_license(self):
"""Gets the terms of usage.
An empty license means the terms are unknown.
return: (osid.locale.DisplayText) - the license
*compliance: mandatory -- This method must be implemented.*
"""
if 'license' in self._my_map:
license_text = sel... | python | def get_license(self):
"""Gets the terms of usage.
An empty license means the terms are unknown.
return: (osid.locale.DisplayText) - the license
*compliance: mandatory -- This method must be implemented.*
"""
if 'license' in self._my_map:
license_text = sel... | [
"def",
"get_license",
"(",
"self",
")",
":",
"if",
"'license'",
"in",
"self",
".",
"_my_map",
":",
"license_text",
"=",
"self",
".",
"_my_map",
"[",
"'license'",
"]",
"return",
"DisplayText",
"(",
"display_text_map",
"=",
"license_text",
")",
"return",
"Disp... | Gets the terms of usage.
An empty license means the terms are unknown.
return: (osid.locale.DisplayText) - the license
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"terms",
"of",
"usage",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/markers.py#L480-L495 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | Transcript.rc | def rc(self):
"""Flip the direction"""
ntx = self.copy()
newstrand = '+'
if ntx.strand == '+': newstrand = '-'
ntx._options = ntx._options._replace(direction=newstrand)
return ntx | python | def rc(self):
"""Flip the direction"""
ntx = self.copy()
newstrand = '+'
if ntx.strand == '+': newstrand = '-'
ntx._options = ntx._options._replace(direction=newstrand)
return ntx | [
"def",
"rc",
"(",
"self",
")",
":",
"ntx",
"=",
"self",
".",
"copy",
"(",
")",
"newstrand",
"=",
"'+'",
"if",
"ntx",
".",
"strand",
"==",
"'+'",
":",
"newstrand",
"=",
"'-'",
"ntx",
".",
"_options",
"=",
"ntx",
".",
"_options",
".",
"_replace",
"... | Flip the direction | [
"Flip",
"the",
"direction"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L93-L99 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | Transcript.slice_sequence | def slice_sequence(self,start,end,directionless=False):
"""Slice the mapping by the position in the sequence
First coordinate is 0-indexed start
Second coordinate is 1-indexed finish
"""
if end > self.length: end = self.length
if start < 0: start = 0
if not directionless and s... | python | def slice_sequence(self,start,end,directionless=False):
"""Slice the mapping by the position in the sequence
First coordinate is 0-indexed start
Second coordinate is 1-indexed finish
"""
if end > self.length: end = self.length
if start < 0: start = 0
if not directionless and s... | [
"def",
"slice_sequence",
"(",
"self",
",",
"start",
",",
"end",
",",
"directionless",
"=",
"False",
")",
":",
"if",
"end",
">",
"self",
".",
"length",
":",
"end",
"=",
"self",
".",
"length",
"if",
"start",
"<",
"0",
":",
"start",
"=",
"0",
"if",
... | Slice the mapping by the position in the sequence
First coordinate is 0-indexed start
Second coordinate is 1-indexed finish | [
"Slice",
"the",
"mapping",
"by",
"the",
"position",
"in",
"the",
"sequence"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L118-L153 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | Transcript.range | def range(self):
"""Get the range from the leftmost exon to the rightmost
:return: total range
:rtype: GenomicRange
"""
return GenomicRange(self._rngs[0].chr,self._rngs[0].start,self._rngs[-1].end) | python | def range(self):
"""Get the range from the leftmost exon to the rightmost
:return: total range
:rtype: GenomicRange
"""
return GenomicRange(self._rngs[0].chr,self._rngs[0].start,self._rngs[-1].end) | [
"def",
"range",
"(",
"self",
")",
":",
"return",
"GenomicRange",
"(",
"self",
".",
"_rngs",
"[",
"0",
"]",
".",
"chr",
",",
"self",
".",
"_rngs",
"[",
"0",
"]",
".",
"start",
",",
"self",
".",
"_rngs",
"[",
"-",
"1",
"]",
".",
"end",
")"
] | Get the range from the leftmost exon to the rightmost
:return: total range
:rtype: GenomicRange | [
"Get",
"the",
"range",
"from",
"the",
"leftmost",
"exon",
"to",
"the",
"rightmost"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L156-L162 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | Transcript.set_strand | def set_strand(self,dir):
"""Set the strand (direction)
:param dir: direction + or -
:type dir: char
"""
self._options = self._options._replace(direction = dir) | python | def set_strand(self,dir):
"""Set the strand (direction)
:param dir: direction + or -
:type dir: char
"""
self._options = self._options._replace(direction = dir) | [
"def",
"set_strand",
"(",
"self",
",",
"dir",
")",
":",
"self",
".",
"_options",
"=",
"self",
".",
"_options",
".",
"_replace",
"(",
"direction",
"=",
"dir",
")"
] | Set the strand (direction)
:param dir: direction + or -
:type dir: char | [
"Set",
"the",
"strand",
"(",
"direction",
")"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L164-L170 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | Transcript.chr | def chr(self):
"""the reference chromosome. greedy return the first chromosome in exon array
:return: chromosome
:rtype: string
"""
if len(self.exons)==0:
sys.stderr.write("WARNING can't return chromsome with nothing here\n")
return None
return self._rngs[0].chr | python | def chr(self):
"""the reference chromosome. greedy return the first chromosome in exon array
:return: chromosome
:rtype: string
"""
if len(self.exons)==0:
sys.stderr.write("WARNING can't return chromsome with nothing here\n")
return None
return self._rngs[0].chr | [
"def",
"chr",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"exons",
")",
"==",
"0",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"\"WARNING can't return chromsome with nothing here\\n\"",
")",
"return",
"None",
"return",
"self",
".",
"_rngs",
"["... | the reference chromosome. greedy return the first chromosome in exon array
:return: chromosome
:rtype: string | [
"the",
"reference",
"chromosome",
".",
"greedy",
"return",
"the",
"first",
"chromosome",
"in",
"exon",
"array"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L187-L196 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | Transcript.junctions | def junctions(self):
"""Can be inferred from the exons, this is not implemented yet"""
if len(self.exons) < 2: return []
junctions = []
for i in range(1,len(self.exons)):
junctions.append(Junction(self.exons[i-1],self.exons[i]))
return junctions | python | def junctions(self):
"""Can be inferred from the exons, this is not implemented yet"""
if len(self.exons) < 2: return []
junctions = []
for i in range(1,len(self.exons)):
junctions.append(Junction(self.exons[i-1],self.exons[i]))
return junctions | [
"def",
"junctions",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"exons",
")",
"<",
"2",
":",
"return",
"[",
"]",
"junctions",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"1",
",",
"len",
"(",
"self",
".",
"exons",
")",
")",
":",
... | Can be inferred from the exons, this is not implemented yet | [
"Can",
"be",
"inferred",
"from",
"the",
"exons",
"this",
"is",
"not",
"implemented",
"yet"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L199-L205 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | Transcript.get_gpd_line | def get_gpd_line(self,transcript_name=None,gene_name=None,direction=None):
"""Get the genpred format string representation of the mapping"""
return transcript_to_gpd_line(self,transcript_name=transcript_name,gene_name=gene_name,direction=direction) | python | def get_gpd_line(self,transcript_name=None,gene_name=None,direction=None):
"""Get the genpred format string representation of the mapping"""
return transcript_to_gpd_line(self,transcript_name=transcript_name,gene_name=gene_name,direction=direction) | [
"def",
"get_gpd_line",
"(",
"self",
",",
"transcript_name",
"=",
"None",
",",
"gene_name",
"=",
"None",
",",
"direction",
"=",
"None",
")",
":",
"return",
"transcript_to_gpd_line",
"(",
"self",
",",
"transcript_name",
"=",
"transcript_name",
",",
"gene_name",
... | Get the genpred format string representation of the mapping | [
"Get",
"the",
"genpred",
"format",
"string",
"representation",
"of",
"the",
"mapping"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L207-L209 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | Transcript.set_gene_name | def set_gene_name(self,name):
"""assign a gene name
:param name: name
:type name: string
"""
self._options = self._options._replace(gene_name = name) | python | def set_gene_name(self,name):
"""assign a gene name
:param name: name
:type name: string
"""
self._options = self._options._replace(gene_name = name) | [
"def",
"set_gene_name",
"(",
"self",
",",
"name",
")",
":",
"self",
".",
"_options",
"=",
"self",
".",
"_options",
".",
"_replace",
"(",
"gene_name",
"=",
"name",
")"
] | assign a gene name
:param name: name
:type name: string | [
"assign",
"a",
"gene",
"name"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L211-L217 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | Transcript.set_transcript_name | def set_transcript_name(self,name):
"""assign a transcript name
:param name: name
:type name: string
"""
self._options = self._options._replace(name = name) | python | def set_transcript_name(self,name):
"""assign a transcript name
:param name: name
:type name: string
"""
self._options = self._options._replace(name = name) | [
"def",
"set_transcript_name",
"(",
"self",
",",
"name",
")",
":",
"self",
".",
"_options",
"=",
"self",
".",
"_options",
".",
"_replace",
"(",
"name",
"=",
"name",
")"
] | assign a transcript name
:param name: name
:type name: string | [
"assign",
"a",
"transcript",
"name"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L228-L234 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | Transcript.exon_overlap | def exon_overlap(self,tx,multi_minover=10,multi_endfrac=0,multi_midfrac=0.8,single_minover=50,single_frac=0.5,multi_consec=True):
"""Get a report on how mucht the exons overlap
:param tx:
:param multi_minover: multi-exons need to overlap by at lest this much to be considered overlapped (default 10)
:pa... | python | def exon_overlap(self,tx,multi_minover=10,multi_endfrac=0,multi_midfrac=0.8,single_minover=50,single_frac=0.5,multi_consec=True):
"""Get a report on how mucht the exons overlap
:param tx:
:param multi_minover: multi-exons need to overlap by at lest this much to be considered overlapped (default 10)
:pa... | [
"def",
"exon_overlap",
"(",
"self",
",",
"tx",
",",
"multi_minover",
"=",
"10",
",",
"multi_endfrac",
"=",
"0",
",",
"multi_midfrac",
"=",
"0.8",
",",
"single_minover",
"=",
"50",
",",
"single_frac",
"=",
"0.5",
",",
"multi_consec",
"=",
"True",
")",
":"... | Get a report on how mucht the exons overlap
:param tx:
:param multi_minover: multi-exons need to overlap by at lest this much to be considered overlapped (default 10)
:param multi_endfrac: multi-exons need an end fraction coverage of at least this by default (default 0)
:param multi_midfrac: multi-exon... | [
"Get",
"a",
"report",
"on",
"how",
"mucht",
"the",
"exons",
"overlap"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L269-L289 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | ExonOverlap.consecutive_exon_count | def consecutive_exon_count(self1):
"""Best number of consecutive exons that overlap
:return: matched consecutive exon count
:rtype: int
"""
best = 1
consec = 1
for i in range(0,len(self1.dif1)):
if self1.dif1[i] == 1 and self1.dif2[i] == 1:
consec += 1
... | python | def consecutive_exon_count(self1):
"""Best number of consecutive exons that overlap
:return: matched consecutive exon count
:rtype: int
"""
best = 1
consec = 1
for i in range(0,len(self1.dif1)):
if self1.dif1[i] == 1 and self1.dif2[i] == 1:
consec += 1
... | [
"def",
"consecutive_exon_count",
"(",
"self1",
")",
":",
"best",
"=",
"1",
"consec",
"=",
"1",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"len",
"(",
"self1",
".",
"dif1",
")",
")",
":",
"if",
"self1",
".",
"dif1",
"[",
"i",
"]",
"==",
"1",
"and... | Best number of consecutive exons that overlap
:return: matched consecutive exon count
:rtype: int | [
"Best",
"number",
"of",
"consecutive",
"exons",
"that",
"overlap"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L351-L366 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | ExonOverlap.is_subset | def is_subset(self1):
""" Return value if tx_obj2 is a complete subset of tx_obj1 or
tx_obj1 is a complete subset of tx_obj2
Values are:
* Return 1: Full overlap (mutual subests)
* Return 2: two is a subset of one
* Return 3: one is a subset of two
*... | python | def is_subset(self1):
""" Return value if tx_obj2 is a complete subset of tx_obj1 or
tx_obj1 is a complete subset of tx_obj2
Values are:
* Return 1: Full overlap (mutual subests)
* Return 2: two is a subset of one
* Return 3: one is a subset of two
*... | [
"def",
"is_subset",
"(",
"self1",
")",
":",
"if",
"len",
"(",
"self1",
".",
"overs",
")",
"==",
"0",
":",
"return",
"False",
"if",
"len",
"(",
"self1",
".",
"dif1",
")",
">",
"0",
":",
"# make sure they are consecutive if more than one",
"if",
"max",
"("... | Return value if tx_obj2 is a complete subset of tx_obj1 or
tx_obj1 is a complete subset of tx_obj2
Values are:
* Return 1: Full overlap (mutual subests)
* Return 2: two is a subset of one
* Return 3: one is a subset of two
* Return False if neither is a su... | [
"Return",
"value",
"if",
"tx_obj2",
"is",
"a",
"complete",
"subset",
"of",
"tx_obj1",
"or",
"tx_obj1",
"is",
"a",
"complete",
"subset",
"of",
"tx_obj2"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L368-L391 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | ExonOverlap.is_full_overlap | def is_full_overlap(self1):
"""true if they are a full overlap
:return: is full overlap
:rtype: bool
"""
if len(self1.overs) == 0: return False
if len(self1.dif1) > 0:
if max(self1.dif1) != 1 or max(self1.dif2) != 1: return False
if self1.start1 and self1.end1 and self... | python | def is_full_overlap(self1):
"""true if they are a full overlap
:return: is full overlap
:rtype: bool
"""
if len(self1.overs) == 0: return False
if len(self1.dif1) > 0:
if max(self1.dif1) != 1 or max(self1.dif2) != 1: return False
if self1.start1 and self1.end1 and self... | [
"def",
"is_full_overlap",
"(",
"self1",
")",
":",
"if",
"len",
"(",
"self1",
".",
"overs",
")",
"==",
"0",
":",
"return",
"False",
"if",
"len",
"(",
"self1",
".",
"dif1",
")",
">",
"0",
":",
"if",
"max",
"(",
"self1",
".",
"dif1",
")",
"!=",
"1... | true if they are a full overlap
:return: is full overlap
:rtype: bool | [
"true",
"if",
"they",
"are",
"a",
"full",
"overlap"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L393-L404 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | ExonOverlap.analyze_overs | def analyze_overs(self1):
"""A helper function that prepares overlap and consecutive matches data"""
#check for full overlap first
self1.dif1 = [self1.overs[i][0]-self1.overs[i-1][0] for i in range(1,len(self1.overs))]
self1.dif2 = [self1.overs[i][1]-self1.overs[i-1][1] for i in range(1,len(self... | python | def analyze_overs(self1):
"""A helper function that prepares overlap and consecutive matches data"""
#check for full overlap first
self1.dif1 = [self1.overs[i][0]-self1.overs[i-1][0] for i in range(1,len(self1.overs))]
self1.dif2 = [self1.overs[i][1]-self1.overs[i-1][1] for i in range(1,len(self... | [
"def",
"analyze_overs",
"(",
"self1",
")",
":",
"#check for full overlap first",
"self1",
".",
"dif1",
"=",
"[",
"self1",
".",
"overs",
"[",
"i",
"]",
"[",
"0",
"]",
"-",
"self1",
".",
"overs",
"[",
"i",
"-",
"1",
"]",
"[",
"0",
"]",
"for",
"i",
... | A helper function that prepares overlap and consecutive matches data | [
"A",
"helper",
"function",
"that",
"prepares",
"overlap",
"and",
"consecutive",
"matches",
"data"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L420-L430 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | ExonOverlap.calculate_overlap | def calculate_overlap(self1):
"""Create the array that describes how junctions overlap"""
overs = []
if not self1.tx_obj1.range.overlaps(self1.tx_obj2.range): return # if they dont overlap wont find anything
for i in range(0,len(self1.tx_obj1.exons)):
for j in range(0,len(self1.tx_obj2.e... | python | def calculate_overlap(self1):
"""Create the array that describes how junctions overlap"""
overs = []
if not self1.tx_obj1.range.overlaps(self1.tx_obj2.range): return # if they dont overlap wont find anything
for i in range(0,len(self1.tx_obj1.exons)):
for j in range(0,len(self1.tx_obj2.e... | [
"def",
"calculate_overlap",
"(",
"self1",
")",
":",
"overs",
"=",
"[",
"]",
"if",
"not",
"self1",
".",
"tx_obj1",
".",
"range",
".",
"overlaps",
"(",
"self1",
".",
"tx_obj2",
".",
"range",
")",
":",
"return",
"# if they dont overlap wont find anything",
"for... | Create the array that describes how junctions overlap | [
"Create",
"the",
"array",
"that",
"describes",
"how",
"junctions",
"overlap"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L432-L460 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | JunctionOverlap.is_subset | def is_subset(self):
"""Return value if tx_obj2 is a complete subset of tx_obj1 or tx_obj1 is a complete subset of tx_obj2
values:
* Return 1: Full overlap (mutual subests)
* Return 2: two is a subset of one
* Return 3: one is a subset of two
* Return False if neither is a subset ... | python | def is_subset(self):
"""Return value if tx_obj2 is a complete subset of tx_obj1 or tx_obj1 is a complete subset of tx_obj2
values:
* Return 1: Full overlap (mutual subests)
* Return 2: two is a subset of one
* Return 3: one is a subset of two
* Return False if neither is a subset ... | [
"def",
"is_subset",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"overs",
")",
"==",
"0",
":",
"return",
"False",
"if",
"len",
"(",
"self",
".",
"dif1",
")",
">",
"0",
":",
"# make sure they are consecutive if more than one",
"if",
"len",
"(",
... | Return value if tx_obj2 is a complete subset of tx_obj1 or tx_obj1 is a complete subset of tx_obj2
values:
* Return 1: Full overlap (mutual subests)
* Return 2: two is a subset of one
* Return 3: one is a subset of two
* Return False if neither is a subset of the other | [
"Return",
"value",
"if",
"tx_obj2",
"is",
"a",
"complete",
"subset",
"of",
"tx_obj1",
"or",
"tx_obj1",
"is",
"a",
"complete",
"subset",
"of",
"tx_obj2"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L493-L516 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/__init__.py | JunctionOverlap.analyze_overs | def analyze_overs(self):
"""A helper function to prepare values describing overlaps"""
#check for full overlap first
self.dif1 = [self.overs[i][0]-self.overs[i-1][0] for i in range(1,len(self.overs))]
self.dif2 = [self.overs[i][1]-self.overs[i-1][1] for i in range(1,len(self.overs))]
#see ... | python | def analyze_overs(self):
"""A helper function to prepare values describing overlaps"""
#check for full overlap first
self.dif1 = [self.overs[i][0]-self.overs[i-1][0] for i in range(1,len(self.overs))]
self.dif2 = [self.overs[i][1]-self.overs[i-1][1] for i in range(1,len(self.overs))]
#see ... | [
"def",
"analyze_overs",
"(",
"self",
")",
":",
"#check for full overlap first",
"self",
".",
"dif1",
"=",
"[",
"self",
".",
"overs",
"[",
"i",
"]",
"[",
"0",
"]",
"-",
"self",
".",
"overs",
"[",
"i",
"-",
"1",
"]",
"[",
"0",
"]",
"for",
"i",
"in"... | A helper function to prepare values describing overlaps | [
"A",
"helper",
"function",
"to",
"prepare",
"values",
"describing",
"overlaps"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/__init__.py#L518-L528 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.