hexsha stringlengths 40 40 | repo stringlengths 7 114 | path stringlengths 4 124 | license listlengths 1 9 | language stringclasses 1
value | identifier stringlengths 1 71 | return_type stringlengths 1 749 ⌀ | original_string stringlengths 76 22.7k | original_docstring stringlengths 16 7.61k | docstring stringlengths 16 2.47k | docstring_tokens listlengths 6 477 | code stringlengths 14 10.2k | code_tokens listlengths 6 996 | short_docstring stringlengths 2 644 | short_docstring_tokens listlengths 1 116 | comment listlengths 1 89 | parameters listlengths 0 64 | docstring_params dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38a0826ecd0b6dcc6f0f09576bc70b8a6be1fa6e | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/config_commands.py | [
"Apache-2.0"
] | Python | _SetHdfsDefault | null | def _SetHdfsDefault(self):
"""Helper method for dealing with hdfs-specific default-fs settings."""
flags.RegisterValidator(
'namenode_uri', path_validator.AbsoluteHDFSUri,
flag_values=self._command_flags)
if not self._flags.namenode_uri:
namenode_address = self._ExtractNamenodeUriFromR... | Helper method for dealing with hdfs-specific default-fs settings. | Helper method for dealing with hdfs-specific default-fs settings. | [
"Helper",
"method",
"for",
"dealing",
"with",
"hdfs",
"-",
"specific",
"default",
"-",
"fs",
"settings",
"."
] | def _SetHdfsDefault(self):
flags.RegisterValidator(
'namenode_uri', path_validator.AbsoluteHDFSUri,
flag_values=self._command_flags)
if not self._flags.namenode_uri:
namenode_address = self._ExtractNamenodeUriFromRpcAddress()
else:
namenode_address = self._flags.namenode_uri
... | [
"def",
"_SetHdfsDefault",
"(",
"self",
")",
":",
"flags",
".",
"RegisterValidator",
"(",
"'namenode_uri'",
",",
"path_validator",
".",
"AbsoluteHDFSUri",
",",
"flag_values",
"=",
"self",
".",
"_command_flags",
")",
"if",
"not",
"self",
".",
"_flags",
".",
"nam... | Helper method for dealing with hdfs-specific default-fs settings. | [
"Helper",
"method",
"for",
"dealing",
"with",
"hdfs",
"-",
"specific",
"default",
"-",
"fs",
"settings",
"."
] | [
"\"\"\"Helper method for dealing with hdfs-specific default-fs settings.\"\"\"",
"# Setting the flag from itself triggers newly added validators."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
38a0826ecd0b6dcc6f0f09576bc70b8a6be1fa6e | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/config_commands.py | [
"Apache-2.0"
] | Python | _ExtractNamenodeUriFromRpcAddress | <not_specific> | def _ExtractNamenodeUriFromRpcAddress(self):
"""Tries finding namenode rpc-address as substitute for namenode uri."""
logging.warn('--namenode_uri not specified. Checking in hdfs-site.xml')
hdfs_site_file_name = os.path.join(
self._flags.hadoop_conf_dir, 'hdfs-site.xml')
conf = xml_configuration... | Tries finding namenode rpc-address as substitute for namenode uri. | Tries finding namenode rpc-address as substitute for namenode uri. | [
"Tries",
"finding",
"namenode",
"rpc",
"-",
"address",
"as",
"substitute",
"for",
"namenode",
"uri",
"."
] | def _ExtractNamenodeUriFromRpcAddress(self):
logging.warn('--namenode_uri not specified. Checking in hdfs-site.xml')
hdfs_site_file_name = os.path.join(
self._flags.hadoop_conf_dir, 'hdfs-site.xml')
conf = xml_configuration.Configuration.FromFile(hdfs_site_file_name)
namenode_address = conf.GetP... | [
"def",
"_ExtractNamenodeUriFromRpcAddress",
"(",
"self",
")",
":",
"logging",
".",
"warn",
"(",
"'--namenode_uri not specified. Checking in hdfs-site.xml'",
")",
"hdfs_site_file_name",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_flags",
".",
"hadoop_conf_... | Tries finding namenode rpc-address as substitute for namenode uri. | [
"Tries",
"finding",
"namenode",
"rpc",
"-",
"address",
"as",
"substitute",
"for",
"namenode",
"uri",
"."
] | [
"\"\"\"Tries finding namenode rpc-address as substitute for namenode uri.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
55ad5bab641dbb5e5cec6444f7298529e18544e1 | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_config_commands_test.py | [
"Apache-2.0"
] | Python | testNormalOperation | <not_specific> | def testNormalOperation(self):
"""Test command with default valid flags"""
if not self._test_cmd:
return
self._SetDefaultValidFlags()
self._flag_values_copy.dry_run = False
self._test_cmd.Run(None)
self._ValidateNormalOperation() | Test command with default valid flags | Test command with default valid flags | [
"Test",
"command",
"with",
"default",
"valid",
"flags"
] | def testNormalOperation(self):
if not self._test_cmd:
return
self._SetDefaultValidFlags()
self._flag_values_copy.dry_run = False
self._test_cmd.Run(None)
self._ValidateNormalOperation() | [
"def",
"testNormalOperation",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_test_cmd",
":",
"return",
"self",
".",
"_SetDefaultValidFlags",
"(",
")",
"self",
".",
"_flag_values_copy",
".",
"dry_run",
"=",
"False",
"self",
".",
"_test_cmd",
".",
"Run",
... | Test command with default valid flags | [
"Test",
"command",
"with",
"default",
"valid",
"flags"
] | [
"\"\"\"Test command with default valid flags\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
55ad5bab641dbb5e5cec6444f7298529e18544e1 | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_config_commands_test.py | [
"Apache-2.0"
] | Python | testDryRun | <not_specific> | def testDryRun(self):
"""Test --dry_run prevents modifications from being committed."""
if not self._test_cmd:
return
self._SetDefaultValidFlags()
self._flag_values_copy.dry_run = True
self._test_cmd.Run(None)
# Nothing added.
conf = xml_configuration.Configuration.FromFile(self._conf... | Test --dry_run prevents modifications from being committed. | -dry_run prevents modifications from being committed. | [
"-",
"dry_run",
"prevents",
"modifications",
"from",
"being",
"committed",
"."
] | def testDryRun(self):
if not self._test_cmd:
return
self._SetDefaultValidFlags()
self._flag_values_copy.dry_run = True
self._test_cmd.Run(None)
conf = xml_configuration.Configuration.FromFile(self._config_filename)
self.assertEqual(0, conf.GetNumProperties())
conf = xml_configuration.C... | [
"def",
"testDryRun",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_test_cmd",
":",
"return",
"self",
".",
"_SetDefaultValidFlags",
"(",
")",
"self",
".",
"_flag_values_copy",
".",
"dry_run",
"=",
"True",
"self",
".",
"_test_cmd",
".",
"Run",
"(",
"N... | Test --dry_run prevents modifications from being committed. | [
"Test",
"--",
"dry_run",
"prevents",
"modifications",
"from",
"being",
"committed",
"."
] | [
"\"\"\"Test --dry_run prevents modifications from being committed.\"\"\"",
"# Nothing added.",
"# Nothing changed"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
55ad5bab641dbb5e5cec6444f7298529e18544e1 | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_config_commands_test.py | [
"Apache-2.0"
] | Python | testCreateIfAbsent | <not_specific> | def testCreateIfAbsent(self):
"""Test --create_if_absent_creates an empty config if one is not given."""
if not self._test_cmd:
return
self._SetDefaultValidFlags()
os.remove(self._flag_values_copy.configuration_file)
self._flag_values_copy.create_if_absent = True
self._flag_values_copy._... | Test --create_if_absent_creates an empty config if one is not given. | -create_if_absent_creates an empty config if one is not given. | [
"-",
"create_if_absent_creates",
"an",
"empty",
"config",
"if",
"one",
"is",
"not",
"given",
"."
] | def testCreateIfAbsent(self):
if not self._test_cmd:
return
self._SetDefaultValidFlags()
os.remove(self._flag_values_copy.configuration_file)
self._flag_values_copy.create_if_absent = True
self._flag_values_copy._AssertAllValidators()
self._test_cmd.Run(None)
self._ValidateNormalOperat... | [
"def",
"testCreateIfAbsent",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_test_cmd",
":",
"return",
"self",
".",
"_SetDefaultValidFlags",
"(",
")",
"os",
".",
"remove",
"(",
"self",
".",
"_flag_values_copy",
".",
"configuration_file",
")",
"self",
".",... | Test --create_if_absent_creates an empty config if one is not given. | [
"Test",
"--",
"create_if_absent_creates",
"an",
"empty",
"config",
"if",
"one",
"is",
"not",
"given",
"."
] | [
"\"\"\"Test --create_if_absent_creates an empty config if one is not given.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
55ad5bab641dbb5e5cec6444f7298529e18544e1 | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_config_commands_test.py | [
"Apache-2.0"
] | Python | testFlagValidation | null | def testFlagValidation(self):
"""Test basic flag failures for configure_hadoop."""
# Validators get invoked on __setattr__ (overload for '=').
failure_modes = [
('configuration_file', None),
('name', None),
('name', ''),
('value', None),
]
self._ValidateFlagFailures(f... | Test basic flag failures for configure_hadoop. | Test basic flag failures for configure_hadoop. | [
"Test",
"basic",
"flag",
"failures",
"for",
"configure_hadoop",
"."
] | def testFlagValidation(self):
failure_modes = [
('configuration_file', None),
('name', None),
('name', ''),
('value', None),
]
self._ValidateFlagFailures(failure_modes) | [
"def",
"testFlagValidation",
"(",
"self",
")",
":",
"failure_modes",
"=",
"[",
"(",
"'configuration_file'",
",",
"None",
")",
",",
"(",
"'name'",
",",
"None",
")",
",",
"(",
"'name'",
",",
"''",
")",
",",
"(",
"'value'",
",",
"None",
")",
",",
"]",
... | Test basic flag failures for configure_hadoop. | [
"Test",
"basic",
"flag",
"failures",
"for",
"configure_hadoop",
"."
] | [
"\"\"\"Test basic flag failures for configure_hadoop.\"\"\"",
"# Validators get invoked on __setattr__ (overload for '=')."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
55ad5bab641dbb5e5cec6444f7298529e18544e1 | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_config_commands_test.py | [
"Apache-2.0"
] | Python | testFlagValidation | null | def testFlagValidation(self):
"""Test basic flag failures for configure_hadoop."""
# Validators get invoked on __setattr__ (overload for '=').
failure_modes = [
('configuration_file', None),
('name', None),
('name', ''),
]
self._ValidateFlagFailures(failure_modes) | Test basic flag failures for configure_hadoop. | Test basic flag failures for configure_hadoop. | [
"Test",
"basic",
"flag",
"failures",
"for",
"configure_hadoop",
"."
] | def testFlagValidation(self):
failure_modes = [
('configuration_file', None),
('name', None),
('name', ''),
]
self._ValidateFlagFailures(failure_modes) | [
"def",
"testFlagValidation",
"(",
"self",
")",
":",
"failure_modes",
"=",
"[",
"(",
"'configuration_file'",
",",
"None",
")",
",",
"(",
"'name'",
",",
"None",
")",
",",
"(",
"'name'",
",",
"''",
")",
",",
"]",
"self",
".",
"_ValidateFlagFailures",
"(",
... | Test basic flag failures for configure_hadoop. | [
"Test",
"basic",
"flag",
"failures",
"for",
"configure_hadoop",
"."
] | [
"\"\"\"Test basic flag failures for configure_hadoop.\"\"\"",
"# Validators get invoked on __setattr__ (overload for '=')."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
55ad5bab641dbb5e5cec6444f7298529e18544e1 | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_config_commands_test.py | [
"Apache-2.0"
] | Python | testFlagValidation | null | def testFlagValidation(self):
"""Test basic flag failures for configure_hadoop."""
# Validators get invoked on __setattr__ (overload for '=').
failure_modes = [
('configuration_file', None),
('source_configuration_file', None),
('source_configuration_file', 'unreadable_file'),
]
... | Test basic flag failures for configure_hadoop. | Test basic flag failures for configure_hadoop. | [
"Test",
"basic",
"flag",
"failures",
"for",
"configure_hadoop",
"."
] | def testFlagValidation(self):
failure_modes = [
('configuration_file', None),
('source_configuration_file', None),
('source_configuration_file', 'unreadable_file'),
]
self._ValidateFlagFailures(failure_modes) | [
"def",
"testFlagValidation",
"(",
"self",
")",
":",
"failure_modes",
"=",
"[",
"(",
"'configuration_file'",
",",
"None",
")",
",",
"(",
"'source_configuration_file'",
",",
"None",
")",
",",
"(",
"'source_configuration_file'",
",",
"'unreadable_file'",
")",
",",
... | Test basic flag failures for configure_hadoop. | [
"Test",
"basic",
"flag",
"failures",
"for",
"configure_hadoop",
"."
] | [
"\"\"\"Test basic flag failures for configure_hadoop.\"\"\"",
"# Validators get invoked on __setattr__ (overload for '=')."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
55ad5bab641dbb5e5cec6444f7298529e18544e1 | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_config_commands_test.py | [
"Apache-2.0"
] | Python | testFlagValidation | null | def testFlagValidation(self):
"""Test basic flag failures for configure_hadoop."""
# Validators get invoked on __setattr__ (overload for '=').
failure_modes = [
('configuration_file', None),
]
self._ValidateFlagFailures(failure_modes) | Test basic flag failures for configure_hadoop. | Test basic flag failures for configure_hadoop. | [
"Test",
"basic",
"flag",
"failures",
"for",
"configure_hadoop",
"."
] | def testFlagValidation(self):
failure_modes = [
('configuration_file', None),
]
self._ValidateFlagFailures(failure_modes) | [
"def",
"testFlagValidation",
"(",
"self",
")",
":",
"failure_modes",
"=",
"[",
"(",
"'configuration_file'",
",",
"None",
")",
",",
"]",
"self",
".",
"_ValidateFlagFailures",
"(",
"failure_modes",
")"
] | Test basic flag failures for configure_hadoop. | [
"Test",
"basic",
"flag",
"failures",
"for",
"configure_hadoop",
"."
] | [
"\"\"\"Test basic flag failures for configure_hadoop.\"\"\"",
"# Validators get invoked on __setattr__ (overload for '=')."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
55ad5bab641dbb5e5cec6444f7298529e18544e1 | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_config_commands_test.py | [
"Apache-2.0"
] | Python | testCreateIfAbsent | <not_specific> | def testCreateIfAbsent(self):
"""Test --create_if_absent_creates an empty config if one is not given."""
if not self._test_cmd:
return
self._SetDefaultValidFlags()
os.remove(self._flag_values_copy.configuration_file)
self._flag_values_copy.create_if_absent = True
self._flag_values_copy._... | Test --create_if_absent_creates an empty config if one is not given. | -create_if_absent_creates an empty config if one is not given. | [
"-",
"create_if_absent_creates",
"an",
"empty",
"config",
"if",
"one",
"is",
"not",
"given",
"."
] | def testCreateIfAbsent(self):
if not self._test_cmd:
return
self._SetDefaultValidFlags()
os.remove(self._flag_values_copy.configuration_file)
self._flag_values_copy.create_if_absent = True
self._flag_values_copy._AssertAllValidators()
self._test_cmd.Run(None)
conf = xml_configuration.C... | [
"def",
"testCreateIfAbsent",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_test_cmd",
":",
"return",
"self",
".",
"_SetDefaultValidFlags",
"(",
")",
"os",
".",
"remove",
"(",
"self",
".",
"_flag_values_copy",
".",
"configuration_file",
")",
"self",
".",... | Test --create_if_absent_creates an empty config if one is not given. | [
"Test",
"--",
"create_if_absent_creates",
"an",
"empty",
"config",
"if",
"one",
"is",
"not",
"given",
"."
] | [
"\"\"\"Test --create_if_absent_creates an empty config if one is not given.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5c5d2964cdeaacf11f5a96be5e695a84e8f9e3c1 | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_configuration_test.py | [
"Apache-2.0"
] | Python | testUpdateOptionalAddAndRemove | null | def testUpdateOptionalAddAndRemove(self):
"""Properties takes precendence over pptional properties"""
conf = xml_configuration.Configuration.EmptyConfiguration()
properties_to_update = {}
optional_properties_to_add = {
'key1': 'value1',
'key2': 'value2',
}
conf.Update(properties... | Properties takes precendence over pptional properties | Properties takes precendence over pptional properties | [
"Properties",
"takes",
"precendence",
"over",
"pptional",
"properties"
] | def testUpdateOptionalAddAndRemove(self):
conf = xml_configuration.Configuration.EmptyConfiguration()
properties_to_update = {}
optional_properties_to_add = {
'key1': 'value1',
'key2': 'value2',
}
conf.Update(properties_to_update, optional_properties_to_add)
self.assertEqual('val... | [
"def",
"testUpdateOptionalAddAndRemove",
"(",
"self",
")",
":",
"conf",
"=",
"xml_configuration",
".",
"Configuration",
".",
"EmptyConfiguration",
"(",
")",
"properties_to_update",
"=",
"{",
"}",
"optional_properties_to_add",
"=",
"{",
"'key1'",
":",
"'value1'",
","... | Properties takes precendence over pptional properties | [
"Properties",
"takes",
"precendence",
"over",
"pptional",
"properties"
] | [
"\"\"\"Properties takes precendence over pptional properties\"\"\"",
"# value2 unchanged, value3 added.",
"# It is an error to true to 'delete' a property using the",
"# optional_properties_to_add."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5c5d2964cdeaacf11f5a96be5e695a84e8f9e3c1 | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_configuration_test.py | [
"Apache-2.0"
] | Python | testUpdateAndOptionalAdd | null | def testUpdateAndOptionalAdd(self):
"""Optionally update an existing property plus nonexistent one."""
conf = xml_configuration.Configuration.EmptyConfiguration()
properties_to_update = {
'key1': 'value1',
'key2': 'value2',
}
optional_properties_to_add = {
'key2': 'value2_opt... | Optionally update an existing property plus nonexistent one. | Optionally update an existing property plus nonexistent one. | [
"Optionally",
"update",
"an",
"existing",
"property",
"plus",
"nonexistent",
"one",
"."
] | def testUpdateAndOptionalAdd(self):
conf = xml_configuration.Configuration.EmptyConfiguration()
properties_to_update = {
'key1': 'value1',
'key2': 'value2',
}
optional_properties_to_add = {
'key2': 'value2_opt',
'key3': 'value3_opt',
}
conf.Update(properties_to_up... | [
"def",
"testUpdateAndOptionalAdd",
"(",
"self",
")",
":",
"conf",
"=",
"xml_configuration",
".",
"Configuration",
".",
"EmptyConfiguration",
"(",
")",
"properties_to_update",
"=",
"{",
"'key1'",
":",
"'value1'",
",",
"'key2'",
":",
"'value2'",
",",
"}",
"optiona... | Optionally update an existing property plus nonexistent one. | [
"Optionally",
"update",
"an",
"existing",
"property",
"plus",
"nonexistent",
"one",
"."
] | [
"\"\"\"Optionally update an existing property plus nonexistent one.\"\"\"",
"# Updates are applied before optional properties, so they win if done",
"# simultaneously.",
"# Setting 'None' is updates, and then adding in optional_properties_to_add",
"# is equivalent to just putting the optional adds into the ... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5c5d2964cdeaacf11f5a96be5e695a84e8f9e3c1 | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_configuration_test.py | [
"Apache-2.0"
] | Python | testEmptyProperty | null | def testEmptyProperty(self):
"""Test empty values are distinct from None"""
conf = xml_configuration.Configuration.EmptyConfiguration()
# Empty string is considered a valid property value (even though the XML
# dom would return None as the text node of the property element.
conf.SetProperty('key', ... | Test empty values are distinct from None | Test empty values are distinct from None | [
"Test",
"empty",
"values",
"are",
"distinct",
"from",
"None"
] | def testEmptyProperty(self):
conf = xml_configuration.Configuration.EmptyConfiguration()
conf.SetProperty('key', '')
self.assertEqual('', conf.GetPropertyValue('key')) | [
"def",
"testEmptyProperty",
"(",
"self",
")",
":",
"conf",
"=",
"xml_configuration",
".",
"Configuration",
".",
"EmptyConfiguration",
"(",
")",
"conf",
".",
"SetProperty",
"(",
"'key'",
",",
"''",
")",
"self",
".",
"assertEqual",
"(",
"''",
",",
"conf",
".... | Test empty values are distinct from None | [
"Test",
"empty",
"values",
"are",
"distinct",
"from",
"None"
] | [
"\"\"\"Test empty values are distinct from None\"\"\"",
"# Empty string is considered a valid property value (even though the XML",
"# dom would return None as the text node of the property element."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5c5d2964cdeaacf11f5a96be5e695a84e8f9e3c1 | zulily/bigdata-interop | tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_configuration_test.py | [
"Apache-2.0"
] | Python | testToPrettyXml | null | def testToPrettyXml(self):
"""Make sure indenting, stripping, and textwrapping works"""
conf = xml_configuration.Configuration.EmptyConfiguration()
long_description = textwrap.dedent("""\
This is a very long multi-line description. This will be split into multiple
lines by the formatter. I think thi... | Make sure indenting, stripping, and textwrapping works | Make sure indenting, stripping, and textwrapping works | [
"Make",
"sure",
"indenting",
"stripping",
"and",
"textwrapping",
"works"
] | def testToPrettyXml(self):
conf = xml_configuration.Configuration.EmptyConfiguration()
long_description = textwrap.dedent("""\
This is a very long multi-line description. This will be split into multiple
lines by the formatter. I think this should be enough text anyways.""")
short_description = 'Sho... | [
"def",
"testToPrettyXml",
"(",
"self",
")",
":",
"conf",
"=",
"xml_configuration",
".",
"Configuration",
".",
"EmptyConfiguration",
"(",
")",
"long_description",
"=",
"textwrap",
".",
"dedent",
"(",
"\"\"\"\\\n This is a very long multi-line description. This will be spl... | Make sure indenting, stripping, and textwrapping works | [
"Make",
"sure",
"indenting",
"stripping",
"and",
"textwrapping",
"works"
] | [
"\"\"\"Make sure indenting, stripping, and textwrapping works\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
7bfa5f200f711be860fcc06e1af31eaa5259f6c9 | PoeticDeath/face-comparison | face_compare/weights/weights.py | [
"MIT"
] | Python | load_weights | null | def load_weights(model):
'''Loads weights to given FaceNet model
Args:
model (keras.models.Models): FaceNet model.
'''
weights_dir = Path(__file__).parent.joinpath('weights')
for layer_name in WEIGHTS:
print(f'loading layer {layer_name}')
if 'conv' in layer_name:
... | Loads weights to given FaceNet model
Args:
model (keras.models.Models): FaceNet model.
| Loads weights to given FaceNet model | [
"Loads",
"weights",
"to",
"given",
"FaceNet",
"model"
] | def load_weights(model):
weights_dir = Path(__file__).parent.joinpath('weights')
for layer_name in WEIGHTS:
print(f'loading layer {layer_name}')
if 'conv' in layer_name:
model.get_layer(layer_name).set_weights(get_conv_weights(weights_dir, layer_name))
elif 'bn' in layer_name... | [
"def",
"load_weights",
"(",
"model",
")",
":",
"weights_dir",
"=",
"Path",
"(",
"__file__",
")",
".",
"parent",
".",
"joinpath",
"(",
"'weights'",
")",
"for",
"layer_name",
"in",
"WEIGHTS",
":",
"print",
"(",
"f'loading layer {layer_name}'",
")",
"if",
"'con... | Loads weights to given FaceNet model | [
"Loads",
"weights",
"to",
"given",
"FaceNet",
"model"
] | [
"'''Loads weights to given FaceNet model\n \n Args:\n model (keras.models.Models): FaceNet model.\n '''"
] | [
{
"param": "model",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "model",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"is_optional": false
}
],
"outlier_params": [],
"others": []
} |
f1bee9080f01b289d06b5230d6d7ca8b91a587c4 | siddharth-agrawal/Stacked-Autoencoder | stackedAutoencoder.py | [
"MIT"
] | Python | sparseAutoencoderCost | <not_specific> | def sparseAutoencoderCost(self, theta, input):
""" Extract weights and biases from 'theta' input """
W1 = theta[self.limit0 : self.limit1].reshape(self.hidden_size, self.visible_size)
W2 = theta[self.limit1 : self.limit2].reshape(self.visible_size, self.hidden_size)
b1 ... | Extract weights and biases from 'theta' input | Extract weights and biases from 'theta' input | [
"Extract",
"weights",
"and",
"biases",
"from",
"'",
"theta",
"'",
"input"
] | def sparseAutoencoderCost(self, theta, input):
W1 = theta[self.limit0 : self.limit1].reshape(self.hidden_size, self.visible_size)
W2 = theta[self.limit1 : self.limit2].reshape(self.visible_size, self.hidden_size)
b1 = theta[self.limit2 : self.limit3].reshape(self.hidden_size, 1)
b2 = the... | [
"def",
"sparseAutoencoderCost",
"(",
"self",
",",
"theta",
",",
"input",
")",
":",
"W1",
"=",
"theta",
"[",
"self",
".",
"limit0",
":",
"self",
".",
"limit1",
"]",
".",
"reshape",
"(",
"self",
".",
"hidden_size",
",",
"self",
".",
"visible_size",
")",
... | Extract weights and biases from 'theta' input | [
"Extract",
"weights",
"and",
"biases",
"from",
"'",
"theta",
"'",
"input"
] | [
"\"\"\" Extract weights and biases from 'theta' input \"\"\"",
"\"\"\" Compute output layers by performing a feedforward pass\n Computation is done for all the training inputs simultaneously \"\"\"",
"\"\"\" Estimate the average activation value of the hidden layers \"\"\"",
"\"\"\" Compute interme... | [
{
"param": "self",
"type": null
},
{
"param": "theta",
"type": null
},
{
"param": "input",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "theta",
"type": null,
"docstring": null,
"docstring_tokens": ... |
f1bee9080f01b289d06b5230d6d7ca8b91a587c4 | siddharth-agrawal/Stacked-Autoencoder | stackedAutoencoder.py | [
"MIT"
] | Python | feedForwardAutoencoder | <not_specific> | def feedForwardAutoencoder(theta, hidden_size, visible_size, input):
""" Define limits to access useful data """
limit0 = 0
limit1 = hidden_size * visible_size
limit2 = 2 * hidden_size * visible_size
limit3 = 2 * hidden_size * visible_size + hidden_size
""" Access W1 and b1 from 'theta' "... | Define limits to access useful data | Define limits to access useful data | [
"Define",
"limits",
"to",
"access",
"useful",
"data"
] | def feedForwardAutoencoder(theta, hidden_size, visible_size, input):
limit0 = 0
limit1 = hidden_size * visible_size
limit2 = 2 * hidden_size * visible_size
limit3 = 2 * hidden_size * visible_size + hidden_size
W1 = theta[limit0 : limit1].reshape(hidden_size, visible_size)
b1 = theta[limit2 : lim... | [
"def",
"feedForwardAutoencoder",
"(",
"theta",
",",
"hidden_size",
",",
"visible_size",
",",
"input",
")",
":",
"limit0",
"=",
"0",
"limit1",
"=",
"hidden_size",
"*",
"visible_size",
"limit2",
"=",
"2",
"*",
"hidden_size",
"*",
"visible_size",
"limit3",
"=",
... | Define limits to access useful data | [
"Define",
"limits",
"to",
"access",
"useful",
"data"
] | [
"\"\"\" Define limits to access useful data \"\"\"",
"\"\"\" Access W1 and b1 from 'theta' \"\"\"",
"\"\"\" Compute the hidden layer activations \"\"\""
] | [
{
"param": "theta",
"type": null
},
{
"param": "hidden_size",
"type": null
},
{
"param": "visible_size",
"type": null
},
{
"param": "input",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "theta",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "hidden_size",
"type": null,
"docstring": null,
"docstring_to... |
f1bee9080f01b289d06b5230d6d7ca8b91a587c4 | siddharth-agrawal/Stacked-Autoencoder | stackedAutoencoder.py | [
"MIT"
] | Python | stack2Params | <not_specific> | def stack2Params(stack):
""" Initialize an empty list of parameters """
params = []
num_layers = len(stack) / 2
""" For each layer in the neural network, append the corresponding parameters """
for i in range(num_layers):
params = numpy.concatenate((params, numpy.array(stack[i, "W... | Initialize an empty list of parameters | Initialize an empty list of parameters | [
"Initialize",
"an",
"empty",
"list",
"of",
"parameters"
] | def stack2Params(stack):
params = []
num_layers = len(stack) / 2
for i in range(num_layers):
params = numpy.concatenate((params, numpy.array(stack[i, "W"]).flatten()))
params = numpy.concatenate((params, numpy.array(stack[i, "b"]).flatten()))
return params | [
"def",
"stack2Params",
"(",
"stack",
")",
":",
"params",
"=",
"[",
"]",
"num_layers",
"=",
"len",
"(",
"stack",
")",
"/",
"2",
"\"\"\" For each layer in the neural network, append the corresponding parameters \"\"\"",
"for",
"i",
"in",
"range",
"(",
"num_layers",
")... | Initialize an empty list of parameters | [
"Initialize",
"an",
"empty",
"list",
"of",
"parameters"
] | [
"\"\"\" Initialize an empty list of parameters \"\"\"",
"\"\"\" For each layer in the neural network, append the corresponding parameters \"\"\""
] | [
{
"param": "stack",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "stack",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f1bee9080f01b289d06b5230d6d7ca8b91a587c4 | siddharth-agrawal/Stacked-Autoencoder | stackedAutoencoder.py | [
"MIT"
] | Python | executeStackedAutoencoder | null | def executeStackedAutoencoder():
""" Define the parameters of the first Autoencoder """
visible_size = 784 # size of input vector
hidden_size1 = 200 # size of hidden layer vector of first autoencoder
hidden_size2 = 200 # size of hidden layer vector of second autoencoder
rho ... | Define the parameters of the first Autoencoder | Define the parameters of the first Autoencoder | [
"Define",
"the",
"parameters",
"of",
"the",
"first",
"Autoencoder"
] | def executeStackedAutoencoder():
visible_size = 784
hidden_size1 = 200
hidden_size2 = 200
rho = 0.1
lamda = 0.003
beta = 3
max_iterations = 200
num_classes = 10
train_data = loadMNISTImages('train-images.idx3-... | [
"def",
"executeStackedAutoencoder",
"(",
")",
":",
"visible_size",
"=",
"784",
"hidden_size1",
"=",
"200",
"hidden_size2",
"=",
"200",
"rho",
"=",
"0.1",
"lamda",
"=",
"0.003",
"beta",
"=",
"3",
"max_iterations",
"=",
"200",
"num_classes",
"=",
"10",
"\"\"\"... | Define the parameters of the first Autoencoder | [
"Define",
"the",
"parameters",
"of",
"the",
"first",
"Autoencoder"
] | [
"\"\"\" Define the parameters of the first Autoencoder \"\"\"",
"# size of input vector",
"# size of hidden layer vector of first autoencoder",
"# size of hidden layer vector of second autoencoder",
"# desired average activation of hidden units",
"# weight decay parameter",
"# weight of sparsity penalty... | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
aa4c271434ea958802e3692012deaca2bdf1fff4 | K9173A/ProductCatalog | mainapp/views.py | [
"MIT"
] | Python | catalog | <not_specific> | def catalog(request):
"""
Renders catalog and its items.
:param request: request object.
:return: rendered catalog page.
"""
context = {
'title': 'Каталог',
'products': Product.objects.all()
}
return render(request, 'mainapp/catalog.html', context) |
Renders catalog and its items.
:param request: request object.
:return: rendered catalog page.
| Renders catalog and its items. | [
"Renders",
"catalog",
"and",
"its",
"items",
"."
] | def catalog(request):
context = {
'title': 'Каталог',
'products': Product.objects.all()
}
return render(request, 'mainapp/catalog.html', context) | [
"def",
"catalog",
"(",
"request",
")",
":",
"context",
"=",
"{",
"'title'",
":",
"'Каталог',",
"",
"'products'",
":",
"Product",
".",
"objects",
".",
"all",
"(",
")",
"}",
"return",
"render",
"(",
"request",
",",
"'mainapp/catalog.html'",
",",
"context",
... | Renders catalog and its items. | [
"Renders",
"catalog",
"and",
"its",
"items",
"."
] | [
"\"\"\"\n Renders catalog and its items.\n :param request: request object.\n :return: rendered catalog page.\n \"\"\""
] | [
{
"param": "request",
"type": null
}
] | {
"returns": [
{
"docstring": "rendered catalog page.",
"docstring_tokens": [
"rendered",
"catalog",
"page",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "request",
"type": null,
"docstring": null,
... |
aa4c271434ea958802e3692012deaca2bdf1fff4 | K9173A/ProductCatalog | mainapp/views.py | [
"MIT"
] | Python | create_product | <not_specific> | def create_product(request):
"""
This view has 2 cases:
1) POST-method: adds new item to the database and returns renewed list
of products.
2) GET-method: opens empty modal form.
:param request: request object.
:return: serialized form and list of products.
"""
if request.method =... |
This view has 2 cases:
1) POST-method: adds new item to the database and returns renewed list
of products.
2) GET-method: opens empty modal form.
:param request: request object.
:return: serialized form and list of products.
| This view has 2 cases:
1) POST-method: adds new item to the database and returns renewed list
of products.
2) GET-method: opens empty modal form. | [
"This",
"view",
"has",
"2",
"cases",
":",
"1",
")",
"POST",
"-",
"method",
":",
"adds",
"new",
"item",
"to",
"the",
"database",
"and",
"returns",
"renewed",
"list",
"of",
"products",
".",
"2",
")",
"GET",
"-",
"method",
":",
"opens",
"empty",
"modal"... | def create_product(request):
if request.method == 'POST':
form = ProductForm(request.POST)
if form.is_valid():
form.save()
data = {
'form_is_valid': True,
'products_html': render_to_string(
'mainapp/product_list.html',
... | [
"def",
"create_product",
"(",
"request",
")",
":",
"if",
"request",
".",
"method",
"==",
"'POST'",
":",
"form",
"=",
"ProductForm",
"(",
"request",
".",
"POST",
")",
"if",
"form",
".",
"is_valid",
"(",
")",
":",
"form",
".",
"save",
"(",
")",
"data",... | This view has 2 cases:
1) POST-method: adds new item to the database and returns renewed list
of products. | [
"This",
"view",
"has",
"2",
"cases",
":",
"1",
")",
"POST",
"-",
"method",
":",
"adds",
"new",
"item",
"to",
"the",
"database",
"and",
"returns",
"renewed",
"list",
"of",
"products",
"."
] | [
"\"\"\"\n This view has 2 cases:\n 1) POST-method: adds new item to the database and returns renewed list\n of products.\n 2) GET-method: opens empty modal form.\n :param request: request object.\n :return: serialized form and list of products.\n \"\"\""
] | [
{
"param": "request",
"type": null
}
] | {
"returns": [
{
"docstring": "serialized form and list of products.",
"docstring_tokens": [
"serialized",
"form",
"and",
"list",
"of",
"products",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier":... |
aa4c271434ea958802e3692012deaca2bdf1fff4 | K9173A/ProductCatalog | mainapp/views.py | [
"MIT"
] | Python | delete_product | <not_specific> | def delete_product(request, pk):
"""
Deletes item from the database.
:param request: request object.
:param pk: id of item to be deleted.
:return: updated list of products.
"""
if request.is_ajax():
item = Product.objects.filter(pk=pk).first()
if item:
item.delete... |
Deletes item from the database.
:param request: request object.
:param pk: id of item to be deleted.
:return: updated list of products.
| Deletes item from the database. | [
"Deletes",
"item",
"from",
"the",
"database",
"."
] | def delete_product(request, pk):
if request.is_ajax():
item = Product.objects.filter(pk=pk).first()
if item:
item.delete()
data = {
'products_html': render_to_string(
'mainapp/product_list.html',
context={'products': Product.objects.all... | [
"def",
"delete_product",
"(",
"request",
",",
"pk",
")",
":",
"if",
"request",
".",
"is_ajax",
"(",
")",
":",
"item",
"=",
"Product",
".",
"objects",
".",
"filter",
"(",
"pk",
"=",
"pk",
")",
".",
"first",
"(",
")",
"if",
"item",
":",
"item",
"."... | Deletes item from the database. | [
"Deletes",
"item",
"from",
"the",
"database",
"."
] | [
"\"\"\"\n Deletes item from the database.\n :param request: request object.\n :param pk: id of item to be deleted.\n :return: updated list of products.\n \"\"\""
] | [
{
"param": "request",
"type": null
},
{
"param": "pk",
"type": null
}
] | {
"returns": [
{
"docstring": "updated list of products.",
"docstring_tokens": [
"updated",
"list",
"of",
"products",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "request",
"type": null,
"docstri... |
3af7f353897174c1f473bb117c7136afd589bde1 | weiguanghuang/analytics-zoo | pyzoo/zoo/pipeline/api/keras/models.py | [
"Apache-2.0"
] | Python | from_jvalue | <not_specific> | def from_jvalue(jvalue, bigdl_type="float"):
"""
Create a Python Model base on the given java value
:param jvalue: Java object create by Py4j
:return: A Python Model
"""
model = Sequential(jvalue=jvalue)
model.value = jvalue
return model |
Create a Python Model base on the given java value
:param jvalue: Java object create by Py4j
:return: A Python Model
| Create a Python Model base on the given java value | [
"Create",
"a",
"Python",
"Model",
"base",
"on",
"the",
"given",
"java",
"value"
] | def from_jvalue(jvalue, bigdl_type="float"):
model = Sequential(jvalue=jvalue)
model.value = jvalue
return model | [
"def",
"from_jvalue",
"(",
"jvalue",
",",
"bigdl_type",
"=",
"\"float\"",
")",
":",
"model",
"=",
"Sequential",
"(",
"jvalue",
"=",
"jvalue",
")",
"model",
".",
"value",
"=",
"jvalue",
"return",
"model"
] | Create a Python Model base on the given java value | [
"Create",
"a",
"Python",
"Model",
"base",
"on",
"the",
"given",
"java",
"value"
] | [
"\"\"\"\n Create a Python Model base on the given java value\n :param jvalue: Java object create by Py4j\n :return: A Python Model\n \"\"\""
] | [
{
"param": "jvalue",
"type": null
},
{
"param": "bigdl_type",
"type": null
}
] | {
"returns": [
{
"docstring": "A Python Model",
"docstring_tokens": [
"A",
"Python",
"Model"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "jvalue",
"type": null,
"docstring": "Java object create by Py4j",
"docs... |
3af7f353897174c1f473bb117c7136afd589bde1 | weiguanghuang/analytics-zoo | pyzoo/zoo/pipeline/api/keras/models.py | [
"Apache-2.0"
] | Python | save_graph_topology | null | def save_graph_topology(self, log_path, backward=False):
"""
Save the current model graph to a folder, which can be displayed in TensorBoard by running the command:
tensorboard --logdir log_path
# Arguments
log_path: The path to save the model graph.
backward: The name o... |
Save the current model graph to a folder, which can be displayed in TensorBoard by running the command:
tensorboard --logdir log_path
# Arguments
log_path: The path to save the model graph.
backward: The name of the application.
| Save the current model graph to a folder, which can be displayed in TensorBoard by running the command:
tensorboard --logdir log_path
Arguments
log_path: The path to save the model graph.
backward: The name of the application. | [
"Save",
"the",
"current",
"model",
"graph",
"to",
"a",
"folder",
"which",
"can",
"be",
"displayed",
"in",
"TensorBoard",
"by",
"running",
"the",
"command",
":",
"tensorboard",
"--",
"logdir",
"log_path",
"Arguments",
"log_path",
":",
"The",
"path",
"to",
"sa... | def save_graph_topology(self, log_path, backward=False):
callBigDlFunc(self.bigdl_type, "zooSaveGraphTopology",
self.value,
log_path,
backward) | [
"def",
"save_graph_topology",
"(",
"self",
",",
"log_path",
",",
"backward",
"=",
"False",
")",
":",
"callBigDlFunc",
"(",
"self",
".",
"bigdl_type",
",",
"\"zooSaveGraphTopology\"",
",",
"self",
".",
"value",
",",
"log_path",
",",
"backward",
")"
] | Save the current model graph to a folder, which can be displayed in TensorBoard by running the command:
tensorboard --logdir log_path | [
"Save",
"the",
"current",
"model",
"graph",
"to",
"a",
"folder",
"which",
"can",
"be",
"displayed",
"in",
"TensorBoard",
"by",
"running",
"the",
"command",
":",
"tensorboard",
"--",
"logdir",
"log_path"
] | [
"\"\"\"\n Save the current model graph to a folder, which can be displayed in TensorBoard by running the command:\n tensorboard --logdir log_path\n\n # Arguments\n log_path: The path to save the model graph.\n backward: The name of the application.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "log_path",
"type": null
},
{
"param": "backward",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "log_path",
"type": null,
"docstring": null,
"docstring_tokens... |
3af7f353897174c1f473bb117c7136afd589bde1 | weiguanghuang/analytics-zoo | pyzoo/zoo/pipeline/api/keras/models.py | [
"Apache-2.0"
] | Python | from_jvalue | <not_specific> | def from_jvalue(jvalue, bigdl_type="float"):
"""
Create a Python Model base on the given java value
:param jvalue: Java object create by Py4j
:return: A Python Model
"""
model = Model([], [], jvalue=jvalue)
model.value = jvalue
return model |
Create a Python Model base on the given java value
:param jvalue: Java object create by Py4j
:return: A Python Model
| Create a Python Model base on the given java value | [
"Create",
"a",
"Python",
"Model",
"base",
"on",
"the",
"given",
"java",
"value"
] | def from_jvalue(jvalue, bigdl_type="float"):
model = Model([], [], jvalue=jvalue)
model.value = jvalue
return model | [
"def",
"from_jvalue",
"(",
"jvalue",
",",
"bigdl_type",
"=",
"\"float\"",
")",
":",
"model",
"=",
"Model",
"(",
"[",
"]",
",",
"[",
"]",
",",
"jvalue",
"=",
"jvalue",
")",
"model",
".",
"value",
"=",
"jvalue",
"return",
"model"
] | Create a Python Model base on the given java value | [
"Create",
"a",
"Python",
"Model",
"base",
"on",
"the",
"given",
"java",
"value"
] | [
"\"\"\"\n Create a Python Model base on the given java value\n :param jvalue: Java object create by Py4j\n :return: A Python Model\n \"\"\""
] | [
{
"param": "jvalue",
"type": null
},
{
"param": "bigdl_type",
"type": null
}
] | {
"returns": [
{
"docstring": "A Python Model",
"docstring_tokens": [
"A",
"Python",
"Model"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "jvalue",
"type": null,
"docstring": "Java object create by Py4j",
"docs... |
2393c76419675829aa3b681b91be0d3c5403b6d5 | TheJacksonLaboratory/detect_rois_omero | src/create_rois.py | [
"MIT"
] | Python | create_rois | <not_specific> | def create_rois(image, size_thresh, method_thresh, closing, scale_factor):
'''
Main entry-point function for generating ROIs automatically.
Does thresholding, clever merging of intersecting ROIs and ordering left-right-top-bottom.
Parameters:
image (np.array): 3-dimensional... |
Main entry-point function for generating ROIs automatically.
Does thresholding, clever merging of intersecting ROIs and ordering left-right-top-bottom.
Parameters:
image (np.array): 3-dimensional (2d + RGB) numpy array with pixel data for retrieved jpeg from OMERO
... | Main entry-point function for generating ROIs automatically.
Does thresholding, clever merging of intersecting ROIs and ordering left-right-top-bottom.
image (np.array): 3-dimensional (2d + RGB) numpy array with pixel data for retrieved jpeg from OMERO
size_thresh (num): Minimum size (in full-resolution pixels) for an... | [
"Main",
"entry",
"-",
"point",
"function",
"for",
"generating",
"ROIs",
"automatically",
".",
"Does",
"thresholding",
"clever",
"merging",
"of",
"intersecting",
"ROIs",
"and",
"ordering",
"left",
"-",
"right",
"-",
"top",
"-",
"bottom",
".",
"image",
"(",
"n... | def create_rois(image, size_thresh, method_thresh, closing, scale_factor):
from skimage.color import rgb2gray
from skimage.filters import threshold_otsu, threshold_triangle, threshold_yen, threshold_li
from skimage.util import invert
from skimage.morphology import diamond, binary_closing
from skimag... | [
"def",
"create_rois",
"(",
"image",
",",
"size_thresh",
",",
"method_thresh",
",",
"closing",
",",
"scale_factor",
")",
":",
"from",
"skimage",
".",
"color",
"import",
"rgb2gray",
"from",
"skimage",
".",
"filters",
"import",
"threshold_otsu",
",",
"threshold_tri... | Main entry-point function for generating ROIs automatically. | [
"Main",
"entry",
"-",
"point",
"function",
"for",
"generating",
"ROIs",
"automatically",
"."
] | [
"'''\n Main entry-point function for generating ROIs automatically. \n Does thresholding, clever merging of intersecting ROIs and ordering left-right-top-bottom.\n\n Parameters:\n image (np.array): 3-dimensional (2d + RGB) numpy array with pixel data for retrieved jpeg from OMERO... | [
{
"param": "image",
"type": null
},
{
"param": "size_thresh",
"type": null
},
{
"param": "method_thresh",
"type": null
},
{
"param": "closing",
"type": null
},
{
"param": "scale_factor",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "image",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "size_thresh",
"type": null,
"docstring": null,
"docstring_to... |
2393c76419675829aa3b681b91be0d3c5403b6d5 | TheJacksonLaboratory/detect_rois_omero | src/create_rois.py | [
"MIT"
] | Python | distance | <not_specific> | def distance(p1, p2):
'''
Basic L2 distance. I will not bother writing a detailed docstring for this.
'''
import numpy as np
d = np.sqrt(((p2[0] - p1[0]) ** 2) + ((p2[1] - p1[1]) ** 2))
return d |
Basic L2 distance. I will not bother writing a detailed docstring for this.
| Basic L2 distance. I will not bother writing a detailed docstring for this. | [
"Basic",
"L2",
"distance",
".",
"I",
"will",
"not",
"bother",
"writing",
"a",
"detailed",
"docstring",
"for",
"this",
"."
] | def distance(p1, p2):
import numpy as np
d = np.sqrt(((p2[0] - p1[0]) ** 2) + ((p2[1] - p1[1]) ** 2))
return d | [
"def",
"distance",
"(",
"p1",
",",
"p2",
")",
":",
"import",
"numpy",
"as",
"np",
"d",
"=",
"np",
".",
"sqrt",
"(",
"(",
"(",
"p2",
"[",
"0",
"]",
"-",
"p1",
"[",
"0",
"]",
")",
"**",
"2",
")",
"+",
"(",
"(",
"p2",
"[",
"1",
"]",
"-",
... | Basic L2 distance. | [
"Basic",
"L2",
"distance",
"."
] | [
"'''\n Basic L2 distance. I will not bother writing a detailed docstring for this.\n '''"
] | [
{
"param": "p1",
"type": null
},
{
"param": "p2",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "p1",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "p2",
"type": null,
"docstring": null,
"docstring_tokens": [],
... |
2393c76419675829aa3b681b91be0d3c5403b6d5 | TheJacksonLaboratory/detect_rois_omero | src/create_rois.py | [
"MIT"
] | Python | weighted_distance | <not_specific> | def weighted_distance(p1, p2, weight):
'''
Weighted L2 distance where Y difference is multiplied by a weight.
We want discrepancies in Y to be magnified to be able to detect lines.
'''
import numpy as np
d = np.sqrt(((p2[0] - p1[0]) ** 2) + ((weight * (p2[1] - p1[1])) ** 2))
return d |
Weighted L2 distance where Y difference is multiplied by a weight.
We want discrepancies in Y to be magnified to be able to detect lines.
| Weighted L2 distance where Y difference is multiplied by a weight.
We want discrepancies in Y to be magnified to be able to detect lines. | [
"Weighted",
"L2",
"distance",
"where",
"Y",
"difference",
"is",
"multiplied",
"by",
"a",
"weight",
".",
"We",
"want",
"discrepancies",
"in",
"Y",
"to",
"be",
"magnified",
"to",
"be",
"able",
"to",
"detect",
"lines",
"."
] | def weighted_distance(p1, p2, weight):
import numpy as np
d = np.sqrt(((p2[0] - p1[0]) ** 2) + ((weight * (p2[1] - p1[1])) ** 2))
return d | [
"def",
"weighted_distance",
"(",
"p1",
",",
"p2",
",",
"weight",
")",
":",
"import",
"numpy",
"as",
"np",
"d",
"=",
"np",
".",
"sqrt",
"(",
"(",
"(",
"p2",
"[",
"0",
"]",
"-",
"p1",
"[",
"0",
"]",
")",
"**",
"2",
")",
"+",
"(",
"(",
"weight... | Weighted L2 distance where Y difference is multiplied by a weight. | [
"Weighted",
"L2",
"distance",
"where",
"Y",
"difference",
"is",
"multiplied",
"by",
"a",
"weight",
"."
] | [
"'''\n Weighted L2 distance where Y difference is multiplied by a weight. \n We want discrepancies in Y to be magnified to be able to detect lines.\n '''"
] | [
{
"param": "p1",
"type": null
},
{
"param": "p2",
"type": null
},
{
"param": "weight",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "p1",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "p2",
"type": null,
"docstring": null,
"docstring_tokens": [],
... |
2393c76419675829aa3b681b91be0d3c5403b6d5 | TheJacksonLaboratory/detect_rois_omero | src/create_rois.py | [
"MIT"
] | Python | generate_centroids | <not_specific> | def generate_centroids(regions):
'''
Generate centroids of the region bounding boxes.
Parameters:
regions (list): tuples of the form (y1,x1,y2,x2) representing the ROI bounding boxes
Returns:
centroids (list): list of tuples of the f... |
Generate centroids of the region bounding boxes.
Parameters:
regions (list): tuples of the form (y1,x1,y2,x2) representing the ROI bounding boxes
Returns:
centroids (list): list of tuples of the form (X, Y) with centroids (because I hat... | Generate centroids of the region bounding boxes. | [
"Generate",
"centroids",
"of",
"the",
"region",
"bounding",
"boxes",
"."
] | def generate_centroids(regions):
centroids = []
if regions != []:
for region in regions:
centroids.append(((region[1]+ region[3])/2, (region[0]+ region[2])/2))
return centroids | [
"def",
"generate_centroids",
"(",
"regions",
")",
":",
"centroids",
"=",
"[",
"]",
"if",
"regions",
"!=",
"[",
"]",
":",
"for",
"region",
"in",
"regions",
":",
"centroids",
".",
"append",
"(",
"(",
"(",
"region",
"[",
"1",
"]",
"+",
"region",
"[",
... | Generate centroids of the region bounding boxes. | [
"Generate",
"centroids",
"of",
"the",
"region",
"bounding",
"boxes",
"."
] | [
"'''\n Generate centroids of the region bounding boxes. \n\n Parameters:\n regions (list): tuples of the form (y1,x1,y2,x2) representing the ROI bounding boxes\n \n Returns:\n centroids (list): list of tuples of the form (X, Y) with centroids... | [
{
"param": "regions",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "regions",
"type": null,
"docstring": "tuples of the form (y1,x1,y2,x2) representing the ROI bounding boxes\nReturns.",
"docstring_tokens": [
"tuples",
"of",
"the",
"form",
"(",
"... |
2393c76419675829aa3b681b91be0d3c5403b6d5 | TheJacksonLaboratory/detect_rois_omero | src/create_rois.py | [
"MIT"
] | Python | order_regions | <not_specific> | def order_regions(regions):
'''
This function is an absolute nightmare that will require a lot of in-line commenting to make any sense of. But basically it gets
a list of region bounding boxes and returns the same list, but ordered left-right and top-bottom (i.e. writing order).
Parameters:
... |
This function is an absolute nightmare that will require a lot of in-line commenting to make any sense of. But basically it gets
a list of region bounding boxes and returns the same list, but ordered left-right and top-bottom (i.e. writing order).
Parameters:
regions (list): tuples of... | This function is an absolute nightmare that will require a lot of in-line commenting to make any sense of. But basically it gets
a list of region bounding boxes and returns the same list, but ordered left-right and top-bottom . | [
"This",
"function",
"is",
"an",
"absolute",
"nightmare",
"that",
"will",
"require",
"a",
"lot",
"of",
"in",
"-",
"line",
"commenting",
"to",
"make",
"any",
"sense",
"of",
".",
"But",
"basically",
"it",
"gets",
"a",
"list",
"of",
"region",
"bounding",
"bo... | def order_regions(regions):
import numpy as np
if regions != []:
centroids = generate_centroids(regions)
sums = [c[0]+c[1] for c in centroids]
topleft = sums.index(min(sums))
c_topleft = centroids[topleft]
r_topleft = regions[topleft]
regions.remove(r_topleft)
... | [
"def",
"order_regions",
"(",
"regions",
")",
":",
"import",
"numpy",
"as",
"np",
"if",
"regions",
"!=",
"[",
"]",
":",
"centroids",
"=",
"generate_centroids",
"(",
"regions",
")",
"sums",
"=",
"[",
"c",
"[",
"0",
"]",
"+",
"c",
"[",
"1",
"]",
"for"... | This function is an absolute nightmare that will require a lot of in-line commenting to make any sense of. | [
"This",
"function",
"is",
"an",
"absolute",
"nightmare",
"that",
"will",
"require",
"a",
"lot",
"of",
"in",
"-",
"line",
"commenting",
"to",
"make",
"any",
"sense",
"of",
"."
] | [
"'''\n This function is an absolute nightmare that will require a lot of in-line commenting to make any sense of. But basically it gets\n a list of region bounding boxes and returns the same list, but ordered left-right and top-bottom (i.e. writing order). \n\n Parameters:\n regions (lis... | [
{
"param": "regions",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "regions",
"type": null,
"docstring": "tuples of the form (y1,x1,y2,x2) representing the ROI bounding boxes\nReturns.",
"docstring_tokens": [
"tuples",
"of",
"the",
"form",
"(",
"... |
2393c76419675829aa3b681b91be0d3c5403b6d5 | TheJacksonLaboratory/detect_rois_omero | src/create_rois.py | [
"MIT"
] | Python | prune_regions | <not_specific> | def prune_regions(regions):
'''
Get rid of any regions with aspect ratios bigger than 4. Why 4? Good question.
'''
restart = True
while restart:
restart = False
for region in regions:
if check_aspect_ratio(region, 4):
regions.remove(region)
... |
Get rid of any regions with aspect ratios bigger than 4. Why 4? Good question.
| Get rid of any regions with aspect ratios bigger than 4. Why 4. Good question. | [
"Get",
"rid",
"of",
"any",
"regions",
"with",
"aspect",
"ratios",
"bigger",
"than",
"4",
".",
"Why",
"4",
".",
"Good",
"question",
"."
] | def prune_regions(regions):
restart = True
while restart:
restart = False
for region in regions:
if check_aspect_ratio(region, 4):
regions.remove(region)
restart = True
break
regions = cluster_regions(regions)
return(regions) | [
"def",
"prune_regions",
"(",
"regions",
")",
":",
"restart",
"=",
"True",
"while",
"restart",
":",
"restart",
"=",
"False",
"for",
"region",
"in",
"regions",
":",
"if",
"check_aspect_ratio",
"(",
"region",
",",
"4",
")",
":",
"regions",
".",
"remove",
"(... | Get rid of any regions with aspect ratios bigger than 4. | [
"Get",
"rid",
"of",
"any",
"regions",
"with",
"aspect",
"ratios",
"bigger",
"than",
"4",
"."
] | [
"'''\n Get rid of any regions with aspect ratios bigger than 4. Why 4? Good question.\n '''"
] | [
{
"param": "regions",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "regions",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2393c76419675829aa3b681b91be0d3c5403b6d5 | TheJacksonLaboratory/detect_rois_omero | src/create_rois.py | [
"MIT"
] | Python | cluster_regions | <not_specific> | def cluster_regions(regions):
'''
This function does some clever graph stuff to merge ROIs hierarchically based on intersection areas. By defining merge
priorities a priori instead of iteratively, we get really good quality ROIs that can even overlap without becoming a single
huge bounding box.
P... |
This function does some clever graph stuff to merge ROIs hierarchically based on intersection areas. By defining merge
priorities a priori instead of iteratively, we get really good quality ROIs that can even overlap without becoming a single
huge bounding box.
Parameters:
regions... | This function does some clever graph stuff to merge ROIs hierarchically based on intersection areas. By defining merge
priorities a priori instead of iteratively, we get really good quality ROIs that can even overlap without becoming a single
huge bounding box. | [
"This",
"function",
"does",
"some",
"clever",
"graph",
"stuff",
"to",
"merge",
"ROIs",
"hierarchically",
"based",
"on",
"intersection",
"areas",
".",
"By",
"defining",
"merge",
"priorities",
"a",
"priori",
"instead",
"of",
"iteratively",
"we",
"get",
"really",
... | def cluster_regions(regions):
import networkx as nx
willmerge = []
mergee = []
results = []
for region in regions:
intersection = check_intersections(region,regions)
if intersection != -1:
willmerge.append(True)
mergee.append(intersection)
else:
... | [
"def",
"cluster_regions",
"(",
"regions",
")",
":",
"import",
"networkx",
"as",
"nx",
"willmerge",
"=",
"[",
"]",
"mergee",
"=",
"[",
"]",
"results",
"=",
"[",
"]",
"for",
"region",
"in",
"regions",
":",
"intersection",
"=",
"check_intersections",
"(",
"... | This function does some clever graph stuff to merge ROIs hierarchically based on intersection areas. | [
"This",
"function",
"does",
"some",
"clever",
"graph",
"stuff",
"to",
"merge",
"ROIs",
"hierarchically",
"based",
"on",
"intersection",
"areas",
"."
] | [
"'''\n This function does some clever graph stuff to merge ROIs hierarchically based on intersection areas. By defining merge \n priorities a priori instead of iteratively, we get really good quality ROIs that can even overlap without becoming a single\n huge bounding box.\n\n Parameters:\n ... | [
{
"param": "regions",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "regions",
"type": null,
"docstring": "tuples of the form (y1,x1,y2,x2) representing the ROI bounding boxes\nReturns.",
"docstring_tokens": [
"tuples",
"of",
"the",
"form",
"(",
"... |
2393c76419675829aa3b681b91be0d3c5403b6d5 | TheJacksonLaboratory/detect_rois_omero | src/create_rois.py | [
"MIT"
] | Python | merge_cluster | <not_specific> | def merge_cluster(indices, regions):
'''
Generate a bounding box around all ROIs with given indices on the list of regions (also given)
'''
region = regions[indices[0]]
for i in range(1,len(indices)):
region = merge_regions(region, regions[indices[i]])
return region |
Generate a bounding box around all ROIs with given indices on the list of regions (also given)
| Generate a bounding box around all ROIs with given indices on the list of regions (also given) | [
"Generate",
"a",
"bounding",
"box",
"around",
"all",
"ROIs",
"with",
"given",
"indices",
"on",
"the",
"list",
"of",
"regions",
"(",
"also",
"given",
")"
] | def merge_cluster(indices, regions):
region = regions[indices[0]]
for i in range(1,len(indices)):
region = merge_regions(region, regions[indices[i]])
return region | [
"def",
"merge_cluster",
"(",
"indices",
",",
"regions",
")",
":",
"region",
"=",
"regions",
"[",
"indices",
"[",
"0",
"]",
"]",
"for",
"i",
"in",
"range",
"(",
"1",
",",
"len",
"(",
"indices",
")",
")",
":",
"region",
"=",
"merge_regions",
"(",
"re... | Generate a bounding box around all ROIs with given indices on the list of regions (also given) | [
"Generate",
"a",
"bounding",
"box",
"around",
"all",
"ROIs",
"with",
"given",
"indices",
"on",
"the",
"list",
"of",
"regions",
"(",
"also",
"given",
")"
] | [
"'''\n Generate a bounding box around all ROIs with given indices on the list of regions (also given)\n '''"
] | [
{
"param": "indices",
"type": null
},
{
"param": "regions",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "indices",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "regions",
"type": null,
"docstring": null,
"docstring_toke... |
2393c76419675829aa3b681b91be0d3c5403b6d5 | TheJacksonLaboratory/detect_rois_omero | src/create_rois.py | [
"MIT"
] | Python | check_aspect_ratio | <not_specific> | def check_aspect_ratio(region, threshold):
'''
Simple binary check to see whether a bounding box exceeds a threshold aspect ratio. True means ROI is very elongated.
'''
bbox = region
ratio = (bbox[2]-bbox[0])/(bbox[3]-bbox[1])
if ratio > threshold or ratio < (1/threshold):
return True |
Simple binary check to see whether a bounding box exceeds a threshold aspect ratio. True means ROI is very elongated.
| Simple binary check to see whether a bounding box exceeds a threshold aspect ratio. True means ROI is very elongated. | [
"Simple",
"binary",
"check",
"to",
"see",
"whether",
"a",
"bounding",
"box",
"exceeds",
"a",
"threshold",
"aspect",
"ratio",
".",
"True",
"means",
"ROI",
"is",
"very",
"elongated",
"."
] | def check_aspect_ratio(region, threshold):
bbox = region
ratio = (bbox[2]-bbox[0])/(bbox[3]-bbox[1])
if ratio > threshold or ratio < (1/threshold):
return True | [
"def",
"check_aspect_ratio",
"(",
"region",
",",
"threshold",
")",
":",
"bbox",
"=",
"region",
"ratio",
"=",
"(",
"bbox",
"[",
"2",
"]",
"-",
"bbox",
"[",
"0",
"]",
")",
"/",
"(",
"bbox",
"[",
"3",
"]",
"-",
"bbox",
"[",
"1",
"]",
")",
"if",
... | Simple binary check to see whether a bounding box exceeds a threshold aspect ratio. | [
"Simple",
"binary",
"check",
"to",
"see",
"whether",
"a",
"bounding",
"box",
"exceeds",
"a",
"threshold",
"aspect",
"ratio",
"."
] | [
"'''\n Simple binary check to see whether a bounding box exceeds a threshold aspect ratio. True means ROI is very elongated.\n '''"
] | [
{
"param": "region",
"type": null
},
{
"param": "threshold",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "region",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "threshold",
"type": null,
"docstring": null,
"docstring_tok... |
2393c76419675829aa3b681b91be0d3c5403b6d5 | TheJacksonLaboratory/detect_rois_omero | src/create_rois.py | [
"MIT"
] | Python | check_intersections | <not_specific> | def check_intersections(region, regions):
'''
Calculates intersection areas between a region and all other regions and returns the index of the maximum intersection area.
Parameters:
regions (list): tuples of the form (y1,x1,y2,x2) representing the ROI bounding boxes
... |
Calculates intersection areas between a region and all other regions and returns the index of the maximum intersection area.
Parameters:
regions (list): tuples of the form (y1,x1,y2,x2) representing the ROI bounding boxes
region (tuple): tuple of the form (y1,x1,y2,x2) ... | Calculates intersection areas between a region and all other regions and returns the index of the maximum intersection area. | [
"Calculates",
"intersection",
"areas",
"between",
"a",
"region",
"and",
"all",
"other",
"regions",
"and",
"returns",
"the",
"index",
"of",
"the",
"maximum",
"intersection",
"area",
"."
] | def check_intersections(region, regions):
int_areas = []
bbox = region
for r in regions:
r_bbox = r
if (r_bbox == bbox):
int_areas.append(0)
continue
if bbox[0] >= r_bbox[2] or r_bbox[0] >= bbox[2]:
int_areas.append(0)
continue
... | [
"def",
"check_intersections",
"(",
"region",
",",
"regions",
")",
":",
"int_areas",
"=",
"[",
"]",
"bbox",
"=",
"region",
"for",
"r",
"in",
"regions",
":",
"r_bbox",
"=",
"r",
"if",
"(",
"r_bbox",
"==",
"bbox",
")",
":",
"int_areas",
".",
"append",
"... | Calculates intersection areas between a region and all other regions and returns the index of the maximum intersection area. | [
"Calculates",
"intersection",
"areas",
"between",
"a",
"region",
"and",
"all",
"other",
"regions",
"and",
"returns",
"the",
"index",
"of",
"the",
"maximum",
"intersection",
"area",
"."
] | [
"'''\n Calculates intersection areas between a region and all other regions and returns the index of the maximum intersection area.\n\n Parameters:\n regions (list): tuples of the form (y1,x1,y2,x2) representing the ROI bounding boxes\n region (tuple): tuple of the form (... | [
{
"param": "region",
"type": null
},
{
"param": "regions",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "region",
"type": null,
"docstring": "tuple of the form (y1,x1,y2,x2) representing the ROI to be checked against all others\nReturns.",
"docstring_tokens": [
"tuple",
"of",
"the",
"form",
... |
2393c76419675829aa3b681b91be0d3c5403b6d5 | TheJacksonLaboratory/detect_rois_omero | src/create_rois.py | [
"MIT"
] | Python | merge_regions | <not_specific> | def merge_regions(region,other):
'''
Simple magic code that generates a bounding box that is the union of two bounding boxes.
'''
y1 = min(region[0],other[0])
x1 = min(region[1], other[1])
y2 = max(region[2], other[2])
x2 = max(region[3], other[3])
return (y1,x1,y2,x2) |
Simple magic code that generates a bounding box that is the union of two bounding boxes.
| Simple magic code that generates a bounding box that is the union of two bounding boxes. | [
"Simple",
"magic",
"code",
"that",
"generates",
"a",
"bounding",
"box",
"that",
"is",
"the",
"union",
"of",
"two",
"bounding",
"boxes",
"."
] | def merge_regions(region,other):
y1 = min(region[0],other[0])
x1 = min(region[1], other[1])
y2 = max(region[2], other[2])
x2 = max(region[3], other[3])
return (y1,x1,y2,x2) | [
"def",
"merge_regions",
"(",
"region",
",",
"other",
")",
":",
"y1",
"=",
"min",
"(",
"region",
"[",
"0",
"]",
",",
"other",
"[",
"0",
"]",
")",
"x1",
"=",
"min",
"(",
"region",
"[",
"1",
"]",
",",
"other",
"[",
"1",
"]",
")",
"y2",
"=",
"m... | Simple magic code that generates a bounding box that is the union of two bounding boxes. | [
"Simple",
"magic",
"code",
"that",
"generates",
"a",
"bounding",
"box",
"that",
"is",
"the",
"union",
"of",
"two",
"bounding",
"boxes",
"."
] | [
"'''\n Simple magic code that generates a bounding box that is the union of two bounding boxes.\n '''"
] | [
{
"param": "region",
"type": null
},
{
"param": "other",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "region",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "other",
"type": null,
"docstring": null,
"docstring_tokens"... |
c09209be73c6ddb097827e8d5b2a2fcba0c7a08b | TheJacksonLaboratory/detect_rois_omero | src/save_rois.py | [
"MIT"
] | Python | save_rois | <not_specific> | def save_rois(image, regions, scale, replace):
'''
Main entry point - given a (BlitzGateway-based) omero image, regions and a scaling factor (that should be the same used for ROI creation),
saves the regions as ROIs in OMERO
Parameters:
image (OMERO image): return of a BlitzGateway.... |
Main entry point - given a (BlitzGateway-based) omero image, regions and a scaling factor (that should be the same used for ROI creation),
saves the regions as ROIs in OMERO
Parameters:
image (OMERO image): return of a BlitzGateway.getObject() call, where ROIs will be saved to
... | Main entry point - given a (BlitzGateway-based) omero image, regions and a scaling factor (that should be the same used for ROI creation),
saves the regions as ROIs in OMERO
image (OMERO image): return of a BlitzGateway.getObject() call, where ROIs will be saved to
regions (list): list of tuples of the form (y1,x1,y2,... | [
"Main",
"entry",
"point",
"-",
"given",
"a",
"(",
"BlitzGateway",
"-",
"based",
")",
"omero",
"image",
"regions",
"and",
"a",
"scaling",
"factor",
"(",
"that",
"should",
"be",
"the",
"same",
"used",
"for",
"ROI",
"creation",
")",
"saves",
"the",
"regions... | def save_rois(image, regions, scale, replace):
if replace:
remove_all_rois(image)
if regions and image:
conn = image._conn
counter = 1
for region in regions:
bbox = region
shape = create_rectangle(bbox, counter, scale)
if shape is not None:
... | [
"def",
"save_rois",
"(",
"image",
",",
"regions",
",",
"scale",
",",
"replace",
")",
":",
"if",
"replace",
":",
"remove_all_rois",
"(",
"image",
")",
"if",
"regions",
"and",
"image",
":",
"conn",
"=",
"image",
".",
"_conn",
"counter",
"=",
"1",
"for",
... | Main entry point - given a (BlitzGateway-based) omero image, regions and a scaling factor (that should be the same used for ROI creation),
saves the regions as ROIs in OMERO | [
"Main",
"entry",
"point",
"-",
"given",
"a",
"(",
"BlitzGateway",
"-",
"based",
")",
"omero",
"image",
"regions",
"and",
"a",
"scaling",
"factor",
"(",
"that",
"should",
"be",
"the",
"same",
"used",
"for",
"ROI",
"creation",
")",
"saves",
"the",
"regions... | [
"'''\n Main entry point - given a (BlitzGateway-based) omero image, regions and a scaling factor (that should be the same used for ROI creation),\n saves the regions as ROIs in OMERO\n\n Parameters:\n image (OMERO image): return of a BlitzGateway.getObject() call, where ROIs will be save... | [
{
"param": "image",
"type": null
},
{
"param": "regions",
"type": null
},
{
"param": "scale",
"type": null
},
{
"param": "replace",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "image",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "regions",
"type": null,
"docstring": null,
"docstring_tokens... |
c09209be73c6ddb097827e8d5b2a2fcba0c7a08b | TheJacksonLaboratory/detect_rois_omero | src/save_rois.py | [
"MIT"
] | Python | create_rectangle | <not_specific> | def create_rectangle(data, order, scale):
'''
Generate shape from bounding box data and scaling factor.
'''
from omero.model import RectangleI
# assuming 2d image
z_index = 0
t_index = 0
# scale up to full-size image
y1 = data[0] * scale
x1 =... |
Generate shape from bounding box data and scaling factor.
| Generate shape from bounding box data and scaling factor. | [
"Generate",
"shape",
"from",
"bounding",
"box",
"data",
"and",
"scaling",
"factor",
"."
] | def create_rectangle(data, order, scale):
from omero.model import RectangleI
z_index = 0
t_index = 0
y1 = data[0] * scale
x1 = data[1] * scale
h = (data[2] - data[0]) * scale
w = (data[3] - data[1]) * scale
shape = RectangleI()
shape.x = rdouble(x1)
shape.y = rdouble(y1)
shap... | [
"def",
"create_rectangle",
"(",
"data",
",",
"order",
",",
"scale",
")",
":",
"from",
"omero",
".",
"model",
"import",
"RectangleI",
"z_index",
"=",
"0",
"t_index",
"=",
"0",
"y1",
"=",
"data",
"[",
"0",
"]",
"*",
"scale",
"x1",
"=",
"data",
"[",
"... | Generate shape from bounding box data and scaling factor. | [
"Generate",
"shape",
"from",
"bounding",
"box",
"data",
"and",
"scaling",
"factor",
"."
] | [
"'''\n Generate shape from bounding box data and scaling factor.\n \n '''",
"# assuming 2d image",
"# scale up to full-size image"
] | [
{
"param": "data",
"type": null
},
{
"param": "order",
"type": null
},
{
"param": "scale",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "data",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "order",
"type": null,
"docstring": null,
"docstring_tokens": ... |
c09209be73c6ddb097827e8d5b2a2fcba0c7a08b | TheJacksonLaboratory/detect_rois_omero | src/save_rois.py | [
"MIT"
] | Python | create_roi | <not_specific> | def create_roi(conn, img, shapes):
'''
Generic function to save ROI(s) to OMERO using updateService
'''
from omero.model import RoiI
updateService = conn.getUpdateService()
roi = RoiI()
roi.setImage(img._obj)
# I could be calling this functi... |
Generic function to save ROI(s) to OMERO using updateService
| Generic function to save ROI(s) to OMERO using updateService | [
"Generic",
"function",
"to",
"save",
"ROI",
"(",
"s",
")",
"to",
"OMERO",
"using",
"updateService"
] | def create_roi(conn, img, shapes):
from omero.model import RoiI
updateService = conn.getUpdateService()
roi = RoiI()
roi.setImage(img._obj)
for shape in shapes:
roi.addShape(shape)
group_id = img.getDetails().getGroup().getId()
ctx = {'omero.group': str(group_id)}
return updateSe... | [
"def",
"create_roi",
"(",
"conn",
",",
"img",
",",
"shapes",
")",
":",
"from",
"omero",
".",
"model",
"import",
"RoiI",
"updateService",
"=",
"conn",
".",
"getUpdateService",
"(",
")",
"roi",
"=",
"RoiI",
"(",
")",
"roi",
".",
"setImage",
"(",
"img",
... | Generic function to save ROI(s) to OMERO using updateService | [
"Generic",
"function",
"to",
"save",
"ROI",
"(",
"s",
")",
"to",
"OMERO",
"using",
"updateService"
] | [
"'''\n Generic function to save ROI(s) to OMERO using updateService \n \n '''",
"# I could be calling this function just once by creating a list of shapes beforehand, but whatever",
"# setting group is always necessary here - using same group as the image's "
] | [
{
"param": "conn",
"type": null
},
{
"param": "img",
"type": null
},
{
"param": "shapes",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "img",
"type": null,
"docstring": null,
"docstring_tokens": []... |
1cba6737eb7bf6057d05c58e8337f3393d8d3600 | Anaphory/100woerterbuecher | 05-Needleman-Wunsch/needlemanwunsch.py | [
"MIT"
] | Python | needleman_wunsch | <not_specific> | def needleman_wunsch(sequence1, sequence2):
"""Generate an alignment between sequence1 and sequence2.
Use Needleman and Wunsch's dynamic programming algorithm to create
an alignment between sequence1 and sequence2, and return the
corresponding edit distance.
"""
data = [[None for _ in range(le... | Generate an alignment between sequence1 and sequence2.
Use Needleman and Wunsch's dynamic programming algorithm to create
an alignment between sequence1 and sequence2, and return the
corresponding edit distance.
| Generate an alignment between sequence1 and sequence2.
Use Needleman and Wunsch's dynamic programming algorithm to create
an alignment between sequence1 and sequence2, and return the
corresponding edit distance. | [
"Generate",
"an",
"alignment",
"between",
"sequence1",
"and",
"sequence2",
".",
"Use",
"Needleman",
"and",
"Wunsch",
"'",
"s",
"dynamic",
"programming",
"algorithm",
"to",
"create",
"an",
"alignment",
"between",
"sequence1",
"and",
"sequence2",
"and",
"return",
... | def needleman_wunsch(sequence1, sequence2):
data = [[None for _ in range(len(sequence1) + 1)]
for _ in range(len(sequence2) + 1)]
traceback = [[None for _ in range(len(sequence1) + 1)]
for _ in range(len(sequence2) + 1)]
for top in range(len(sequence1) + 1):
data[0][top]... | [
"def",
"needleman_wunsch",
"(",
"sequence1",
",",
"sequence2",
")",
":",
"data",
"=",
"[",
"[",
"None",
"for",
"_",
"in",
"range",
"(",
"len",
"(",
"sequence1",
")",
"+",
"1",
")",
"]",
"for",
"_",
"in",
"range",
"(",
"len",
"(",
"sequence2",
")",
... | Generate an alignment between sequence1 and sequence2. | [
"Generate",
"an",
"alignment",
"between",
"sequence1",
"and",
"sequence2",
"."
] | [
"\"\"\"Generate an alignment between sequence1 and sequence2.\n\n Use Needleman and Wunsch's dynamic programming algorithm to create\n an alignment between sequence1 and sequence2, and return the\n corresponding edit distance.\n\n \"\"\""
] | [
{
"param": "sequence1",
"type": null
},
{
"param": "sequence2",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "sequence1",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "sequence2",
"type": null,
"docstring": null,
"docstring_... |
bb2e8e61c3c4c1bdf035a47628d63800a0320129 | jayvdb/tox-constraints | src/tox_constraints/hooks.py | [
"MIT"
] | Python | tox_configure | <not_specific> | def tox_configure(config):
"""Apply concrete constraints and export abstract dependencies"""
try:
tool_config = Config.read()
except (FileNotFoundError, KeyError):
# Disable plugin by default to make it less disruptive in a development
# environment that is shared by multiple project... | Apply concrete constraints and export abstract dependencies | Apply concrete constraints and export abstract dependencies | [
"Apply",
"concrete",
"constraints",
"and",
"export",
"abstract",
"dependencies"
] | def tox_configure(config):
try:
tool_config = Config.read()
except (FileNotFoundError, KeyError):
return
if tool_config.plugin_enabled:
_export_deps(config.envconfigs)
_patch_envconfigs(config.envconfigs) | [
"def",
"tox_configure",
"(",
"config",
")",
":",
"try",
":",
"tool_config",
"=",
"Config",
".",
"read",
"(",
")",
"except",
"(",
"FileNotFoundError",
",",
"KeyError",
")",
":",
"return",
"if",
"tool_config",
".",
"plugin_enabled",
":",
"_export_deps",
"(",
... | Apply concrete constraints and export abstract dependencies | [
"Apply",
"concrete",
"constraints",
"and",
"export",
"abstract",
"dependencies"
] | [
"\"\"\"Apply concrete constraints and export abstract dependencies\"\"\"",
"# Disable plugin by default to make it less disruptive in a development",
"# environment that is shared by multiple projects"
] | [
{
"param": "config",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "config",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d91eb343e8828d38d39e107adf015e7501c48af1 | murrayrm/txtlsim-python | BioSIMI-Python/EnzymaticRxnSBMLBioscrape_TEST_FILE.py | [
"BSD-3-Clause"
] | Python | check | <not_specific> | def check(value, message):
"""If 'value' is None, prints an error message constructed using
'message' and then exits with status code 1. If 'value' is an integer,
it assumes it is a libSBML return status code. If the code value is
LIBSBML_OPERATION_SUCCESS, returns without further action; if it is not,
... | If 'value' is None, prints an error message constructed using
'message' and then exits with status code 1. If 'value' is an integer,
it assumes it is a libSBML return status code. If the code value is
LIBSBML_OPERATION_SUCCESS, returns without further action; if it is not,
prints an error message construc... | If 'value' is None, prints an error message constructed using
'message' and then exits with status code 1. If 'value' is an integer,
it assumes it is a libSBML return status code. If the code value is
LIBSBML_OPERATION_SUCCESS, returns without further action; if it is not,
prints an error message constructed using 'm... | [
"If",
"'",
"value",
"'",
"is",
"None",
"prints",
"an",
"error",
"message",
"constructed",
"using",
"'",
"message",
"'",
"and",
"then",
"exits",
"with",
"status",
"code",
"1",
".",
"If",
"'",
"value",
"'",
"is",
"an",
"integer",
"it",
"assumes",
"it",
... | def check(value, message):
if value == None:
raise SystemExit('LibSBML returned a null value trying to ' + message + '.')
elif type(value) is int:
if value == LIBSBML_OPERATION_SUCCESS:
return
else:
err_msg = 'Error encountered trying to ' + message + '.' \
+ 'LibSBML... | [
"def",
"check",
"(",
"value",
",",
"message",
")",
":",
"if",
"value",
"==",
"None",
":",
"raise",
"SystemExit",
"(",
"'LibSBML returned a null value trying to '",
"+",
"message",
"+",
"'.'",
")",
"elif",
"type",
"(",
"value",
")",
"is",
"int",
":",
"if",
... | If 'value' is None, prints an error message constructed using
'message' and then exits with status code 1. | [
"If",
"'",
"value",
"'",
"is",
"None",
"prints",
"an",
"error",
"message",
"constructed",
"using",
"'",
"message",
"'",
"and",
"then",
"exits",
"with",
"status",
"code",
"1",
"."
] | [
"\"\"\"If 'value' is None, prints an error message constructed using\n 'message' and then exits with status code 1. If 'value' is an integer,\n it assumes it is a libSBML return status code. If the code value is\n LIBSBML_OPERATION_SUCCESS, returns without further action; if it is not,\n prints an error m... | [
{
"param": "value",
"type": null
},
{
"param": "message",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "value",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "message",
"type": null,
"docstring": null,
"docstring_tokens... |
5f2611702c49186e2f37414b41c379d15dc8ff89 | murrayrm/txtlsim-python | BioSIMI-Python/modules/Subsystem.py | [
"BSD-3-Clause"
] | Python | renameSName | <not_specific> | def renameSName(self, old_name, new_name):
'''
Search the SBMLDocument for the oldName and rename all such
components by the newName
'''
model = self.getSubsystemDoc().getModel()
check(model,'retreiving model from document in renameSName')
mod_obj = SimpleModel(m... |
Search the SBMLDocument for the oldName and rename all such
components by the newName
| Search the SBMLDocument for the oldName and rename all such
components by the newName | [
"Search",
"the",
"SBMLDocument",
"for",
"the",
"oldName",
"and",
"rename",
"all",
"such",
"components",
"by",
"the",
"newName"
] | def renameSName(self, old_name, new_name):
model = self.getSubsystemDoc().getModel()
check(model,'retreiving model from document in renameSName')
mod_obj = SimpleModel(model)
species = mod_obj.getSpeciesByName(old_name)
if species == None:
print('No species named' + o... | [
"def",
"renameSName",
"(",
"self",
",",
"old_name",
",",
"new_name",
")",
":",
"model",
"=",
"self",
".",
"getSubsystemDoc",
"(",
")",
".",
"getModel",
"(",
")",
"check",
"(",
"model",
",",
"'retreiving model from document in renameSName'",
")",
"mod_obj",
"="... | Search the SBMLDocument for the oldName and rename all such
components by the newName | [
"Search",
"the",
"SBMLDocument",
"for",
"the",
"oldName",
"and",
"rename",
"all",
"such",
"components",
"by",
"the",
"newName"
] | [
"'''\n Search the SBMLDocument for the oldName and rename all such \n components by the newName\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "old_name",
"type": null
},
{
"param": "new_name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "old_name",
"type": null,
"docstring": null,
"docstring_tokens... |
5f2611702c49186e2f37414b41c379d15dc8ff89 | murrayrm/txtlsim-python | BioSIMI-Python/modules/Subsystem.py | [
"BSD-3-Clause"
] | Python | convertSubsystemLevelAndVersion | <not_specific> | def convertSubsystemLevelAndVersion(self, newLevel, newVersion):
'''
Converts the SBMLDocument of the current Subsytem to the newLevel and newVersion
'''
document = self.getSubsystemDoc()
check(document,'retreiving document object for subsystem in convert function')
confi... |
Converts the SBMLDocument of the current Subsytem to the newLevel and newVersion
| Converts the SBMLDocument of the current Subsytem to the newLevel and newVersion | [
"Converts",
"the",
"SBMLDocument",
"of",
"the",
"current",
"Subsytem",
"to",
"the",
"newLevel",
"and",
"newVersion"
] | def convertSubsystemLevelAndVersion(self, newLevel, newVersion):
document = self.getSubsystemDoc()
check(document,'retreiving document object for subsystem in convert function')
config = ConversionProperties()
if config != None:
config.addOption('setLevelAndVersion')
... | [
"def",
"convertSubsystemLevelAndVersion",
"(",
"self",
",",
"newLevel",
",",
"newVersion",
")",
":",
"document",
"=",
"self",
".",
"getSubsystemDoc",
"(",
")",
"check",
"(",
"document",
",",
"'retreiving document object for subsystem in convert function'",
")",
"config"... | Converts the SBMLDocument of the current Subsytem to the newLevel and newVersion | [
"Converts",
"the",
"SBMLDocument",
"of",
"the",
"current",
"Subsytem",
"to",
"the",
"newLevel",
"and",
"newVersion"
] | [
"'''\n Converts the SBMLDocument of the current Subsytem to the newLevel and newVersion\n '''",
"# Now, need to set the target level and version (to which to convert the document)",
"# Use the setTargetNamespaces() object of the ConversionsProperties as follows.",
"# First, need to create a new ... | [
{
"param": "self",
"type": null
},
{
"param": "newLevel",
"type": null
},
{
"param": "newVersion",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "newLevel",
"type": null,
"docstring": null,
"docstring_tokens... |
5f2611702c49186e2f37414b41c379d15dc8ff89 | murrayrm/txtlsim-python | BioSIMI-Python/modules/Subsystem.py | [
"BSD-3-Clause"
] | Python | suffixAllElementIds | <not_specific> | def suffixAllElementIds(self, name):
'''
All elements identifiers in the
SBMLDocument of the Subsystem are suffixed with name
'''
document = self.getSubsystemDoc()
check(document,'retreiving document from subsystem in suffixAllElements')
allids = self.getAllIds()
... |
All elements identifiers in the
SBMLDocument of the Subsystem are suffixed with name
| All elements identifiers in the
SBMLDocument of the Subsystem are suffixed with name | [
"All",
"elements",
"identifiers",
"in",
"the",
"SBMLDocument",
"of",
"the",
"Subsystem",
"are",
"suffixed",
"with",
"name"
] | def suffixAllElementIds(self, name):
document = self.getSubsystemDoc()
check(document,'retreiving document from subsystem in suffixAllElements')
allids = self.getAllIds()
for oldid in allids:
if document.getElementBySId(oldid) != None:
self.renameSId(oldid, ol... | [
"def",
"suffixAllElementIds",
"(",
"self",
",",
"name",
")",
":",
"document",
"=",
"self",
".",
"getSubsystemDoc",
"(",
")",
"check",
"(",
"document",
",",
"'retreiving document from subsystem in suffixAllElements'",
")",
"allids",
"=",
"self",
".",
"getAllIds",
"... | All elements identifiers in the
SBMLDocument of the Subsystem are suffixed with name | [
"All",
"elements",
"identifiers",
"in",
"the",
"SBMLDocument",
"of",
"the",
"Subsystem",
"are",
"suffixed",
"with",
"name"
] | [
"'''\n All elements identifiers in the\n SBMLDocument of the Subsystem are suffixed with name\n '''",
"## Use if want to rename all names too",
"# elements = document.getListOfAllElements()",
"# for element in elements:",
"# if element.isSetName():",
"# oldname = element.g... | [
{
"param": "self",
"type": null
},
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens": [... |
5f2611702c49186e2f37414b41c379d15dc8ff89 | murrayrm/txtlsim-python | BioSIMI-Python/modules/Subsystem.py | [
"BSD-3-Clause"
] | Python | createNewModel | <not_specific> | def createNewModel(self, modelId, timeUnits, extentUnits, substanceUnits):
'''
Creates a new Model object in the SBMLDocument of the Subsystem
with the given attributes
'''
model = self.getSubsystemDoc().createModel()
if model == None:
print('Unable to create... |
Creates a new Model object in the SBMLDocument of the Subsystem
with the given attributes
| Creates a new Model object in the SBMLDocument of the Subsystem
with the given attributes | [
"Creates",
"a",
"new",
"Model",
"object",
"in",
"the",
"SBMLDocument",
"of",
"the",
"Subsystem",
"with",
"the",
"given",
"attributes"
] | def createNewModel(self, modelId, timeUnits, extentUnits, substanceUnits):
model = self.getSubsystemDoc().createModel()
if model == None:
print('Unable to create Model object.')
sys.exit(1)
status = model.setId(modelId)
if status != LIBSBML_OPERATION_SUCCESS:
... | [
"def",
"createNewModel",
"(",
"self",
",",
"modelId",
",",
"timeUnits",
",",
"extentUnits",
",",
"substanceUnits",
")",
":",
"model",
"=",
"self",
".",
"getSubsystemDoc",
"(",
")",
".",
"createModel",
"(",
")",
"if",
"model",
"==",
"None",
":",
"print",
... | Creates a new Model object in the SBMLDocument of the Subsystem
with the given attributes | [
"Creates",
"a",
"new",
"Model",
"object",
"in",
"the",
"SBMLDocument",
"of",
"the",
"Subsystem",
"with",
"the",
"given",
"attributes"
] | [
"'''\n Creates a new Model object in the SBMLDocument of the Subsystem \n with the given attributes\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "modelId",
"type": null
},
{
"param": "timeUnits",
"type": null
},
{
"param": "extentUnits",
"type": null
},
{
"param": "substanceUnits",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "modelId",
"type": null,
"docstring": null,
"docstring_tokens"... |
5f2611702c49186e2f37414b41c379d15dc8ff89 | murrayrm/txtlsim-python | BioSIMI-Python/modules/Subsystem.py | [
"BSD-3-Clause"
] | Python | mergeSubsystemModels | null | def mergeSubsystemModels(self, ListOfSubsystems):
'''
The ListOfSubsystems are merged together. All components are
merged together except the Species.
'''
# functions, units, compartments, species, parameters,
# initial assignments, rules, constraints, reactions, and ev... |
The ListOfSubsystems are merged together. All components are
merged together except the Species.
| The ListOfSubsystems are merged together. All components are
merged together except the Species. | [
"The",
"ListOfSubsystems",
"are",
"merged",
"together",
".",
"All",
"components",
"are",
"merged",
"together",
"except",
"the",
"Species",
"."
] | def mergeSubsystemModels(self, ListOfSubsystems):
document = self.getSubsystemDoc()
check(document,'retreiving document in mergeSubsystem')
model_base = ListOfSubsystems[0].getSubsystemDoc().getModel()
check(model_base,'retreiving model in mergeSubsystems')
model = self.createNew... | [
"def",
"mergeSubsystemModels",
"(",
"self",
",",
"ListOfSubsystems",
")",
":",
"document",
"=",
"self",
".",
"getSubsystemDoc",
"(",
")",
"check",
"(",
"document",
",",
"'retreiving document in mergeSubsystem'",
")",
"model_base",
"=",
"ListOfSubsystems",
"[",
"0",
... | The ListOfSubsystems are merged together. | [
"The",
"ListOfSubsystems",
"are",
"merged",
"together",
"."
] | [
"'''\n The ListOfSubsystems are merged together. All components are \n merged together except the Species.\n '''",
"# functions, units, compartments, species, parameters, ",
"# initial assignments, rules, constraints, reactions, and events",
"# Obsolete in SBML Level 3 ",
"# if mod.getN... | [
{
"param": "self",
"type": null
},
{
"param": "ListOfSubsystems",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ListOfSubsystems",
"type": null,
"docstring": null,
"docstrin... |
5f2611702c49186e2f37414b41c379d15dc8ff89 | murrayrm/txtlsim-python | BioSIMI-Python/modules/Subsystem.py | [
"BSD-3-Clause"
] | Python | shareSubsystems | null | def shareSubsystems(self, ListOfSubsystems, ListOfSharedResources, mode = 'volume', combineCall = False):
'''
The ListOfSubsystems are merged and all Species are also added to the
Subsystem object. The Species in ListOfSharedResources are combined together
and so are shared by all Subs... |
The ListOfSubsystems are merged and all Species are also added to the
Subsystem object. The Species in ListOfSharedResources are combined together
and so are shared by all Subsystems in the ListOfSubsystems. The Model id is also updated.
| The ListOfSubsystems are merged and all Species are also added to the
Subsystem object. The Species in ListOfSharedResources are combined together
and so are shared by all Subsystems in the ListOfSubsystems. The Model id is also updated. | [
"The",
"ListOfSubsystems",
"are",
"merged",
"and",
"all",
"Species",
"are",
"also",
"added",
"to",
"the",
"Subsystem",
"object",
".",
"The",
"Species",
"in",
"ListOfSharedResources",
"are",
"combined",
"together",
"and",
"so",
"are",
"shared",
"by",
"all",
"Su... | def shareSubsystems(self, ListOfSubsystems, ListOfSharedResources, mode = 'volume', combineCall = False):
self.mergeSubsystemModels(ListOfSubsystems)
model = self.getSubsystemDoc().getModel()
check(model,'retreiving model in shareSubsystems')
model_obj = SimpleModel(model)
mod_id... | [
"def",
"shareSubsystems",
"(",
"self",
",",
"ListOfSubsystems",
",",
"ListOfSharedResources",
",",
"mode",
"=",
"'volume'",
",",
"combineCall",
"=",
"False",
")",
":",
"self",
".",
"mergeSubsystemModels",
"(",
"ListOfSubsystems",
")",
"model",
"=",
"self",
".",
... | The ListOfSubsystems are merged and all Species are also added to the
Subsystem object. | [
"The",
"ListOfSubsystems",
"are",
"merged",
"and",
"all",
"Species",
"are",
"also",
"added",
"to",
"the",
"Subsystem",
"object",
"."
] | [
"'''\n The ListOfSubsystems are merged and all Species are also added to the \n Subsystem object. The Species in ListOfSharedResources are combined together \n and so are shared by all Subsystems in the ListOfSubsystems. The Model id is also updated.\n '''",
"# if list of shared resour... | [
{
"param": "self",
"type": null
},
{
"param": "ListOfSubsystems",
"type": null
},
{
"param": "ListOfSharedResources",
"type": null
},
{
"param": "mode",
"type": null
},
{
"param": "combineCall",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ListOfSubsystems",
"type": null,
"docstring": null,
"docstrin... |
5f2611702c49186e2f37414b41c379d15dc8ff89 | murrayrm/txtlsim-python | BioSIMI-Python/modules/Subsystem.py | [
"BSD-3-Clause"
] | Python | connectSubsystems | <not_specific> | def connectSubsystems(self, ListOfSubsystems, connectionLogic, mode = 'volume', combineNames = False, inputSpecies = None):
'''
The ListOfSubsystems are combined together as in combineSubsystems
method (depending on combineNames). Additionally, species interaction specified
In the conn... |
The ListOfSubsystems are combined together as in combineSubsystems
method (depending on combineNames). Additionally, species interaction specified
In the connectionLogic is modeled for the concerned Species. The inputSpecies is
An optional argument that may be used to specify a list ... | The ListOfSubsystems are combined together as in combineSubsystems
method (depending on combineNames). Additionally, species interaction specified
In the connectionLogic is modeled for the concerned Species. The inputSpecies is
An optional argument that may be used to specify a list of Species which are desired
inactiv... | [
"The",
"ListOfSubsystems",
"are",
"combined",
"together",
"as",
"in",
"combineSubsystems",
"method",
"(",
"depending",
"on",
"combineNames",
")",
".",
"Additionally",
"species",
"interaction",
"specified",
"In",
"the",
"connectionLogic",
"is",
"modeled",
"for",
"the... | def connectSubsystems(self, ListOfSubsystems, connectionLogic, mode = 'volume', combineNames = False, inputSpecies = None):
self.combineSubsystems(ListOfSubsystems, combineNames, mode)
model = self.getSubsystemDoc().getModel()
check(model,'retreiving self model in connectSubsystem')
mode... | [
"def",
"connectSubsystems",
"(",
"self",
",",
"ListOfSubsystems",
",",
"connectionLogic",
",",
"mode",
"=",
"'volume'",
",",
"combineNames",
"=",
"False",
",",
"inputSpecies",
"=",
"None",
")",
":",
"self",
".",
"combineSubsystems",
"(",
"ListOfSubsystems",
",",... | The ListOfSubsystems are combined together as in combineSubsystems
method (depending on combineNames). | [
"The",
"ListOfSubsystems",
"are",
"combined",
"together",
"as",
"in",
"combineSubsystems",
"method",
"(",
"depending",
"on",
"combineNames",
")",
"."
] | [
"'''\n The ListOfSubsystems are combined together as in combineSubsystems \n method (depending on combineNames). Additionally, species interaction specified \n In the connectionLogic is modeled for the concerned Species. The inputSpecies is \n An optional argument that may be used to spe... | [
{
"param": "self",
"type": null
},
{
"param": "ListOfSubsystems",
"type": null
},
{
"param": "connectionLogic",
"type": null
},
{
"param": "mode",
"type": null
},
{
"param": "combineNames",
"type": null
},
{
"param": "inputSpecies",
"type": null
... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ListOfSubsystems",
"type": null,
"docstring": null,
"docstrin... |
5f2611702c49186e2f37414b41c379d15dc8ff89 | murrayrm/txtlsim-python | BioSIMI-Python/modules/Subsystem.py | [
"BSD-3-Clause"
] | Python | unsetReversibleReactions | <not_specific> | def unsetReversibleReactions(self, indexList, rateFormulaList = None):
''' The indexList is used to unset the corresponding reactions' reversible
attribute by setting it as False.
The rateFormulaList is a list of strings with math formula
for the new rates of the corresponding reaction... | The indexList is used to unset the corresponding reactions' reversible
attribute by setting it as False.
The rateFormulaList is a list of strings with math formula
for the new rates of the corresponding reactions that are
being set as reversible. Returns the new Subsystem object with... | The indexList is used to unset the corresponding reactions' reversible
attribute by setting it as False.
The rateFormulaList is a list of strings with math formula
for the new rates of the corresponding reactions that are
being set as reversible. Returns the new Subsystem object with changes made | [
"The",
"indexList",
"is",
"used",
"to",
"unset",
"the",
"corresponding",
"reactions",
"'",
"reversible",
"attribute",
"by",
"setting",
"it",
"as",
"False",
".",
"The",
"rateFormulaList",
"is",
"a",
"list",
"of",
"strings",
"with",
"math",
"formula",
"for",
"... | def unsetReversibleReactions(self, indexList, rateFormulaList = None):
if not indexList:
print('The list of index for reactions is empty.')
return
newSubsystem = self.getSystem().createNewSubsystem(3,1)
model_orig = self.getSubsystemDoc().getModel()
newSubsystem.g... | [
"def",
"unsetReversibleReactions",
"(",
"self",
",",
"indexList",
",",
"rateFormulaList",
"=",
"None",
")",
":",
"if",
"not",
"indexList",
":",
"print",
"(",
"'The list of index for reactions is empty.'",
")",
"return",
"newSubsystem",
"=",
"self",
".",
"getSystem",... | The indexList is used to unset the corresponding reactions' reversible
attribute by setting it as False. | [
"The",
"indexList",
"is",
"used",
"to",
"unset",
"the",
"corresponding",
"reactions",
"'",
"reversible",
"attribute",
"by",
"setting",
"it",
"as",
"False",
"."
] | [
"''' The indexList is used to unset the corresponding reactions' reversible\n attribute by setting it as False. \n The rateFormulaList is a list of strings with math formula \n for the new rates of the corresponding reactions that are \n being set as reversible. Returns the new Subsystem... | [
{
"param": "self",
"type": null
},
{
"param": "indexList",
"type": null
},
{
"param": "rateFormulaList",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "indexList",
"type": null,
"docstring": null,
"docstring_token... |
5f2611702c49186e2f37414b41c379d15dc8ff89 | murrayrm/txtlsim-python | BioSIMI-Python/modules/Subsystem.py | [
"BSD-3-Clause"
] | Python | modelReduce | <not_specific> | def modelReduce(self, timepoints):
'''
Reduces the model by removing the reactions which are set as fast
in the Subsystem model. The timepoints are used to simulate the
fast reactions for these timepoints. The steady state values of
the involved species in the fast reactions ar... |
Reduces the model by removing the reactions which are set as fast
in the Subsystem model. The timepoints are used to simulate the
fast reactions for these timepoints. The steady state values of
the involved species in the fast reactions are used in the
reduced model as their i... | Reduces the model by removing the reactions which are set as fast
in the Subsystem model. The timepoints are used to simulate the
fast reactions for these timepoints. The steady state values of
the involved species in the fast reactions are used in the
reduced model as their initial value.
Returns the Subsystem object ... | [
"Reduces",
"the",
"model",
"by",
"removing",
"the",
"reactions",
"which",
"are",
"set",
"as",
"fast",
"in",
"the",
"Subsystem",
"model",
".",
"The",
"timepoints",
"are",
"used",
"to",
"simulate",
"the",
"fast",
"reactions",
"for",
"these",
"timepoints",
".",... | def modelReduce(self, timepoints):
reducedSubsystem = self.getSystem().createNewSubsystem(3,1)
model_orig = self.getSubsystemDoc().getModel()
reducedSubsystem.getSubsystemDoc().setModel(model_orig)
mod = reducedSubsystem.getSubsystemDoc().getModel()
fastRxns = self.getFastReactio... | [
"def",
"modelReduce",
"(",
"self",
",",
"timepoints",
")",
":",
"reducedSubsystem",
"=",
"self",
".",
"getSystem",
"(",
")",
".",
"createNewSubsystem",
"(",
"3",
",",
"1",
")",
"model_orig",
"=",
"self",
".",
"getSubsystemDoc",
"(",
")",
".",
"getModel",
... | Reduces the model by removing the reactions which are set as fast
in the Subsystem model. | [
"Reduces",
"the",
"model",
"by",
"removing",
"the",
"reactions",
"which",
"are",
"set",
"as",
"fast",
"in",
"the",
"Subsystem",
"model",
"."
] | [
"''' \n Reduces the model by removing the reactions which are set as fast\n in the Subsystem model. The timepoints are used to simulate the\n fast reactions for these timepoints. The steady state values of \n the involved species in the fast reactions are used in the\n reduced mod... | [
{
"param": "self",
"type": null
},
{
"param": "timepoints",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "timepoints",
"type": null,
"docstring": null,
"docstring_toke... |
5f2611702c49186e2f37414b41c379d15dc8ff89 | murrayrm/txtlsim-python | BioSIMI-Python/modules/Subsystem.py | [
"BSD-3-Clause"
] | Python | simulateSbmlWithBioscrape | <not_specific> | def simulateSbmlWithBioscrape(self, initialTime, timepoints):
'''
To simulate SBML model without generating the plot.
Returns the data for all species.
'''
filename = 'models/temp_simulate.xml'
writeSBML(self.getSubsystemDoc(), filename)
m = bioscrape.types.rea... |
To simulate SBML model without generating the plot.
Returns the data for all species.
| To simulate SBML model without generating the plot.
Returns the data for all species. | [
"To",
"simulate",
"SBML",
"model",
"without",
"generating",
"the",
"plot",
".",
"Returns",
"the",
"data",
"for",
"all",
"species",
"."
] | def simulateSbmlWithBioscrape(self, initialTime, timepoints):
filename = 'models/temp_simulate.xml'
writeSBML(self.getSubsystemDoc(), filename)
m = bioscrape.types.read_model_from_sbml(filename)
s = bioscrape.simulator.ModelCSimInterface(m)
s.py_prep_deterministic_simulation()
... | [
"def",
"simulateSbmlWithBioscrape",
"(",
"self",
",",
"initialTime",
",",
"timepoints",
")",
":",
"filename",
"=",
"'models/temp_simulate.xml'",
"writeSBML",
"(",
"self",
".",
"getSubsystemDoc",
"(",
")",
",",
"filename",
")",
"m",
"=",
"bioscrape",
".",
"types"... | To simulate SBML model without generating the plot. | [
"To",
"simulate",
"SBML",
"model",
"without",
"generating",
"the",
"plot",
"."
] | [
"''' \n To simulate SBML model without generating the plot. \n Returns the data for all species.\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "initialTime",
"type": null
},
{
"param": "timepoints",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "initialTime",
"type": null,
"docstring": null,
"docstring_tok... |
5f2611702c49186e2f37414b41c379d15dc8ff89 | murrayrm/txtlsim-python | BioSIMI-Python/modules/Subsystem.py | [
"BSD-3-Clause"
] | Python | simulateVariableInputs | <not_specific> | def simulateVariableInputs(self, ListOfInputs, ListOfListOfAmounts, ListOfSpeciesToPlot, timepoints, mode = 'continue', xlabel = 'Time', ylabel = 'Concentration (AU)', sizeOfXLabels = 14, sizeOfYLabels = 14):
''''
Simulates the Subsystem model with the input species amounts varying
Uses bioscra... |
Simulates the Subsystem model with the input species amounts varying
Uses bioscrape to simulate and plots the result
| Simulates the Subsystem model with the input species amounts varying
Uses bioscrape to simulate and plots the result | [
"Simulates",
"the",
"Subsystem",
"model",
"with",
"the",
"input",
"species",
"amounts",
"varying",
"Uses",
"bioscrape",
"to",
"simulate",
"and",
"plots",
"the",
"result"
] | def simulateVariableInputs(self, ListOfInputs, ListOfListOfAmounts, ListOfSpeciesToPlot, timepoints, mode = 'continue', xlabel = 'Time', ylabel = 'Concentration (AU)', sizeOfXLabels = 14, sizeOfYLabels = 14):
mpl.rc('axes', prop_cycle=(mpl.cycler('color', ['r', 'k', 'b','g','y','m','c']) ))
model = self... | [
"def",
"simulateVariableInputs",
"(",
"self",
",",
"ListOfInputs",
",",
"ListOfListOfAmounts",
",",
"ListOfSpeciesToPlot",
",",
"timepoints",
",",
"mode",
"=",
"'continue'",
",",
"xlabel",
"=",
"'Time'",
",",
"ylabel",
"=",
"'Concentration (AU)'",
",",
"sizeOfXLabel... | Simulates the Subsystem model with the input species amounts varying
Uses bioscrape to simulate and plots the result | [
"Simulates",
"the",
"Subsystem",
"model",
"with",
"the",
"input",
"species",
"amounts",
"varying",
"Uses",
"bioscrape",
"to",
"simulate",
"and",
"plots",
"the",
"result"
] | [
"''''\n Simulates the Subsystem model with the input species amounts varying \n Uses bioscrape to simulate and plots the result\n '''",
"# Start simulating and create data",
"# Start simulating and create data"
] | [
{
"param": "self",
"type": null
},
{
"param": "ListOfInputs",
"type": null
},
{
"param": "ListOfListOfAmounts",
"type": null
},
{
"param": "ListOfSpeciesToPlot",
"type": null
},
{
"param": "timepoints",
"type": null
},
{
"param": "mode",
"type": nu... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ListOfInputs",
"type": null,
"docstring": null,
"docstring_to... |
8a0d6fedb534898bdde2de0826637fe6492edd2c | murrayrm/txtlsim-python | txtl/component.py | [
"BSD-3-Clause"
] | Python | update_species | null | def update_species(self, mixture, concentration):
"""Update (or create) the set of species associated with this
component.
The update_species() function is responsible for generating
all of the species associated with this component, including
any species that are needed by comp... | Update (or create) the set of species associated with this
component.
The update_species() function is responsible for generating
all of the species associated with this component, including
any species that are needed by component-specific mechanisms.
| Update (or create) the set of species associated with this
component.
The update_species() function is responsible for generating
all of the species associated with this component, including
any species that are needed by component-specific mechanisms. | [
"Update",
"(",
"or",
"create",
")",
"the",
"set",
"of",
"species",
"associated",
"with",
"this",
"component",
".",
"The",
"update_species",
"()",
"function",
"is",
"responsible",
"for",
"generating",
"all",
"of",
"the",
"species",
"associated",
"with",
"this",... | def update_species(self, mixture, concentration):
mechanisms = get_mechanisms(mixture, self)
for name in mechanisms:
mechanism = mechanisms[name]
mechanism.update_species(mixture, self, concentration)
warn("component: default __init__ called for " + name) | [
"def",
"update_species",
"(",
"self",
",",
"mixture",
",",
"concentration",
")",
":",
"mechanisms",
"=",
"get_mechanisms",
"(",
"mixture",
",",
"self",
")",
"for",
"name",
"in",
"mechanisms",
":",
"mechanism",
"=",
"mechanisms",
"[",
"name",
"]",
"mechanism"... | Update (or create) the set of species associated with this
component. | [
"Update",
"(",
"or",
"create",
")",
"the",
"set",
"of",
"species",
"associated",
"with",
"this",
"component",
"."
] | [
"\"\"\"Update (or create) the set of species associated with this\n component.\n\n The update_species() function is responsible for generating\n all of the species associated with this component, including\n any species that are needed by component-specific mechanisms.\n\n \"\"\""... | [
{
"param": "self",
"type": null
},
{
"param": "mixture",
"type": null
},
{
"param": "concentration",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "mixture",
"type": null,
"docstring": null,
"docstring_tokens"... |
8a0d6fedb534898bdde2de0826637fe6492edd2c | murrayrm/txtlsim-python | txtl/component.py | [
"BSD-3-Clause"
] | Python | update_reactions | null | def update_reactions(self, mixture):
"""Update (or create) the set of reactions associated with this
component
The update_reactions() function is responsible for generating
all of the reactions associated with this component, including
any species that are needed by component-sp... | Update (or create) the set of reactions associated with this
component
The update_reactions() function is responsible for generating
all of the reactions associated with this component, including
any species that are needed by component-specific mechanisms.
| Update (or create) the set of reactions associated with this
component
The update_reactions() function is responsible for generating
all of the reactions associated with this component, including
any species that are needed by component-specific mechanisms. | [
"Update",
"(",
"or",
"create",
")",
"the",
"set",
"of",
"reactions",
"associated",
"with",
"this",
"component",
"The",
"update_reactions",
"()",
"function",
"is",
"responsible",
"for",
"generating",
"all",
"of",
"the",
"reactions",
"associated",
"with",
"this",
... | def update_reactions(self, mixture):
parameters = parameters.copy()
parameters.update(self.parameters)
mechanisms = get_mechanisms(mixture, component)
for name in mechanisms:
mechanism = mechanisms[name]
mechanism.update_reactions(mixture, component)
warn(... | [
"def",
"update_reactions",
"(",
"self",
",",
"mixture",
")",
":",
"parameters",
"=",
"parameters",
".",
"copy",
"(",
")",
"parameters",
".",
"update",
"(",
"self",
".",
"parameters",
")",
"mechanisms",
"=",
"get_mechanisms",
"(",
"mixture",
",",
"component",... | Update (or create) the set of reactions associated with this
component | [
"Update",
"(",
"or",
"create",
")",
"the",
"set",
"of",
"reactions",
"associated",
"with",
"this",
"component"
] | [
"\"\"\"Update (or create) the set of reactions associated with this\n component\n\n The update_reactions() function is responsible for generating\n all of the reactions associated with this component, including\n any species that are needed by component-specific mechanisms.\n\n \"... | [
{
"param": "self",
"type": null
},
{
"param": "mixture",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "mixture",
"type": null,
"docstring": null,
"docstring_tokens"... |
412418b3209fa3de05775dab6fdfc422626fea2f | murrayrm/txtlsim-python | BioSIMI-Python/modules/System.py | [
"BSD-3-Clause"
] | Python | appendSharedResources | null | def appendSharedResources(self, list):
'''
Append the list of resources to the
self.ListOfSharedResources
'''
for element in list:
if type(element) is str:
self.ListOfSharedResources.append(element)
else:
raise ValueErro... |
Append the list of resources to the
self.ListOfSharedResources
| Append the list of resources to the
self.ListOfSharedResources | [
"Append",
"the",
"list",
"of",
"resources",
"to",
"the",
"self",
".",
"ListOfSharedResources"
] | def appendSharedResources(self, list):
for element in list:
if type(element) is str:
self.ListOfSharedResources.append(element)
else:
raise ValueError('List element {0} is not a string'.format(element)) | [
"def",
"appendSharedResources",
"(",
"self",
",",
"list",
")",
":",
"for",
"element",
"in",
"list",
":",
"if",
"type",
"(",
"element",
")",
"is",
"str",
":",
"self",
".",
"ListOfSharedResources",
".",
"append",
"(",
"element",
")",
"else",
":",
"raise",
... | Append the list of resources to the
self.ListOfSharedResources | [
"Append",
"the",
"list",
"of",
"resources",
"to",
"the",
"self",
".",
"ListOfSharedResources"
] | [
"''' \n Append the list of resources to the \n self.ListOfSharedResources \n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "list",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "list",
"type": null,
"docstring": null,
"docstring_tokens": [... |
412418b3209fa3de05775dab6fdfc422626fea2f | murrayrm/txtlsim-python | BioSIMI-Python/modules/System.py | [
"BSD-3-Clause"
] | Python | removeSharedResource | null | def removeSharedResource(self, resource):
'''
Remove the given resource name from
self.ListOfSharedResources
'''
if type(resource) is str and resource in self.ListOfSharedResources:
self.ListOfSharedResources.remove(resource) |
Remove the given resource name from
self.ListOfSharedResources
| Remove the given resource name from
self.ListOfSharedResources | [
"Remove",
"the",
"given",
"resource",
"name",
"from",
"self",
".",
"ListOfSharedResources"
] | def removeSharedResource(self, resource):
if type(resource) is str and resource in self.ListOfSharedResources:
self.ListOfSharedResources.remove(resource) | [
"def",
"removeSharedResource",
"(",
"self",
",",
"resource",
")",
":",
"if",
"type",
"(",
"resource",
")",
"is",
"str",
"and",
"resource",
"in",
"self",
".",
"ListOfSharedResources",
":",
"self",
".",
"ListOfSharedResources",
".",
"remove",
"(",
"resource",
... | Remove the given resource name from
self.ListOfSharedResources | [
"Remove",
"the",
"given",
"resource",
"name",
"from",
"self",
".",
"ListOfSharedResources"
] | [
"''' \n Remove the given resource name from\n self.ListOfSharedResources\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "resource",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "resource",
"type": null,
"docstring": null,
"docstring_tokens... |
412418b3209fa3de05775dab6fdfc422626fea2f | murrayrm/txtlsim-python | BioSIMI-Python/modules/System.py | [
"BSD-3-Clause"
] | Python | createSubsystem | <not_specific> | def createSubsystem(self, filename, subsystemName = ''):
'''
Creates a new Subsystem object inside the System
with the SubsystemName suffixed to all elements of the given SBML filename
'''
# 1. Read the SBML model
# 2. Create an object of the Subsystem class with the SBMLDocumen... |
Creates a new Subsystem object inside the System
with the SubsystemName suffixed to all elements of the given SBML filename
| Creates a new Subsystem object inside the System
with the SubsystemName suffixed to all elements of the given SBML filename | [
"Creates",
"a",
"new",
"Subsystem",
"object",
"inside",
"the",
"System",
"with",
"the",
"SubsystemName",
"suffixed",
"to",
"all",
"elements",
"of",
"the",
"given",
"SBML",
"filename"
] | def createSubsystem(self, filename, subsystemName = ''):
name = self.getSystemName()
sbmlDoc = getFromXML(filename)
model = sbmlDoc.getModel()
subsystem = Subsystem(sbmlDoc)
subsystem.setSystem(self)
if subsystem.getSubsystemDoc().getLevel() != 3:
print('BioSI... | [
"def",
"createSubsystem",
"(",
"self",
",",
"filename",
",",
"subsystemName",
"=",
"''",
")",
":",
"name",
"=",
"self",
".",
"getSystemName",
"(",
")",
"sbmlDoc",
"=",
"getFromXML",
"(",
"filename",
")",
"model",
"=",
"sbmlDoc",
".",
"getModel",
"(",
")"... | Creates a new Subsystem object inside the System
with the SubsystemName suffixed to all elements of the given SBML filename | [
"Creates",
"a",
"new",
"Subsystem",
"object",
"inside",
"the",
"System",
"with",
"the",
"SubsystemName",
"suffixed",
"to",
"all",
"elements",
"of",
"the",
"given",
"SBML",
"filename"
] | [
"''' \n Creates a new Subsystem object inside the System\n with the SubsystemName suffixed to all elements of the given SBML filename\n '''",
"# 1. Read the SBML model",
"# 2. Create an object of the Subsystem class with the SBMLDocument read in Step 1",
"# handling sbml events --- incomp... | [
{
"param": "self",
"type": null
},
{
"param": "filename",
"type": null
},
{
"param": "subsystemName",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "filename",
"type": null,
"docstring": null,
"docstring_tokens... |
412418b3209fa3de05775dab6fdfc422626fea2f | murrayrm/txtlsim-python | BioSIMI-Python/modules/System.py | [
"BSD-3-Clause"
] | Python | createNewSubsystem | <not_specific> | def createNewSubsystem(self, level, version):
'''
Creates a new empty Subsystem object with SBMLDocument
of given level and version
'''
newDocument = createSbmlDoc(level,version)
subsystem = Subsystem(newDocument)
subsystem.setSystem(self)
return subsyste... |
Creates a new empty Subsystem object with SBMLDocument
of given level and version
| Creates a new empty Subsystem object with SBMLDocument
of given level and version | [
"Creates",
"a",
"new",
"empty",
"Subsystem",
"object",
"with",
"SBMLDocument",
"of",
"given",
"level",
"and",
"version"
] | def createNewSubsystem(self, level, version):
newDocument = createSbmlDoc(level,version)
subsystem = Subsystem(newDocument)
subsystem.setSystem(self)
return subsystem | [
"def",
"createNewSubsystem",
"(",
"self",
",",
"level",
",",
"version",
")",
":",
"newDocument",
"=",
"createSbmlDoc",
"(",
"level",
",",
"version",
")",
"subsystem",
"=",
"Subsystem",
"(",
"newDocument",
")",
"subsystem",
".",
"setSystem",
"(",
"self",
")",... | Creates a new empty Subsystem object with SBMLDocument
of given level and version | [
"Creates",
"a",
"new",
"empty",
"Subsystem",
"object",
"with",
"SBMLDocument",
"of",
"given",
"level",
"and",
"version"
] | [
"'''\n Creates a new empty Subsystem object with SBMLDocument \n of given level and version\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "level",
"type": null
},
{
"param": "version",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "level",
"type": null,
"docstring": null,
"docstring_tokens": ... |
412418b3209fa3de05775dab6fdfc422626fea2f | murrayrm/txtlsim-python | BioSIMI-Python/modules/System.py | [
"BSD-3-Clause"
] | Python | createNewSubsystem | <not_specific> | def createNewSubsystem(level, version):
'''
Creates a new empty Subsystem object with SBMLDocument
of given level and version
'''
newDocument = createSbmlDoc(level,version)
subsystem = Subsystem(newDocument)
return subsystem |
Creates a new empty Subsystem object with SBMLDocument
of given level and version
| Creates a new empty Subsystem object with SBMLDocument
of given level and version | [
"Creates",
"a",
"new",
"empty",
"Subsystem",
"object",
"with",
"SBMLDocument",
"of",
"given",
"level",
"and",
"version"
] | def createNewSubsystem(level, version):
newDocument = createSbmlDoc(level,version)
subsystem = Subsystem(newDocument)
return subsystem | [
"def",
"createNewSubsystem",
"(",
"level",
",",
"version",
")",
":",
"newDocument",
"=",
"createSbmlDoc",
"(",
"level",
",",
"version",
")",
"subsystem",
"=",
"Subsystem",
"(",
"newDocument",
")",
"return",
"subsystem"
] | Creates a new empty Subsystem object with SBMLDocument
of given level and version | [
"Creates",
"a",
"new",
"empty",
"Subsystem",
"object",
"with",
"SBMLDocument",
"of",
"given",
"level",
"and",
"version"
] | [
"'''\n Creates a new empty Subsystem object with SBMLDocument \n of given level and version\n '''"
] | [
{
"param": "level",
"type": null
},
{
"param": "version",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "level",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "version",
"type": null,
"docstring": null,
"docstring_tokens... |
5e4f1935e61deb91c06d432dfd1cb3916b28d513 | murrayrm/txtlsim-python | BioSIMI-Python/modules/NewReaction.py | [
"BSD-3-Clause"
] | Python | parseReactionString | <not_specific> | def parseReactionString(self, rStr):
'''
Parses the reaction string to return a list of reactants (and products), a list of
stoichiometry constants of the reactants (and products)
'''
rxn = self.getReaction()
if '-->' in rStr:
rReversible = False
elif... |
Parses the reaction string to return a list of reactants (and products), a list of
stoichiometry constants of the reactants (and products)
| Parses the reaction string to return a list of reactants (and products), a list of
stoichiometry constants of the reactants (and products) | [
"Parses",
"the",
"reaction",
"string",
"to",
"return",
"a",
"list",
"of",
"reactants",
"(",
"and",
"products",
")",
"a",
"list",
"of",
"stoichiometry",
"constants",
"of",
"the",
"reactants",
"(",
"and",
"products",
")"
] | def parseReactionString(self, rStr):
rxn = self.getReaction()
if '-->' in rStr:
rReversible = False
elif '<->' in rStr:
rReversible = True
check(rxn.setReversible(rReversible), 'set r_obj reversible')
if not rxn.isSetReversible():
raise SyntaxE... | [
"def",
"parseReactionString",
"(",
"self",
",",
"rStr",
")",
":",
"rxn",
"=",
"self",
".",
"getReaction",
"(",
")",
"if",
"'-->'",
"in",
"rStr",
":",
"rReversible",
"=",
"False",
"elif",
"'<->'",
"in",
"rStr",
":",
"rReversible",
"=",
"True",
"check",
... | Parses the reaction string to return a list of reactants (and products), a list of
stoichiometry constants of the reactants (and products) | [
"Parses",
"the",
"reaction",
"string",
"to",
"return",
"a",
"list",
"of",
"reactants",
"(",
"and",
"products",
")",
"a",
"list",
"of",
"stoichiometry",
"constants",
"of",
"the",
"reactants",
"(",
"and",
"products",
")"
] | [
"'''\n Parses the reaction string to return a list of reactants (and products), a list of \n stoichiometry constants of the reactants (and products)\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "rStr",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "rStr",
"type": null,
"docstring": null,
"docstring_tokens": [... |
5e4f1935e61deb91c06d432dfd1cb3916b28d513 | murrayrm/txtlsim-python | BioSIMI-Python/modules/NewReaction.py | [
"BSD-3-Clause"
] | Python | createNewReactant | <not_specific> | def createNewReactant(self, rtSpeciesId, rtConstant, rtStoichiometry):
'''
Creates a new Reactant inside the current Reaction object and returns the
SpeciesReference object to it
'''
species_ref_obj_reactant = self.getReaction().createReactant()
check(species_ref_obj_reac... |
Creates a new Reactant inside the current Reaction object and returns the
SpeciesReference object to it
| Creates a new Reactant inside the current Reaction object and returns the
SpeciesReference object to it | [
"Creates",
"a",
"new",
"Reactant",
"inside",
"the",
"current",
"Reaction",
"object",
"and",
"returns",
"the",
"SpeciesReference",
"object",
"to",
"it"
] | def createNewReactant(self, rtSpeciesId, rtConstant, rtStoichiometry):
species_ref_obj_reactant = self.getReaction().createReactant()
check(species_ref_obj_reactant,
'created species_ref_obj_reactant reactant')
check(species_ref_obj_reactant.setSpecies(
rtSpeciesId), 's... | [
"def",
"createNewReactant",
"(",
"self",
",",
"rtSpeciesId",
",",
"rtConstant",
",",
"rtStoichiometry",
")",
":",
"species_ref_obj_reactant",
"=",
"self",
".",
"getReaction",
"(",
")",
".",
"createReactant",
"(",
")",
"check",
"(",
"species_ref_obj_reactant",
",",... | Creates a new Reactant inside the current Reaction object and returns the
SpeciesReference object to it | [
"Creates",
"a",
"new",
"Reactant",
"inside",
"the",
"current",
"Reaction",
"object",
"and",
"returns",
"the",
"SpeciesReference",
"object",
"to",
"it"
] | [
"'''\n Creates a new Reactant inside the current Reaction object and returns the\n SpeciesReference object to it\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "rtSpeciesId",
"type": null
},
{
"param": "rtConstant",
"type": null
},
{
"param": "rtStoichiometry",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "rtSpeciesId",
"type": null,
"docstring": null,
"docstring_tok... |
5e4f1935e61deb91c06d432dfd1cb3916b28d513 | murrayrm/txtlsim-python | BioSIMI-Python/modules/NewReaction.py | [
"BSD-3-Clause"
] | Python | createNewProduct | <not_specific> | def createNewProduct(self, rtSpeciesId, rtConstant, rtStoichiometry):
'''
Creates a new Product inside the current Reaction object and returns the
SpeciesReference object to it
'''
species_ref_obj_product = self.getReaction().createProduct()
check(species_ref_obj_product,... |
Creates a new Product inside the current Reaction object and returns the
SpeciesReference object to it
| Creates a new Product inside the current Reaction object and returns the
SpeciesReference object to it | [
"Creates",
"a",
"new",
"Product",
"inside",
"the",
"current",
"Reaction",
"object",
"and",
"returns",
"the",
"SpeciesReference",
"object",
"to",
"it"
] | def createNewProduct(self, rtSpeciesId, rtConstant, rtStoichiometry):
species_ref_obj_product = self.getReaction().createProduct()
check(species_ref_obj_product, 'created species_ref_obj_product produc')
check(species_ref_obj_product.setSpecies(rtSpeciesId), 'set species_ref_obj_product ID')
... | [
"def",
"createNewProduct",
"(",
"self",
",",
"rtSpeciesId",
",",
"rtConstant",
",",
"rtStoichiometry",
")",
":",
"species_ref_obj_product",
"=",
"self",
".",
"getReaction",
"(",
")",
".",
"createProduct",
"(",
")",
"check",
"(",
"species_ref_obj_product",
",",
"... | Creates a new Product inside the current Reaction object and returns the
SpeciesReference object to it | [
"Creates",
"a",
"new",
"Product",
"inside",
"the",
"current",
"Reaction",
"object",
"and",
"returns",
"the",
"SpeciesReference",
"object",
"to",
"it"
] | [
"'''\n Creates a new Product inside the current Reaction object and returns the\n SpeciesReference object to it\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "rtSpeciesId",
"type": null
},
{
"param": "rtConstant",
"type": null
},
{
"param": "rtStoichiometry",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "rtSpeciesId",
"type": null,
"docstring": null,
"docstring_tok... |
5e4f1935e61deb91c06d432dfd1cb3916b28d513 | murrayrm/txtlsim-python | BioSIMI-Python/modules/NewReaction.py | [
"BSD-3-Clause"
] | Python | createRate | <not_specific> | def createRate(self, math_ast):
'''
Creates a new KineticLaw object inside the current Reaction and returns it.
The AST_Node object given as an argument in
math_ast is used to define the rate
'''
kinetic_law_reaction = self.getReaction().createKineticLaw()
check... |
Creates a new KineticLaw object inside the current Reaction and returns it.
The AST_Node object given as an argument in
math_ast is used to define the rate
| Creates a new KineticLaw object inside the current Reaction and returns it.
The AST_Node object given as an argument in
math_ast is used to define the rate | [
"Creates",
"a",
"new",
"KineticLaw",
"object",
"inside",
"the",
"current",
"Reaction",
"and",
"returns",
"it",
".",
"The",
"AST_Node",
"object",
"given",
"as",
"an",
"argument",
"in",
"math_ast",
"is",
"used",
"to",
"define",
"the",
"rate"
] | def createRate(self, math_ast):
kinetic_law_reaction = self.getReaction().createKineticLaw()
check(kinetic_law_reaction, 'create kinetic law')
check(kinetic_law_reaction.setMath(math_ast), 'set math on kinetic law')
return kinetic_law_reaction | [
"def",
"createRate",
"(",
"self",
",",
"math_ast",
")",
":",
"kinetic_law_reaction",
"=",
"self",
".",
"getReaction",
"(",
")",
".",
"createKineticLaw",
"(",
")",
"check",
"(",
"kinetic_law_reaction",
",",
"'create kinetic law'",
")",
"check",
"(",
"kinetic_law_... | Creates a new KineticLaw object inside the current Reaction and returns it. | [
"Creates",
"a",
"new",
"KineticLaw",
"object",
"inside",
"the",
"current",
"Reaction",
"and",
"returns",
"it",
"."
] | [
"'''\n Creates a new KineticLaw object inside the current Reaction and returns it.\n The AST_Node object given as an argument in \n math_ast is used to define the rate \n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "math_ast",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "math_ast",
"type": null,
"docstring": null,
"docstring_tokens... |
5e4f1935e61deb91c06d432dfd1cb3916b28d513 | murrayrm/txtlsim-python | BioSIMI-Python/modules/NewReaction.py | [
"BSD-3-Clause"
] | Python | createMath | <not_specific> | def createMath(self, formulaString):
'''
Creates a new math AST_Node using the formulaString given and returns it
'''
math_ast = parseL3Formula(formulaString)
check(math_ast, 'create AST for rate expression')
return math_ast |
Creates a new math AST_Node using the formulaString given and returns it
| Creates a new math AST_Node using the formulaString given and returns it | [
"Creates",
"a",
"new",
"math",
"AST_Node",
"using",
"the",
"formulaString",
"given",
"and",
"returns",
"it"
] | def createMath(self, formulaString):
math_ast = parseL3Formula(formulaString)
check(math_ast, 'create AST for rate expression')
return math_ast | [
"def",
"createMath",
"(",
"self",
",",
"formulaString",
")",
":",
"math_ast",
"=",
"parseL3Formula",
"(",
"formulaString",
")",
"check",
"(",
"math_ast",
",",
"'create AST for rate expression'",
")",
"return",
"math_ast"
] | Creates a new math AST_Node using the formulaString given and returns it | [
"Creates",
"a",
"new",
"math",
"AST_Node",
"using",
"the",
"formulaString",
"given",
"and",
"returns",
"it"
] | [
"''' \n Creates a new math AST_Node using the formulaString given and returns it \n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "formulaString",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "formulaString",
"type": null,
"docstring": null,
"docstring_t... |
5e4f1935e61deb91c06d432dfd1cb3916b28d513 | murrayrm/txtlsim-python | BioSIMI-Python/modules/NewReaction.py | [
"BSD-3-Clause"
] | Python | check | <not_specific> | def check(value, message):
"""If 'value' is None, prints an error message constructed using
'message' and then exits with status code 1. If 'value' is an integer,
it assumes it is a libSBML return status code. If the code value is
LIBSBML_OPERATION_SUCCESS, returns without further action; if it is not... | If 'value' is None, prints an error message constructed using
'message' and then exits with status code 1. If 'value' is an integer,
it assumes it is a libSBML return status code. If the code value is
LIBSBML_OPERATION_SUCCESS, returns without further action; if it is not,
prints an error message cons... | If 'value' is None, prints an error message constructed using
'message' and then exits with status code 1. If 'value' is an integer,
it assumes it is a libSBML return status code. If the code value is
LIBSBML_OPERATION_SUCCESS, returns without further action; if it is not,
prints an error message constructed using 'm... | [
"If",
"'",
"value",
"'",
"is",
"None",
"prints",
"an",
"error",
"message",
"constructed",
"using",
"'",
"message",
"'",
"and",
"then",
"exits",
"with",
"status",
"code",
"1",
".",
"If",
"'",
"value",
"'",
"is",
"an",
"integer",
"it",
"assumes",
"it",
... | def check(value, message):
if value == None:
raise SystemExit(
'LibSBML returned a null value trying to ' + message + '.')
elif type(value) is int:
if value == LIBSBML_OPERATION_SUCCESS:
return
else:
err_msg = 'Error encountered trying to ' + m... | [
"def",
"check",
"(",
"value",
",",
"message",
")",
":",
"if",
"value",
"==",
"None",
":",
"raise",
"SystemExit",
"(",
"'LibSBML returned a null value trying to '",
"+",
"message",
"+",
"'.'",
")",
"elif",
"type",
"(",
"value",
")",
"is",
"int",
":",
"if",
... | If 'value' is None, prints an error message constructed using
'message' and then exits with status code 1. | [
"If",
"'",
"value",
"'",
"is",
"None",
"prints",
"an",
"error",
"message",
"constructed",
"using",
"'",
"message",
"'",
"and",
"then",
"exits",
"with",
"status",
"code",
"1",
"."
] | [
"\"\"\"If 'value' is None, prints an error message constructed using\n 'message' and then exits with status code 1. If 'value' is an integer,\n it assumes it is a libSBML return status code. If the code value is\n LIBSBML_OPERATION_SUCCESS, returns without further action; if it is not,\n prints an err... | [
{
"param": "value",
"type": null
},
{
"param": "message",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "value",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "message",
"type": null,
"docstring": null,
"docstring_tokens... |
7ae0305555146006ee0df17730d5aa6ae460f8bb | murrayrm/txtlsim-python | BioSIMI-Python/modules/SimpleModel.py | [
"BSD-3-Clause"
] | Python | createNewUnitDefinition | <not_specific> | def createNewUnitDefinition(self, uid, ukind, exponent, scale, multiplier):
'''
Creates a new UnitDefinition inside the
Model with the given attributes and returns a pointer to the object created
'''
model = self.getModel()
unitdef = model.createUnitDefinition()
... |
Creates a new UnitDefinition inside the
Model with the given attributes and returns a pointer to the object created
| Creates a new UnitDefinition inside the
Model with the given attributes and returns a pointer to the object created | [
"Creates",
"a",
"new",
"UnitDefinition",
"inside",
"the",
"Model",
"with",
"the",
"given",
"attributes",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | def createNewUnitDefinition(self, uid, ukind, exponent, scale, multiplier):
model = self.getModel()
unitdef = model.createUnitDefinition()
check(unitdef, 'create unit definition')
check(unitdef.setId(uid), 'set unit definition id')
unit = unitdef.createUnit()
check(unit, ... | [
"def",
"createNewUnitDefinition",
"(",
"self",
",",
"uid",
",",
"ukind",
",",
"exponent",
",",
"scale",
",",
"multiplier",
")",
":",
"model",
"=",
"self",
".",
"getModel",
"(",
")",
"unitdef",
"=",
"model",
".",
"createUnitDefinition",
"(",
")",
"check",
... | Creates a new UnitDefinition inside the
Model with the given attributes and returns a pointer to the object created | [
"Creates",
"a",
"new",
"UnitDefinition",
"inside",
"the",
"Model",
"with",
"the",
"given",
"attributes",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | [
"''' \n Creates a new UnitDefinition inside the \n Model with the given attributes and returns a pointer to the object created\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "uid",
"type": null
},
{
"param": "ukind",
"type": null
},
{
"param": "exponent",
"type": null
},
{
"param": "scale",
"type": null
},
{
"param": "multiplier",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "uid",
"type": null,
"docstring": null,
"docstring_tokens": []... |
7ae0305555146006ee0df17730d5aa6ae460f8bb | murrayrm/txtlsim-python | BioSIMI-Python/modules/SimpleModel.py | [
"BSD-3-Clause"
] | Python | createNewCompartment | <not_specific> | def createNewCompartment(self, cId, cName, cSize, cUnits, cConstant):
'''
Creates a new Compartment in the Model and returns a pointer to the object created
'''
model = self.getModel()
check(model,'retreived model object')
comp_obj = model.createCompartment()
chec... |
Creates a new Compartment in the Model and returns a pointer to the object created
| Creates a new Compartment in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"Compartment",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | def createNewCompartment(self, cId, cName, cSize, cUnits, cConstant):
model = self.getModel()
check(model,'retreived model object')
comp_obj = model.createCompartment()
check(comp_obj, 'Create comp_obj compartment')
check(comp_obj.setId(cId), 'Set comp_obj id')
check(comp... | [
"def",
"createNewCompartment",
"(",
"self",
",",
"cId",
",",
"cName",
",",
"cSize",
",",
"cUnits",
",",
"cConstant",
")",
":",
"model",
"=",
"self",
".",
"getModel",
"(",
")",
"check",
"(",
"model",
",",
"'retreived model object'",
")",
"comp_obj",
"=",
... | Creates a new Compartment in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"Compartment",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | [
"'''\n Creates a new Compartment in the Model and returns a pointer to the object created\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "cId",
"type": null
},
{
"param": "cName",
"type": null
},
{
"param": "cSize",
"type": null
},
{
"param": "cUnits",
"type": null
},
{
"param": "cConstant",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cId",
"type": null,
"docstring": null,
"docstring_tokens": []... |
7ae0305555146006ee0df17730d5aa6ae460f8bb | murrayrm/txtlsim-python | BioSIMI-Python/modules/SimpleModel.py | [
"BSD-3-Clause"
] | Python | createNewSpecies | <not_specific> | def createNewSpecies(self, ListOfSpecies, sComp, ListOfAmounts, sConstant, sSubstance, sBoundary = False, sHasOnlySubstance = False):
'''
Creates new Species object inside the
Model with the given attributes and returns a pointer to the list of Species object created
'''
model ... |
Creates new Species object inside the
Model with the given attributes and returns a pointer to the list of Species object created
| Creates new Species object inside the
Model with the given attributes and returns a pointer to the list of Species object created | [
"Creates",
"new",
"Species",
"object",
"inside",
"the",
"Model",
"with",
"the",
"given",
"attributes",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"list",
"of",
"Species",
"object",
"created"
] | def createNewSpecies(self, ListOfSpecies, sComp, ListOfAmounts, sConstant, sSubstance, sBoundary = False, sHasOnlySubstance = False):
model = self.getModel()
allIds = self.getAllIds()
trans = SetIdFromNames(allIds)
check(model,'retreived model object')
amount = []
species... | [
"def",
"createNewSpecies",
"(",
"self",
",",
"ListOfSpecies",
",",
"sComp",
",",
"ListOfAmounts",
",",
"sConstant",
",",
"sSubstance",
",",
"sBoundary",
"=",
"False",
",",
"sHasOnlySubstance",
"=",
"False",
")",
":",
"model",
"=",
"self",
".",
"getModel",
"(... | Creates new Species object inside the
Model with the given attributes and returns a pointer to the list of Species object created | [
"Creates",
"new",
"Species",
"object",
"inside",
"the",
"Model",
"with",
"the",
"given",
"attributes",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"list",
"of",
"Species",
"object",
"created"
] | [
"''' \n Creates new Species object inside the \n Model with the given attributes and returns a pointer to the list of Species object created\n '''",
"# Multiple species"
] | [
{
"param": "self",
"type": null
},
{
"param": "ListOfSpecies",
"type": null
},
{
"param": "sComp",
"type": null
},
{
"param": "ListOfAmounts",
"type": null
},
{
"param": "sConstant",
"type": null
},
{
"param": "sSubstance",
"type": null
},
{
... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ListOfSpecies",
"type": null,
"docstring": null,
"docstring_t... |
7ae0305555146006ee0df17730d5aa6ae460f8bb | murrayrm/txtlsim-python | BioSIMI-Python/modules/SimpleModel.py | [
"BSD-3-Clause"
] | Python | createNewParameter | <not_specific> | def createNewParameter(self, ListOfParameters, ListOfValues, pConstant, pUnit):
'''
Creates new Parameter object inside the
Model with the given attributes and returns pointer to the list of Parameter object created
'''
model = self.getModel()
allIds = self.getAllIds()
... |
Creates new Parameter object inside the
Model with the given attributes and returns pointer to the list of Parameter object created
| Creates new Parameter object inside the
Model with the given attributes and returns pointer to the list of Parameter object created | [
"Creates",
"new",
"Parameter",
"object",
"inside",
"the",
"Model",
"with",
"the",
"given",
"attributes",
"and",
"returns",
"pointer",
"to",
"the",
"list",
"of",
"Parameter",
"object",
"created"
] | def createNewParameter(self, ListOfParameters, ListOfValues, pConstant, pUnit):
model = self.getModel()
allIds = self.getAllIds()
trans = SetIdFromNames(allIds)
check(model,'retreived model object')
values = []
parametersList = []
if (type(ListOfParameters) is str... | [
"def",
"createNewParameter",
"(",
"self",
",",
"ListOfParameters",
",",
"ListOfValues",
",",
"pConstant",
",",
"pUnit",
")",
":",
"model",
"=",
"self",
".",
"getModel",
"(",
")",
"allIds",
"=",
"self",
".",
"getAllIds",
"(",
")",
"trans",
"=",
"SetIdFromNa... | Creates new Parameter object inside the
Model with the given attributes and returns pointer to the list of Parameter object created | [
"Creates",
"new",
"Parameter",
"object",
"inside",
"the",
"Model",
"with",
"the",
"given",
"attributes",
"and",
"returns",
"pointer",
"to",
"the",
"list",
"of",
"Parameter",
"object",
"created"
] | [
"''' \n Creates new Parameter object inside the \n Model with the given attributes and returns pointer to the list of Parameter object created\n '''",
"# Multiple parameters "
] | [
{
"param": "self",
"type": null
},
{
"param": "ListOfParameters",
"type": null
},
{
"param": "ListOfValues",
"type": null
},
{
"param": "pConstant",
"type": null
},
{
"param": "pUnit",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ListOfParameters",
"type": null,
"docstring": null,
"docstrin... |
7ae0305555146006ee0df17730d5aa6ae460f8bb | murrayrm/txtlsim-python | BioSIMI-Python/modules/SimpleModel.py | [
"BSD-3-Clause"
] | Python | createNewReaction | <not_specific> | def createNewReaction(self, rId, rStr, rRate, rFast = False, isConstant = False):
'''
Creates a new Reaction object inside the
Model with the given attributes and returns a pointer to the Reaction object created
'''
model = self.getModel()
check(model,'retreived model o... |
Creates a new Reaction object inside the
Model with the given attributes and returns a pointer to the Reaction object created
| Creates a new Reaction object inside the
Model with the given attributes and returns a pointer to the Reaction object created | [
"Creates",
"a",
"new",
"Reaction",
"object",
"inside",
"the",
"Model",
"with",
"the",
"given",
"attributes",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"Reaction",
"object",
"created"
] | def createNewReaction(self, rId, rStr, rRate, rFast = False, isConstant = False):
model = self.getModel()
check(model,'retreived model object')
r_obj = model.createReaction()
check(r_obj, 'created r_obj reaction')
check(r_obj.setId(rId), 'set r_obj ID')
check(r_obj.setFas... | [
"def",
"createNewReaction",
"(",
"self",
",",
"rId",
",",
"rStr",
",",
"rRate",
",",
"rFast",
"=",
"False",
",",
"isConstant",
"=",
"False",
")",
":",
"model",
"=",
"self",
".",
"getModel",
"(",
")",
"check",
"(",
"model",
",",
"'retreived model object'"... | Creates a new Reaction object inside the
Model with the given attributes and returns a pointer to the Reaction object created | [
"Creates",
"a",
"new",
"Reaction",
"object",
"inside",
"the",
"Model",
"with",
"the",
"given",
"attributes",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"Reaction",
"object",
"created"
] | [
"''' \n Creates a new Reaction object inside the \n Model with the given attributes and returns a pointer to the Reaction object created\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "rId",
"type": null
},
{
"param": "rStr",
"type": null
},
{
"param": "rRate",
"type": null
},
{
"param": "rFast",
"type": null
},
{
"param": "isConstant",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "rId",
"type": null,
"docstring": null,
"docstring_tokens": []... |
7ae0305555146006ee0df17730d5aa6ae460f8bb | murrayrm/txtlsim-python | BioSIMI-Python/modules/SimpleModel.py | [
"BSD-3-Clause"
] | Python | createNewConstraint | <not_specific> | def createNewConstraint(self, formulaString, msg = 'Constraint not satisfied for the model', name = ''):
'''
Creates a new Constraint in the Model and returns a pointer to the object created
'''
model = self.getModel()
check(model,'retreived model object')
constr = model.... |
Creates a new Constraint in the Model and returns a pointer to the object created
| Creates a new Constraint in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"Constraint",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | def createNewConstraint(self, formulaString, msg = 'Constraint not satisfied for the model', name = ''):
model = self.getModel()
check(model,'retreived model object')
constr = model.createConstraint()
check(constr, 'creating a new constraint inside the model')
astMath = parseL3Fo... | [
"def",
"createNewConstraint",
"(",
"self",
",",
"formulaString",
",",
"msg",
"=",
"'Constraint not satisfied for the model'",
",",
"name",
"=",
"''",
")",
":",
"model",
"=",
"self",
".",
"getModel",
"(",
")",
"check",
"(",
"model",
",",
"'retreived model object'... | Creates a new Constraint in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"Constraint",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | [
"'''\n Creates a new Constraint in the Model and returns a pointer to the object created\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "formulaString",
"type": null
},
{
"param": "msg",
"type": null
},
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "formulaString",
"type": null,
"docstring": null,
"docstring_t... |
7ae0305555146006ee0df17730d5aa6ae460f8bb | murrayrm/txtlsim-python | BioSIMI-Python/modules/SimpleModel.py | [
"BSD-3-Clause"
] | Python | createNewEvent | <not_specific> | def createNewEvent(self, id, trigger_persistent, trigger_initialValue,
trigger_formula, variable_id, assignment_formula, delay_formula = '',
priority_formula = '', useValuesFromTriggerTime = True, name = ''):
'''
Creates a new Event in the Model and returns a pointer to the object crea... |
Creates a new Event in the Model and returns a pointer to the object created
| Creates a new Event in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"Event",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | def createNewEvent(self, id, trigger_persistent, trigger_initialValue,
trigger_formula, variable_id, assignment_formula, delay_formula = '',
priority_formula = '', useValuesFromTriggerTime = True, name = ''):
model = self.getModel()
check(model,'retreived model object')
e = mod... | [
"def",
"createNewEvent",
"(",
"self",
",",
"id",
",",
"trigger_persistent",
",",
"trigger_initialValue",
",",
"trigger_formula",
",",
"variable_id",
",",
"assignment_formula",
",",
"delay_formula",
"=",
"''",
",",
"priority_formula",
"=",
"''",
",",
"useValuesFromTr... | Creates a new Event in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"Event",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | [
"'''\n Creates a new Event in the Model and returns a pointer to the object created\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
},
{
"param": "trigger_persistent",
"type": null
},
{
"param": "trigger_initialValue",
"type": null
},
{
"param": "trigger_formula",
"type": null
},
{
"param": "variable_id",
"type": ... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
7ae0305555146006ee0df17730d5aa6ae460f8bb | murrayrm/txtlsim-python | BioSIMI-Python/modules/SimpleModel.py | [
"BSD-3-Clause"
] | Python | createNewInitialAssignment | <not_specific> | def createNewInitialAssignment(self, symbol, initialAssignment_formula):
'''
Creates a new InitialAssignment in the Model and returns a pointer to the object created
'''
model = self.getModel()
check(model,'retreived model object')
init_asmt = model.createInitialAssignmen... |
Creates a new InitialAssignment in the Model and returns a pointer to the object created
| Creates a new InitialAssignment in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"InitialAssignment",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | def createNewInitialAssignment(self, symbol, initialAssignment_formula):
model = self.getModel()
check(model,'retreived model object')
init_asmt = model.createInitialAssignment()
check(init_asmt,'creating new initial assignment inside the model')
check(init_asmt.setSymbol(symbol)... | [
"def",
"createNewInitialAssignment",
"(",
"self",
",",
"symbol",
",",
"initialAssignment_formula",
")",
":",
"model",
"=",
"self",
".",
"getModel",
"(",
")",
"check",
"(",
"model",
",",
"'retreived model object'",
")",
"init_asmt",
"=",
"model",
".",
"createInit... | Creates a new InitialAssignment in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"InitialAssignment",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | [
"'''\n Creates a new InitialAssignment in the Model and returns a pointer to the object created\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "symbol",
"type": null
},
{
"param": "initialAssignment_formula",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "symbol",
"type": null,
"docstring": null,
"docstring_tokens":... |
7ae0305555146006ee0df17730d5aa6ae460f8bb | murrayrm/txtlsim-python | BioSIMI-Python/modules/SimpleModel.py | [
"BSD-3-Clause"
] | Python | createNewAssignmentRule | <not_specific> | def createNewAssignmentRule(self, variable_id, assignmentRule_formula):
'''
Creates a new AssignmentRule in the Model and returns a pointer to the object created
'''
model = self.getModel()
check(model,'retreived model object')
asmt = model.createAssignmentRule()
... |
Creates a new AssignmentRule in the Model and returns a pointer to the object created
| Creates a new AssignmentRule in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"AssignmentRule",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | def createNewAssignmentRule(self, variable_id, assignmentRule_formula):
model = self.getModel()
check(model,'retreived model object')
asmt = model.createAssignmentRule()
check(asmt, 'creating new assignment rule in the model')
check(asmt.setFormula(assignmentRule_formula), 'setti... | [
"def",
"createNewAssignmentRule",
"(",
"self",
",",
"variable_id",
",",
"assignmentRule_formula",
")",
":",
"model",
"=",
"self",
".",
"getModel",
"(",
")",
"check",
"(",
"model",
",",
"'retreived model object'",
")",
"asmt",
"=",
"model",
".",
"createAssignment... | Creates a new AssignmentRule in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"AssignmentRule",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | [
"'''\n Creates a new AssignmentRule in the Model and returns a pointer to the object created\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "variable_id",
"type": null
},
{
"param": "assignmentRule_formula",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "variable_id",
"type": null,
"docstring": null,
"docstring_tok... |
7ae0305555146006ee0df17730d5aa6ae460f8bb | murrayrm/txtlsim-python | BioSIMI-Python/modules/SimpleModel.py | [
"BSD-3-Clause"
] | Python | createNewRateRule | <not_specific> | def createNewRateRule(self, variable_id, rateRule_formula):
'''
Creates a new RateRule in the Model and returns a pointer to the object created
'''
model = self.getModel()
check(model,'retreived model object')
rateRule = model.createRateRule()
check(rateRule, 'cre... |
Creates a new RateRule in the Model and returns a pointer to the object created
| Creates a new RateRule in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"RateRule",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | def createNewRateRule(self, variable_id, rateRule_formula):
model = self.getModel()
check(model,'retreived model object')
rateRule = model.createRateRule()
check(rateRule, 'creating a new rate rule inside the model')
check(rateRule.setFormula(rateRule_formula), 'setting the formu... | [
"def",
"createNewRateRule",
"(",
"self",
",",
"variable_id",
",",
"rateRule_formula",
")",
":",
"model",
"=",
"self",
".",
"getModel",
"(",
")",
"check",
"(",
"model",
",",
"'retreived model object'",
")",
"rateRule",
"=",
"model",
".",
"createRateRule",
"(",
... | Creates a new RateRule in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"RateRule",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | [
"'''\n Creates a new RateRule in the Model and returns a pointer to the object created\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "variable_id",
"type": null
},
{
"param": "rateRule_formula",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "variable_id",
"type": null,
"docstring": null,
"docstring_tok... |
7ae0305555146006ee0df17730d5aa6ae460f8bb | murrayrm/txtlsim-python | BioSIMI-Python/modules/SimpleModel.py | [
"BSD-3-Clause"
] | Python | createNewAlgebraicRule | <not_specific> | def createNewAlgebraicRule(self, variable_id, algebraicRule_formula):
'''
Creates a new AlgebraicRule in the Model and returnsa pointer to the object created
'''
model = self.getModel()
check(model,'retreived model object')
algbRule = model.createAlgebraicRule()
c... |
Creates a new AlgebraicRule in the Model and returnsa pointer to the object created
| Creates a new AlgebraicRule in the Model and returnsa pointer to the object created | [
"Creates",
"a",
"new",
"AlgebraicRule",
"in",
"the",
"Model",
"and",
"returnsa",
"pointer",
"to",
"the",
"object",
"created"
] | def createNewAlgebraicRule(self, variable_id, algebraicRule_formula):
model = self.getModel()
check(model,'retreived model object')
algbRule = model.createAlgebraicRule()
check(algbRule, 'creating new algebraic rule inside the model')
check(algbRule.setFormula(algebraicRule_formu... | [
"def",
"createNewAlgebraicRule",
"(",
"self",
",",
"variable_id",
",",
"algebraicRule_formula",
")",
":",
"model",
"=",
"self",
".",
"getModel",
"(",
")",
"check",
"(",
"model",
",",
"'retreived model object'",
")",
"algbRule",
"=",
"model",
".",
"createAlgebrai... | Creates a new AlgebraicRule in the Model and returnsa pointer to the object created | [
"Creates",
"a",
"new",
"AlgebraicRule",
"in",
"the",
"Model",
"and",
"returnsa",
"pointer",
"to",
"the",
"object",
"created"
] | [
"'''\n Creates a new AlgebraicRule in the Model and returnsa pointer to the object created\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "variable_id",
"type": null
},
{
"param": "algebraicRule_formula",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "variable_id",
"type": null,
"docstring": null,
"docstring_tok... |
7ae0305555146006ee0df17730d5aa6ae460f8bb | murrayrm/txtlsim-python | BioSIMI-Python/modules/SimpleModel.py | [
"BSD-3-Clause"
] | Python | createNewFunctionDefinition | <not_specific> | def createNewFunctionDefinition(self, id, functionDefinition_formula, name = ''):
'''
Creates a new FunctionDefinition in the Model and returns a pointer to the object created
'''
model = self.getModel()
check(model,'retreived model object')
func_def = model.createFunctio... |
Creates a new FunctionDefinition in the Model and returns a pointer to the object created
| Creates a new FunctionDefinition in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"FunctionDefinition",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | def createNewFunctionDefinition(self, id, functionDefinition_formula, name = ''):
model = self.getModel()
check(model,'retreived model object')
func_def = model.createFunctionDefinition()
check(func_def, 'creating a new function definition inside the model')
check(func_def.setId(... | [
"def",
"createNewFunctionDefinition",
"(",
"self",
",",
"id",
",",
"functionDefinition_formula",
",",
"name",
"=",
"''",
")",
":",
"model",
"=",
"self",
".",
"getModel",
"(",
")",
"check",
"(",
"model",
",",
"'retreived model object'",
")",
"func_def",
"=",
... | Creates a new FunctionDefinition in the Model and returns a pointer to the object created | [
"Creates",
"a",
"new",
"FunctionDefinition",
"in",
"the",
"Model",
"and",
"returns",
"a",
"pointer",
"to",
"the",
"object",
"created"
] | [
"'''\n Creates a new FunctionDefinition in the Model and returns a pointer to the object created\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
},
{
"param": "functionDefinition_formula",
"type": null
},
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
7cbc91359ab8e320ec6c9d592aac076b017a18be | murrayrm/txtlsim-python | BioSIMI-Python/modules/utilityFunctions.py | [
"BSD-3-Clause"
] | Python | createSbmlDoc | <not_specific> | def createSbmlDoc(newLevel, newVersion):
'''
Creates a new SBMLDocument ojbect of the given newLevel and newVersion
'''
try:
sbmlDoc = SBMLDocument(newLevel, newVersion)
except ValueError:
print('Could not create SBMLDocument object')
sys.exit(1)
return sbmlDoc |
Creates a new SBMLDocument ojbect of the given newLevel and newVersion
| Creates a new SBMLDocument ojbect of the given newLevel and newVersion | [
"Creates",
"a",
"new",
"SBMLDocument",
"ojbect",
"of",
"the",
"given",
"newLevel",
"and",
"newVersion"
] | def createSbmlDoc(newLevel, newVersion):
try:
sbmlDoc = SBMLDocument(newLevel, newVersion)
except ValueError:
print('Could not create SBMLDocument object')
sys.exit(1)
return sbmlDoc | [
"def",
"createSbmlDoc",
"(",
"newLevel",
",",
"newVersion",
")",
":",
"try",
":",
"sbmlDoc",
"=",
"SBMLDocument",
"(",
"newLevel",
",",
"newVersion",
")",
"except",
"ValueError",
":",
"print",
"(",
"'Could not create SBMLDocument object'",
")",
"sys",
".",
"exit... | Creates a new SBMLDocument ojbect of the given newLevel and newVersion | [
"Creates",
"a",
"new",
"SBMLDocument",
"ojbect",
"of",
"the",
"given",
"newLevel",
"and",
"newVersion"
] | [
"''' \n Creates a new SBMLDocument ojbect of the given newLevel and newVersion\n '''"
] | [
{
"param": "newLevel",
"type": null
},
{
"param": "newVersion",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "newLevel",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "newVersion",
"type": null,
"docstring": null,
"docstring_... |
7cbc91359ab8e320ec6c9d592aac076b017a18be | murrayrm/txtlsim-python | BioSIMI-Python/modules/utilityFunctions.py | [
"BSD-3-Clause"
] | Python | plotSbmlWithBioscrape | <not_specific> | def plotSbmlWithBioscrape(ListOfFiles, initialTime, timepoints, ListOfListOfSpeciesToPlot, xlabel = 'Time', ylabel = 'Concentration (AU)', sizeOfXLabels = 14, sizeOfYLabels = 14):
'''
Plots the amounts of ListOfSpeciesToPlot in the given SBML files
starting at initialTime and for the timepoints given.
... |
Plots the amounts of ListOfSpeciesToPlot in the given SBML files
starting at initialTime and for the timepoints given.
The other arguments for axes labels and sizes are optional.
If a list of files is given, then corresponding list of list of species is
used to plot the corresponding list of sp... | Plots the amounts of ListOfSpeciesToPlot in the given SBML files
starting at initialTime and for the timepoints given.
The other arguments for axes labels and sizes are optional.
If a list of files is given, then corresponding list of list of species is
used to plot the corresponding list of species for each SBML model... | [
"Plots",
"the",
"amounts",
"of",
"ListOfSpeciesToPlot",
"in",
"the",
"given",
"SBML",
"files",
"starting",
"at",
"initialTime",
"and",
"for",
"the",
"timepoints",
"given",
".",
"The",
"other",
"arguments",
"for",
"axes",
"labels",
"and",
"sizes",
"are",
"optio... | def plotSbmlWithBioscrape(ListOfFiles, initialTime, timepoints, ListOfListOfSpeciesToPlot, xlabel = 'Time', ylabel = 'Concentration (AU)', sizeOfXLabels = 14, sizeOfYLabels = 14):
mpl.rc('axes', prop_cycle=(mpl.cycler('color', ['r', 'k', 'b','g','y','m','c']) ))
mpl.rc('xtick', labelsize=sizeOfXLabels)
mpl... | [
"def",
"plotSbmlWithBioscrape",
"(",
"ListOfFiles",
",",
"initialTime",
",",
"timepoints",
",",
"ListOfListOfSpeciesToPlot",
",",
"xlabel",
"=",
"'Time'",
",",
"ylabel",
"=",
"'Concentration (AU)'",
",",
"sizeOfXLabels",
"=",
"14",
",",
"sizeOfYLabels",
"=",
"14",
... | Plots the amounts of ListOfSpeciesToPlot in the given SBML files
starting at initialTime and for the timepoints given. | [
"Plots",
"the",
"amounts",
"of",
"ListOfSpeciesToPlot",
"in",
"the",
"given",
"SBML",
"files",
"starting",
"at",
"initialTime",
"and",
"for",
"the",
"timepoints",
"given",
"."
] | [
"''' \n Plots the amounts of ListOfSpeciesToPlot in the given SBML files \n starting at initialTime and for the timepoints given. \n The other arguments for axes labels and sizes are optional.\n If a list of files is given, then corresponding list of list of species is \n used to plot the correspondi... | [
{
"param": "ListOfFiles",
"type": null
},
{
"param": "initialTime",
"type": null
},
{
"param": "timepoints",
"type": null
},
{
"param": "ListOfListOfSpeciesToPlot",
"type": null
},
{
"param": "xlabel",
"type": null
},
{
"param": "ylabel",
"type": n... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ListOfFiles",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "initialTime",
"type": null,
"docstring": null,
"docstr... |
54eba2da8df319c9d593ebc942acd32ee88f548d | neuronflow/torchio | torchio/transforms/preprocessing/spatial/resample.py | [
"MIT"
] | Python | parse_target | TypeTarget | def parse_target(
self,
target: Union[TypeSpacing, str],
) -> TypeTarget:
"""
If target is an existing path, return a torchio.ScalarImage
If it does not exist, return the string
If it is not a Path or string, return None
"""
if isinstan... |
If target is an existing path, return a torchio.ScalarImage
If it does not exist, return the string
If it is not a Path or string, return None
| If target is an existing path, return a torchio.ScalarImage
If it does not exist, return the string
If it is not a Path or string, return None | [
"If",
"target",
"is",
"an",
"existing",
"path",
"return",
"a",
"torchio",
".",
"ScalarImage",
"If",
"it",
"does",
"not",
"exist",
"return",
"the",
"string",
"If",
"it",
"is",
"not",
"a",
"Path",
"or",
"string",
"return",
"None"
] | def parse_target(
self,
target: Union[TypeSpacing, str],
) -> TypeTarget:
if isinstance(target, (str, Path)):
if Path(target).is_file():
path = target
reference_image = ScalarImage(path)
else:
reference_i... | [
"def",
"parse_target",
"(",
"self",
",",
"target",
":",
"Union",
"[",
"TypeSpacing",
",",
"str",
"]",
",",
")",
"->",
"TypeTarget",
":",
"if",
"isinstance",
"(",
"target",
",",
"(",
"str",
",",
"Path",
")",
")",
":",
"if",
"Path",
"(",
"target",
")... | If target is an existing path, return a torchio.ScalarImage
If it does not exist, return the string
If it is not a Path or string, return None | [
"If",
"target",
"is",
"an",
"existing",
"path",
"return",
"a",
"torchio",
".",
"ScalarImage",
"If",
"it",
"does",
"not",
"exist",
"return",
"the",
"string",
"If",
"it",
"is",
"not",
"a",
"Path",
"or",
"string",
"return",
"None"
] | [
"\"\"\"\n If target is an existing path, return a torchio.ScalarImage\n If it does not exist, return the string\n If it is not a Path or string, return None\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "target",
"type": "Union[TypeSpacing, str]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "target",
"type": "Union[TypeSpacing, str]",
"docstring": null,
... |
2ec8f3e1c0d456d9b817dd9cd049262dad22cc14 | neuronflow/torchio | torchio/data/subject.py | [
"MIT"
] | Python | shape | <not_specific> | def shape(self):
"""Return shape of first image in subject.
Consistency of shapes across images in the subject is checked first.
"""
self.check_consistent_attribute('shape')
return self.get_first_image().shape | Return shape of first image in subject.
Consistency of shapes across images in the subject is checked first.
| Return shape of first image in subject.
Consistency of shapes across images in the subject is checked first. | [
"Return",
"shape",
"of",
"first",
"image",
"in",
"subject",
".",
"Consistency",
"of",
"shapes",
"across",
"images",
"in",
"the",
"subject",
"is",
"checked",
"first",
"."
] | def shape(self):
self.check_consistent_attribute('shape')
return self.get_first_image().shape | [
"def",
"shape",
"(",
"self",
")",
":",
"self",
".",
"check_consistent_attribute",
"(",
"'shape'",
")",
"return",
"self",
".",
"get_first_image",
"(",
")",
".",
"shape"
] | Return shape of first image in subject. | [
"Return",
"shape",
"of",
"first",
"image",
"in",
"subject",
"."
] | [
"\"\"\"Return shape of first image in subject.\n\n Consistency of shapes across images in the subject is checked first.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2ec8f3e1c0d456d9b817dd9cd049262dad22cc14 | neuronflow/torchio | torchio/data/subject.py | [
"MIT"
] | Python | spatial_shape | <not_specific> | def spatial_shape(self):
"""Return spatial shape of first image in subject.
Consistency of spatial shapes across images in the subject is checked
first.
"""
self.check_consistent_spatial_shape()
return self.get_first_image().spatial_shape | Return spatial shape of first image in subject.
Consistency of spatial shapes across images in the subject is checked
first.
| Return spatial shape of first image in subject.
Consistency of spatial shapes across images in the subject is checked
first. | [
"Return",
"spatial",
"shape",
"of",
"first",
"image",
"in",
"subject",
".",
"Consistency",
"of",
"spatial",
"shapes",
"across",
"images",
"in",
"the",
"subject",
"is",
"checked",
"first",
"."
] | def spatial_shape(self):
self.check_consistent_spatial_shape()
return self.get_first_image().spatial_shape | [
"def",
"spatial_shape",
"(",
"self",
")",
":",
"self",
".",
"check_consistent_spatial_shape",
"(",
")",
"return",
"self",
".",
"get_first_image",
"(",
")",
".",
"spatial_shape"
] | Return spatial shape of first image in subject. | [
"Return",
"spatial",
"shape",
"of",
"first",
"image",
"in",
"subject",
"."
] | [
"\"\"\"Return spatial shape of first image in subject.\n\n Consistency of spatial shapes across images in the subject is checked\n first.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2ec8f3e1c0d456d9b817dd9cd049262dad22cc14 | neuronflow/torchio | torchio/data/subject.py | [
"MIT"
] | Python | spacing | <not_specific> | def spacing(self):
"""Return spacing of first image in subject.
Consistency of spacings across images in the subject is checked first.
"""
self.check_consistent_attribute('spacing')
return self.get_first_image().spacing | Return spacing of first image in subject.
Consistency of spacings across images in the subject is checked first.
| Return spacing of first image in subject.
Consistency of spacings across images in the subject is checked first. | [
"Return",
"spacing",
"of",
"first",
"image",
"in",
"subject",
".",
"Consistency",
"of",
"spacings",
"across",
"images",
"in",
"the",
"subject",
"is",
"checked",
"first",
"."
] | def spacing(self):
self.check_consistent_attribute('spacing')
return self.get_first_image().spacing | [
"def",
"spacing",
"(",
"self",
")",
":",
"self",
".",
"check_consistent_attribute",
"(",
"'spacing'",
")",
"return",
"self",
".",
"get_first_image",
"(",
")",
".",
"spacing"
] | Return spacing of first image in subject. | [
"Return",
"spacing",
"of",
"first",
"image",
"in",
"subject",
"."
] | [
"\"\"\"Return spacing of first image in subject.\n\n Consistency of spacings across images in the subject is checked first.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
8477174d79ecda1ce8c074d47dcdc0688807e094 | neuronflow/torchio | torchio/utils.py | [
"MIT"
] | Python | nib_to_sitk | sitk.Image | def nib_to_sitk(
data: TypeData,
affine: TypeData,
squeeze: bool = False,
force_3d: bool = False,
force_4d: bool = False,
) -> sitk.Image:
"""Create a SimpleITK image from a tensor and a 4x4 affine matrix.
Args:
data: PyTorch tensor or NumPy array
... | Create a SimpleITK image from a tensor and a 4x4 affine matrix.
Args:
data: PyTorch tensor or NumPy array
affine: # TODO
| Create a SimpleITK image from a tensor and a 4x4 affine matrix. | [
"Create",
"a",
"SimpleITK",
"image",
"from",
"a",
"tensor",
"and",
"a",
"4x4",
"affine",
"matrix",
"."
] | def nib_to_sitk(
data: TypeData,
affine: TypeData,
squeeze: bool = False,
force_3d: bool = False,
force_4d: bool = False,
) -> sitk.Image:
if data.ndim != 4:
raise ValueError(f'Input must be 4D, but has shape {tuple(data.shape)}')
array = np.asarray(data)
... | [
"def",
"nib_to_sitk",
"(",
"data",
":",
"TypeData",
",",
"affine",
":",
"TypeData",
",",
"squeeze",
":",
"bool",
"=",
"False",
",",
"force_3d",
":",
"bool",
"=",
"False",
",",
"force_4d",
":",
"bool",
"=",
"False",
",",
")",
"->",
"sitk",
".",
"Image... | Create a SimpleITK image from a tensor and a 4x4 affine matrix. | [
"Create",
"a",
"SimpleITK",
"image",
"from",
"a",
"tensor",
"and",
"a",
"4x4",
"affine",
"matrix",
"."
] | [
"\"\"\"Create a SimpleITK image from a tensor and a 4x4 affine matrix.\n\n Args:\n data: PyTorch tensor or NumPy array\n affine: # TODO\n \"\"\"",
"# Possibilities",
"# (1, w, h, 1)",
"# (c, w, h, 1)",
"# (1, w, h, 1)",
"# (c, w, h, d)",
"# (W, H, D, C) or (W, H, D)",
"# ignore fir... | [
{
"param": "data",
"type": "TypeData"
},
{
"param": "affine",
"type": "TypeData"
},
{
"param": "squeeze",
"type": "bool"
},
{
"param": "force_3d",
"type": "bool"
},
{
"param": "force_4d",
"type": "bool"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "data",
"type": "TypeData",
"docstring": "PyTorch tensor or NumPy array",
"docstring_tokens": [
"PyTorch",
"tensor",
"or",
"NumPy",
"array"
],
"default": null,
"is_optio... |
8dfd14999be61202a5583b4c8ef76b03332645bc | MPonchon/aoc | aoc2021/day04/part1.py | [
"MIT"
] | Python | check_win_grilles | int | def check_win_grilles(grilles, marks) -> int:
""" retourne le no de la premiere grille gagnante ou -1"""
for no, grille in grilles.items():
if check_win_grille(grille, marks):
return no
return -1 | retourne le no de la premiere grille gagnante ou -1 | retourne le no de la premiere grille gagnante ou -1 | [
"retourne",
"le",
"no",
"de",
"la",
"premiere",
"grille",
"gagnante",
"ou",
"-",
"1"
] | def check_win_grilles(grilles, marks) -> int:
for no, grille in grilles.items():
if check_win_grille(grille, marks):
return no
return -1 | [
"def",
"check_win_grilles",
"(",
"grilles",
",",
"marks",
")",
"->",
"int",
":",
"for",
"no",
",",
"grille",
"in",
"grilles",
".",
"items",
"(",
")",
":",
"if",
"check_win_grille",
"(",
"grille",
",",
"marks",
")",
":",
"return",
"no",
"return",
"-",
... | retourne le no de la premiere grille gagnante ou -1 | [
"retourne",
"le",
"no",
"de",
"la",
"premiere",
"grille",
"gagnante",
"ou",
"-",
"1"
] | [
"\"\"\" retourne le no de la premiere grille gagnante ou -1\"\"\""
] | [
{
"param": "grilles",
"type": null
},
{
"param": "marks",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "grilles",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "marks",
"type": null,
"docstring": null,
"docstring_tokens... |
8dfd14999be61202a5583b4c8ef76b03332645bc | MPonchon/aoc | aoc2021/day04/part1.py | [
"MIT"
] | Python | sol | tuple | def sol(grilles, numbers, marks) -> tuple:
""" retourn no de grille, numero sorti"""
for n in numbers:
print(n)
if n in marks:
continue
marks.add(n)
no = check_win_grilles(grilles, marks)
if no != -1:
# print(no)
# print(g... | retourn no de grille, numero sorti | retourn no de grille, numero sorti | [
"retourn",
"no",
"de",
"grille",
"numero",
"sorti"
] | def sol(grilles, numbers, marks) -> tuple:
for n in numbers:
print(n)
if n in marks:
continue
marks.add(n)
no = check_win_grilles(grilles, marks)
if no != -1:
return n, no
return (0, 0) | [
"def",
"sol",
"(",
"grilles",
",",
"numbers",
",",
"marks",
")",
"->",
"tuple",
":",
"for",
"n",
"in",
"numbers",
":",
"print",
"(",
"n",
")",
"if",
"n",
"in",
"marks",
":",
"continue",
"marks",
".",
"add",
"(",
"n",
")",
"no",
"=",
"check_win_gr... | retourn no de grille, numero sorti | [
"retourn",
"no",
"de",
"grille",
"numero",
"sorti"
] | [
"\"\"\" retourn no de grille, numero sorti\"\"\"",
"# print(no)\r",
"# print(grilles[no])\r",
"# sum = sum_unmarked(grilles[no], marks)\r",
"# print(n, sum)\r",
"# return n * sum\r"
] | [
{
"param": "grilles",
"type": null
},
{
"param": "numbers",
"type": null
},
{
"param": "marks",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "grilles",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "numbers",
"type": null,
"docstring": null,
"docstring_toke... |
7984b68a2abc16fc1dfc5409783904863b0c6a1e | MPonchon/aoc | aoc2021/day04/part2.py | [
"MIT"
] | Python | last_win | int | def last_win(grilles: dict, numbers: list, marks: set) -> int:
"""
trouve le dernier board gagnant
retroune le no de board, le numero sorti
"""
# marks = set()
boad_won = set()
for n in numbers:
# print("numero:", n)
if n in marks:
continue
mark... |
trouve le dernier board gagnant
retroune le no de board, le numero sorti
| trouve le dernier board gagnant
retroune le no de board, le numero sorti | [
"trouve",
"le",
"dernier",
"board",
"gagnant",
"retroune",
"le",
"no",
"de",
"board",
"le",
"numero",
"sorti"
] | def last_win(grilles: dict, numbers: list, marks: set) -> int:
boad_won = set()
for n in numbers:
if n in marks:
continue
marks.add(n)
for key, grille in grilles.items():
if check_win_grille(grille, marks):
if key not in boad_won:
... | [
"def",
"last_win",
"(",
"grilles",
":",
"dict",
",",
"numbers",
":",
"list",
",",
"marks",
":",
"set",
")",
"->",
"int",
":",
"boad_won",
"=",
"set",
"(",
")",
"for",
"n",
"in",
"numbers",
":",
"if",
"n",
"in",
"marks",
":",
"continue",
"marks",
... | trouve le dernier board gagnant
retroune le no de board, le numero sorti | [
"trouve",
"le",
"dernier",
"board",
"gagnant",
"retroune",
"le",
"no",
"de",
"board",
"le",
"numero",
"sorti"
] | [
"\"\"\"\r\n trouve le dernier board gagnant\r\n retroune le no de board, le numero sorti\r\n \"\"\"",
"# marks = set()\r",
"# print(\"numero:\", n)\r",
"# print(\"key: {}, boad_won:{}\".format(key, boad_won))\r",
"# print(\"key: {} not in board\".format(key))\r",
"# print(\"->boad_won:\", boad_wo... | [
{
"param": "grilles",
"type": "dict"
},
{
"param": "numbers",
"type": "list"
},
{
"param": "marks",
"type": "set"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "grilles",
"type": "dict",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "numbers",
"type": "list",
"docstring": null,
"docstring_... |
19984d58f7792f164646407a65972c3c7683e89e | HusseinLezzaik/Deep-Learning-for-Multi-Robotics | Reinforcement Learning/examples/envs/mobile_robot_env_gym_multirobots.py | [
"MIT"
] | Python | timer_callback | null | def timer_callback(self):
" Publish Speed Commands to Robot 1 "
msgl1 = Float32()
msgr1 = Float32()
msgl1.data = self.VL1
msgr1.data = self.VR1
self.publisher_l1.publish(msgl1)
self.publisher_r1.publish(msgr1)
" Publish Sp... | Publish Speed Commands to Robot 1 | Publish Speed Commands to Robot 1 | [
"Publish",
"Speed",
"Commands",
"to",
"Robot",
"1"
] | def timer_callback(self):
msgl1 = Float32()
msgr1 = Float32()
msgl1.data = self.VL1
msgr1.data = self.VR1
self.publisher_l1.publish(msgl1)
self.publisher_r1.publish(msgr1)
msgl2 = Float32()
msgr2 = Float32()
msgl2.data = self.VL2
msgr2.... | [
"def",
"timer_callback",
"(",
"self",
")",
":",
"msgl1",
"=",
"Float32",
"(",
")",
"msgr1",
"=",
"Float32",
"(",
")",
"msgl1",
".",
"data",
"=",
"self",
".",
"VL1",
"msgr1",
".",
"data",
"=",
"self",
".",
"VR1",
"self",
".",
"publisher_l1",
".",
"p... | Publish Speed Commands to Robot 1 | [
"Publish",
"Speed",
"Commands",
"to",
"Robot",
"1"
] | [
"\" Publish Speed Commands to Robot 1 \"",
"\" Publish Speed Commands to Robot 2 \"",
"\" Publish Speed Commands to Robot 3 \"",
"\" Publish Speed Commands to Robot 4 \"",
"\" Publish Speed Commands to Robot 5 \"",
"\" Publish Speed Commands to Robot 6 \""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
968d602f46cdd0e8a32211089525ed7ef3bba0fb | mengjian0502/GroupLasso_Quant | models/quant/quantizer.py | [
"MIT"
] | Python | linear_quantize | <not_specific> | def linear_quantize(input, scale, zero_point, inplace=False):
"""
Linearly quantize the input tensor based on scale and zero point.
https://pytorch.org/docs/stable/quantization.html
"""
if inplace:
input.mul_(scale).sub_(zero_point).round_()
return input
# print(scale)
return... |
Linearly quantize the input tensor based on scale and zero point.
https://pytorch.org/docs/stable/quantization.html
| Linearly quantize the input tensor based on scale and zero point. | [
"Linearly",
"quantize",
"the",
"input",
"tensor",
"based",
"on",
"scale",
"and",
"zero",
"point",
"."
] | def linear_quantize(input, scale, zero_point, inplace=False):
if inplace:
input.mul_(scale).sub_(zero_point).round_()
return input
return torch.round(input * scale - zero_point) | [
"def",
"linear_quantize",
"(",
"input",
",",
"scale",
",",
"zero_point",
",",
"inplace",
"=",
"False",
")",
":",
"if",
"inplace",
":",
"input",
".",
"mul_",
"(",
"scale",
")",
".",
"sub_",
"(",
"zero_point",
")",
".",
"round_",
"(",
")",
"return",
"i... | Linearly quantize the input tensor based on scale and zero point. | [
"Linearly",
"quantize",
"the",
"input",
"tensor",
"based",
"on",
"scale",
"and",
"zero",
"point",
"."
] | [
"\"\"\"\n Linearly quantize the input tensor based on scale and zero point.\n https://pytorch.org/docs/stable/quantization.html\n \"\"\"",
"# print(scale)"
] | [
{
"param": "input",
"type": null
},
{
"param": "scale",
"type": null
},
{
"param": "zero_point",
"type": null
},
{
"param": "inplace",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "input",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "scale",
"type": null,
"docstring": null,
"docstring_tokens":... |
b31f1868cd456dc5ee6a04176ba157f5afbf143d | olmozavala/eoas-pyutils | io_utils/io_common.py | [
"MIT"
] | Python | create_folder | null | def create_folder(output_folder):
"""
It creates a folder only if it doesn't exist
Args:
output_folder:
"""
if not(os.path.exists(output_folder)):
os.makedirs(output_folder) |
It creates a folder only if it doesn't exist
Args:
output_folder:
| It creates a folder only if it doesn't exist | [
"It",
"creates",
"a",
"folder",
"only",
"if",
"it",
"doesn",
"'",
"t",
"exist"
] | def create_folder(output_folder):
if not(os.path.exists(output_folder)):
os.makedirs(output_folder) | [
"def",
"create_folder",
"(",
"output_folder",
")",
":",
"if",
"not",
"(",
"os",
".",
"path",
".",
"exists",
"(",
"output_folder",
")",
")",
":",
"os",
".",
"makedirs",
"(",
"output_folder",
")"
] | It creates a folder only if it doesn't exist | [
"It",
"creates",
"a",
"folder",
"only",
"if",
"it",
"doesn",
"'",
"t",
"exist"
] | [
"\"\"\"\n It creates a folder only if it doesn't exist\n Args:\n output_folder:\n \"\"\""
] | [
{
"param": "output_folder",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "output_folder",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b31f1868cd456dc5ee6a04176ba157f5afbf143d | olmozavala/eoas-pyutils | io_utils/io_common.py | [
"MIT"
] | Python | all_files_in_folder | <not_specific> | def all_files_in_folder(input_folder, file_ext=None):
"""
Gets all the filenames in a folder
:param input_folder:
:param file_ext:
:return:
"""
paths = []
file_names = []
for root,d_names,f_names in os.walk(input_folder):
for f in f_names:
if file_ext is None or f... |
Gets all the filenames in a folder
:param input_folder:
:param file_ext:
:return:
| Gets all the filenames in a folder | [
"Gets",
"all",
"the",
"filenames",
"in",
"a",
"folder"
] | def all_files_in_folder(input_folder, file_ext=None):
paths = []
file_names = []
for root,d_names,f_names in os.walk(input_folder):
for f in f_names:
if file_ext is None or f.find(file_ext) != -1:
paths.append(os.path.join(root, f))
file_names.append(f)
... | [
"def",
"all_files_in_folder",
"(",
"input_folder",
",",
"file_ext",
"=",
"None",
")",
":",
"paths",
"=",
"[",
"]",
"file_names",
"=",
"[",
"]",
"for",
"root",
",",
"d_names",
",",
"f_names",
"in",
"os",
".",
"walk",
"(",
"input_folder",
")",
":",
"for"... | Gets all the filenames in a folder | [
"Gets",
"all",
"the",
"filenames",
"in",
"a",
"folder"
] | [
"\"\"\"\n Gets all the filenames in a folder\n :param input_folder:\n :param file_ext:\n :return:\n \"\"\""
] | [
{
"param": "input_folder",
"type": null
},
{
"param": "file_ext",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "input_folder",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null... |
b31f1868cd456dc5ee6a04176ba157f5afbf143d | olmozavala/eoas-pyutils | io_utils/io_common.py | [
"MIT"
] | Python | str2bool | bool | def str2bool(cstr: str) -> bool:
"""
It compares a string with anything like true, and it returns True or False
Args:
cstr:
Returns:
Boolean value of the string
"""
return cstr in ['True', 'true', 't', True] |
It compares a string with anything like true, and it returns True or False
Args:
cstr:
Returns:
Boolean value of the string
| It compares a string with anything like true, and it returns True or False | [
"It",
"compares",
"a",
"string",
"with",
"anything",
"like",
"true",
"and",
"it",
"returns",
"True",
"or",
"False"
] | def str2bool(cstr: str) -> bool:
return cstr in ['True', 'true', 't', True] | [
"def",
"str2bool",
"(",
"cstr",
":",
"str",
")",
"->",
"bool",
":",
"return",
"cstr",
"in",
"[",
"'True'",
",",
"'true'",
",",
"'t'",
",",
"True",
"]"
] | It compares a string with anything like true, and it returns True or False | [
"It",
"compares",
"a",
"string",
"with",
"anything",
"like",
"true",
"and",
"it",
"returns",
"True",
"or",
"False"
] | [
"\"\"\"\n It compares a string with anything like true, and it returns True or False\n Args:\n cstr:\n\n Returns:\n Boolean value of the string\n \"\"\""
] | [
{
"param": "cstr",
"type": "str"
}
] | {
"returns": [
{
"docstring": "Boolean value of the string",
"docstring_tokens": [
"Boolean",
"value",
"of",
"the",
"string"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "cstr",
"type": "str",
"docstr... |
bf694250cf524ba5943b775fe32d02165069e206 | olmozavala/eoas-pyutils | proc_utils/comp_fields.py | [
"MIT"
] | Python | vorticity | <not_specific> | def vorticity(u, v, dist_grid=None):
'''
It computes the vorticity between the u and v fields. If a distance grid is provided
it considers it for the computation.
:param u:
:param v:
:param dist_grid:
:return:
'''
final_vort = np.zeros(u.shape)
# ------- 2D ----------
if len(... |
It computes the vorticity between the u and v fields. If a distance grid is provided
it considers it for the computation.
:param u:
:param v:
:param dist_grid:
:return:
| It computes the vorticity between the u and v fields. If a distance grid is provided
it considers it for the computation. | [
"It",
"computes",
"the",
"vorticity",
"between",
"the",
"u",
"and",
"v",
"fields",
".",
"If",
"a",
"distance",
"grid",
"is",
"provided",
"it",
"considers",
"it",
"for",
"the",
"computation",
"."
] | def vorticity(u, v, dist_grid=None):
final_vort = np.zeros(u.shape)
if len(u.shape) == 2:
if dist_grid is None:
vort = np.diff(v, axis=1)[:-1, :] - np.diff(u, axis=0)[:, :-1]
else:
vort = np.diff(v, axis=1)[:-1, :]/dist_grid[0] - np.diff(u, axis=0)[:, :-1]/dist_grid[1]
... | [
"def",
"vorticity",
"(",
"u",
",",
"v",
",",
"dist_grid",
"=",
"None",
")",
":",
"final_vort",
"=",
"np",
".",
"zeros",
"(",
"u",
".",
"shape",
")",
"if",
"len",
"(",
"u",
".",
"shape",
")",
"==",
"2",
":",
"if",
"dist_grid",
"is",
"None",
":",... | It computes the vorticity between the u and v fields. | [
"It",
"computes",
"the",
"vorticity",
"between",
"the",
"u",
"and",
"v",
"fields",
"."
] | [
"'''\n It computes the vorticity between the u and v fields. If a distance grid is provided\n it considers it for the computation.\n :param u:\n :param v:\n :param dist_grid:\n :return:\n '''",
"# ------- 2D ----------",
"# ------- 3D ----------",
"# Assumes first dimension is time",
"#... | [
{
"param": "u",
"type": null
},
{
"param": "v",
"type": null
},
{
"param": "dist_grid",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "u",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"is... |
5a1c03f1868d62e92efb4bf4db649282af1d100a | olmozavala/eoas-pyutils | viz_utils/eoas_viz_3d.py | [
"MIT"
] | Python | plot_surface_itk | null | def plot_surface_itk(self, ctr_np, title='', file_name=''):
"""
Simple wrapper for itk image formats
:param ctr_np:
:param title:
:param file_name:
:return:
"""
self.plot_surface_np(sitk.GetArrayFromImage(ctr_np), title=title, file_name=file_name) |
Simple wrapper for itk image formats
:param ctr_np:
:param title:
:param file_name:
:return:
| Simple wrapper for itk image formats | [
"Simple",
"wrapper",
"for",
"itk",
"image",
"formats"
] | def plot_surface_itk(self, ctr_np, title='', file_name=''):
self.plot_surface_np(sitk.GetArrayFromImage(ctr_np), title=title, file_name=file_name) | [
"def",
"plot_surface_itk",
"(",
"self",
",",
"ctr_np",
",",
"title",
"=",
"''",
",",
"file_name",
"=",
"''",
")",
":",
"self",
".",
"plot_surface_np",
"(",
"sitk",
".",
"GetArrayFromImage",
"(",
"ctr_np",
")",
",",
"title",
"=",
"title",
",",
"file_name"... | Simple wrapper for itk image formats | [
"Simple",
"wrapper",
"for",
"itk",
"image",
"formats"
] | [
"\"\"\"\n Simple wrapper for itk image formats\n :param ctr_np:\n :param title:\n :param file_name:\n :return:\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "ctr_np",
"type": null
},
{
"param": "title",
"type": null
},
{
"param": "file_name",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
5a1c03f1868d62e92efb4bf4db649282af1d100a | olmozavala/eoas-pyutils | viz_utils/eoas_viz_3d.py | [
"MIT"
] | Python | plot_surface_np | null | def plot_surface_np(self, ctr_np, title='', file_name=''):
"""
Makes a 3D surface using Ploty from a 3D Volume. It expects a binary mask
:param ctr_np:
:param title:
:param file_name:
:return:
"""
# Computes marching cubes to obtain a mesh
print('\... |
Makes a 3D surface using Ploty from a 3D Volume. It expects a binary mask
:param ctr_np:
:param title:
:param file_name:
:return:
| Makes a 3D surface using Ploty from a 3D Volume. It expects a binary mask | [
"Makes",
"a",
"3D",
"surface",
"using",
"Ploty",
"from",
"a",
"3D",
"Volume",
".",
"It",
"expects",
"a",
"binary",
"mask"
] | def plot_surface_np(self, ctr_np, title='', file_name=''):
print('\tMarching cubes...')
vertices, simplices, normals, values = measure.marching_cubes_lewiner(ctr_np,.8)
print('\tDone!')
print('\t3D Surface...')
x, y, z = zip(*vertices)
camera = dict(up=dict(x=1, y=0, z=0)... | [
"def",
"plot_surface_np",
"(",
"self",
",",
"ctr_np",
",",
"title",
"=",
"''",
",",
"file_name",
"=",
"''",
")",
":",
"print",
"(",
"'\\tMarching cubes...'",
")",
"vertices",
",",
"simplices",
",",
"normals",
",",
"values",
"=",
"measure",
".",
"marching_c... | Makes a 3D surface using Ploty from a 3D Volume. | [
"Makes",
"a",
"3D",
"surface",
"using",
"Ploty",
"from",
"a",
"3D",
"Volume",
"."
] | [
"\"\"\"\n Makes a 3D surface using Ploty from a 3D Volume. It expects a binary mask\n :param ctr_np:\n :param title:\n :param file_name:\n :return:\n \"\"\"",
"# Computes marching cubes to obtain a mesh"
] | [
{
"param": "self",
"type": null
},
{
"param": "ctr_np",
"type": null
},
{
"param": "title",
"type": null
},
{
"param": "file_name",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
5a1c03f1868d62e92efb4bf4db649282af1d100a | olmozavala/eoas-pyutils | viz_utils/eoas_viz_3d.py | [
"MIT"
] | Python | plot_scatter_np | null | def plot_scatter_np(self, ctr_np, file_name, title=''):
"""
Makes a 3D scatter plot with the obtained
:param ctr_np:
:param file_name:
:param title:
:return:
"""
z, y, x = np.where(ctr_np > 0)
data=[]
max_z = max(z)
min_z= min(z)
... |
Makes a 3D scatter plot with the obtained
:param ctr_np:
:param file_name:
:param title:
:return:
| Makes a 3D scatter plot with the obtained | [
"Makes",
"a",
"3D",
"scatter",
"plot",
"with",
"the",
"obtained"
] | def plot_scatter_np(self, ctr_np, file_name, title=''):
z, y, x = np.where(ctr_np > 0)
data=[]
max_z = max(z)
min_z= min(z)
min_y= min(y)
min_x= min(x)
print("\tMaking data")
for z_level in range(int(min_z), int(max_z)):
color = 'rgb({},0,0)'.f... | [
"def",
"plot_scatter_np",
"(",
"self",
",",
"ctr_np",
",",
"file_name",
",",
"title",
"=",
"''",
")",
":",
"z",
",",
"y",
",",
"x",
"=",
"np",
".",
"where",
"(",
"ctr_np",
">",
"0",
")",
"data",
"=",
"[",
"]",
"max_z",
"=",
"max",
"(",
"z",
"... | Makes a 3D scatter plot with the obtained | [
"Makes",
"a",
"3D",
"scatter",
"plot",
"with",
"the",
"obtained"
] | [
"\"\"\"\n Makes a 3D scatter plot with the obtained\n :param ctr_np:\n :param file_name:\n :param title:\n :return:\n \"\"\"",
"# Making data and assigning colors",
"# =========== ALL THIS PART IS TO 'IMPROVE' THE LAYOUT ===========",
"# https://plot.ly/python/3d-axes... | [
{
"param": "self",
"type": null
},
{
"param": "ctr_np",
"type": null
},
{
"param": "file_name",
"type": null
},
{
"param": "title",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
7bae2b98f5dffa31882782e8a6c3d270a538569a | olmozavala/eoas-pyutils | proc_utils/gom.py | [
"MIT"
] | Python | change_units | <not_specific> | def change_units(cc, lon, lat):
"""skimage functions extracts the contour but the paths are image indices
and not (lon, lat)"""
flon = interp1d(np.arange(0,len(lon)), lon)
flat = interp1d(np.arange(0,len(lat)), lat)
newcc = []
for cci in cc:
try:
t = np.zeros(cci.shape)
... | skimage functions extracts the contour but the paths are image indices
and not (lon, lat) | skimage functions extracts the contour but the paths are image indices
and not (lon, lat) | [
"skimage",
"functions",
"extracts",
"the",
"contour",
"but",
"the",
"paths",
"are",
"image",
"indices",
"and",
"not",
"(",
"lon",
"lat",
")"
] | def change_units(cc, lon, lat):
flon = interp1d(np.arange(0,len(lon)), lon)
flat = interp1d(np.arange(0,len(lat)), lat)
newcc = []
for cci in cc:
try:
t = np.zeros(cci.shape)
t[:,0] = flat(cci[:,0])
t[:,1] = flon(cci[:,1])
newcc.append(t)
e... | [
"def",
"change_units",
"(",
"cc",
",",
"lon",
",",
"lat",
")",
":",
"flon",
"=",
"interp1d",
"(",
"np",
".",
"arange",
"(",
"0",
",",
"len",
"(",
"lon",
")",
")",
",",
"lon",
")",
"flat",
"=",
"interp1d",
"(",
"np",
".",
"arange",
"(",
"0",
"... | skimage functions extracts the contour but the paths are image indices
and not (lon, lat) | [
"skimage",
"functions",
"extracts",
"the",
"contour",
"but",
"the",
"paths",
"are",
"image",
"indices",
"and",
"not",
"(",
"lon",
"lat",
")"
] | [
"\"\"\"skimage functions extracts the contour but the paths are image indices\n and not (lon, lat)\"\"\""
] | [
{
"param": "cc",
"type": null
},
{
"param": "lon",
"type": null
},
{
"param": "lat",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cc",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "lon",
"type": null,
"docstring": null,
"docstring_tokens": [],
... |
6b3934ad826855dff168d0197fe9075473c458c0 | olmozavala/eoas-pyutils | viz_utils/eoa_viz.py | [
"MIT"
] | Python | select_colormap | <not_specific> | def select_colormap(field_name):
'''
Based on the name if the field it chooses a colormap from cmocean
Args:
field_name:
Returns:
'''
if np.any([field_name.find(x) != -1 for x in ('ssh', 'srfhgt', 'adt','surf_el')]):
# cmaps_fields.append(cmocean.cm.deep_r)
return cmoce... |
Based on the name if the field it chooses a colormap from cmocean
Args:
field_name:
Returns:
| Based on the name if the field it chooses a colormap from cmocean | [
"Based",
"on",
"the",
"name",
"if",
"the",
"field",
"it",
"chooses",
"a",
"colormap",
"from",
"cmocean"
] | def select_colormap(field_name):
if np.any([field_name.find(x) != -1 for x in ('ssh', 'srfhgt', 'adt','surf_el')]):
return cmocean.cm.curl
elif np.any([field_name.find(x) != -1 for x in ('temp', 'sst', 'temperature')]):
return cmocean.cm.thermal
elif np.any([field_name.find(x) != -1 for x in... | [
"def",
"select_colormap",
"(",
"field_name",
")",
":",
"if",
"np",
".",
"any",
"(",
"[",
"field_name",
".",
"find",
"(",
"x",
")",
"!=",
"-",
"1",
"for",
"x",
"in",
"(",
"'ssh'",
",",
"'srfhgt'",
",",
"'adt'",
",",
"'surf_el'",
")",
"]",
")",
":"... | Based on the name if the field it chooses a colormap from cmocean | [
"Based",
"on",
"the",
"name",
"if",
"the",
"field",
"it",
"chooses",
"a",
"colormap",
"from",
"cmocean"
] | [
"'''\n Based on the name if the field it chooses a colormap from cmocean\n Args:\n field_name:\n\n Returns:\n\n '''",
"# cmaps_fields.append(cmocean.cm.deep_r)"
] | [
{
"param": "field_name",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "field_name",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
6b3934ad826855dff168d0197fe9075473c458c0 | olmozavala/eoas-pyutils | viz_utils/eoa_viz.py | [
"MIT"
] | Python | plot_slice_eoa | None | def plot_slice_eoa(self, c_img, ax, cmap='gray', mode=PlotMode.RASTER, mincbar=np.nan, maxcbar=np.nan) -> None:
"""
Plots a 2D img for EOA data.
:param c_img: 2D array
:param ax: geoaxes
:return:
"""
c_ax = ax
if self._flip_data:
origin = 'lowe... |
Plots a 2D img for EOA data.
:param c_img: 2D array
:param ax: geoaxes
:return:
| Plots a 2D img for EOA data. | [
"Plots",
"a",
"2D",
"img",
"for",
"EOA",
"data",
"."
] | def plot_slice_eoa(self, c_img, ax, cmap='gray', mode=PlotMode.RASTER, mincbar=np.nan, maxcbar=np.nan) -> None:
c_ax = ax
if self._flip_data:
origin = 'lower'
else:
origin = 'upper'
if self._background == BackgroundType.CARTO_DEF:
c_ax.stock_img()
... | [
"def",
"plot_slice_eoa",
"(",
"self",
",",
"c_img",
",",
"ax",
",",
"cmap",
"=",
"'gray'",
",",
"mode",
"=",
"PlotMode",
".",
"RASTER",
",",
"mincbar",
"=",
"np",
".",
"nan",
",",
"maxcbar",
"=",
"np",
".",
"nan",
")",
"->",
"None",
":",
"c_ax",
... | Plots a 2D img for EOA data. | [
"Plots",
"a",
"2D",
"img",
"for",
"EOA",
"data",
"."
] | [
"\"\"\"\n Plots a 2D img for EOA data.\n :param c_img: 2D array\n :param ax: geoaxes\n :return:\n \"\"\"",
"# Adds a threshold to the plot to see the polygons",
"# gl.xlabel_style = {'size': self._font_size/2, 'color': '#aaaaaa', 'weight':'bold'}"
] | [
{
"param": "self",
"type": null
},
{
"param": "c_img",
"type": null
},
{
"param": "ax",
"type": null
},
{
"param": "cmap",
"type": null
},
{
"param": "mode",
"type": null
},
{
"param": "mincbar",
"type": null
},
{
"param": "maxcbar",
"t... | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.