repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidTemporalForm.set_start_date | def set_start_date(self, date):
"""Sets the start date.
arg: date (osid.calendaring.DateTime): the new date
raise: InvalidArgument - ``date`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``date`` is ``null``
*compliance: ... | python | def set_start_date(self, date):
"""Sets the start date.
arg: date (osid.calendaring.DateTime): the new date
raise: InvalidArgument - ``date`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``date`` is ``null``
*compliance: ... | [
"def",
"set_start_date",
"(",
"self",
",",
"date",
")",
":",
"if",
"self",
".",
"get_start_date_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"errors",
".",
"NoAccess",
"(",
")",
"if",
"not",
"self",
".",
"_is_valid_date_time",
"(",
"... | Sets the start date.
arg: date (osid.calendaring.DateTime): the new date
raise: InvalidArgument - ``date`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``date`` is ``null``
*compliance: mandatory -- This method must be implemente... | [
"Sets",
"the",
"start",
"date",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1299-L1314 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidTemporalForm.clear_start_date | def clear_start_date(self):
"""Clears the start date.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_start_date_metadata().is_read_only() or
... | python | def clear_start_date(self):
"""Clears the start date.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_start_date_metadata().is_read_only() or
... | [
"def",
"clear_start_date",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_start_date_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_start_date_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
"errors",... | Clears the start date.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.* | [
"Clears",
"the",
"start",
"date",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1316-L1327 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidTemporalForm.get_end_date_metadata | def get_end_date_metadata(self):
"""Gets the metadata for an end date.
return: (osid.Metadata) - metadata for the date
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['end_date'])
metadata.update({'existing_date_time_values': ... | python | def get_end_date_metadata(self):
"""Gets the metadata for an end date.
return: (osid.Metadata) - metadata for the date
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['end_date'])
metadata.update({'existing_date_time_values': ... | [
"def",
"get_end_date_metadata",
"(",
"self",
")",
":",
"metadata",
"=",
"dict",
"(",
"self",
".",
"_mdata",
"[",
"'end_date'",
"]",
")",
"metadata",
".",
"update",
"(",
"{",
"'existing_date_time_values'",
":",
"self",
".",
"_my_map",
"[",
"'endDate'",
"]",
... | Gets the metadata for an end date.
return: (osid.Metadata) - metadata for the date
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"metadata",
"for",
"an",
"end",
"date",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1331-L1340 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidTemporalForm.set_end_date | def set_end_date(self, date):
"""Sets the end date.
arg: date (osid.calendaring.DateTime): the new date
raise: InvalidArgument - ``date`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``date`` is ``null``
*compliance: mand... | python | def set_end_date(self, date):
"""Sets the end date.
arg: date (osid.calendaring.DateTime): the new date
raise: InvalidArgument - ``date`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``date`` is ``null``
*compliance: mand... | [
"def",
"set_end_date",
"(",
"self",
",",
"date",
")",
":",
"if",
"self",
".",
"get_end_date_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"errors",
".",
"NoAccess",
"(",
")",
"if",
"not",
"self",
".",
"_is_valid_date_time",
"(",
"date... | Sets the end date.
arg: date (osid.calendaring.DateTime): the new date
raise: InvalidArgument - ``date`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``date`` is ``null``
*compliance: mandatory -- This method must be implemented.... | [
"Sets",
"the",
"end",
"date",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1345-L1360 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidTemporalForm.clear_end_date | def clear_end_date(self):
"""Clears the end date.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_end_date_metadata().is_read_only() or
... | python | def clear_end_date(self):
"""Clears the end date.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_end_date_metadata().is_read_only() or
... | [
"def",
"clear_end_date",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_end_date_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_end_date_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
"errors",
"."... | Clears the end date.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.* | [
"Clears",
"the",
"end",
"date",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1362-L1373 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidContainableForm.set_sequestered | def set_sequestered(self, sequestered):
"""Sets the sequestered flag.
arg: sequestered (boolean): the new sequestered flag
raise: InvalidArgument - ``sequestered`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must ... | python | def set_sequestered(self, sequestered):
"""Sets the sequestered flag.
arg: sequestered (boolean): the new sequestered flag
raise: InvalidArgument - ``sequestered`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must ... | [
"def",
"set_sequestered",
"(",
"self",
",",
"sequestered",
")",
":",
"if",
"sequestered",
"is",
"None",
":",
"raise",
"errors",
".",
"NullArgument",
"(",
")",
"if",
"self",
".",
"get_sequestered_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"rai... | Sets the sequestered flag.
arg: sequestered (boolean): the new sequestered flag
raise: InvalidArgument - ``sequestered`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.* | [
"Sets",
"the",
"sequestered",
"flag",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1425-L1440 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidContainableForm.clear_sequestered | def clear_sequestered(self):
"""Clears the sequestered flag.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_sequestered_metadata().is_read_only() ... | python | def clear_sequestered(self):
"""Clears the sequestered flag.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_sequestered_metadata().is_read_only() ... | [
"def",
"clear_sequestered",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_sequestered_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_sequestered_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
"error... | Clears the sequestered flag.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.* | [
"Clears",
"the",
"sequestered",
"flag",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1442-L1453 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidSourceableForm.get_provider_metadata | def get_provider_metadata(self):
"""Gets the metadata for a provider.
return: (osid.Metadata) - metadata for the provider
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['provider'])
metadata.update({'existing_id_values': self... | python | def get_provider_metadata(self):
"""Gets the metadata for a provider.
return: (osid.Metadata) - metadata for the provider
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['provider'])
metadata.update({'existing_id_values': self... | [
"def",
"get_provider_metadata",
"(",
"self",
")",
":",
"metadata",
"=",
"dict",
"(",
"self",
".",
"_mdata",
"[",
"'provider'",
"]",
")",
"metadata",
".",
"update",
"(",
"{",
"'existing_id_values'",
":",
"self",
".",
"_my_map",
"[",
"'providerId'",
"]",
"}"... | Gets the metadata for a provider.
return: (osid.Metadata) - metadata for the provider
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"metadata",
"for",
"a",
"provider",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1494-L1503 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidSourceableForm.set_provider | def set_provider(self, provider_id):
"""Sets a provider.
arg: provider_id (osid.id.Id): the new provider
raise: InvalidArgument - ``provider_id`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``provider_id`` is ``null``
*c... | python | def set_provider(self, provider_id):
"""Sets a provider.
arg: provider_id (osid.id.Id): the new provider
raise: InvalidArgument - ``provider_id`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``provider_id`` is ``null``
*c... | [
"def",
"set_provider",
"(",
"self",
",",
"provider_id",
")",
":",
"if",
"self",
".",
"get_provider_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"errors",
".",
"NoAccess",
"(",
")",
"if",
"not",
"self",
".",
"_is_valid_id",
"(",
"prov... | Sets a provider.
arg: provider_id (osid.id.Id): the new provider
raise: InvalidArgument - ``provider_id`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``provider_id`` is ``null``
*compliance: mandatory -- This method must be impl... | [
"Sets",
"a",
"provider",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1508-L1522 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidSourceableForm.clear_provider | def clear_provider(self):
"""Removes the provider.
raise: NoAccess - ``Metadata.isRequired()`` is ``true`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_provider_metadata().is_read_only() o... | python | def clear_provider(self):
"""Removes the provider.
raise: NoAccess - ``Metadata.isRequired()`` is ``true`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_provider_metadata().is_read_only() o... | [
"def",
"clear_provider",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_provider_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_provider_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
"errors",
"."... | Removes the provider.
raise: NoAccess - ``Metadata.isRequired()`` is ``true`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.* | [
"Removes",
"the",
"provider",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1524-L1535 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidSourceableForm.get_branding_metadata | def get_branding_metadata(self):
"""Gets the metadata for the asset branding.
return: (osid.Metadata) - metadata for the asset branding.
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['branding'])
metadata.update({'existing_i... | python | def get_branding_metadata(self):
"""Gets the metadata for the asset branding.
return: (osid.Metadata) - metadata for the asset branding.
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['branding'])
metadata.update({'existing_i... | [
"def",
"get_branding_metadata",
"(",
"self",
")",
":",
"metadata",
"=",
"dict",
"(",
"self",
".",
"_mdata",
"[",
"'branding'",
"]",
")",
"metadata",
".",
"update",
"(",
"{",
"'existing_id_values'",
":",
"self",
".",
"_my_map",
"[",
"'brandingIds'",
"]",
"}... | Gets the metadata for the asset branding.
return: (osid.Metadata) - metadata for the asset branding.
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"metadata",
"for",
"the",
"asset",
"branding",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1539-L1548 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidSourceableForm.set_branding | def set_branding(self, asset_ids):
"""Sets the branding.
arg: asset_ids (osid.id.Id[]): the new assets
raise: InvalidArgument - ``asset_ids`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``asset_ids`` is ``null``
*complia... | python | def set_branding(self, asset_ids):
"""Sets the branding.
arg: asset_ids (osid.id.Id[]): the new assets
raise: InvalidArgument - ``asset_ids`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``asset_ids`` is ``null``
*complia... | [
"def",
"set_branding",
"(",
"self",
",",
"asset_ids",
")",
":",
"if",
"self",
".",
"get_branding_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"errors",
".",
"NoAccess",
"(",
")",
"if",
"not",
"self",
".",
"_is_valid_input",
"(",
"ass... | Sets the branding.
arg: asset_ids (osid.id.Id[]): the new assets
raise: InvalidArgument - ``asset_ids`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``asset_ids`` is ``null``
*compliance: mandatory -- This method must be implemen... | [
"Sets",
"the",
"branding",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1553-L1570 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidSourceableForm.get_license_metadata | def get_license_metadata(self):
"""Gets the metadata for the license.
return: (osid.Metadata) - metadata for the license
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['license'])
metadata.update({'existing_string_values': se... | python | def get_license_metadata(self):
"""Gets the metadata for the license.
return: (osid.Metadata) - metadata for the license
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['license'])
metadata.update({'existing_string_values': se... | [
"def",
"get_license_metadata",
"(",
"self",
")",
":",
"metadata",
"=",
"dict",
"(",
"self",
".",
"_mdata",
"[",
"'license'",
"]",
")",
"metadata",
".",
"update",
"(",
"{",
"'existing_string_values'",
":",
"self",
".",
"_my_map",
"[",
"'license'",
"]",
"}",... | Gets the metadata for the license.
return: (osid.Metadata) - metadata for the license
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"metadata",
"for",
"the",
"license",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1587-L1596 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidSourceableForm.set_license | def set_license(self, license_):
"""Sets the license.
arg: license (string): the new license
raise: InvalidArgument - ``license`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``license`` is ``null``
*compliance: mandatory... | python | def set_license(self, license_):
"""Sets the license.
arg: license (string): the new license
raise: InvalidArgument - ``license`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``license`` is ``null``
*compliance: mandatory... | [
"def",
"set_license",
"(",
"self",
",",
"license_",
")",
":",
"self",
".",
"_my_map",
"[",
"'license'",
"]",
"=",
"self",
".",
"_get_display_text",
"(",
"license_",
",",
"self",
".",
"get_license_metadata",
"(",
")",
")"
] | Sets the license.
arg: license (string): the new license
raise: InvalidArgument - ``license`` is invalid
raise: NoAccess - ``Metadata.isReadOnly()`` is ``true``
raise: NullArgument - ``license`` is ``null``
*compliance: mandatory -- This method must be implemented.* | [
"Sets",
"the",
"license",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1601-L1611 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidSourceableForm.clear_license | def clear_license(self):
"""Removes the license.
raise: NoAccess - ``Metadata.isRequired()`` is ``true`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_license_metadata().is_read_only() or
... | python | def clear_license(self):
"""Removes the license.
raise: NoAccess - ``Metadata.isRequired()`` is ``true`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_license_metadata().is_read_only() or
... | [
"def",
"clear_license",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_license_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_license_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
"errors",
".",
... | Removes the license.
raise: NoAccess - ``Metadata.isRequired()`` is ``true`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.* | [
"Removes",
"the",
"license",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1613-L1624 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidObjectForm._init_metadata | def _init_metadata(self, **kwargs):
"""Initialize metadata for form"""
self._mdata.update(default_mdata.get_osid_object_mdata())
OsidForm._init_metadata(self)
if 'default_display_name' in kwargs:
self._mdata['display_name']['default_string_values'][0]['text'] = kwargs['defaul... | python | def _init_metadata(self, **kwargs):
"""Initialize metadata for form"""
self._mdata.update(default_mdata.get_osid_object_mdata())
OsidForm._init_metadata(self)
if 'default_display_name' in kwargs:
self._mdata['display_name']['default_string_values'][0]['text'] = kwargs['defaul... | [
"def",
"_init_metadata",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_mdata",
".",
"update",
"(",
"default_mdata",
".",
"get_osid_object_mdata",
"(",
")",
")",
"OsidForm",
".",
"_init_metadata",
"(",
"self",
")",
"if",
"'default_display_nam... | Initialize metadata for form | [
"Initialize",
"metadata",
"for",
"form"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1774-L1789 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidObjectForm._init_map | def _init_map(self, record_types=None):
"""Initialize map for form"""
OsidForm._init_map(self)
self._my_map['displayName'] = dict(self._display_name_default)
self._my_map['description'] = dict(self._description_default)
self._my_map['genusTypeId'] = self._genus_type_default
... | python | def _init_map(self, record_types=None):
"""Initialize map for form"""
OsidForm._init_map(self)
self._my_map['displayName'] = dict(self._display_name_default)
self._my_map['description'] = dict(self._description_default)
self._my_map['genusTypeId'] = self._genus_type_default
... | [
"def",
"_init_map",
"(",
"self",
",",
"record_types",
"=",
"None",
")",
":",
"OsidForm",
".",
"_init_map",
"(",
"self",
")",
"self",
".",
"_my_map",
"[",
"'displayName'",
"]",
"=",
"dict",
"(",
"self",
".",
"_display_name_default",
")",
"self",
".",
"_my... | Initialize map for form | [
"Initialize",
"map",
"for",
"form"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1791-L1797 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidObjectForm.get_display_name_metadata | def get_display_name_metadata(self):
"""Gets the metadata for a display name.
return: (osid.Metadata) - metadata for the display name
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['display_name'])
metadata.update({'existing_... | python | def get_display_name_metadata(self):
"""Gets the metadata for a display name.
return: (osid.Metadata) - metadata for the display name
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['display_name'])
metadata.update({'existing_... | [
"def",
"get_display_name_metadata",
"(",
"self",
")",
":",
"metadata",
"=",
"dict",
"(",
"self",
".",
"_mdata",
"[",
"'display_name'",
"]",
")",
"metadata",
".",
"update",
"(",
"{",
"'existing_string_values'",
":",
"self",
".",
"_my_map",
"[",
"'displayName'",... | Gets the metadata for a display name.
return: (osid.Metadata) - metadata for the display name
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"metadata",
"for",
"a",
"display",
"name",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1799-L1808 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidObjectForm.set_display_name | def set_display_name(self, display_name):
"""Sets a display name.
A display name is required and if not set, will be set by the
provider.
arg: display_name (string): the new display name
raise: InvalidArgument - ``display_name`` is invalid
raise: NoAccess - ``Metad... | python | def set_display_name(self, display_name):
"""Sets a display name.
A display name is required and if not set, will be set by the
provider.
arg: display_name (string): the new display name
raise: InvalidArgument - ``display_name`` is invalid
raise: NoAccess - ``Metad... | [
"def",
"set_display_name",
"(",
"self",
",",
"display_name",
")",
":",
"self",
".",
"_my_map",
"[",
"'displayName'",
"]",
"=",
"self",
".",
"_get_display_text",
"(",
"display_name",
",",
"self",
".",
"get_display_name_metadata",
"(",
")",
")"
] | Sets a display name.
A display name is required and if not set, will be set by the
provider.
arg: display_name (string): the new display name
raise: InvalidArgument - ``display_name`` is invalid
raise: NoAccess - ``Metadata.isReadonly()`` is ``true``
raise: NullAr... | [
"Sets",
"a",
"display",
"name",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1813-L1826 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidObjectForm.clear_display_name | def clear_display_name(self):
"""Clears the display name.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_display_name_metadata().is_read_only() or... | python | def clear_display_name(self):
"""Clears the display name.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_display_name_metadata().is_read_only() or... | [
"def",
"clear_display_name",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_display_name_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_display_name_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
"er... | Clears the display name.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.* | [
"Clears",
"the",
"display",
"name",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1828-L1839 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidObjectForm.get_description_metadata | def get_description_metadata(self):
"""Gets the metadata for a description.
return: (osid.Metadata) - metadata for the description
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['description'])
metadata.update({'existing_stri... | python | def get_description_metadata(self):
"""Gets the metadata for a description.
return: (osid.Metadata) - metadata for the description
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['description'])
metadata.update({'existing_stri... | [
"def",
"get_description_metadata",
"(",
"self",
")",
":",
"metadata",
"=",
"dict",
"(",
"self",
".",
"_mdata",
"[",
"'description'",
"]",
")",
"metadata",
".",
"update",
"(",
"{",
"'existing_string_values'",
":",
"self",
".",
"_my_map",
"[",
"'description'",
... | Gets the metadata for a description.
return: (osid.Metadata) - metadata for the description
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"metadata",
"for",
"a",
"description",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1843-L1852 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidObjectForm.set_description | def set_description(self, description):
"""Sets a description.
arg: description (string): the new description
raise: InvalidArgument - ``description`` is invalid
raise: NoAccess - ``Metadata.isReadonly()`` is ``true``
raise: NullArgument - ``description`` is ``null``
... | python | def set_description(self, description):
"""Sets a description.
arg: description (string): the new description
raise: InvalidArgument - ``description`` is invalid
raise: NoAccess - ``Metadata.isReadonly()`` is ``true``
raise: NullArgument - ``description`` is ``null``
... | [
"def",
"set_description",
"(",
"self",
",",
"description",
")",
":",
"self",
".",
"_my_map",
"[",
"'description'",
"]",
"=",
"self",
".",
"_get_display_text",
"(",
"description",
",",
"self",
".",
"get_description_metadata",
"(",
")",
")"
] | Sets a description.
arg: description (string): the new description
raise: InvalidArgument - ``description`` is invalid
raise: NoAccess - ``Metadata.isReadonly()`` is ``true``
raise: NullArgument - ``description`` is ``null``
*compliance: mandatory -- This method must be im... | [
"Sets",
"a",
"description",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1857-L1867 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidObjectForm.clear_description | def clear_description(self):
"""Clears the description.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_description_metadata().is_read_only() or
... | python | def clear_description(self):
"""Clears the description.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_description_metadata().is_read_only() or
... | [
"def",
"clear_description",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_description_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_description_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
"error... | Clears the description.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.* | [
"Clears",
"the",
"description",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1869-L1880 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidObjectForm.get_genus_type_metadata | def get_genus_type_metadata(self):
"""Gets the metadata for a genus type.
return: (osid.Metadata) - metadata for the genus
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['genus_type'])
metadata.update({'existing_string_values... | python | def get_genus_type_metadata(self):
"""Gets the metadata for a genus type.
return: (osid.Metadata) - metadata for the genus
*compliance: mandatory -- This method must be implemented.*
"""
metadata = dict(self._mdata['genus_type'])
metadata.update({'existing_string_values... | [
"def",
"get_genus_type_metadata",
"(",
"self",
")",
":",
"metadata",
"=",
"dict",
"(",
"self",
".",
"_mdata",
"[",
"'genus_type'",
"]",
")",
"metadata",
".",
"update",
"(",
"{",
"'existing_string_values'",
":",
"self",
".",
"_my_map",
"[",
"'genusTypeId'",
"... | Gets the metadata for a genus type.
return: (osid.Metadata) - metadata for the genus
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"metadata",
"for",
"a",
"genus",
"type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1884-L1893 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidObjectForm.set_genus_type | def set_genus_type(self, genus_type):
"""Sets a genus.
A genus cannot be cleared because all objects have at minimum a
root genus.
arg: genus_type (osid.type.Type): the new genus
raise: InvalidArgument - ``genus_type`` is invalid
raise: NoAccess - ``Metadata.isRead... | python | def set_genus_type(self, genus_type):
"""Sets a genus.
A genus cannot be cleared because all objects have at minimum a
root genus.
arg: genus_type (osid.type.Type): the new genus
raise: InvalidArgument - ``genus_type`` is invalid
raise: NoAccess - ``Metadata.isRead... | [
"def",
"set_genus_type",
"(",
"self",
",",
"genus_type",
")",
":",
"if",
"self",
".",
"get_genus_type_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"errors",
".",
"NoAccess",
"(",
")",
"if",
"not",
"self",
".",
"_is_valid_type",
"(",
... | Sets a genus.
A genus cannot be cleared because all objects have at minimum a
root genus.
arg: genus_type (osid.type.Type): the new genus
raise: InvalidArgument - ``genus_type`` is invalid
raise: NoAccess - ``Metadata.isReadonly()`` is ``true``
raise: NullArgument... | [
"Sets",
"a",
"genus",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1898-L1915 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidObjectForm.clear_genus_type | def clear_genus_type(self):
"""Clears the genus type.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_genus_type_metadata().is_read_only() or
... | python | def clear_genus_type(self):
"""Clears the genus type.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
if (self.get_genus_type_metadata().is_read_only() or
... | [
"def",
"clear_genus_type",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_genus_type_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_genus_type_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
"errors",... | Clears the genus type.
raise: NoAccess - ``Metadata.isRequired()`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.* | [
"Clears",
"the",
"genus",
"type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L1917-L1928 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidList._get_next_n | def _get_next_n(self, object_class, number=None):
"""Gets the next set of "n" elements in this list.
The specified amount must be less than or equal to the return
from ``available()``.
arg: n (cardinal): the number of ``Relationship`` elements
requested which must be... | python | def _get_next_n(self, object_class, number=None):
"""Gets the next set of "n" elements in this list.
The specified amount must be less than or equal to the return
from ``available()``.
arg: n (cardinal): the number of ``Relationship`` elements
requested which must be... | [
"def",
"_get_next_n",
"(",
"self",
",",
"object_class",
",",
"number",
"=",
"None",
")",
":",
"if",
"number",
">",
"self",
".",
"available",
"(",
")",
":",
"# !!! This is not quite as specified (see method docs) !!!",
"raise",
"errors",
".",
"IllegalState",
"(",
... | Gets the next set of "n" elements in this list.
The specified amount must be less than or equal to the return
from ``available()``.
arg: n (cardinal): the number of ``Relationship`` elements
requested which must be less than or equal to
``available()``
... | [
"Gets",
"the",
"next",
"set",
"of",
"n",
"elements",
"in",
"this",
"list",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L2361-L2390 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidList._get_next_object | def _get_next_object(self, object_class):
"""stub"""
next_object = OsidList.next(self)
if isinstance(next_object, dict):
next_object = object_class(osid_object_map=next_object, runtime=self._runtime, proxy=self._proxy)
elif is_string(next_object) and object_class == Id:
... | python | def _get_next_object(self, object_class):
"""stub"""
next_object = OsidList.next(self)
if isinstance(next_object, dict):
next_object = object_class(osid_object_map=next_object, runtime=self._runtime, proxy=self._proxy)
elif is_string(next_object) and object_class == Id:
... | [
"def",
"_get_next_object",
"(",
"self",
",",
"object_class",
")",
":",
"next_object",
"=",
"OsidList",
".",
"next",
"(",
"self",
")",
"if",
"isinstance",
"(",
"next_object",
",",
"dict",
")",
":",
"next_object",
"=",
"object_class",
"(",
"osid_object_map",
"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L2392-L2399 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidList.skip | def skip(self, n):
"""Skip the specified number of elements in the list.
If the number skipped is greater than the number of elements in
the list, hasNext() becomes false and available() returns zero
as there are no more elements to retrieve.
arg: n (cardinal): the number of... | python | def skip(self, n):
"""Skip the specified number of elements in the list.
If the number skipped is greater than the number of elements in
the list, hasNext() becomes false and available() returns zero
as there are no more elements to retrieve.
arg: n (cardinal): the number of... | [
"def",
"skip",
"(",
"self",
",",
"n",
")",
":",
"try",
":",
"self",
".",
"_iter_object",
".",
"skip",
"(",
"n",
")",
"except",
"AttributeError",
":",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"n",
")",
":",
"self",
".",
"next",
"(",
")"
] | Skip the specified number of elements in the list.
If the number skipped is greater than the number of elements in
the list, hasNext() becomes false and available() returns zero
as there are no more elements to retrieve.
arg: n (cardinal): the number of elements to skip
*com... | [
"Skip",
"the",
"specified",
"number",
"of",
"elements",
"in",
"the",
"list",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L2469-L2484 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidNode.get_parent_ids | def get_parent_ids(self):
"""Gets the parents of this node.
return: (osid.id.IdList) - the parents of this node
*compliance: mandatory -- This method must be implemented.*
"""
id_list = []
from ..id.objects import IdList
for parent_node in self._my_map['parentNo... | python | def get_parent_ids(self):
"""Gets the parents of this node.
return: (osid.id.IdList) - the parents of this node
*compliance: mandatory -- This method must be implemented.*
"""
id_list = []
from ..id.objects import IdList
for parent_node in self._my_map['parentNo... | [
"def",
"get_parent_ids",
"(",
"self",
")",
":",
"id_list",
"=",
"[",
"]",
"from",
".",
".",
"id",
".",
"objects",
"import",
"IdList",
"for",
"parent_node",
"in",
"self",
".",
"_my_map",
"[",
"'parentNodes'",
"]",
":",
"id_list",
".",
"append",
"(",
"st... | Gets the parents of this node.
return: (osid.id.IdList) - the parents of this node
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"parents",
"of",
"this",
"node",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L2533-L2544 |
mitsei/dlkit | dlkit/json_/osid/objects.py | OsidNode.get_child_ids | def get_child_ids(self):
"""Gets the children of this node.
return: (osid.id.IdList) - the children of this node
*compliance: mandatory -- This method must be implemented.*
"""
id_list = []
from ..id.objects import IdList
for child_node in self._my_map['childNod... | python | def get_child_ids(self):
"""Gets the children of this node.
return: (osid.id.IdList) - the children of this node
*compliance: mandatory -- This method must be implemented.*
"""
id_list = []
from ..id.objects import IdList
for child_node in self._my_map['childNod... | [
"def",
"get_child_ids",
"(",
"self",
")",
":",
"id_list",
"=",
"[",
"]",
"from",
".",
".",
"id",
".",
"objects",
"import",
"IdList",
"for",
"child_node",
"in",
"self",
".",
"_my_map",
"[",
"'childNodes'",
"]",
":",
"id_list",
".",
"append",
"(",
"str",... | Gets the children of this node.
return: (osid.id.IdList) - the children of this node
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"children",
"of",
"this",
"node",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/osid/objects.py#L2577-L2588 |
mitsei/dlkit | dlkit/json_/relationship/objects.py | FamilyNode.get_family | def get_family(self):
"""Gets the ``Family`` at this node.
return: (osid.relationship.Family) - the family represented by
this node
*compliance: mandatory -- This method must be implemented.*
"""
if self._lookup_session is None:
mgr = get_provider_ma... | python | def get_family(self):
"""Gets the ``Family`` at this node.
return: (osid.relationship.Family) - the family represented by
this node
*compliance: mandatory -- This method must be implemented.*
"""
if self._lookup_session is None:
mgr = get_provider_ma... | [
"def",
"get_family",
"(",
"self",
")",
":",
"if",
"self",
".",
"_lookup_session",
"is",
"None",
":",
"mgr",
"=",
"get_provider_manager",
"(",
"'RELATIONSHIP'",
",",
"runtime",
"=",
"self",
".",
"_runtime",
",",
"proxy",
"=",
"self",
".",
"_proxy",
")",
"... | Gets the ``Family`` at this node.
return: (osid.relationship.Family) - the family represented by
this node
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"Family",
"at",
"this",
"node",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/relationship/objects.py#L364-L375 |
mitsei/dlkit | dlkit/json_/relationship/objects.py | FamilyNode.get_parent_family_nodes | def get_parent_family_nodes(self):
"""Gets the parents of this family.
return: (osid.relationship.FamilyNodeList) - the parents of the
``id``
*compliance: mandatory -- This method must be implemented.*
"""
parent_family_nodes = []
for node in self._my_ma... | python | def get_parent_family_nodes(self):
"""Gets the parents of this family.
return: (osid.relationship.FamilyNodeList) - the parents of the
``id``
*compliance: mandatory -- This method must be implemented.*
"""
parent_family_nodes = []
for node in self._my_ma... | [
"def",
"get_parent_family_nodes",
"(",
"self",
")",
":",
"parent_family_nodes",
"=",
"[",
"]",
"for",
"node",
"in",
"self",
".",
"_my_map",
"[",
"'parentNodes'",
"]",
":",
"parent_family_nodes",
".",
"append",
"(",
"FamilyNode",
"(",
"node",
".",
"_my_map",
... | Gets the parents of this family.
return: (osid.relationship.FamilyNodeList) - the parents of the
``id``
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"the",
"parents",
"of",
"this",
"family",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/relationship/objects.py#L379-L394 |
mulkieran/justbases | src/justbases/_config.py | BasesConfig.set_display_config | def set_display_config(cls, config): # pragma: no cover
"""
Set configuration for superficial aspects of display.
:param DisplayConfig config: a configuration object
"""
cls.DISPLAY_CONFIG = DisplayConfig(
show_approx_str=config.show_approx_str,
base_conf... | python | def set_display_config(cls, config): # pragma: no cover
"""
Set configuration for superficial aspects of display.
:param DisplayConfig config: a configuration object
"""
cls.DISPLAY_CONFIG = DisplayConfig(
show_approx_str=config.show_approx_str,
base_conf... | [
"def",
"set_display_config",
"(",
"cls",
",",
"config",
")",
":",
"# pragma: no cover",
"cls",
".",
"DISPLAY_CONFIG",
"=",
"DisplayConfig",
"(",
"show_approx_str",
"=",
"config",
".",
"show_approx_str",
",",
"base_config",
"=",
"config",
".",
"base_config",
",",
... | Set configuration for superficial aspects of display.
:param DisplayConfig config: a configuration object | [
"Set",
"configuration",
"for",
"superficial",
"aspects",
"of",
"display",
"."
] | train | https://github.com/mulkieran/justbases/blob/dd52ff4b3d11609f54b2673599ee4eeb20f9734f/src/justbases/_config.py#L185-L196 |
chop-dbhi/varify | varify/api/__init__.py | cache_key | def cache_key(model, pk):
"Generates a cache key for a model instance."
app = model._meta.app_label
name = model._meta.module_name
return 'api:{0}:{1}:{2}'.format(app, name, pk) | python | def cache_key(model, pk):
"Generates a cache key for a model instance."
app = model._meta.app_label
name = model._meta.module_name
return 'api:{0}:{1}:{2}'.format(app, name, pk) | [
"def",
"cache_key",
"(",
"model",
",",
"pk",
")",
":",
"app",
"=",
"model",
".",
"_meta",
".",
"app_label",
"name",
"=",
"model",
".",
"_meta",
".",
"module_name",
"return",
"'api:{0}:{1}:{2}'",
".",
"format",
"(",
"app",
",",
"name",
",",
"pk",
")"
] | Generates a cache key for a model instance. | [
"Generates",
"a",
"cache",
"key",
"for",
"a",
"model",
"instance",
"."
] | train | https://github.com/chop-dbhi/varify/blob/5dc721e49ed9bd3582f4b117785fdd1a8b6ba777/varify/api/__init__.py#L16-L20 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/converters.py | transcript_to_gpd_line | def transcript_to_gpd_line(tx,transcript_name=None,gene_name=None,direction=None):
"""Get the genpred format string representation of the mapping
:param transcript_name:
:param gene_name:
:param strand:
:type transcript_name: string
:type gene_name: string
:type strand: string
:return: ... | python | def transcript_to_gpd_line(tx,transcript_name=None,gene_name=None,direction=None):
"""Get the genpred format string representation of the mapping
:param transcript_name:
:param gene_name:
:param strand:
:type transcript_name: string
:type gene_name: string
:type strand: string
:return: ... | [
"def",
"transcript_to_gpd_line",
"(",
"tx",
",",
"transcript_name",
"=",
"None",
",",
"gene_name",
"=",
"None",
",",
"direction",
"=",
"None",
")",
":",
"tname",
"=",
"tx",
".",
"_options",
".",
"name",
"if",
"transcript_name",
":",
"tname",
"=",
"transcri... | Get the genpred format string representation of the mapping
:param transcript_name:
:param gene_name:
:param strand:
:type transcript_name: string
:type gene_name: string
:type strand: string
:return: GPD line
:rtype: string | [
"Get",
"the",
"genpred",
"format",
"string",
"representation",
"of",
"the",
"mapping"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/converters.py#L6-L40 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/converters.py | transcript_to_fake_psl_line | def transcript_to_fake_psl_line(self,ref):
"""Convert a mapping to a fake PSL line
:param ref: reference genome dictionary
:type ref: dict()
:return: psl line
:rtype: string
"""
self._initialize()
e = self
mylen = 0
matches = 0
qstartslist = []
for exon in self.exons:
... | python | def transcript_to_fake_psl_line(self,ref):
"""Convert a mapping to a fake PSL line
:param ref: reference genome dictionary
:type ref: dict()
:return: psl line
:rtype: string
"""
self._initialize()
e = self
mylen = 0
matches = 0
qstartslist = []
for exon in self.exons:
... | [
"def",
"transcript_to_fake_psl_line",
"(",
"self",
",",
"ref",
")",
":",
"self",
".",
"_initialize",
"(",
")",
"e",
"=",
"self",
"mylen",
"=",
"0",
"matches",
"=",
"0",
"qstartslist",
"=",
"[",
"]",
"for",
"exon",
"in",
"self",
".",
"exons",
":",
"my... | Convert a mapping to a fake PSL line
:param ref: reference genome dictionary
:type ref: dict()
:return: psl line
:rtype: string | [
"Convert",
"a",
"mapping",
"to",
"a",
"fake",
"PSL",
"line"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/converters.py#L42-L81 |
ilgarm/pyzimbra | pyzimbra/soap_transport.py | SoapTransport.invoke | def invoke(self, ns, request_name, params, auth_token, simplify=False):
"""
Invokes zimbra soap request.
"""
ZimbraClientTransport.invoke(self,
ns,
request_name,
params,
... | python | def invoke(self, ns, request_name, params, auth_token, simplify=False):
"""
Invokes zimbra soap request.
"""
ZimbraClientTransport.invoke(self,
ns,
request_name,
params,
... | [
"def",
"invoke",
"(",
"self",
",",
"ns",
",",
"request_name",
",",
"params",
",",
"auth_token",
",",
"simplify",
"=",
"False",
")",
":",
"ZimbraClientTransport",
".",
"invoke",
"(",
"self",
",",
"ns",
",",
"request_name",
",",
"params",
",",
"auth_token",
... | Invokes zimbra soap request. | [
"Invokes",
"zimbra",
"soap",
"request",
"."
] | train | https://github.com/ilgarm/pyzimbra/blob/c397bc7497554d260ec6fd1a80405aed872a70cc/pyzimbra/soap_transport.py#L52-L89 |
mitsei/dlkit | dlkit/primordium/locale/types/currency.py | get_type_data | def get_type_data(name):
"""Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type
"""
name = name.upper()
if name in ISO_CURRENCY_TYPES:
article = 'the '
type_name = ISO_CURRENCY_TYPES[name]
elif name in ISO_CURRENCY_ELEMENT_TYPES:
... | python | def get_type_data(name):
"""Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type
"""
name = name.upper()
if name in ISO_CURRENCY_TYPES:
article = 'the '
type_name = ISO_CURRENCY_TYPES[name]
elif name in ISO_CURRENCY_ELEMENT_TYPES:
... | [
"def",
"get_type_data",
"(",
"name",
")",
":",
"name",
"=",
"name",
".",
"upper",
"(",
")",
"if",
"name",
"in",
"ISO_CURRENCY_TYPES",
":",
"article",
"=",
"'the '",
"type_name",
"=",
"ISO_CURRENCY_TYPES",
"[",
"name",
"]",
"elif",
"name",
"in",
"ISO_CURREN... | Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type | [
"Return",
"dictionary",
"representation",
"of",
"type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/primordium/locale/types/currency.py#L529-L554 |
dreamhost/cliff-tablib | setup.py | find_package_data | def find_package_data(
where='.', package='',
exclude=standard_exclude,
exclude_directories=standard_exclude_directories,
only_in_packages=True,
show_ignored=False,
):
"""
Return a dictionary suitable for use in ``package_data``
in a distutils ``setup.py`` file.
The dictionary l... | python | def find_package_data(
where='.', package='',
exclude=standard_exclude,
exclude_directories=standard_exclude_directories,
only_in_packages=True,
show_ignored=False,
):
"""
Return a dictionary suitable for use in ``package_data``
in a distutils ``setup.py`` file.
The dictionary l... | [
"def",
"find_package_data",
"(",
"where",
"=",
"'.'",
",",
"package",
"=",
"''",
",",
"exclude",
"=",
"standard_exclude",
",",
"exclude_directories",
"=",
"standard_exclude_directories",
",",
"only_in_packages",
"=",
"True",
",",
"show_ignored",
"=",
"False",
",",... | Return a dictionary suitable for use in ``package_data``
in a distutils ``setup.py`` file.
The dictionary looks like::
{'package': [files]}
Where ``files`` is a list of all the files in that package that
don't match anything in ``exclude``.
If ``only_in_packages`` is true, then top-level... | [
"Return",
"a",
"dictionary",
"suitable",
"for",
"use",
"in",
"package_data",
"in",
"a",
"distutils",
"setup",
".",
"py",
"file",
"."
] | train | https://github.com/dreamhost/cliff-tablib/blob/090daf24ad11f8947d7badd42426f41ca39f76ca/setup.py#L33-L114 |
morngrar/betterdialogs | betterdialogs/datedialog.py | DateDialog.buttons | def buttons(self, master):
'''Add a standard button box.
Override if you do not want the standard buttons
'''
box = tk.Frame(master)
ttk.Button(
box,
text="Next",
width=10,
command=self.next_day
).pack(side=tk.LEFT, padx=... | python | def buttons(self, master):
'''Add a standard button box.
Override if you do not want the standard buttons
'''
box = tk.Frame(master)
ttk.Button(
box,
text="Next",
width=10,
command=self.next_day
).pack(side=tk.LEFT, padx=... | [
"def",
"buttons",
"(",
"self",
",",
"master",
")",
":",
"box",
"=",
"tk",
".",
"Frame",
"(",
"master",
")",
"ttk",
".",
"Button",
"(",
"box",
",",
"text",
"=",
"\"Next\"",
",",
"width",
"=",
"10",
",",
"command",
"=",
"self",
".",
"next_day",
")"... | Add a standard button box.
Override if you do not want the standard buttons | [
"Add",
"a",
"standard",
"button",
"box",
"."
] | train | https://github.com/morngrar/betterdialogs/blob/185570c8dd6ea3718fef5e09ac1647e716d8bff5/betterdialogs/datedialog.py#L89-L121 |
jason-weirather/py-seq-tools | seqtools/errors.py | ErrorProfileFactory.close | def close(self):
"""Set some objects to None to hopefully free up some memory."""
self._target_context_errors = None
self._query_context_errors = None
self._general_errors = None
for ae in self._alignment_errors:
ae.close()
self._alignment_errors = None | python | def close(self):
"""Set some objects to None to hopefully free up some memory."""
self._target_context_errors = None
self._query_context_errors = None
self._general_errors = None
for ae in self._alignment_errors:
ae.close()
self._alignment_errors = None | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"_target_context_errors",
"=",
"None",
"self",
".",
"_query_context_errors",
"=",
"None",
"self",
".",
"_general_errors",
"=",
"None",
"for",
"ae",
"in",
"self",
".",
"_alignment_errors",
":",
"ae",
".",
... | Set some objects to None to hopefully free up some memory. | [
"Set",
"some",
"objects",
"to",
"None",
"to",
"hopefully",
"free",
"up",
"some",
"memory",
"."
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L53-L60 |
jason-weirather/py-seq-tools | seqtools/errors.py | ErrorProfileFactory.add_alignment_errors | def add_alignment_errors(self,ae):
"""If you alread have thealignment errors, add them for profile construction."""
self._target_context_errors = None
self._query_context_errors = None
self._alignment_errors.append(ae)
self._general_errors.add_alignment_errors(ae) | python | def add_alignment_errors(self,ae):
"""If you alread have thealignment errors, add them for profile construction."""
self._target_context_errors = None
self._query_context_errors = None
self._alignment_errors.append(ae)
self._general_errors.add_alignment_errors(ae) | [
"def",
"add_alignment_errors",
"(",
"self",
",",
"ae",
")",
":",
"self",
".",
"_target_context_errors",
"=",
"None",
"self",
".",
"_query_context_errors",
"=",
"None",
"self",
".",
"_alignment_errors",
".",
"append",
"(",
"ae",
")",
"self",
".",
"_general_erro... | If you alread have thealignment errors, add them for profile construction. | [
"If",
"you",
"alread",
"have",
"thealignment",
"errors",
"add",
"them",
"for",
"profile",
"construction",
"."
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L63-L68 |
jason-weirather/py-seq-tools | seqtools/errors.py | ErrorProfileFactory.add_alignment | def add_alignment(self,align):
"""Calculate alignment errors from the alignment and add it to the profile."""
self._target_context_errors = None
self._query_context_errors = None
ae = AlignmentErrors(align)
self._alignment_errors.append(ae)
self._general_errors.add_alignment_errors(ae) | python | def add_alignment(self,align):
"""Calculate alignment errors from the alignment and add it to the profile."""
self._target_context_errors = None
self._query_context_errors = None
ae = AlignmentErrors(align)
self._alignment_errors.append(ae)
self._general_errors.add_alignment_errors(ae) | [
"def",
"add_alignment",
"(",
"self",
",",
"align",
")",
":",
"self",
".",
"_target_context_errors",
"=",
"None",
"self",
".",
"_query_context_errors",
"=",
"None",
"ae",
"=",
"AlignmentErrors",
"(",
"align",
")",
"self",
".",
"_alignment_errors",
".",
"append"... | Calculate alignment errors from the alignment and add it to the profile. | [
"Calculate",
"alignment",
"errors",
"from",
"the",
"alignment",
"and",
"add",
"it",
"to",
"the",
"profile",
"."
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L70-L76 |
jason-weirather/py-seq-tools | seqtools/errors.py | ErrorProfileFactory.get_target_context_error_report | def get_target_context_error_report(self):
"""Get a report on context-specific errors relative to what is expected on the target strand.
:returns: Object with a 'header' and a 'data' where data describes context: before,after ,reference, query. A total is kept for each reference base, and individual errors ar... | python | def get_target_context_error_report(self):
"""Get a report on context-specific errors relative to what is expected on the target strand.
:returns: Object with a 'header' and a 'data' where data describes context: before,after ,reference, query. A total is kept for each reference base, and individual errors ar... | [
"def",
"get_target_context_error_report",
"(",
"self",
")",
":",
"report",
"=",
"{",
"}",
"report",
"[",
"'header'",
"]",
"=",
"[",
"'before'",
",",
"'after'",
",",
"'reference'",
",",
"'query'",
",",
"'fraction'",
"]",
"report",
"[",
"'data'",
"]",
"=",
... | Get a report on context-specific errors relative to what is expected on the target strand.
:returns: Object with a 'header' and a 'data' where data describes context: before,after ,reference, query. A total is kept for each reference base, and individual errors are finally checked
:rtype: dict() | [
"Get",
"a",
"report",
"on",
"context",
"-",
"specific",
"errors",
"relative",
"to",
"what",
"is",
"expected",
"on",
"the",
"target",
"strand",
"."
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L87-L106 |
jason-weirather/py-seq-tools | seqtools/errors.py | ErrorProfileFactory.get_min_context_count | def get_min_context_count(self,context_type):
"""Calculate out which context has the minum coverage thusfar.
:param context_type: 'target' or 'query'
:type context_type: string
:returns: Minimum Coverage
:rtype: int
"""
cnt = 10000000000
bases = ['A','C','G','T']
basesplus = ['A','... | python | def get_min_context_count(self,context_type):
"""Calculate out which context has the minum coverage thusfar.
:param context_type: 'target' or 'query'
:type context_type: string
:returns: Minimum Coverage
:rtype: int
"""
cnt = 10000000000
bases = ['A','C','G','T']
basesplus = ['A','... | [
"def",
"get_min_context_count",
"(",
"self",
",",
"context_type",
")",
":",
"cnt",
"=",
"10000000000",
"bases",
"=",
"[",
"'A'",
",",
"'C'",
",",
"'G'",
",",
"'T'",
"]",
"basesplus",
"=",
"[",
"'A'",
",",
"'C'",
",",
"'G'",
",",
"'T'",
",",
"'-'",
... | Calculate out which context has the minum coverage thusfar.
:param context_type: 'target' or 'query'
:type context_type: string
:returns: Minimum Coverage
:rtype: int | [
"Calculate",
"out",
"which",
"context",
"has",
"the",
"minum",
"coverage",
"thusfar",
"."
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L108-L132 |
jason-weirather/py-seq-tools | seqtools/errors.py | ErrorProfileFactory.write_context_error_report | def write_context_error_report(self,file,context_type):
"""Write a context error report relative to the target or query into the specified filename
:param file: The name of a file to write the report to
:param context_type: They type of profile, target or query based
:type file: string
:type contex... | python | def write_context_error_report(self,file,context_type):
"""Write a context error report relative to the target or query into the specified filename
:param file: The name of a file to write the report to
:param context_type: They type of profile, target or query based
:type file: string
:type contex... | [
"def",
"write_context_error_report",
"(",
"self",
",",
"file",
",",
"context_type",
")",
":",
"if",
"context_type",
"==",
"'target'",
":",
"r",
"=",
"self",
".",
"get_target_context_error_report",
"(",
")",
"elif",
"context_type",
"==",
"'query'",
":",
"r",
"=... | Write a context error report relative to the target or query into the specified filename
:param file: The name of a file to write the report to
:param context_type: They type of profile, target or query based
:type file: string
:type context_type: string | [
"Write",
"a",
"context",
"error",
"report",
"relative",
"to",
"the",
"target",
"or",
"query",
"into",
"the",
"specified",
"filename"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L134-L154 |
jason-weirather/py-seq-tools | seqtools/errors.py | ErrorProfileFactory.get_query_context_error_report | def get_query_context_error_report(self):
"""Get a report on context-specific errors relative to what is expected on the query strand.
:returns: Object with a 'header' and a 'data' where data describes context: before,after ,reference, query. A total is kept for each reference base, and individual errors are ... | python | def get_query_context_error_report(self):
"""Get a report on context-specific errors relative to what is expected on the query strand.
:returns: Object with a 'header' and a 'data' where data describes context: before,after ,reference, query. A total is kept for each reference base, and individual errors are ... | [
"def",
"get_query_context_error_report",
"(",
"self",
")",
":",
"report",
"=",
"{",
"}",
"report",
"[",
"'header'",
"]",
"=",
"[",
"'before'",
",",
"'after'",
",",
"'reference'",
",",
"'query'",
",",
"'fraction'",
"]",
"report",
"[",
"'data'",
"]",
"=",
... | Get a report on context-specific errors relative to what is expected on the query strand.
:returns: Object with a 'header' and a 'data' where data describes context: before,after ,reference, query. A total is kept for each reference base, and individual errors are finally checked
:rtype: dict() | [
"Get",
"a",
"report",
"on",
"context",
"-",
"specific",
"errors",
"relative",
"to",
"what",
"is",
"expected",
"on",
"the",
"query",
"strand",
"."
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L156-L175 |
jason-weirather/py-seq-tools | seqtools/errors.py | ErrorProfileFactory.combine_context_errors | def combine_context_errors(self):
"""Each alignment contributes some information to the error report. These reports for each alignment need to be gone through and combined into one report.
:returns: Dictionary containing the error counts on context base
:rtype: dict()
"""
r = {}
if self._tar... | python | def combine_context_errors(self):
"""Each alignment contributes some information to the error report. These reports for each alignment need to be gone through and combined into one report.
:returns: Dictionary containing the error counts on context base
:rtype: dict()
"""
r = {}
if self._tar... | [
"def",
"combine_context_errors",
"(",
"self",
")",
":",
"r",
"=",
"{",
"}",
"if",
"self",
".",
"_target_context_errors",
":",
"r",
"=",
"self",
".",
"_target_context_errors",
"for",
"k",
"in",
"[",
"x",
".",
"get_context_target_errors",
"(",
")",
"for",
"x... | Each alignment contributes some information to the error report. These reports for each alignment need to be gone through and combined into one report.
:returns: Dictionary containing the error counts on context base
:rtype: dict() | [
"Each",
"alignment",
"contributes",
"some",
"information",
"to",
"the",
"error",
"report",
".",
"These",
"reports",
"for",
"each",
"alignment",
"need",
"to",
"be",
"gone",
"through",
"and",
"combined",
"into",
"one",
"report",
"."
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L199-L240 |
jason-weirather/py-seq-tools | seqtools/errors.py | ErrorProfileFactory.get_string | def get_string(self):
"""Make a string reprentation of the error stats.
:returns: error profile
:rtype: string
"""
ostr = ''
ostr += str(len(self._alignment_errors))+" Alignments\n"
ostr += 'Target: '+"\n"
totbases = sum([len(x.get_target_sequence()) for x in self._alignment_errors])
... | python | def get_string(self):
"""Make a string reprentation of the error stats.
:returns: error profile
:rtype: string
"""
ostr = ''
ostr += str(len(self._alignment_errors))+" Alignments\n"
ostr += 'Target: '+"\n"
totbases = sum([len(x.get_target_sequence()) for x in self._alignment_errors])
... | [
"def",
"get_string",
"(",
"self",
")",
":",
"ostr",
"=",
"''",
"ostr",
"+=",
"str",
"(",
"len",
"(",
"self",
".",
"_alignment_errors",
")",
")",
"+",
"\" Alignments\\n\"",
"ostr",
"+=",
"'Target: '",
"+",
"\"\\n\"",
"totbases",
"=",
"sum",
"(",
"[",
"l... | Make a string reprentation of the error stats.
:returns: error profile
:rtype: string | [
"Make",
"a",
"string",
"reprentation",
"of",
"the",
"error",
"stats",
"."
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L245-L266 |
jason-weirather/py-seq-tools | seqtools/errors.py | BaseError.get_error_probability | def get_error_probability(self):
"""This means for the base we are talking about how many errors between 0 and 1 do we attribute to it?
For the 'unobserved' errors, these can only count when one is adjacent to base
:returns: error probability p(error_observed)+(1-p_error_observed)*error_unobserved
:... | python | def get_error_probability(self):
"""This means for the base we are talking about how many errors between 0 and 1 do we attribute to it?
For the 'unobserved' errors, these can only count when one is adjacent to base
:returns: error probability p(error_observed)+(1-p_error_observed)*error_unobserved
:... | [
"def",
"get_error_probability",
"(",
"self",
")",
":",
"a",
"=",
"self",
".",
"_observable",
".",
"get_error_probability",
"(",
")",
"b",
"=",
"self",
".",
"_unobservable",
".",
"get_error_probability",
"(",
")",
"return",
"a",
"+",
"(",
"1",
"-",
"a",
"... | This means for the base we are talking about how many errors between 0 and 1 do we attribute to it?
For the 'unobserved' errors, these can only count when one is adjacent to base
:returns: error probability p(error_observed)+(1-p_error_observed)*error_unobserved
:rtype: float | [
"This",
"means",
"for",
"the",
"base",
"we",
"are",
"talking",
"about",
"how",
"many",
"errors",
"between",
"0",
"and",
"1",
"do",
"we",
"attribute",
"to",
"it?",
"For",
"the",
"unobserved",
"errors",
"these",
"can",
"only",
"count",
"when",
"one",
"is",... | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L317-L327 |
jason-weirather/py-seq-tools | seqtools/errors.py | BaseError.set_observable | def set_observable(self,tseq,qseq):
"""Set the observable sequence data
:param tseq: target sequence (from the homopolymer)
:param qseq: query sequence ( from the homopolymer)
:type tseq: string
:type qseq: string
"""
tnt = None
qnt = None
if len(tseq) > 0: tnt = tseq[0]
if len... | python | def set_observable(self,tseq,qseq):
"""Set the observable sequence data
:param tseq: target sequence (from the homopolymer)
:param qseq: query sequence ( from the homopolymer)
:type tseq: string
:type qseq: string
"""
tnt = None
qnt = None
if len(tseq) > 0: tnt = tseq[0]
if len... | [
"def",
"set_observable",
"(",
"self",
",",
"tseq",
",",
"qseq",
")",
":",
"tnt",
"=",
"None",
"qnt",
"=",
"None",
"if",
"len",
"(",
"tseq",
")",
">",
"0",
":",
"tnt",
"=",
"tseq",
"[",
"0",
"]",
"if",
"len",
"(",
"qseq",
")",
">",
"0",
":",
... | Set the observable sequence data
:param tseq: target sequence (from the homopolymer)
:param qseq: query sequence ( from the homopolymer)
:type tseq: string
:type qseq: string | [
"Set",
"the",
"observable",
"sequence",
"data"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L346-L359 |
jason-weirather/py-seq-tools | seqtools/errors.py | BaseError.set_unobserved_before | def set_unobserved_before(self,tlen,qlen,nt,p):
"""Set the unobservable sequence data before this base
:param tlen: target homopolymer length
:param qlen: query homopolymer length
:param nt: nucleotide
:param p: p is the probability of attributing this base to the unobserved error
:type tlen: i... | python | def set_unobserved_before(self,tlen,qlen,nt,p):
"""Set the unobservable sequence data before this base
:param tlen: target homopolymer length
:param qlen: query homopolymer length
:param nt: nucleotide
:param p: p is the probability of attributing this base to the unobserved error
:type tlen: i... | [
"def",
"set_unobserved_before",
"(",
"self",
",",
"tlen",
",",
"qlen",
",",
"nt",
",",
"p",
")",
":",
"self",
".",
"_unobservable",
".",
"set_before",
"(",
"tlen",
",",
"qlen",
",",
"nt",
",",
"p",
")"
] | Set the unobservable sequence data before this base
:param tlen: target homopolymer length
:param qlen: query homopolymer length
:param nt: nucleotide
:param p: p is the probability of attributing this base to the unobserved error
:type tlen: int
:type qlen: int
:type nt: char
:type p: ... | [
"Set",
"the",
"unobservable",
"sequence",
"data",
"before",
"this",
"base"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L361-L374 |
jason-weirather/py-seq-tools | seqtools/errors.py | BaseError.set_unobserved_after | def set_unobserved_after(self,tlen,qlen,nt,p):
"""Set the unobservable sequence data after this base
:param tlen: target homopolymer length
:param qlen: query homopolymer length
:param nt: nucleotide
:param p: p is the probability of attributing this base to the unobserved error
:type tlen: int... | python | def set_unobserved_after(self,tlen,qlen,nt,p):
"""Set the unobservable sequence data after this base
:param tlen: target homopolymer length
:param qlen: query homopolymer length
:param nt: nucleotide
:param p: p is the probability of attributing this base to the unobserved error
:type tlen: int... | [
"def",
"set_unobserved_after",
"(",
"self",
",",
"tlen",
",",
"qlen",
",",
"nt",
",",
"p",
")",
":",
"self",
".",
"_unobservable",
".",
"set_after",
"(",
"tlen",
",",
"qlen",
",",
"nt",
",",
"p",
")"
] | Set the unobservable sequence data after this base
:param tlen: target homopolymer length
:param qlen: query homopolymer length
:param nt: nucleotide
:param p: p is the probability of attributing this base to the unobserved error
:type tlen: int
:type qlen: int
:type nt: char
:type p: f... | [
"Set",
"the",
"unobservable",
"sequence",
"data",
"after",
"this",
"base"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L375-L388 |
jason-weirather/py-seq-tools | seqtools/errors.py | BaseError.get_adjusted_error_count | def get_adjusted_error_count(self):
""" Get the total error count associated with this single base.
This would typically be one but sometimes it may be larger for instertions.
:returns: error_count
:rtype: float
"""
p1 = self._observable.get_attributable_length()
p1 += self._unobservabl... | python | def get_adjusted_error_count(self):
""" Get the total error count associated with this single base.
This would typically be one but sometimes it may be larger for instertions.
:returns: error_count
:rtype: float
"""
p1 = self._observable.get_attributable_length()
p1 += self._unobservabl... | [
"def",
"get_adjusted_error_count",
"(",
"self",
")",
":",
"p1",
"=",
"self",
".",
"_observable",
".",
"get_attributable_length",
"(",
")",
"p1",
"+=",
"self",
".",
"_unobservable",
".",
"get_attributable_length",
"(",
")",
"return",
"p1"
] | Get the total error count associated with this single base.
This would typically be one but sometimes it may be larger for instertions.
:returns: error_count
:rtype: float | [
"Get",
"the",
"total",
"error",
"count",
"associated",
"with",
"this",
"single",
"base",
".",
"This",
"would",
"typically",
"be",
"one",
"but",
"sometimes",
"it",
"may",
"be",
"larger",
"for",
"instertions",
"."
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L390-L400 |
jason-weirather/py-seq-tools | seqtools/errors.py | BaseError.get_base | def get_base(self):
""" Get the single base at this position.
:returns: base
:rtype: char
"""
if self._type == 'query':
return self._observable.get_query_base()
return self._observable.get_target_base() | python | def get_base(self):
""" Get the single base at this position.
:returns: base
:rtype: char
"""
if self._type == 'query':
return self._observable.get_query_base()
return self._observable.get_target_base() | [
"def",
"get_base",
"(",
"self",
")",
":",
"if",
"self",
".",
"_type",
"==",
"'query'",
":",
"return",
"self",
".",
"_observable",
".",
"get_query_base",
"(",
")",
"return",
"self",
".",
"_observable",
".",
"get_target_base",
"(",
")"
] | Get the single base at this position.
:returns: base
:rtype: char | [
"Get",
"the",
"single",
"base",
"at",
"this",
"position",
"."
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L402-L411 |
jason-weirather/py-seq-tools | seqtools/errors.py | BaseError.get_string | def get_string(self):
""" Get a string representation of this single base error.
:returns: report
:rtype: string
"""
ostr = ''
ostr += 'BaseError for ['+self._type+'] base: '+self.get_base()+"\n"
if self._observable.get_error_probability() > 0:
ostr += ' Homopolymer set:'+"\n"
... | python | def get_string(self):
""" Get a string representation of this single base error.
:returns: report
:rtype: string
"""
ostr = ''
ostr += 'BaseError for ['+self._type+'] base: '+self.get_base()+"\n"
if self._observable.get_error_probability() > 0:
ostr += ' Homopolymer set:'+"\n"
... | [
"def",
"get_string",
"(",
"self",
")",
":",
"ostr",
"=",
"''",
"ostr",
"+=",
"'BaseError for ['",
"+",
"self",
".",
"_type",
"+",
"'] base: '",
"+",
"self",
".",
"get_base",
"(",
")",
"+",
"\"\\n\"",
"if",
"self",
".",
"_observable",
".",
"get_error_prob... | Get a string representation of this single base error.
:returns: report
:rtype: string | [
"Get",
"a",
"string",
"representation",
"of",
"this",
"single",
"base",
"error",
"."
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L425-L458 |
jason-weirather/py-seq-tools | seqtools/errors.py | AlignmentErrors.get_context_target_errors | def get_context_target_errors(self):
"""A more straitfoward calculation of the context-specific errors
relative to the target
:returns: matrix of observed contexts and values
:rtype: matrix of [before][after][reference]{types} with types being any base or a deletion.
"""
if self._context_targ... | python | def get_context_target_errors(self):
"""A more straitfoward calculation of the context-specific errors
relative to the target
:returns: matrix of observed contexts and values
:rtype: matrix of [before][after][reference]{types} with types being any base or a deletion.
"""
if self._context_targ... | [
"def",
"get_context_target_errors",
"(",
"self",
")",
":",
"if",
"self",
".",
"_context_target_errors",
":",
"return",
"self",
".",
"_context_target_errors",
"if",
"len",
"(",
"self",
".",
"_query_errors",
")",
"<",
"3",
":",
"return",
"{",
"}",
"nts",
"=",
... | A more straitfoward calculation of the context-specific errors
relative to the target
:returns: matrix of observed contexts and values
:rtype: matrix of [before][after][reference]{types} with types being any base or a deletion. | [
"A",
"more",
"straitfoward",
"calculation",
"of",
"the",
"context",
"-",
"specific",
"errors",
"relative",
"to",
"the",
"target"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L763-L864 |
jason-weirather/py-seq-tools | seqtools/errors.py | AlignmentErrors.get_context_query_errors | def get_context_query_errors(self):
"""A more straitfoward calculation of the context-specific errors
relative to the query
:returns: matrix of observed contexts and values
:rtype: matrix of [before][after][query]{types} with types being any base or a deletion.
"""
if self._context_query_erro... | python | def get_context_query_errors(self):
"""A more straitfoward calculation of the context-specific errors
relative to the query
:returns: matrix of observed contexts and values
:rtype: matrix of [before][after][query]{types} with types being any base or a deletion.
"""
if self._context_query_erro... | [
"def",
"get_context_query_errors",
"(",
"self",
")",
":",
"if",
"self",
".",
"_context_query_errors",
":",
"return",
"self",
".",
"_context_query_errors",
"if",
"len",
"(",
"self",
".",
"_query_errors",
")",
"<",
"3",
":",
"return",
"{",
"}",
"nts",
"=",
"... | A more straitfoward calculation of the context-specific errors
relative to the query
:returns: matrix of observed contexts and values
:rtype: matrix of [before][after][query]{types} with types being any base or a deletion. | [
"A",
"more",
"straitfoward",
"calculation",
"of",
"the",
"context",
"-",
"specific",
"errors",
"relative",
"to",
"the",
"query"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L866-L963 |
jason-weirather/py-seq-tools | seqtools/errors.py | AlignmentErrors.get_query_errors | def get_query_errors(self):
""" Return a list of base-wise error observations for the query
:returns: list of base-wise errors
:rtype: list of HPA groups
"""
if self._query_errors: return self._query_errors
v = []
for i in range(len(self._query_hpas)):
v.append(self.get_query_error(... | python | def get_query_errors(self):
""" Return a list of base-wise error observations for the query
:returns: list of base-wise errors
:rtype: list of HPA groups
"""
if self._query_errors: return self._query_errors
v = []
for i in range(len(self._query_hpas)):
v.append(self.get_query_error(... | [
"def",
"get_query_errors",
"(",
"self",
")",
":",
"if",
"self",
".",
"_query_errors",
":",
"return",
"self",
".",
"_query_errors",
"v",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"_query_hpas",
")",
")",
":",
"v",
".",
... | Return a list of base-wise error observations for the query
:returns: list of base-wise errors
:rtype: list of HPA groups | [
"Return",
"a",
"list",
"of",
"base",
"-",
"wise",
"error",
"observations",
"for",
"the",
"query"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L965-L976 |
jason-weirather/py-seq-tools | seqtools/errors.py | AlignmentErrors.get_query_error | def get_query_error(self,i):
"""Just get a single error characterization based on the index
:param i: list index
:type i: int
:returns: base-wise error
:rtype: HPA group description
"""
x = self._query_hpas[i]
h = x['hpa']
pos = x['pos']
prob = 0
be = BaseError('query')
... | python | def get_query_error(self,i):
"""Just get a single error characterization based on the index
:param i: list index
:type i: int
:returns: base-wise error
:rtype: HPA group description
"""
x = self._query_hpas[i]
h = x['hpa']
pos = x['pos']
prob = 0
be = BaseError('query')
... | [
"def",
"get_query_error",
"(",
"self",
",",
"i",
")",
":",
"x",
"=",
"self",
".",
"_query_hpas",
"[",
"i",
"]",
"h",
"=",
"x",
"[",
"'hpa'",
"]",
"pos",
"=",
"x",
"[",
"'pos'",
"]",
"prob",
"=",
"0",
"be",
"=",
"BaseError",
"(",
"'query'",
")",... | Just get a single error characterization based on the index
:param i: list index
:type i: int
:returns: base-wise error
:rtype: HPA group description | [
"Just",
"get",
"a",
"single",
"error",
"characterization",
"based",
"on",
"the",
"index"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L980-L1005 |
jason-weirather/py-seq-tools | seqtools/errors.py | AlignmentErrors.get_target_errors | def get_target_errors(self):
"""Just get a single error characterization based on the index relative to the target
:param i: list index
:type i: int
:returns: list of base-wise errors
:rtype: list of HPA groups
"""
if self._target_errors: return self._target_errors
v = []
for i in... | python | def get_target_errors(self):
"""Just get a single error characterization based on the index relative to the target
:param i: list index
:type i: int
:returns: list of base-wise errors
:rtype: list of HPA groups
"""
if self._target_errors: return self._target_errors
v = []
for i in... | [
"def",
"get_target_errors",
"(",
"self",
")",
":",
"if",
"self",
".",
"_target_errors",
":",
"return",
"self",
".",
"_target_errors",
"v",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"_target_hpas",
")",
")",
":",
"v",
"."... | Just get a single error characterization based on the index relative to the target
:param i: list index
:type i: int
:returns: list of base-wise errors
:rtype: list of HPA groups | [
"Just",
"get",
"a",
"single",
"error",
"characterization",
"based",
"on",
"the",
"index",
"relative",
"to",
"the",
"target"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L1007-L1021 |
jason-weirather/py-seq-tools | seqtools/errors.py | AlignmentErrors.get_target_error | def get_target_error(self,i):
"""Just get a single error characterization based on the index relative to the target
:param i: list index
:type i: int
:returns: base-wise error
:rtype: HPA group description
"""
x = self._target_hpas[i]
h = x['hpa']
pos = x['pos']
prob = 0
be... | python | def get_target_error(self,i):
"""Just get a single error characterization based on the index relative to the target
:param i: list index
:type i: int
:returns: base-wise error
:rtype: HPA group description
"""
x = self._target_hpas[i]
h = x['hpa']
pos = x['pos']
prob = 0
be... | [
"def",
"get_target_error",
"(",
"self",
",",
"i",
")",
":",
"x",
"=",
"self",
".",
"_target_hpas",
"[",
"i",
"]",
"h",
"=",
"x",
"[",
"'hpa'",
"]",
"pos",
"=",
"x",
"[",
"'pos'",
"]",
"prob",
"=",
"0",
"be",
"=",
"BaseError",
"(",
"'target'",
"... | Just get a single error characterization based on the index relative to the target
:param i: list index
:type i: int
:returns: base-wise error
:rtype: HPA group description | [
"Just",
"get",
"a",
"single",
"error",
"characterization",
"based",
"on",
"the",
"index",
"relative",
"to",
"the",
"target"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L1025-L1050 |
jason-weirather/py-seq-tools | seqtools/errors.py | AlignmentErrors.analyze_quality | def analyze_quality(self):
"""Go through HPAGroups and store the distro of ordinal values of
quality scores"""
res = {}
for h in self._hpas:
if h.type() not in res: res[h.type()]={}
for c in h.get_quality():
if c not in res[h.type()]: res[h.type()][c] = 0
res[h.type()][c]... | python | def analyze_quality(self):
"""Go through HPAGroups and store the distro of ordinal values of
quality scores"""
res = {}
for h in self._hpas:
if h.type() not in res: res[h.type()]={}
for c in h.get_quality():
if c not in res[h.type()]: res[h.type()][c] = 0
res[h.type()][c]... | [
"def",
"analyze_quality",
"(",
"self",
")",
":",
"res",
"=",
"{",
"}",
"for",
"h",
"in",
"self",
".",
"_hpas",
":",
"if",
"h",
".",
"type",
"(",
")",
"not",
"in",
"res",
":",
"res",
"[",
"h",
".",
"type",
"(",
")",
"]",
"=",
"{",
"}",
"for"... | Go through HPAGroups and store the distro of ordinal values of
quality scores | [
"Go",
"through",
"HPAGroups",
"and",
"store",
"the",
"distro",
"of",
"ordinal",
"values",
"of",
"quality",
"scores"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L1059-L1068 |
jason-weirather/py-seq-tools | seqtools/errors.py | AlignmentErrors.get_quality_report_string | def get_quality_report_string(self):
"""get a report on quality score distribution. currently prints to stdout"""
if not self._quality_distro:
self.analyze_quality()
ostr = ""
for type in sorted(self._quality_distro.keys()):
total = sum([ord(x)*self._quality_distro[type][x] for x in self._q... | python | def get_quality_report_string(self):
"""get a report on quality score distribution. currently prints to stdout"""
if not self._quality_distro:
self.analyze_quality()
ostr = ""
for type in sorted(self._quality_distro.keys()):
total = sum([ord(x)*self._quality_distro[type][x] for x in self._q... | [
"def",
"get_quality_report_string",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_quality_distro",
":",
"self",
".",
"analyze_quality",
"(",
")",
"ostr",
"=",
"\"\"",
"for",
"type",
"in",
"sorted",
"(",
"self",
".",
"_quality_distro",
".",
"keys",
"("... | get a report on quality score distribution. currently prints to stdout | [
"get",
"a",
"report",
"on",
"quality",
"score",
"distribution",
".",
"currently",
"prints",
"to",
"stdout"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L1069-L1079 |
jason-weirather/py-seq-tools | seqtools/errors.py | AlignmentErrors._misalign_split | def _misalign_split(self,alns):
"""Requires alignment strings have been set so for each exon we have
query, target and query_quality
_has_quality will specify whether or not the quality is meaningful
"""
total = []
z = 0
for x in alns:
z += 1
exon_num = z
if self._ali... | python | def _misalign_split(self,alns):
"""Requires alignment strings have been set so for each exon we have
query, target and query_quality
_has_quality will specify whether or not the quality is meaningful
"""
total = []
z = 0
for x in alns:
z += 1
exon_num = z
if self._ali... | [
"def",
"_misalign_split",
"(",
"self",
",",
"alns",
")",
":",
"total",
"=",
"[",
"]",
"z",
"=",
"0",
"for",
"x",
"in",
"alns",
":",
"z",
"+=",
"1",
"exon_num",
"=",
"z",
"if",
"self",
".",
"_alignment",
".",
"strand",
"==",
"'-'",
":",
"exon_num"... | Requires alignment strings have been set so for each exon we have
query, target and query_quality
_has_quality will specify whether or not the quality is meaningful | [
"Requires",
"alignment",
"strings",
"have",
"been",
"set",
"so",
"for",
"each",
"exon",
"we",
"have",
"query",
"target",
"and",
"query_quality",
"_has_quality",
"will",
"specify",
"whether",
"or",
"not",
"the",
"quality",
"is",
"meaningful"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L1084-L1130 |
jason-weirather/py-seq-tools | seqtools/errors.py | GeneralErrorStats.get_string | def get_string(self):
"""make a string representation of the general error report"""
ostr = ''
errtotal = self.deletions['total']+self.insertions['total']+self.mismatches
ostr += 'from '+str(self.alignment_length)+' bp of alignment'+"\n"
ostr += ' '+str(float(errtotal)/float(self.alignment_length))... | python | def get_string(self):
"""make a string representation of the general error report"""
ostr = ''
errtotal = self.deletions['total']+self.insertions['total']+self.mismatches
ostr += 'from '+str(self.alignment_length)+' bp of alignment'+"\n"
ostr += ' '+str(float(errtotal)/float(self.alignment_length))... | [
"def",
"get_string",
"(",
"self",
")",
":",
"ostr",
"=",
"''",
"errtotal",
"=",
"self",
".",
"deletions",
"[",
"'total'",
"]",
"+",
"self",
".",
"insertions",
"[",
"'total'",
"]",
"+",
"self",
".",
"mismatches",
"ostr",
"+=",
"'from '",
"+",
"str",
"... | make a string representation of the general error report | [
"make",
"a",
"string",
"representation",
"of",
"the",
"general",
"error",
"report"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L1235-L1260 |
jason-weirather/py-seq-tools | seqtools/errors.py | GeneralErrorStats.get_stats | def get_stats(self):
"""Return a string describing the stats"""
ostr = ''
errtotal = self.deletions['total']+self.insertions['total']+self.mismatches
ostr += "ALIGNMENT_COUNT\t"+str(self.alignment_count)+"\n"
ostr += "ALIGNMENT_BASES\t"+str(self.alignment_length)+"\n"
ostr += "ANY_ERROR\t"+str(e... | python | def get_stats(self):
"""Return a string describing the stats"""
ostr = ''
errtotal = self.deletions['total']+self.insertions['total']+self.mismatches
ostr += "ALIGNMENT_COUNT\t"+str(self.alignment_count)+"\n"
ostr += "ALIGNMENT_BASES\t"+str(self.alignment_length)+"\n"
ostr += "ANY_ERROR\t"+str(e... | [
"def",
"get_stats",
"(",
"self",
")",
":",
"ostr",
"=",
"''",
"errtotal",
"=",
"self",
".",
"deletions",
"[",
"'total'",
"]",
"+",
"self",
".",
"insertions",
"[",
"'total'",
"]",
"+",
"self",
".",
"mismatches",
"ostr",
"+=",
"\"ALIGNMENT_COUNT\\t\"",
"+"... | Return a string describing the stats | [
"Return",
"a",
"string",
"describing",
"the",
"stats"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L1262-L1276 |
jason-weirather/py-seq-tools | seqtools/errors.py | GeneralErrorStats.get_report | def get_report(self):
"""Another report, but not context based"""
ostr = ''
ostr += "target\tquery\tcnt\ttotal\n"
poss = ['-','A','C','G','T']
for target in poss:
for query in poss:
ostr += target+ "\t"+query+"\t"+str(self.matrix[target][query])+"\t"+str(self.alignment_length)+"\n"
... | python | def get_report(self):
"""Another report, but not context based"""
ostr = ''
ostr += "target\tquery\tcnt\ttotal\n"
poss = ['-','A','C','G','T']
for target in poss:
for query in poss:
ostr += target+ "\t"+query+"\t"+str(self.matrix[target][query])+"\t"+str(self.alignment_length)+"\n"
... | [
"def",
"get_report",
"(",
"self",
")",
":",
"ostr",
"=",
"''",
"ostr",
"+=",
"\"target\\tquery\\tcnt\\ttotal\\n\"",
"poss",
"=",
"[",
"'-'",
",",
"'A'",
",",
"'C'",
",",
"'G'",
",",
"'T'",
"]",
"for",
"target",
"in",
"poss",
":",
"for",
"query",
"in",
... | Another report, but not context based | [
"Another",
"report",
"but",
"not",
"context",
"based"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L1278-L1286 |
jason-weirather/py-seq-tools | seqtools/errors.py | GeneralErrorStats.add_alignment_errors | def add_alignment_errors(self,ae):
"""Add alignment errors to the group
:param ae: one set of alignment errors
:param type:
"""
self.alignment_count += 1
for v in ae.get_HPAGroups():
self._add_HPAGroup(v) | python | def add_alignment_errors(self,ae):
"""Add alignment errors to the group
:param ae: one set of alignment errors
:param type:
"""
self.alignment_count += 1
for v in ae.get_HPAGroups():
self._add_HPAGroup(v) | [
"def",
"add_alignment_errors",
"(",
"self",
",",
"ae",
")",
":",
"self",
".",
"alignment_count",
"+=",
"1",
"for",
"v",
"in",
"ae",
".",
"get_HPAGroups",
"(",
")",
":",
"self",
".",
"_add_HPAGroup",
"(",
"v",
")"
] | Add alignment errors to the group
:param ae: one set of alignment errors
:param type: | [
"Add",
"alignment",
"errors",
"to",
"the",
"group"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/errors.py#L1288-L1296 |
mitsei/dlkit | dlkit/services/cataloging.py | CatalogingManager._set_catalog_view | def _set_catalog_view(self, session):
"""Sets the underlying catalog view to match current view"""
if self._catalog_view == COMPARATIVE:
try:
session.use_comparative_catalog_view()
except AttributeError:
pass
else:
try:
... | python | def _set_catalog_view(self, session):
"""Sets the underlying catalog view to match current view"""
if self._catalog_view == COMPARATIVE:
try:
session.use_comparative_catalog_view()
except AttributeError:
pass
else:
try:
... | [
"def",
"_set_catalog_view",
"(",
"self",
",",
"session",
")",
":",
"if",
"self",
".",
"_catalog_view",
"==",
"COMPARATIVE",
":",
"try",
":",
"session",
".",
"use_comparative_catalog_view",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"else",
":",
"try",
... | Sets the underlying catalog view to match current view | [
"Sets",
"the",
"underlying",
"catalog",
"view",
"to",
"match",
"current",
"view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/cataloging.py#L100-L111 |
mitsei/dlkit | dlkit/services/cataloging.py | CatalogingManager.use_comparative_catalog_view | def use_comparative_catalog_view(self):
"""Pass through to provider CatalogLookupSession.use_comparative_catalog_view"""
self._catalog_view = COMPARATIVE
# self._get_provider_session('catalog_lookup_session') # To make sure the session is tracked
for session in self._get_provider_session... | python | def use_comparative_catalog_view(self):
"""Pass through to provider CatalogLookupSession.use_comparative_catalog_view"""
self._catalog_view = COMPARATIVE
# self._get_provider_session('catalog_lookup_session') # To make sure the session is tracked
for session in self._get_provider_session... | [
"def",
"use_comparative_catalog_view",
"(",
"self",
")",
":",
"self",
".",
"_catalog_view",
"=",
"COMPARATIVE",
"# self._get_provider_session('catalog_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",
"(",
")... | Pass through to provider CatalogLookupSession.use_comparative_catalog_view | [
"Pass",
"through",
"to",
"provider",
"CatalogLookupSession",
".",
"use_comparative_catalog_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/cataloging.py#L266-L274 |
mitsei/dlkit | dlkit/services/cataloging.py | CatalogingManager.use_plenary_catalog_view | def use_plenary_catalog_view(self):
"""Pass through to provider CatalogLookupSession.use_plenary_catalog_view"""
self._catalog_view = PLENARY
# self._get_provider_session('catalog_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions():
... | python | def use_plenary_catalog_view(self):
"""Pass through to provider CatalogLookupSession.use_plenary_catalog_view"""
self._catalog_view = PLENARY
# self._get_provider_session('catalog_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions():
... | [
"def",
"use_plenary_catalog_view",
"(",
"self",
")",
":",
"self",
".",
"_catalog_view",
"=",
"PLENARY",
"# self._get_provider_session('catalog_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",
"(",
")",
":"... | Pass through to provider CatalogLookupSession.use_plenary_catalog_view | [
"Pass",
"through",
"to",
"provider",
"CatalogLookupSession",
".",
"use_plenary_catalog_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/cataloging.py#L276-L284 |
mitsei/dlkit | dlkit/services/cataloging.py | CatalogingManager.get_catalogs_by_ids | def get_catalogs_by_ids(self, *args, **kwargs):
"""Pass through to provider CatalogLookupSession.get_catalogs_by_ids"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_by_ids
catalogs = self._get_provider_session('catalog_lookup_session').get_catalogs_... | python | def get_catalogs_by_ids(self, *args, **kwargs):
"""Pass through to provider CatalogLookupSession.get_catalogs_by_ids"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_by_ids
catalogs = self._get_provider_session('catalog_lookup_session').get_catalogs_... | [
"def",
"get_catalogs_by_ids",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinLookupSession.get_bins_by_ids",
"catalogs",
"=",
"self",
".",
"_get_provider_session",
"(",
"'catalog_lookup_sess... | Pass through to provider CatalogLookupSession.get_catalogs_by_ids | [
"Pass",
"through",
"to",
"provider",
"CatalogLookupSession",
".",
"get_catalogs_by_ids"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/cataloging.py#L296-L304 |
mitsei/dlkit | dlkit/services/cataloging.py | CatalogingManager.get_catalogs | def get_catalogs(self):
"""Pass through to provider CatalogLookupSession.get_catalogs"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_template
catalogs = self._get_provider_session('catalog_lookup_session').get_catalogs()
cat_list = []
... | python | def get_catalogs(self):
"""Pass through to provider CatalogLookupSession.get_catalogs"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_template
catalogs = self._get_provider_session('catalog_lookup_session').get_catalogs()
cat_list = []
... | [
"def",
"get_catalogs",
"(",
"self",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinLookupSession.get_bins_template",
"catalogs",
"=",
"self",
".",
"_get_provider_session",
"(",
"'catalog_lookup_session'",
")",
".",
"get_catalogs",
"(",
")",
"cat_li... | Pass through to provider CatalogLookupSession.get_catalogs | [
"Pass",
"through",
"to",
"provider",
"CatalogLookupSession",
".",
"get_catalogs"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/cataloging.py#L346-L354 |
mitsei/dlkit | dlkit/services/cataloging.py | CatalogingManager.create_catalog | def create_catalog(self, *args, **kwargs):
"""Pass through to provider CatalogAdminSession.create_catalog"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.create_bin
return Catalog(
self._provider_manager,
self._get_provider_session('ca... | python | def create_catalog(self, *args, **kwargs):
"""Pass through to provider CatalogAdminSession.create_catalog"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.create_bin
return Catalog(
self._provider_manager,
self._get_provider_session('ca... | [
"def",
"create_catalog",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinAdminSession.create_bin",
"return",
"Catalog",
"(",
"self",
".",
"_provider_manager",
",",
"self",
".",
"_get_pr... | Pass through to provider CatalogAdminSession.create_catalog | [
"Pass",
"through",
"to",
"provider",
"CatalogAdminSession",
".",
"create_catalog"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/cataloging.py#L400-L408 |
mitsei/dlkit | dlkit/services/cataloging.py | CatalogingManager.get_catalog_form | def get_catalog_form(self, *args, **kwargs):
"""Pass through to provider CatalogAdminSession.get_catalog_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.get_bin_form_for_update_template
# This method might be a bit sketchy. Time will tell.
... | python | def get_catalog_form(self, *args, **kwargs):
"""Pass through to provider CatalogAdminSession.get_catalog_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.get_bin_form_for_update_template
# This method might be a bit sketchy. Time will tell.
... | [
"def",
"get_catalog_form",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinAdminSession.get_bin_form_for_update_template",
"# This method might be a bit sketchy. Time will tell.",
"if",
"isinstance",... | Pass through to provider CatalogAdminSession.get_catalog_form_for_update | [
"Pass",
"through",
"to",
"provider",
"CatalogAdminSession",
".",
"get_catalog_form_for_update"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/cataloging.py#L422-L430 |
mitsei/dlkit | dlkit/services/cataloging.py | CatalogingManager.save_catalog | def save_catalog(self, catalog_form, *args, **kwargs):
"""Pass through to provider CatalogAdminSession.update_catalog"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
if catalog_form.is_for_update():
return self.update_catalog(catalog_fo... | python | def save_catalog(self, catalog_form, *args, **kwargs):
"""Pass through to provider CatalogAdminSession.update_catalog"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
if catalog_form.is_for_update():
return self.update_catalog(catalog_fo... | [
"def",
"save_catalog",
"(",
"self",
",",
"catalog_form",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinAdminSession.update_bin",
"if",
"catalog_form",
".",
"is_for_update",
"(",
")",
":",
"return"... | Pass through to provider CatalogAdminSession.update_catalog | [
"Pass",
"through",
"to",
"provider",
"CatalogAdminSession",
".",
"update_catalog"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/cataloging.py#L443-L450 |
mitsei/dlkit | dlkit/services/cataloging.py | Catalog._set_catalog_view | def _set_catalog_view(self, session):
"""Sets the underlying catalog view to match current view"""
if self._catalog_view == FEDERATED:
try:
session.use_federated_catalog_view()
except AttributeError:
pass
else:
try:
... | python | def _set_catalog_view(self, session):
"""Sets the underlying catalog view to match current view"""
if self._catalog_view == FEDERATED:
try:
session.use_federated_catalog_view()
except AttributeError:
pass
else:
try:
... | [
"def",
"_set_catalog_view",
"(",
"self",
",",
"session",
")",
":",
"if",
"self",
".",
"_catalog_view",
"==",
"FEDERATED",
":",
"try",
":",
"session",
".",
"use_federated_catalog_view",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"else",
":",
"try",
":... | Sets the underlying catalog view to match current view | [
"Sets",
"the",
"underlying",
"catalog",
"view",
"to",
"match",
"current",
"view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/cataloging.py#L687-L698 |
theosysbio/means | src/means/util/moment_counters.py | generate_n_and_k_counters | def generate_n_and_k_counters(max_order, species, central_symbols_prefix="M_", raw_symbols_prefix="x_"):
r"""
Makes a counter for central moments (n_counter) and a counter for raw moment (k_counter).
Each is a list of :class:`~means.approximation.ode_problem.Moment`s.
Therefore, each :cl... | python | def generate_n_and_k_counters(max_order, species, central_symbols_prefix="M_", raw_symbols_prefix="x_"):
r"""
Makes a counter for central moments (n_counter) and a counter for raw moment (k_counter).
Each is a list of :class:`~means.approximation.ode_problem.Moment`s.
Therefore, each :cl... | [
"def",
"generate_n_and_k_counters",
"(",
"max_order",
",",
"species",
",",
"central_symbols_prefix",
"=",
"\"M_\"",
",",
"raw_symbols_prefix",
"=",
"\"x_\"",
")",
":",
"n_moments",
"=",
"max_order",
"+",
"1",
"# first order moments are always 1",
"k_counter",
"=",
"["... | r"""
Makes a counter for central moments (n_counter) and a counter for raw moment (k_counter).
Each is a list of :class:`~means.approximation.ode_problem.Moment`s.
Therefore, each :class:`~means.approximation.ode_problem.Moments` is represented by both
a vector of integer and a symbol.
... | [
"r",
"Makes",
"a",
"counter",
"for",
"central",
"moments",
"(",
"n_counter",
")",
"and",
"a",
"counter",
"for",
"raw",
"moment",
"(",
"k_counter",
")",
".",
"Each",
"is",
"a",
"list",
"of",
":",
"class",
":",
"~means",
".",
"approximation",
".",
"ode_p... | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/util/moment_counters.py#L13-L61 |
HDI-Project/mit-d3m | mit_d3m/config.py | build_config | def build_config(dataset, datasets_dir, phase, problem=None, output_dir='data/output'):
"""
root@d3m-example-pod:/# cat /input/185_baseball/test_config.json
{
"problem_schema": "/input/TEST/problem_TEST/problemDoc.json",
"problem_root": "/input/TEST/problem_TEST",
"dataset_schema": "/input... | python | def build_config(dataset, datasets_dir, phase, problem=None, output_dir='data/output'):
"""
root@d3m-example-pod:/# cat /input/185_baseball/test_config.json
{
"problem_schema": "/input/TEST/problem_TEST/problemDoc.json",
"problem_root": "/input/TEST/problem_TEST",
"dataset_schema": "/input... | [
"def",
"build_config",
"(",
"dataset",
",",
"datasets_dir",
",",
"phase",
",",
"problem",
"=",
"None",
",",
"output_dir",
"=",
"'data/output'",
")",
":",
"if",
"problem",
":",
"full_phase",
"=",
"phase",
"+",
"'_'",
"+",
"problem",
"else",
":",
"full_phase... | root@d3m-example-pod:/# cat /input/185_baseball/test_config.json
{
"problem_schema": "/input/TEST/problem_TEST/problemDoc.json",
"problem_root": "/input/TEST/problem_TEST",
"dataset_schema": "/input/TEST/dataset_TEST/datasetDoc.json",
"test_data_root": "/input/TEST/dataset_TEST",
"resu... | [
"root@d3m",
"-",
"example",
"-",
"pod",
":",
"/",
"#",
"cat",
"/",
"input",
"/",
"185_baseball",
"/",
"test_config",
".",
"json",
"{",
"problem_schema",
":",
"/",
"input",
"/",
"TEST",
"/",
"problem_TEST",
"/",
"problemDoc",
".",
"json",
"problem_root",
... | train | https://github.com/HDI-Project/mit-d3m/blob/3ab44eb5db8de8e28a29ca4b695a7a4becf45275/mit_d3m/config.py#L10-L60 |
theosysbio/means | src/means/approximation/lna/lna.py | LinearNoiseApproximation.run | def run(self):
"""
Overrides the default _run() private method.
Performs the complete analysis
:return: A fully computed set of Ordinary Differential Equations that can be used for further simulation
:rtype: :class:`~means.core.problems.ODEProblem`
"""
S = self.m... | python | def run(self):
"""
Overrides the default _run() private method.
Performs the complete analysis
:return: A fully computed set of Ordinary Differential Equations that can be used for further simulation
:rtype: :class:`~means.core.problems.ODEProblem`
"""
S = self.m... | [
"def",
"run",
"(",
"self",
")",
":",
"S",
"=",
"self",
".",
"model",
".",
"stoichiometry_matrix",
"amat",
"=",
"self",
".",
"model",
".",
"propensities",
"ymat",
"=",
"self",
".",
"model",
".",
"species",
"n_species",
"=",
"len",
"(",
"ymat",
")",
"#... | Overrides the default _run() private method.
Performs the complete analysis
:return: A fully computed set of Ordinary Differential Equations that can be used for further simulation
:rtype: :class:`~means.core.problems.ODEProblem` | [
"Overrides",
"the",
"default",
"_run",
"()",
"private",
"method",
".",
"Performs",
"the",
"complete",
"analysis",
":",
"return",
":",
"A",
"fully",
"computed",
"set",
"of",
"Ordinary",
"Differential",
"Equations",
"that",
"can",
"be",
"used",
"for",
"further",... | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/lna/lna.py#L26-L111 |
HDI-Project/mit-d3m | mit_d3m/dataset.py | D3MDataset._get_learning_data_path | def _get_learning_data_path(self):
"""
Returns the path of learningData.csv in a dataset
"""
for res in self.dsDoc['dataResources']:
resPath = res['resPath']
resType = res['resType']
dirname = os.path.basename(os.path.normpath(os.path.dirname(resPath)... | python | def _get_learning_data_path(self):
"""
Returns the path of learningData.csv in a dataset
"""
for res in self.dsDoc['dataResources']:
resPath = res['resPath']
resType = res['resType']
dirname = os.path.basename(os.path.normpath(os.path.dirname(resPath)... | [
"def",
"_get_learning_data_path",
"(",
"self",
")",
":",
"for",
"res",
"in",
"self",
".",
"dsDoc",
"[",
"'dataResources'",
"]",
":",
"resPath",
"=",
"res",
"[",
"'resPath'",
"]",
"resType",
"=",
"res",
"[",
"'resType'",
"]",
"dirname",
"=",
"os",
".",
... | Returns the path of learningData.csv in a dataset | [
"Returns",
"the",
"path",
"of",
"learningData",
".",
"csv",
"in",
"a",
"dataset"
] | train | https://github.com/HDI-Project/mit-d3m/blob/3ab44eb5db8de8e28a29ca4b695a7a4becf45275/mit_d3m/dataset.py#L35-L50 |
HDI-Project/mit-d3m | mit_d3m/dataset.py | D3MDataset._get_learning_data_resource | def _get_learning_data_resource(self):
"""
Returns the path of learningData.csv in a dataset
"""
for res in self.dsDoc['dataResources']:
resPath = res['resPath']
resType = res['resType']
if resType == 'table':
if 'learningData.csv' in r... | python | def _get_learning_data_resource(self):
"""
Returns the path of learningData.csv in a dataset
"""
for res in self.dsDoc['dataResources']:
resPath = res['resPath']
resType = res['resType']
if resType == 'table':
if 'learningData.csv' in r... | [
"def",
"_get_learning_data_resource",
"(",
"self",
")",
":",
"for",
"res",
"in",
"self",
".",
"dsDoc",
"[",
"'dataResources'",
"]",
":",
"resPath",
"=",
"res",
"[",
"'resPath'",
"]",
"resType",
"=",
"res",
"[",
"'resType'",
"]",
"if",
"resType",
"==",
"'... | Returns the path of learningData.csv in a dataset | [
"Returns",
"the",
"path",
"of",
"learningData",
".",
"csv",
"in",
"a",
"dataset"
] | train | https://github.com/HDI-Project/mit-d3m/blob/3ab44eb5db8de8e28a29ca4b695a7a4becf45275/mit_d3m/dataset.py#L89-L103 |
HDI-Project/mit-d3m | mit_d3m/dataset.py | D3MDataset.get_data_modality | def get_data_modality(self):
"""Detect the data modality based on the resource_types.
resource_types == ['table'] => 'single_table'
resource_types == ['something_else'...] => 'something_else' # this is not likely
resource_types == ['table', 'table'...] => 'multi_table'
resourc... | python | def get_data_modality(self):
"""Detect the data modality based on the resource_types.
resource_types == ['table'] => 'single_table'
resource_types == ['something_else'...] => 'something_else' # this is not likely
resource_types == ['table', 'table'...] => 'multi_table'
resourc... | [
"def",
"get_data_modality",
"(",
"self",
")",
":",
"resource_types",
"=",
"self",
".",
"get_resource_types",
"(",
")",
"first_type",
"=",
"resource_types",
"[",
"0",
"]",
"if",
"first_type",
"!=",
"'table'",
":",
"return",
"first_type",
"elif",
"len",
"(",
"... | Detect the data modality based on the resource_types.
resource_types == ['table'] => 'single_table'
resource_types == ['something_else'...] => 'something_else' # this is not likely
resource_types == ['table', 'table'...] => 'multi_table'
resource_types == ['table', 'something_else'...... | [
"Detect",
"the",
"data",
"modality",
"based",
"on",
"the",
"resource_types",
"."
] | train | https://github.com/HDI-Project/mit-d3m/blob/3ab44eb5db8de8e28a29ca4b695a7a4becf45275/mit_d3m/dataset.py#L112-L133 |
HDI-Project/mit-d3m | mit_d3m/dataset.py | D3MDataset._get_resources_by_type | def _get_resources_by_type(self, resource_type):
"""
Returns the list of resources that are of the indicated type
"""
resources = []
for res in self.dsDoc['dataResources']:
if res['resType'] == resource_type:
resources.append(res)
return resou... | python | def _get_resources_by_type(self, resource_type):
"""
Returns the list of resources that are of the indicated type
"""
resources = []
for res in self.dsDoc['dataResources']:
if res['resType'] == resource_type:
resources.append(res)
return resou... | [
"def",
"_get_resources_by_type",
"(",
"self",
",",
"resource_type",
")",
":",
"resources",
"=",
"[",
"]",
"for",
"res",
"in",
"self",
".",
"dsDoc",
"[",
"'dataResources'",
"]",
":",
"if",
"res",
"[",
"'resType'",
"]",
"==",
"resource_type",
":",
"resources... | Returns the list of resources that are of the indicated type | [
"Returns",
"the",
"list",
"of",
"resources",
"that",
"are",
"of",
"the",
"indicated",
"type"
] | train | https://github.com/HDI-Project/mit-d3m/blob/3ab44eb5db8de8e28a29ca4b695a7a4becf45275/mit_d3m/dataset.py#L167-L176 |
HDI-Project/mit-d3m | mit_d3m/dataset.py | D3MDataset.get_text_path | def get_text_path(self):
"""
Returns the path of the directory containing text if they exist in this dataset.
"""
for res in self.dsDoc['dataResources']:
resPath = res['resPath']
resType = res['resType']
isCollection = res['isCollection']
i... | python | def get_text_path(self):
"""
Returns the path of the directory containing text if they exist in this dataset.
"""
for res in self.dsDoc['dataResources']:
resPath = res['resPath']
resType = res['resType']
isCollection = res['isCollection']
i... | [
"def",
"get_text_path",
"(",
"self",
")",
":",
"for",
"res",
"in",
"self",
".",
"dsDoc",
"[",
"'dataResources'",
"]",
":",
"resPath",
"=",
"res",
"[",
"'resPath'",
"]",
"resType",
"=",
"res",
"[",
"'resType'",
"]",
"isCollection",
"=",
"res",
"[",
"'is... | Returns the path of the directory containing text if they exist in this dataset. | [
"Returns",
"the",
"path",
"of",
"the",
"directory",
"containing",
"text",
"if",
"they",
"exist",
"in",
"this",
"dataset",
"."
] | train | https://github.com/HDI-Project/mit-d3m/blob/3ab44eb5db8de8e28a29ca4b695a7a4becf45275/mit_d3m/dataset.py#L192-L204 |
mdiener/grace | grace/py27/slimit/scope.py | Scope._get_scope_with_mangled | def _get_scope_with_mangled(self, name):
"""Return a scope containing passed mangled name."""
scope = self
while True:
parent = scope.get_enclosing_scope()
if parent is None:
return
if name in parent.rev_mangled:
return parent
... | python | def _get_scope_with_mangled(self, name):
"""Return a scope containing passed mangled name."""
scope = self
while True:
parent = scope.get_enclosing_scope()
if parent is None:
return
if name in parent.rev_mangled:
return parent
... | [
"def",
"_get_scope_with_mangled",
"(",
"self",
",",
"name",
")",
":",
"scope",
"=",
"self",
"while",
"True",
":",
"parent",
"=",
"scope",
".",
"get_enclosing_scope",
"(",
")",
"if",
"parent",
"is",
"None",
":",
"return",
"if",
"name",
"in",
"parent",
"."... | Return a scope containing passed mangled name. | [
"Return",
"a",
"scope",
"containing",
"passed",
"mangled",
"name",
"."
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/scope.py#L101-L112 |
mdiener/grace | grace/py27/slimit/scope.py | Scope._get_scope_with_symbol | def _get_scope_with_symbol(self, name):
"""Return a scope containing passed name as a symbol name."""
scope = self
while True:
parent = scope.get_enclosing_scope()
if parent is None:
return
if name in parent.symbols:
return par... | python | def _get_scope_with_symbol(self, name):
"""Return a scope containing passed name as a symbol name."""
scope = self
while True:
parent = scope.get_enclosing_scope()
if parent is None:
return
if name in parent.symbols:
return par... | [
"def",
"_get_scope_with_symbol",
"(",
"self",
",",
"name",
")",
":",
"scope",
"=",
"self",
"while",
"True",
":",
"parent",
"=",
"scope",
".",
"get_enclosing_scope",
"(",
")",
"if",
"parent",
"is",
"None",
":",
"return",
"if",
"name",
"in",
"parent",
".",... | Return a scope containing passed name as a symbol name. | [
"Return",
"a",
"scope",
"containing",
"passed",
"name",
"as",
"a",
"symbol",
"name",
"."
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/scope.py#L114-L125 |
mdiener/grace | grace/py27/slimit/scope.py | Scope.get_next_mangled_name | def get_next_mangled_name(self):
"""
1. Do not shadow a mangled name from a parent scope
if we reference the original name from that scope
in this scope or any sub-scope.
2. Do not shadow an original name from a parent scope
if it's not mangled and we reference ... | python | def get_next_mangled_name(self):
"""
1. Do not shadow a mangled name from a parent scope
if we reference the original name from that scope
in this scope or any sub-scope.
2. Do not shadow an original name from a parent scope
if it's not mangled and we reference ... | [
"def",
"get_next_mangled_name",
"(",
"self",
")",
":",
"while",
"True",
":",
"mangled",
"=",
"next",
"(",
"self",
".",
"base54",
")",
"# case 1",
"ancestor",
"=",
"self",
".",
"_get_scope_with_mangled",
"(",
"mangled",
")",
"if",
"(",
"ancestor",
"is",
"no... | 1. Do not shadow a mangled name from a parent scope
if we reference the original name from that scope
in this scope or any sub-scope.
2. Do not shadow an original name from a parent scope
if it's not mangled and we reference it in this scope
or any sub-scope. | [
"1",
".",
"Do",
"not",
"shadow",
"a",
"mangled",
"name",
"from",
"a",
"parent",
"scope",
"if",
"we",
"reference",
"the",
"original",
"name",
"from",
"that",
"scope",
"in",
"this",
"scope",
"or",
"any",
"sub",
"-",
"scope",
"."
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/scope.py#L127-L160 |
cablehead/python-fity3 | fity3.py | generator | def generator(
worker_id,
sleep=lambda x: time.sleep(x/1000.0),
now=lambda: int(time.time()*1000)):
"""
worker_id: a unique for your *entire* environment number between 0 and 255
to identify this generator.
sleep(n): function to pause this worker for n milliseconds. ... | python | def generator(
worker_id,
sleep=lambda x: time.sleep(x/1000.0),
now=lambda: int(time.time()*1000)):
"""
worker_id: a unique for your *entire* environment number between 0 and 255
to identify this generator.
sleep(n): function to pause this worker for n milliseconds. ... | [
"def",
"generator",
"(",
"worker_id",
",",
"sleep",
"=",
"lambda",
"x",
":",
"time",
".",
"sleep",
"(",
"x",
"/",
"1000.0",
")",
",",
"now",
"=",
"lambda",
":",
"int",
"(",
"time",
".",
"time",
"(",
")",
"*",
"1000",
")",
")",
":",
"assert",
"w... | worker_id: a unique for your *entire* environment number between 0 and 255
to identify this generator.
sleep(n): function to pause this worker for n milliseconds. you usually
want to supply a custom method for this in asynchronous
processes.
now(): function to... | [
"worker_id",
":",
"a",
"unique",
"for",
"your",
"*",
"entire",
"*",
"environment",
"number",
"between",
"0",
"and",
"255",
"to",
"identify",
"this",
"generator",
"."
] | train | https://github.com/cablehead/python-fity3/blob/42ec2f5c7711f6949d46c586ac8db56803689306/fity3.py#L48-L95 |
mitsei/dlkit | dlkit/records/assessment/qti/inline_choice_records.py | InlineChoiceTextQuestionFormRecord._init_map | def _init_map(self):
"""stub"""
QuestionTextFormRecord._init_map(self)
self.my_osid_object_form._my_map['choices'] = \
self._choices_metadata['default_object_values'][0] | python | def _init_map(self):
"""stub"""
QuestionTextFormRecord._init_map(self)
self.my_osid_object_form._my_map['choices'] = \
self._choices_metadata['default_object_values'][0] | [
"def",
"_init_map",
"(",
"self",
")",
":",
"QuestionTextFormRecord",
".",
"_init_map",
"(",
"self",
")",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"'choices'",
"]",
"=",
"self",
".",
"_choices_metadata",
"[",
"'default_object_values'",
"]",
"[",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/inline_choice_records.py#L249-L253 |
mitsei/dlkit | dlkit/records/assessment/qti/inline_choice_records.py | InlineChoiceTextQuestionFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
QuestionTextFormRecord._init_metadata(self)
self._choices_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'choices'),
'el... | python | def _init_metadata(self):
"""stub"""
QuestionTextFormRecord._init_metadata(self)
self._choices_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'choices'),
'el... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"QuestionTextFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"self",
".",
"_choices_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_object_form",
".",
"_authority",
",",
"self",
"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/inline_choice_records.py#L255-L292 |
mitsei/dlkit | dlkit/records/assessment/qti/inline_choice_records.py | InlineChoiceTextQuestionFormRecord.add_choice | def add_choice(self, text, inline_region, name='', identifier=None):
"""stub"""
choice_display_text = self._choice_text_metadata['default_string_values'][0]
choice_display_text['text'] = text
if identifier is None:
identifier = str(ObjectId())
choice = {
'... | python | def add_choice(self, text, inline_region, name='', identifier=None):
"""stub"""
choice_display_text = self._choice_text_metadata['default_string_values'][0]
choice_display_text['text'] = text
if identifier is None:
identifier = str(ObjectId())
choice = {
'... | [
"def",
"add_choice",
"(",
"self",
",",
"text",
",",
"inline_region",
",",
"name",
"=",
"''",
",",
"identifier",
"=",
"None",
")",
":",
"choice_display_text",
"=",
"self",
".",
"_choice_text_metadata",
"[",
"'default_string_values'",
"]",
"[",
"0",
"]",
"choi... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/inline_choice_records.py#L298-L313 |
mitsei/dlkit | dlkit/records/assessment/qti/inline_choice_records.py | InlineChoiceTextQuestionFormRecord.edit_choice | def edit_choice(self, choice_id, text, inline_region, name=''):
"""edit an existing choice, to keep the ID the same"""
if inline_region not in self.my_osid_object_form._my_map['choices']:
raise IllegalState('that inline region does not exist')
for choice in self.my_osid_object_form._... | python | def edit_choice(self, choice_id, text, inline_region, name=''):
"""edit an existing choice, to keep the ID the same"""
if inline_region not in self.my_osid_object_form._my_map['choices']:
raise IllegalState('that inline region does not exist')
for choice in self.my_osid_object_form._... | [
"def",
"edit_choice",
"(",
"self",
",",
"choice_id",
",",
"text",
",",
"inline_region",
",",
"name",
"=",
"''",
")",
":",
"if",
"inline_region",
"not",
"in",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"'choices'",
"]",
":",
"raise",
"IllegalS... | edit an existing choice, to keep the ID the same | [
"edit",
"an",
"existing",
"choice",
"to",
"keep",
"the",
"ID",
"the",
"same"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/inline_choice_records.py#L315-L325 |
mitsei/dlkit | dlkit/records/assessment/qti/inline_choice_records.py | InlineChoiceTextQuestionFormRecord.remove_choice | def remove_choice(self, choice_id, inline_region):
"""remove a choice, given the id"""
if inline_region in self.my_osid_object_form._my_map['choices']:
updated_choices = []
for choice in self.my_osid_object_form._my_map['choices'][inline_region]:
if choice['id'] !... | python | def remove_choice(self, choice_id, inline_region):
"""remove a choice, given the id"""
if inline_region in self.my_osid_object_form._my_map['choices']:
updated_choices = []
for choice in self.my_osid_object_form._my_map['choices'][inline_region]:
if choice['id'] !... | [
"def",
"remove_choice",
"(",
"self",
",",
"choice_id",
",",
"inline_region",
")",
":",
"if",
"inline_region",
"in",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"'choices'",
"]",
":",
"updated_choices",
"=",
"[",
"]",
"for",
"choice",
"in",
"self... | remove a choice, given the id | [
"remove",
"a",
"choice",
"given",
"the",
"id"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/inline_choice_records.py#L340-L347 |
mitsei/dlkit | dlkit/records/assessment/qti/inline_choice_records.py | InlineChoiceTextQuestionFormRecord.set_choice_order | def set_choice_order(self, choice_ids, inline_region):
""" reorder choices per the passed in list
:param choice_ids:
:return:
"""
reordered_choices = []
current_choice_ids = [c['id'] for c in self.my_osid_object_form._my_map['choices'][inline_region]]
if set(choic... | python | def set_choice_order(self, choice_ids, inline_region):
""" reorder choices per the passed in list
:param choice_ids:
:return:
"""
reordered_choices = []
current_choice_ids = [c['id'] for c in self.my_osid_object_form._my_map['choices'][inline_region]]
if set(choic... | [
"def",
"set_choice_order",
"(",
"self",
",",
"choice_ids",
",",
"inline_region",
")",
":",
"reordered_choices",
"=",
"[",
"]",
"current_choice_ids",
"=",
"[",
"c",
"[",
"'id'",
"]",
"for",
"c",
"in",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
... | reorder choices per the passed in list
:param choice_ids:
:return: | [
"reorder",
"choices",
"per",
"the",
"passed",
"in",
"list",
":",
"param",
"choice_ids",
":",
":",
"return",
":"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/inline_choice_records.py#L350-L366 |
mitsei/dlkit | dlkit/records/assessment/qti/inline_choice_records.py | InlineChoiceTextQuestionRecord.set_values | def set_values(self, choice_ids):
"""assume choice_ids is a dict of {
region: choiceIds
}, like: {
"REGION_1": ["57978959cdfc5c42eefb36d1", "57978959cdfc5c42eefb36d0",
"57978959cdfc5c42eefb36cf", "57978959cdfc5c42eefb36ce"]
}
"""
... | python | def set_values(self, choice_ids):
"""assume choice_ids is a dict of {
region: choiceIds
}, like: {
"REGION_1": ["57978959cdfc5c42eefb36d1", "57978959cdfc5c42eefb36d0",
"57978959cdfc5c42eefb36cf", "57978959cdfc5c42eefb36ce"]
}
"""
... | [
"def",
"set_values",
"(",
"self",
",",
"choice_ids",
")",
":",
"# if not self.my_osid_object._my_map['choices']:",
"# raise IllegalState()",
"organized_regions",
"=",
"{",
"}",
"for",
"region",
",",
"choice_ids",
"in",
"choice_ids",
".",
"items",
"(",
")",
":",
... | assume choice_ids is a dict of {
region: choiceIds
}, like: {
"REGION_1": ["57978959cdfc5c42eefb36d1", "57978959cdfc5c42eefb36d0",
"57978959cdfc5c42eefb36cf", "57978959cdfc5c42eefb36ce"]
} | [
"assume",
"choice_ids",
"is",
"a",
"dict",
"of",
"{",
"region",
":",
"choiceIds",
"}",
"like",
":",
"{",
"REGION_1",
":",
"[",
"57978959cdfc5c42eefb36d1",
"57978959cdfc5c42eefb36d0",
"57978959cdfc5c42eefb36cf",
"57978959cdfc5c42eefb36ce",
"]",
"}"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/inline_choice_records.py#L431-L449 |
mitsei/dlkit | dlkit/records/assessment/qti/inline_choice_records.py | InlineChoiceFeedbackAndFilesAnswerFormRecord._init_map | def _init_map(self):
"""stub"""
FilesAnswerFormRecord._init_map(self)
FeedbackAnswerFormRecord._init_map(self)
self.my_osid_object_form._my_map['inlineRegions'] = \
self._inline_regions_metadata['default_object_values'][0] | python | def _init_map(self):
"""stub"""
FilesAnswerFormRecord._init_map(self)
FeedbackAnswerFormRecord._init_map(self)
self.my_osid_object_form._my_map['inlineRegions'] = \
self._inline_regions_metadata['default_object_values'][0] | [
"def",
"_init_map",
"(",
"self",
")",
":",
"FilesAnswerFormRecord",
".",
"_init_map",
"(",
"self",
")",
"FeedbackAnswerFormRecord",
".",
"_init_map",
"(",
"self",
")",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"'inlineRegions'",
"]",
"=",
"self",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/inline_choice_records.py#L467-L472 |
mitsei/dlkit | dlkit/records/assessment/qti/inline_choice_records.py | InlineChoiceFeedbackAndFilesAnswerFormRecord.add_choice_id | def add_choice_id(self, choice_id, inline_region):
"""stub"""
if inline_region in self.my_osid_object_form._my_map['inlineRegions']:
self.my_osid_object_form._my_map['inlineRegions'][inline_region]['choiceIds'].append(choice_id)
else:
raise IllegalState('that inline regio... | python | def add_choice_id(self, choice_id, inline_region):
"""stub"""
if inline_region in self.my_osid_object_form._my_map['inlineRegions']:
self.my_osid_object_form._my_map['inlineRegions'][inline_region]['choiceIds'].append(choice_id)
else:
raise IllegalState('that inline regio... | [
"def",
"add_choice_id",
"(",
"self",
",",
"choice_id",
",",
"inline_region",
")",
":",
"if",
"inline_region",
"in",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"'inlineRegions'",
"]",
":",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/inline_choice_records.py#L527-L532 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.