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/services/repository.py | Repository.use_comparative_asset_view | def use_comparative_asset_view(self):
"""Pass through to provider AssetLookupSession.use_comparative_asset_view"""
self._object_views['asset'] = COMPARATIVE
# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessio... | python | def use_comparative_asset_view(self):
"""Pass through to provider AssetLookupSession.use_comparative_asset_view"""
self._object_views['asset'] = COMPARATIVE
# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessio... | [
"def",
"use_comparative_asset_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'asset'",
"]",
"=",
"COMPARATIVE",
"# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider... | Pass through to provider AssetLookupSession.use_comparative_asset_view | [
"Pass",
"through",
"to",
"provider",
"AssetLookupSession",
".",
"use_comparative_asset_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1463-L1471 |
mitsei/dlkit | dlkit/services/repository.py | Repository.use_plenary_asset_view | def use_plenary_asset_view(self):
"""Pass through to provider AssetLookupSession.use_plenary_asset_view"""
self._object_views['asset'] = PLENARY
# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions():
... | python | def use_plenary_asset_view(self):
"""Pass through to provider AssetLookupSession.use_plenary_asset_view"""
self._object_views['asset'] = PLENARY
# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions():
... | [
"def",
"use_plenary_asset_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'asset'",
"]",
"=",
"PLENARY",
"# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_session... | Pass through to provider AssetLookupSession.use_plenary_asset_view | [
"Pass",
"through",
"to",
"provider",
"AssetLookupSession",
".",
"use_plenary_asset_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1473-L1481 |
mitsei/dlkit | dlkit/services/repository.py | Repository.use_federated_repository_view | def use_federated_repository_view(self):
"""Pass through to provider AssetLookupSession.use_federated_repository_view"""
self._repository_view = FEDERATED
# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions... | python | def use_federated_repository_view(self):
"""Pass through to provider AssetLookupSession.use_federated_repository_view"""
self._repository_view = FEDERATED
# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions... | [
"def",
"use_federated_repository_view",
"(",
"self",
")",
":",
"self",
".",
"_repository_view",
"=",
"FEDERATED",
"# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",
"(",
")... | Pass through to provider AssetLookupSession.use_federated_repository_view | [
"Pass",
"through",
"to",
"provider",
"AssetLookupSession",
".",
"use_federated_repository_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1483-L1491 |
mitsei/dlkit | dlkit/services/repository.py | Repository.use_isolated_repository_view | def use_isolated_repository_view(self):
"""Pass through to provider AssetLookupSession.use_isolated_repository_view"""
self._repository_view = ISOLATED
# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions():... | python | def use_isolated_repository_view(self):
"""Pass through to provider AssetLookupSession.use_isolated_repository_view"""
self._repository_view = ISOLATED
# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions():... | [
"def",
"use_isolated_repository_view",
"(",
"self",
")",
":",
"self",
".",
"_repository_view",
"=",
"ISOLATED",
"# self._get_provider_session('asset_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",
"(",
")",... | Pass through to provider AssetLookupSession.use_isolated_repository_view | [
"Pass",
"through",
"to",
"provider",
"AssetLookupSession",
".",
"use_isolated_repository_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1493-L1501 |
mitsei/dlkit | dlkit/services/repository.py | Repository.get_asset_form | def get_asset_form(self, *args, **kwargs):
"""Pass through to provider AssetAdminSession.get_asset_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit sketchy. Time will tell.
... | python | def get_asset_form(self, *args, **kwargs):
"""Pass through to provider AssetAdminSession.get_asset_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit sketchy. Time will tell.
... | [
"def",
"get_asset_form",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.ResourceAdminSession.get_resource_form_for_update",
"# This method might be a bit sketchy. Time will tell.",
"if",
"isinstance",
... | Pass through to provider AssetAdminSession.get_asset_form_for_update | [
"Pass",
"through",
"to",
"provider",
"AssetAdminSession",
".",
"get_asset_form_for_update"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1631-L1639 |
mitsei/dlkit | dlkit/services/repository.py | Repository.save_asset | def save_asset(self, asset_form, *args, **kwargs):
"""Pass through to provider AssetAdminSession.update_asset"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if asset_form.is_for_update():
return self.update_asset(asset_form, ... | python | def save_asset(self, asset_form, *args, **kwargs):
"""Pass through to provider AssetAdminSession.update_asset"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if asset_form.is_for_update():
return self.update_asset(asset_form, ... | [
"def",
"save_asset",
"(",
"self",
",",
"asset_form",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.ResourceAdminSession.update_resource",
"if",
"asset_form",
".",
"is_for_update",
"(",
")",
":",
"ret... | Pass through to provider AssetAdminSession.update_asset | [
"Pass",
"through",
"to",
"provider",
"AssetAdminSession",
".",
"update_asset"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1653-L1660 |
mitsei/dlkit | dlkit/services/repository.py | Repository.use_comparative_asset_composition_view | def use_comparative_asset_composition_view(self):
"""Pass through to provider AssetCompositionSession.use_comparative_asset_composition_view"""
self._object_views['asset_composition'] = COMPARATIVE
# self._get_provider_session('asset_composition_session') # To make sure the session is tracked
... | python | def use_comparative_asset_composition_view(self):
"""Pass through to provider AssetCompositionSession.use_comparative_asset_composition_view"""
self._object_views['asset_composition'] = COMPARATIVE
# self._get_provider_session('asset_composition_session') # To make sure the session is tracked
... | [
"def",
"use_comparative_asset_composition_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'asset_composition'",
"]",
"=",
"COMPARATIVE",
"# self._get_provider_session('asset_composition_session') # To make sure the session is tracked",
"for",
"session",
"in",
"s... | Pass through to provider AssetCompositionSession.use_comparative_asset_composition_view | [
"Pass",
"through",
"to",
"provider",
"AssetCompositionSession",
".",
"use_comparative_asset_composition_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1800-L1808 |
mitsei/dlkit | dlkit/services/repository.py | Repository.use_plenary_asset_composition_view | def use_plenary_asset_composition_view(self):
"""Pass through to provider AssetCompositionSession.use_plenary_asset_composition_view"""
self._object_views['asset_composition'] = PLENARY
# self._get_provider_session('asset_composition_session') # To make sure the session is tracked
for se... | python | def use_plenary_asset_composition_view(self):
"""Pass through to provider AssetCompositionSession.use_plenary_asset_composition_view"""
self._object_views['asset_composition'] = PLENARY
# self._get_provider_session('asset_composition_session') # To make sure the session is tracked
for se... | [
"def",
"use_plenary_asset_composition_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'asset_composition'",
"]",
"=",
"PLENARY",
"# self._get_provider_session('asset_composition_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
... | Pass through to provider AssetCompositionSession.use_plenary_asset_composition_view | [
"Pass",
"through",
"to",
"provider",
"AssetCompositionSession",
".",
"use_plenary_asset_composition_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1810-L1818 |
mitsei/dlkit | dlkit/services/repository.py | Repository.use_comparative_composition_view | def use_comparative_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_comparative_composition_view"""
self._object_views['composition'] = COMPARATIVE
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
for sessio... | python | def use_comparative_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_comparative_composition_view"""
self._object_views['composition'] = COMPARATIVE
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
for sessio... | [
"def",
"use_comparative_composition_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'composition'",
"]",
"=",
"COMPARATIVE",
"# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
"."... | Pass through to provider CompositionLookupSession.use_comparative_composition_view | [
"Pass",
"through",
"to",
"provider",
"CompositionLookupSession",
".",
"use_comparative_composition_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1862-L1870 |
mitsei/dlkit | dlkit/services/repository.py | Repository.use_plenary_composition_view | def use_plenary_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_plenary_composition_view"""
self._object_views['composition'] = PLENARY
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
for session in self._g... | python | def use_plenary_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_plenary_composition_view"""
self._object_views['composition'] = PLENARY
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
for session in self._g... | [
"def",
"use_plenary_composition_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'composition'",
"]",
"=",
"PLENARY",
"# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_ge... | Pass through to provider CompositionLookupSession.use_plenary_composition_view | [
"Pass",
"through",
"to",
"provider",
"CompositionLookupSession",
".",
"use_plenary_composition_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1872-L1880 |
mitsei/dlkit | dlkit/services/repository.py | Repository.use_active_composition_view | def use_active_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_active_composition_view"""
self._operable_views['composition'] = ACTIVE
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
for session in self._g... | python | def use_active_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_active_composition_view"""
self._operable_views['composition'] = ACTIVE
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
for session in self._g... | [
"def",
"use_active_composition_view",
"(",
"self",
")",
":",
"self",
".",
"_operable_views",
"[",
"'composition'",
"]",
"=",
"ACTIVE",
"# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_g... | Pass through to provider CompositionLookupSession.use_active_composition_view | [
"Pass",
"through",
"to",
"provider",
"CompositionLookupSession",
".",
"use_active_composition_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1882-L1890 |
mitsei/dlkit | dlkit/services/repository.py | Repository.use_any_status_composition_view | def use_any_status_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_any_status_composition_view"""
self._operable_views['composition'] = ANY_STATUS
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
for sessio... | python | def use_any_status_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_any_status_composition_view"""
self._operable_views['composition'] = ANY_STATUS
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
for sessio... | [
"def",
"use_any_status_composition_view",
"(",
"self",
")",
":",
"self",
".",
"_operable_views",
"[",
"'composition'",
"]",
"=",
"ANY_STATUS",
"# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".... | Pass through to provider CompositionLookupSession.use_any_status_composition_view | [
"Pass",
"through",
"to",
"provider",
"CompositionLookupSession",
".",
"use_any_status_composition_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1892-L1900 |
mitsei/dlkit | dlkit/services/repository.py | Repository.use_sequestered_composition_view | def use_sequestered_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_sequestered_composition_view"""
self._containable_views['composition'] = SEQUESTERED
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
for ... | python | def use_sequestered_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_sequestered_composition_view"""
self._containable_views['composition'] = SEQUESTERED
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
for ... | [
"def",
"use_sequestered_composition_view",
"(",
"self",
")",
":",
"self",
".",
"_containable_views",
"[",
"'composition'",
"]",
"=",
"SEQUESTERED",
"# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",... | Pass through to provider CompositionLookupSession.use_sequestered_composition_view | [
"Pass",
"through",
"to",
"provider",
"CompositionLookupSession",
".",
"use_sequestered_composition_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1902-L1910 |
mitsei/dlkit | dlkit/services/repository.py | Repository.use_unsequestered_composition_view | def use_unsequestered_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_unsequestered_composition_view"""
self._containable_views['composition'] = UNSEQUESTERED
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
... | python | def use_unsequestered_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_unsequestered_composition_view"""
self._containable_views['composition'] = UNSEQUESTERED
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
... | [
"def",
"use_unsequestered_composition_view",
"(",
"self",
")",
":",
"self",
".",
"_containable_views",
"[",
"'composition'",
"]",
"=",
"UNSEQUESTERED",
"# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"sel... | Pass through to provider CompositionLookupSession.use_unsequestered_composition_view | [
"Pass",
"through",
"to",
"provider",
"CompositionLookupSession",
".",
"use_unsequestered_composition_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L1912-L1920 |
mitsei/dlkit | dlkit/services/repository.py | Repository.get_composition_form | def get_composition_form(self, *args, **kwargs):
"""Pass through to provider CompositionAdminSession.get_composition_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit sketchy. Time w... | python | def get_composition_form(self, *args, **kwargs):
"""Pass through to provider CompositionAdminSession.get_composition_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit sketchy. Time w... | [
"def",
"get_composition_form",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.ResourceAdminSession.get_resource_form_for_update",
"# This method might be a bit sketchy. Time will tell.",
"if",
"isinsta... | Pass through to provider CompositionAdminSession.get_composition_form_for_update | [
"Pass",
"through",
"to",
"provider",
"CompositionAdminSession",
".",
"get_composition_form_for_update"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L2050-L2058 |
mitsei/dlkit | dlkit/services/repository.py | Repository.save_composition | def save_composition(self, composition_form, *args, **kwargs):
"""Pass through to provider CompositionAdminSession.update_composition"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if composition_form.is_for_update():
return ... | python | def save_composition(self, composition_form, *args, **kwargs):
"""Pass through to provider CompositionAdminSession.update_composition"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if composition_form.is_for_update():
return ... | [
"def",
"save_composition",
"(",
"self",
",",
"composition_form",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.ResourceAdminSession.update_resource",
"if",
"composition_form",
".",
"is_for_update",
"(",
... | Pass through to provider CompositionAdminSession.update_composition | [
"Pass",
"through",
"to",
"provider",
"CompositionAdminSession",
".",
"update_composition"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/repository.py#L2072-L2079 |
biesnecker/cleveland | cleveland/actor.py | AbstractActor._run | def _run(self):
'''The actor's main work loop'''
while self._is_running:
yield from self._task()
# Signal that the loop has finished.
self._run_complete.set_result(True) | python | def _run(self):
'''The actor's main work loop'''
while self._is_running:
yield from self._task()
# Signal that the loop has finished.
self._run_complete.set_result(True) | [
"def",
"_run",
"(",
"self",
")",
":",
"while",
"self",
".",
"_is_running",
":",
"yield",
"from",
"self",
".",
"_task",
"(",
")",
"# Signal that the loop has finished.",
"self",
".",
"_run_complete",
".",
"set_result",
"(",
"True",
")"
] | The actor's main work loop | [
"The",
"actor",
"s",
"main",
"work",
"loop"
] | train | https://github.com/biesnecker/cleveland/blob/7c899fa7d3fc8cf3736e3c5b7d2ff5ae26b6c3a7/cleveland/actor.py#L38-L45 |
askovpen/discord_simple | discord_simple/bot.py | Bot.connect | def connect(self):
""" Todo connect """
self.transport = Transport(self.token, on_connect=self.on_connect, on_message=self.on_message) | python | def connect(self):
""" Todo connect """
self.transport = Transport(self.token, on_connect=self.on_connect, on_message=self.on_message) | [
"def",
"connect",
"(",
"self",
")",
":",
"self",
".",
"transport",
"=",
"Transport",
"(",
"self",
".",
"token",
",",
"on_connect",
"=",
"self",
".",
"on_connect",
",",
"on_message",
"=",
"self",
".",
"on_message",
")"
] | Todo connect | [
"Todo",
"connect"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/bot.py#L18-L20 |
askovpen/discord_simple | discord_simple/bot.py | Bot.on_connect | def on_connect(self, user):
""" Todo connect """
self.user = user
self.logger.info("connected as %s", user)
if not isinstance(self.con_connect, type(None)):
self.con_connect(user) | python | def on_connect(self, user):
""" Todo connect """
self.user = user
self.logger.info("connected as %s", user)
if not isinstance(self.con_connect, type(None)):
self.con_connect(user) | [
"def",
"on_connect",
"(",
"self",
",",
"user",
")",
":",
"self",
".",
"user",
"=",
"user",
"self",
".",
"logger",
".",
"info",
"(",
"\"connected as %s\"",
",",
"user",
")",
"if",
"not",
"isinstance",
"(",
"self",
".",
"con_connect",
",",
"type",
"(",
... | Todo connect | [
"Todo",
"connect"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/bot.py#L22-L27 |
askovpen/discord_simple | discord_simple/bot.py | Bot.on_message | def on_message(self, data):
""" Todo connect """
if self.user.id != data.author.id:
self.logger.info("Message from %s: %s", data.author, data.content)
if not isinstance(self.con_message, type(None)):
self.logger.debug(type(self.con_message))
self.con_message(data) | python | def on_message(self, data):
""" Todo connect """
if self.user.id != data.author.id:
self.logger.info("Message from %s: %s", data.author, data.content)
if not isinstance(self.con_message, type(None)):
self.logger.debug(type(self.con_message))
self.con_message(data) | [
"def",
"on_message",
"(",
"self",
",",
"data",
")",
":",
"if",
"self",
".",
"user",
".",
"id",
"!=",
"data",
".",
"author",
".",
"id",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"Message from %s: %s\"",
",",
"data",
".",
"author",
",",
"data",
... | Todo connect | [
"Todo",
"connect"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/bot.py#L29-L35 |
askovpen/discord_simple | discord_simple/bot.py | Bot.send_message | def send_message(self, user=None, message=None,channel=None):
""" Todo connect """
self.transport.send_message(user=user, message=message, channel=channel) | python | def send_message(self, user=None, message=None,channel=None):
""" Todo connect """
self.transport.send_message(user=user, message=message, channel=channel) | [
"def",
"send_message",
"(",
"self",
",",
"user",
"=",
"None",
",",
"message",
"=",
"None",
",",
"channel",
"=",
"None",
")",
":",
"self",
".",
"transport",
".",
"send_message",
"(",
"user",
"=",
"user",
",",
"message",
"=",
"message",
",",
"channel",
... | Todo connect | [
"Todo",
"connect"
] | train | https://github.com/askovpen/discord_simple/blob/6dff3a94b63bb3657fae8b16e3d03f944afee71b/discord_simple/bot.py#L46-L48 |
mitsei/dlkit | dlkit/records/assessment/fbw/assessment_part_records.py | AssessmentPartWithLearningObjectiveFormRecord._init_map | def _init_map(self):
"""stub"""
self.my_osid_object_form._my_map['learningObjectiveId'] = \
str(self._learning_objective_id_metadata['default_id_values'][0])
self.my_osid_object_form._my_map['minimumProficiency'] = \
str(self._minimum_proficiency_metadata['default_id_valu... | python | def _init_map(self):
"""stub"""
self.my_osid_object_form._my_map['learningObjectiveId'] = \
str(self._learning_objective_id_metadata['default_id_values'][0])
self.my_osid_object_form._my_map['minimumProficiency'] = \
str(self._minimum_proficiency_metadata['default_id_valu... | [
"def",
"_init_map",
"(",
"self",
")",
":",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"'learningObjectiveId'",
"]",
"=",
"str",
"(",
"self",
".",
"_learning_objective_id_metadata",
"[",
"'default_id_values'",
"]",
"[",
"0",
"]",
")",
"self",
".",... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/fbw/assessment_part_records.py#L43-L48 |
mitsei/dlkit | dlkit/records/assessment/fbw/assessment_part_records.py | AssessmentPartWithLearningObjectiveFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
self._learning_objective_id_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'learning_objective_id'),
'element_label': 'Learning ... | python | def _init_metadata(self):
"""stub"""
self._learning_objective_id_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'learning_objective_id'),
'element_label': 'Learning ... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"self",
".",
"_learning_objective_id_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_object_form",
".",
"_authority",
",",
"self",
".",
"my_osid_object_form",
".",
"_namespace",
",",
"'le... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/fbw/assessment_part_records.py#L50-L79 |
mitsei/dlkit | dlkit/filesystem_adapter/repository/sessions.py | AssetAdminSession._update_asset_content_filename_on_disk_to_match_id | def _update_asset_content_filename_on_disk_to_match_id(self, ac):
"""Because we want the asset content filename to match the ac.ident,
here we manipulate the saved file on disk after creating the
asset content"""
def has_secondary_storage():
return 'secondary_data_store_path'... | python | def _update_asset_content_filename_on_disk_to_match_id(self, ac):
"""Because we want the asset content filename to match the ac.ident,
here we manipulate the saved file on disk after creating the
asset content"""
def has_secondary_storage():
return 'secondary_data_store_path'... | [
"def",
"_update_asset_content_filename_on_disk_to_match_id",
"(",
"self",
",",
"ac",
")",
":",
"def",
"has_secondary_storage",
"(",
")",
":",
"return",
"'secondary_data_store_path'",
"in",
"self",
".",
"_config_map",
"datastore_path",
"=",
"''",
"secondary_data_store_path... | Because we want the asset content filename to match the ac.ident,
here we manipulate the saved file on disk after creating the
asset content | [
"Because",
"we",
"want",
"the",
"asset",
"content",
"filename",
"to",
"match",
"the",
"ac",
".",
"ident",
"here",
"we",
"manipulate",
"the",
"saved",
"file",
"on",
"disk",
"after",
"creating",
"the",
"asset",
"content"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/filesystem_adapter/repository/sessions.py#L1156-L1183 |
mitsei/dlkit | dlkit/filesystem_adapter/repository/sessions.py | AssetAdminSession._update_asset_content_url_to_match_id | def _update_asset_content_url_to_match_id(self, ac):
"""update the ac URL value to match the ident"""
mgr = self._provider_session._get_provider_manager('REPOSITORY')
aas = mgr.get_asset_admin_session_for_repository(self._provider_session._catalog_id,
... | python | def _update_asset_content_url_to_match_id(self, ac):
"""update the ac URL value to match the ident"""
mgr = self._provider_session._get_provider_manager('REPOSITORY')
aas = mgr.get_asset_admin_session_for_repository(self._provider_session._catalog_id,
... | [
"def",
"_update_asset_content_url_to_match_id",
"(",
"self",
",",
"ac",
")",
":",
"mgr",
"=",
"self",
".",
"_provider_session",
".",
"_get_provider_manager",
"(",
"'REPOSITORY'",
")",
"aas",
"=",
"mgr",
".",
"get_asset_admin_session_for_repository",
"(",
"self",
"."... | update the ac URL value to match the ident | [
"update",
"the",
"ac",
"URL",
"value",
"to",
"match",
"the",
"ident"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/filesystem_adapter/repository/sessions.py#L1185-L1197 |
mitsei/dlkit | dlkit/filesystem_adapter/repository/sessions.py | AssetAdminSession.delete_asset_content | def delete_asset_content(self, asset_content_id=None):
"""Deletes content from an ``Asset``.
arg: asset_content_id (osid.id.Id): the ``Id`` of the
``AssetContent``
raise: NotFound - ``asset_content_id`` is not found
raise: NullArgument - ``asset_content_id`` is ``nu... | python | def delete_asset_content(self, asset_content_id=None):
"""Deletes content from an ``Asset``.
arg: asset_content_id (osid.id.Id): the ``Id`` of the
``AssetContent``
raise: NotFound - ``asset_content_id`` is not found
raise: NullArgument - ``asset_content_id`` is ``nu... | [
"def",
"delete_asset_content",
"(",
"self",
",",
"asset_content_id",
"=",
"None",
")",
":",
"asset_content",
"=",
"self",
".",
"_get_asset_content",
"(",
"asset_content_id",
")",
"if",
"asset_content",
".",
"has_url",
"(",
")",
"and",
"'repository/AssetContent'",
... | Deletes content from an ``Asset``.
arg: asset_content_id (osid.id.Id): the ``Id`` of the
``AssetContent``
raise: NotFound - ``asset_content_id`` is not found
raise: NullArgument - ``asset_content_id`` is ``null``
raise: OperationFailed - unable to complete request
... | [
"Deletes",
"content",
"from",
"an",
"Asset",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/filesystem_adapter/repository/sessions.py#L1323-L1340 |
mitsei/dlkit | dlkit/records/assessment/edx/numeric_response_records.py | edXNumericResponseQuestionFormRecord._init_map | def _init_map(self):
"""stub"""
super(edXNumericResponseQuestionFormRecord, self)._init_map()
QuestionTextFormRecord._init_map(self)
QuestionFilesFormRecord._init_map(self)
self.my_osid_object_form._my_map['text']['text'] = '' | python | def _init_map(self):
"""stub"""
super(edXNumericResponseQuestionFormRecord, self)._init_map()
QuestionTextFormRecord._init_map(self)
QuestionFilesFormRecord._init_map(self)
self.my_osid_object_form._my_map['text']['text'] = '' | [
"def",
"_init_map",
"(",
"self",
")",
":",
"super",
"(",
"edXNumericResponseQuestionFormRecord",
",",
"self",
")",
".",
"_init_map",
"(",
")",
"QuestionTextFormRecord",
".",
"_init_map",
"(",
"self",
")",
"QuestionFilesFormRecord",
".",
"_init_map",
"(",
"self",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/edx/numeric_response_records.py#L165-L170 |
mitsei/dlkit | dlkit/records/assessment/edx/numeric_response_records.py | edXNumericResponseQuestionFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
super(edXNumericResponseQuestionFormRecord, self)._init_metadata()
QuestionTextFormRecord._init_metadata(self)
QuestionFilesFormRecord._init_metadata(self) | python | def _init_metadata(self):
"""stub"""
super(edXNumericResponseQuestionFormRecord, self)._init_metadata()
QuestionTextFormRecord._init_metadata(self)
QuestionFilesFormRecord._init_metadata(self) | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"super",
"(",
"edXNumericResponseQuestionFormRecord",
",",
"self",
")",
".",
"_init_metadata",
"(",
")",
"QuestionTextFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"QuestionFilesFormRecord",
".",
"_init_metadata"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/edx/numeric_response_records.py#L172-L176 |
anuragkumarak95/wordnet | wordnet/word_net.py | generate_net | def generate_net(df,tf_idf,dump_path=None):
'''Generate WordNetwork dict of Word() instance, and dump as a file if asked to.
@Args:
--
df : IDF value generated by find_tf_idf()
tf_idf : TF-IDF value generated by find_tf_idf()
dump_path : file_path where to dump network entities, stand... | python | def generate_net(df,tf_idf,dump_path=None):
'''Generate WordNetwork dict of Word() instance, and dump as a file if asked to.
@Args:
--
df : IDF value generated by find_tf_idf()
tf_idf : TF-IDF value generated by find_tf_idf()
dump_path : file_path where to dump network entities, stand... | [
"def",
"generate_net",
"(",
"df",
",",
"tf_idf",
",",
"dump_path",
"=",
"None",
")",
":",
"# error handling",
"if",
"dump_path",
"and",
"dump_path",
"[",
"-",
"4",
":",
"]",
"!=",
"__WRNT_FORMAT",
":",
"raise",
"Exception",
"(",
"__WRNG_FORMAT_MSG",
")",
"... | Generate WordNetwork dict of Word() instance, and dump as a file if asked to.
@Args:
--
df : IDF value generated by find_tf_idf()
tf_idf : TF-IDF value generated by find_tf_idf()
dump_path : file_path where to dump network entities, standart format is '.wrnt' (default=None)
@returns:... | [
"Generate",
"WordNetwork",
"dict",
"of",
"Word",
"()",
"instance",
"and",
"dump",
"as",
"a",
"file",
"if",
"asked",
"to",
"."
] | train | https://github.com/anuragkumarak95/wordnet/blob/7aba239ddebb0971e9e76124890373b60a2573c8/wordnet/word_net.py#L14-L73 |
anuragkumarak95/wordnet | wordnet/word_net.py | retrieve_net | def retrieve_net(wrnt_path):
'''Rerieves a dumped Network and generates WordNet instance.
@Args:
--
wrnt_path : file_path to the '.wrnt' network dumped file.
@returns:
--
word_net : dict of Word() entities generated from the input file.
'''
# Exception Handling of wrong format.
... | python | def retrieve_net(wrnt_path):
'''Rerieves a dumped Network and generates WordNet instance.
@Args:
--
wrnt_path : file_path to the '.wrnt' network dumped file.
@returns:
--
word_net : dict of Word() entities generated from the input file.
'''
# Exception Handling of wrong format.
... | [
"def",
"retrieve_net",
"(",
"wrnt_path",
")",
":",
"# Exception Handling of wrong format.",
"if",
"wrnt_path",
"[",
"-",
"4",
":",
"]",
"!=",
"__WRNT_FORMAT",
":",
"raise",
"Exception",
"(",
"__WRNG_FORMAT_MSG",
")",
"file",
"=",
"open",
"(",
"wrnt_path",
",",
... | Rerieves a dumped Network and generates WordNet instance.
@Args:
--
wrnt_path : file_path to the '.wrnt' network dumped file.
@returns:
--
word_net : dict of Word() entities generated from the input file. | [
"Rerieves",
"a",
"dumped",
"Network",
"and",
"generates",
"WordNet",
"instance",
"."
] | train | https://github.com/anuragkumarak95/wordnet/blob/7aba239ddebb0971e9e76124890373b60a2573c8/wordnet/word_net.py#L76-L100 |
anuragkumarak95/wordnet | wordnet/word_net.py | return_net | def return_net(word,word_net,depth=1):
'''Creates a list of unique words that are at a provided depth from root word.
@Args:
--
word : root word from which the linked words should be returned.
word_net : word network (dictionary of word instances)to be refered in this process.
depth : ... | python | def return_net(word,word_net,depth=1):
'''Creates a list of unique words that are at a provided depth from root word.
@Args:
--
word : root word from which the linked words should be returned.
word_net : word network (dictionary of word instances)to be refered in this process.
depth : ... | [
"def",
"return_net",
"(",
"word",
",",
"word_net",
",",
"depth",
"=",
"1",
")",
":",
"if",
"depth",
"<",
"1",
":",
"raise",
"Exception",
"(",
"TAG",
"+",
"\"Degree value error.range(1,~)\"",
")",
"if",
"depth",
"==",
"1",
":",
"return",
"list",
"(",
"w... | Creates a list of unique words that are at a provided depth from root word.
@Args:
--
word : root word from which the linked words should be returned.
word_net : word network (dictionary of word instances)to be refered in this process.
depth : depth to which this process must traverse and... | [
"Creates",
"a",
"list",
"of",
"unique",
"words",
"that",
"are",
"at",
"a",
"provided",
"depth",
"from",
"root",
"word",
"."
] | train | https://github.com/anuragkumarak95/wordnet/blob/7aba239ddebb0971e9e76124890373b60a2573c8/wordnet/word_net.py#L102-L123 |
cloudnull/cloudlib | cloudlib/parse_ini.py | ConfigurationSetup.load_config | def load_config(self, name=None, path=None, home=False, ext='ini'):
"""Return the full path to a configuration file.
This will look for configuration files in the ``full_path``, in
the users home folder, or in a config directory in "/etc". If you set
`home=True`, the system will look f... | python | def load_config(self, name=None, path=None, home=False, ext='ini'):
"""Return the full path to a configuration file.
This will look for configuration files in the ``full_path``, in
the users home folder, or in a config directory in "/etc". If you set
`home=True`, the system will look f... | [
"def",
"load_config",
"(",
"self",
",",
"name",
"=",
"None",
",",
"path",
"=",
"None",
",",
"home",
"=",
"False",
",",
"ext",
"=",
"'ini'",
")",
":",
"opj",
"=",
"os",
".",
"path",
".",
"join",
"self",
".",
"name",
"=",
"name",
"self",
".",
"fi... | Return the full path to a configuration file.
This will look for configuration files in the ``full_path``, in
the users home folder, or in a config directory in "/etc". If you set
`home=True`, the system will look for a "hidden" configuration file in
the executing users $HOME folder.
... | [
"Return",
"the",
"full",
"path",
"to",
"a",
"configuration",
"file",
"."
] | train | https://github.com/cloudnull/cloudlib/blob/5038111ce02521caa2558117e3bae9e1e806d315/cloudlib/parse_ini.py#L62-L100 |
cloudnull/cloudlib | cloudlib/parse_ini.py | ConfigurationSetup._find_config | def _find_config(self, config_file):
"""This method will check if the configuration file "exist"
If it does NOT then the method will bail calling an IOError.
:param config_file: ``str``
:return: ``str``
"""
msg = ('Configuration file [ %s ] was not found.' % self.filena... | python | def _find_config(self, config_file):
"""This method will check if the configuration file "exist"
If it does NOT then the method will bail calling an IOError.
:param config_file: ``str``
:return: ``str``
"""
msg = ('Configuration file [ %s ] was not found.' % self.filena... | [
"def",
"_find_config",
"(",
"self",
",",
"config_file",
")",
":",
"msg",
"=",
"(",
"'Configuration file [ %s ] was not found.'",
"%",
"self",
".",
"filename",
")",
"self",
".",
"log",
".",
"fatal",
"(",
"msg",
")",
"raise",
"IOError",
"(",
"msg",
")"
] | This method will check if the configuration file "exist"
If it does NOT then the method will bail calling an IOError.
:param config_file: ``str``
:return: ``str`` | [
"This",
"method",
"will",
"check",
"if",
"the",
"configuration",
"file",
"exist"
] | train | https://github.com/cloudnull/cloudlib/blob/5038111ce02521caa2558117e3bae9e1e806d315/cloudlib/parse_ini.py#L102-L112 |
cloudnull/cloudlib | cloudlib/parse_ini.py | ConfigurationSetup.check_perms | def check_perms(self, perms='0600,0400'):
"""Check and enforce the permissions of the config file.
Enforce permission on a provided configuration file. This will check
and see if the permission are set based on the permission octet as
set in the ``perms`` value. ``perms`` is a comma sep... | python | def check_perms(self, perms='0600,0400'):
"""Check and enforce the permissions of the config file.
Enforce permission on a provided configuration file. This will check
and see if the permission are set based on the permission octet as
set in the ``perms`` value. ``perms`` is a comma sep... | [
"def",
"check_perms",
"(",
"self",
",",
"perms",
"=",
"'0600,0400'",
")",
":",
"confpath",
"=",
"os",
".",
"path",
".",
"realpath",
"(",
"self",
".",
"config_file",
")",
"mode",
"=",
"stat",
".",
"S_IMODE",
"(",
"os",
".",
"stat",
"(",
"confpath",
")... | Check and enforce the permissions of the config file.
Enforce permission on a provided configuration file. This will check
and see if the permission are set based on the permission octet as
set in the ``perms`` value. ``perms`` is a comma separated list
of acceptable perms in octal form... | [
"Check",
"and",
"enforce",
"the",
"permissions",
"of",
"the",
"config",
"file",
"."
] | train | https://github.com/cloudnull/cloudlib/blob/5038111ce02521caa2558117e3bae9e1e806d315/cloudlib/parse_ini.py#L114-L139 |
cloudnull/cloudlib | cloudlib/parse_ini.py | ConfigurationSetup.config_args | def config_args(self, section='default'):
"""Loop through the configuration file and set all of our values.
Note:
that anything can be set as a "section" in the argument file. If a
section does not exist an empty dict will be returned.
:param section: ``str``
:retu... | python | def config_args(self, section='default'):
"""Loop through the configuration file and set all of our values.
Note:
that anything can be set as a "section" in the argument file. If a
section does not exist an empty dict will be returned.
:param section: ``str``
:retu... | [
"def",
"config_args",
"(",
"self",
",",
"section",
"=",
"'default'",
")",
":",
"if",
"sys",
".",
"version_info",
">=",
"(",
"2",
",",
"7",
",",
"0",
")",
":",
"parser",
"=",
"ConfigParser",
".",
"SafeConfigParser",
"(",
"allow_no_value",
"=",
"True",
"... | Loop through the configuration file and set all of our values.
Note:
that anything can be set as a "section" in the argument file. If a
section does not exist an empty dict will be returned.
:param section: ``str``
:return: ``dict`` | [
"Loop",
"through",
"the",
"configuration",
"file",
"and",
"set",
"all",
"of",
"our",
"values",
"."
] | train | https://github.com/cloudnull/cloudlib/blob/5038111ce02521caa2558117e3bae9e1e806d315/cloudlib/parse_ini.py#L141-L174 |
mitsei/dlkit | dlkit/authz_adapter/repository/managers.py | RepositoryManager.get_asset_content_lookup_session | def get_asset_content_lookup_session(self):
"""Pass through to provider get_asset_content_lookup_session"""
return getattr(sessions, 'AssetContentLookupSession')(
provider_session=self._provider_manager.get_asset_content_lookup_session(),
authz_session=self._authz_session) | python | def get_asset_content_lookup_session(self):
"""Pass through to provider get_asset_content_lookup_session"""
return getattr(sessions, 'AssetContentLookupSession')(
provider_session=self._provider_manager.get_asset_content_lookup_session(),
authz_session=self._authz_session) | [
"def",
"get_asset_content_lookup_session",
"(",
"self",
")",
":",
"return",
"getattr",
"(",
"sessions",
",",
"'AssetContentLookupSession'",
")",
"(",
"provider_session",
"=",
"self",
".",
"_provider_manager",
".",
"get_asset_content_lookup_session",
"(",
")",
",",
"au... | Pass through to provider get_asset_content_lookup_session | [
"Pass",
"through",
"to",
"provider",
"get_asset_content_lookup_session"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/repository/managers.py#L224-L228 |
mitsei/dlkit | dlkit/authz_adapter/repository/managers.py | RepositoryManager.get_asset_content_lookup_session_for_repository | def get_asset_content_lookup_session_for_repository(self, repository_id):
"""Pass through to provider get_asset_content_lookup_session_for_repository"""
return getattr(sessions, 'AssetContentLookupSession')(
provider_session=self._provider_manager.get_asset_content_lookup_session_for_reposit... | python | def get_asset_content_lookup_session_for_repository(self, repository_id):
"""Pass through to provider get_asset_content_lookup_session_for_repository"""
return getattr(sessions, 'AssetContentLookupSession')(
provider_session=self._provider_manager.get_asset_content_lookup_session_for_reposit... | [
"def",
"get_asset_content_lookup_session_for_repository",
"(",
"self",
",",
"repository_id",
")",
":",
"return",
"getattr",
"(",
"sessions",
",",
"'AssetContentLookupSession'",
")",
"(",
"provider_session",
"=",
"self",
".",
"_provider_manager",
".",
"get_asset_content_lo... | Pass through to provider get_asset_content_lookup_session_for_repository | [
"Pass",
"through",
"to",
"provider",
"get_asset_content_lookup_session_for_repository"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/repository/managers.py#L230-L234 |
mitsei/dlkit | dlkit/authz_adapter/repository/managers.py | RepositoryProxyManager.get_asset_content_lookup_session | def get_asset_content_lookup_session(self, proxy):
"""Pass through to provider get_asset_content_lookup_session"""
return getattr(sessions, 'AssetContentLookupSession')(
provider_session=self._provider_manager.get_asset_content_lookup_session(proxy),
authz_session=self._get_authz... | python | def get_asset_content_lookup_session(self, proxy):
"""Pass through to provider get_asset_content_lookup_session"""
return getattr(sessions, 'AssetContentLookupSession')(
provider_session=self._provider_manager.get_asset_content_lookup_session(proxy),
authz_session=self._get_authz... | [
"def",
"get_asset_content_lookup_session",
"(",
"self",
",",
"proxy",
")",
":",
"return",
"getattr",
"(",
"sessions",
",",
"'AssetContentLookupSession'",
")",
"(",
"provider_session",
"=",
"self",
".",
"_provider_manager",
".",
"get_asset_content_lookup_session",
"(",
... | Pass through to provider get_asset_content_lookup_session | [
"Pass",
"through",
"to",
"provider",
"get_asset_content_lookup_session"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/repository/managers.py#L631-L636 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/group.py | ExonGroup.start_range | def start_range(self):
"""Similar to the junction range but don't need to check for leftmost or rightmost"""
if len(self._exons) == 0: return None
return GenomicRange(self._exons[0].chr,
min([x.start for x in self._exons]),# must be part of junction
max([x.start for x in self... | python | def start_range(self):
"""Similar to the junction range but don't need to check for leftmost or rightmost"""
if len(self._exons) == 0: return None
return GenomicRange(self._exons[0].chr,
min([x.start for x in self._exons]),# must be part of junction
max([x.start for x in self... | [
"def",
"start_range",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"_exons",
")",
"==",
"0",
":",
"return",
"None",
"return",
"GenomicRange",
"(",
"self",
".",
"_exons",
"[",
"0",
"]",
".",
"chr",
",",
"min",
"(",
"[",
"x",
".",
"start",... | Similar to the junction range but don't need to check for leftmost or rightmost | [
"Similar",
"to",
"the",
"junction",
"range",
"but",
"don",
"t",
"need",
"to",
"check",
"for",
"leftmost",
"or",
"rightmost"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/group.py#L23-L28 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/group.py | ExonGroup.end_range | def end_range(self):
"""Similar to the junction range but don't need to check for leftmost or rightmost"""
if len(self._exons) == 0: return None
return GenomicRange(self._exons[0].chr,
min([x.end for x in self._exons]),
max([x.end for x in self._exons])) | python | def end_range(self):
"""Similar to the junction range but don't need to check for leftmost or rightmost"""
if len(self._exons) == 0: return None
return GenomicRange(self._exons[0].chr,
min([x.end for x in self._exons]),
max([x.end for x in self._exons])) | [
"def",
"end_range",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"_exons",
")",
"==",
"0",
":",
"return",
"None",
"return",
"GenomicRange",
"(",
"self",
".",
"_exons",
"[",
"0",
"]",
".",
"chr",
",",
"min",
"(",
"[",
"x",
".",
"end",
"... | Similar to the junction range but don't need to check for leftmost or rightmost | [
"Similar",
"to",
"the",
"junction",
"range",
"but",
"don",
"t",
"need",
"to",
"check",
"for",
"leftmost",
"or",
"rightmost"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/group.py#L30-L35 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/group.py | FuzzyTranscript._rngs | def _rngs(self):
"""This is where we should also enforce evidence requirements"""
outputs = []
if len(self._exon_groups)==1:
return [self._exon_groups.consensus('single')]
z = 0 #output count
begin = 0
meeting_criteria = [i for i in range(0,len(self._exon_groups)) if len(se... | python | def _rngs(self):
"""This is where we should also enforce evidence requirements"""
outputs = []
if len(self._exon_groups)==1:
return [self._exon_groups.consensus('single')]
z = 0 #output count
begin = 0
meeting_criteria = [i for i in range(0,len(self._exon_groups)) if len(se... | [
"def",
"_rngs",
"(",
"self",
")",
":",
"outputs",
"=",
"[",
"]",
"if",
"len",
"(",
"self",
".",
"_exon_groups",
")",
"==",
"1",
":",
"return",
"[",
"self",
".",
"_exon_groups",
".",
"consensus",
"(",
"'single'",
")",
"]",
"z",
"=",
"0",
"#output co... | This is where we should also enforce evidence requirements | [
"This",
"is",
"where",
"we",
"should",
"also",
"enforce",
"evidence",
"requirements"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/group.py#L97-L122 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/group.py | FuzzyTranscript.add_transcripts | def add_transcripts(self,txs):
"""We traverse through the other transcripts and try to add to these groups
"""
passed = []
for tx2 in txs:
for tx1 in self._initial:
jov = tx1.junction_overlap(tx2,self._tolerance)
sub = jov.is_subset()
if sub == 1 or s... | python | def add_transcripts(self,txs):
"""We traverse through the other transcripts and try to add to these groups
"""
passed = []
for tx2 in txs:
for tx1 in self._initial:
jov = tx1.junction_overlap(tx2,self._tolerance)
sub = jov.is_subset()
if sub == 1 or s... | [
"def",
"add_transcripts",
"(",
"self",
",",
"txs",
")",
":",
"passed",
"=",
"[",
"]",
"for",
"tx2",
"in",
"txs",
":",
"for",
"tx1",
"in",
"self",
".",
"_initial",
":",
"jov",
"=",
"tx1",
".",
"junction_overlap",
"(",
"tx2",
",",
"self",
".",
"_tole... | We traverse through the other transcripts and try to add to these groups | [
"We",
"traverse",
"through",
"the",
"other",
"transcripts",
"and",
"try",
"to",
"add",
"to",
"these",
"groups"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/group.py#L129-L145 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/group.py | FuzzyTranscript.add_transcript | def add_transcript(self,tx):
"""add a single transcript"""
candidates = tx.junctions
targets = self.junctions
matches = []
for i in range(0,len(targets)):
for j in range(0,len(candidates)):
if targets[i].overlaps(candidates[j],self._tolerance):
matches.a... | python | def add_transcript(self,tx):
"""add a single transcript"""
candidates = tx.junctions
targets = self.junctions
matches = []
for i in range(0,len(targets)):
for j in range(0,len(candidates)):
if targets[i].overlaps(candidates[j],self._tolerance):
matches.a... | [
"def",
"add_transcript",
"(",
"self",
",",
"tx",
")",
":",
"candidates",
"=",
"tx",
".",
"junctions",
"targets",
"=",
"self",
".",
"junctions",
"matches",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"len",
"(",
"targets",
")",
")",
":"... | add a single transcript | [
"add",
"a",
"single",
"transcript"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/group.py#L147-L165 |
jason-weirather/py-seq-tools | seqtools/structure/transcript/group.py | Deconvolution.parse | def parse(self,tolerance=0,downsample=None,evidence=2,use_gene_names=False):
"""Divide out the transcripts. allow junction tolerance if wanted"""
g = Graph()
nodes = [Node(x) for x in self._transcripts]
for n in nodes: g.add_node(n)
for i in range(0,len(nodes)):
for j in range(0,... | python | def parse(self,tolerance=0,downsample=None,evidence=2,use_gene_names=False):
"""Divide out the transcripts. allow junction tolerance if wanted"""
g = Graph()
nodes = [Node(x) for x in self._transcripts]
for n in nodes: g.add_node(n)
for i in range(0,len(nodes)):
for j in range(0,... | [
"def",
"parse",
"(",
"self",
",",
"tolerance",
"=",
"0",
",",
"downsample",
"=",
"None",
",",
"evidence",
"=",
"2",
",",
"use_gene_names",
"=",
"False",
")",
":",
"g",
"=",
"Graph",
"(",
")",
"nodes",
"=",
"[",
"Node",
"(",
"x",
")",
"for",
"x",
... | Divide out the transcripts. allow junction tolerance if wanted | [
"Divide",
"out",
"the",
"transcripts",
".",
"allow",
"junction",
"tolerance",
"if",
"wanted"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/transcript/group.py#L215-L238 |
jason-weirather/py-seq-tools | seqtools/stream.py | LocusStream.read_entry | def read_entry(self):
"""As long as entires overlap keep putting them together in a list that is
the payload for a range that describes the bounds of the list
:return: range with payload list of elements
:rtype: GenomicRange
"""
if not self._current_range:
return None
... | python | def read_entry(self):
"""As long as entires overlap keep putting them together in a list that is
the payload for a range that describes the bounds of the list
:return: range with payload list of elements
:rtype: GenomicRange
"""
if not self._current_range:
return None
... | [
"def",
"read_entry",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_current_range",
":",
"return",
"None",
"output",
"=",
"None",
"while",
"True",
":",
"try",
":",
"e",
"=",
"self",
".",
"_stream",
".",
"next",
"(",
")",
"except",
"StopIteration",
... | As long as entires overlap keep putting them together in a list that is
the payload for a range that describes the bounds of the list
:return: range with payload list of elements
:rtype: GenomicRange | [
"As",
"long",
"as",
"entires",
"overlap",
"keep",
"putting",
"them",
"together",
"in",
"a",
"list",
"that",
"is",
"the",
"payload",
"for",
"a",
"range",
"that",
"describes",
"the",
"bounds",
"of",
"the",
"list"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/stream.py#L183-L213 |
vimalkvn/riboplot | riboplot/riboplot.py | get_start_stops | def get_start_stops(transcript_sequence, start_codons=None, stop_codons=None):
"""Return start and stop positions for all frames in the given
transcript.
"""
transcript_sequence = transcript_sequence.upper() # for comparison with codons below
if not start_codons:
st... | python | def get_start_stops(transcript_sequence, start_codons=None, stop_codons=None):
"""Return start and stop positions for all frames in the given
transcript.
"""
transcript_sequence = transcript_sequence.upper() # for comparison with codons below
if not start_codons:
st... | [
"def",
"get_start_stops",
"(",
"transcript_sequence",
",",
"start_codons",
"=",
"None",
",",
"stop_codons",
"=",
"None",
")",
":",
"transcript_sequence",
"=",
"transcript_sequence",
".",
"upper",
"(",
")",
"# for comparison with codons below",
"if",
"not",
"start_codo... | Return start and stop positions for all frames in the given
transcript. | [
"Return",
"start",
"and",
"stop",
"positions",
"for",
"all",
"frames",
"in",
"the",
"given",
"transcript",
"."
] | train | https://github.com/vimalkvn/riboplot/blob/914515df54eccc2e726ba71e751c3260f2066d97/riboplot/riboplot.py#L47-L79 |
vimalkvn/riboplot | riboplot/riboplot.py | get_rna_counts | def get_rna_counts(rna_file, transcript_name):
"""Get coverage for a given RNA BAM file, return read counts. """
# check if the RNA file exists
if not os.path.exists(rna_file):
msg = 'RNA-Seq BAM file "{}" does not exist'.format(rna_file)
logging.error(msg)
raise OSError(msg)
rna... | python | def get_rna_counts(rna_file, transcript_name):
"""Get coverage for a given RNA BAM file, return read counts. """
# check if the RNA file exists
if not os.path.exists(rna_file):
msg = 'RNA-Seq BAM file "{}" does not exist'.format(rna_file)
logging.error(msg)
raise OSError(msg)
rna... | [
"def",
"get_rna_counts",
"(",
"rna_file",
",",
"transcript_name",
")",
":",
"# check if the RNA file exists",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"rna_file",
")",
":",
"msg",
"=",
"'RNA-Seq BAM file \"{}\" does not exist'",
".",
"format",
"(",
"rna... | Get coverage for a given RNA BAM file, return read counts. | [
"Get",
"coverage",
"for",
"a",
"given",
"RNA",
"BAM",
"file",
"return",
"read",
"counts",
"."
] | train | https://github.com/vimalkvn/riboplot/blob/914515df54eccc2e726ba71e751c3260f2066d97/riboplot/riboplot.py#L82-L106 |
vimalkvn/riboplot | riboplot/riboplot.py | set_axis_color | def set_axis_color(axis, color, alpha=None):
"""Sets the spine color of all sides of an axis (top, right, bottom, left)."""
for side in ('top', 'right', 'bottom', 'left'):
spine = axis.spines[side]
spine.set_color(color)
if alpha is not None:
spine.set_alpha(alpha) | python | def set_axis_color(axis, color, alpha=None):
"""Sets the spine color of all sides of an axis (top, right, bottom, left)."""
for side in ('top', 'right', 'bottom', 'left'):
spine = axis.spines[side]
spine.set_color(color)
if alpha is not None:
spine.set_alpha(alpha) | [
"def",
"set_axis_color",
"(",
"axis",
",",
"color",
",",
"alpha",
"=",
"None",
")",
":",
"for",
"side",
"in",
"(",
"'top'",
",",
"'right'",
",",
"'bottom'",
",",
"'left'",
")",
":",
"spine",
"=",
"axis",
".",
"spines",
"[",
"side",
"]",
"spine",
".... | Sets the spine color of all sides of an axis (top, right, bottom, left). | [
"Sets",
"the",
"spine",
"color",
"of",
"all",
"sides",
"of",
"an",
"axis",
"(",
"top",
"right",
"bottom",
"left",
")",
"."
] | train | https://github.com/vimalkvn/riboplot/blob/914515df54eccc2e726ba71e751c3260f2066d97/riboplot/riboplot.py#L109-L115 |
vimalkvn/riboplot | riboplot/riboplot.py | get_color_palette | def get_color_palette(scheme):
"""Return colors for a given scheme. Default colors are returned for an item
if undefined in scheme.
"""
color_schemes = {
'default': {
'frames': ['tomato', 'limegreen', 'deepskyblue'], 'background': '#ffffff',
'color': '#616161', 'ticks': ... | python | def get_color_palette(scheme):
"""Return colors for a given scheme. Default colors are returned for an item
if undefined in scheme.
"""
color_schemes = {
'default': {
'frames': ['tomato', 'limegreen', 'deepskyblue'], 'background': '#ffffff',
'color': '#616161', 'ticks': ... | [
"def",
"get_color_palette",
"(",
"scheme",
")",
":",
"color_schemes",
"=",
"{",
"'default'",
":",
"{",
"'frames'",
":",
"[",
"'tomato'",
",",
"'limegreen'",
",",
"'deepskyblue'",
"]",
",",
"'background'",
":",
"'#ffffff'",
",",
"'color'",
":",
"'#616161'",
"... | Return colors for a given scheme. Default colors are returned for an item
if undefined in scheme. | [
"Return",
"colors",
"for",
"a",
"given",
"scheme",
".",
"Default",
"colors",
"are",
"returned",
"for",
"an",
"item",
"if",
"undefined",
"in",
"scheme",
"."
] | train | https://github.com/vimalkvn/riboplot/blob/914515df54eccc2e726ba71e751c3260f2066d97/riboplot/riboplot.py#L118-L145 |
vimalkvn/riboplot | riboplot/riboplot.py | plot_profile | def plot_profile(ribo_counts, transcript_name, transcript_length,
start_stops, read_lengths=None, read_offsets=None, rna_counts=None,
color_scheme='default', html_file='index.html', output_path='output'):
"""Plot read counts (in all 3 frames) and RNA coverage if provided for a
... | python | def plot_profile(ribo_counts, transcript_name, transcript_length,
start_stops, read_lengths=None, read_offsets=None, rna_counts=None,
color_scheme='default', html_file='index.html', output_path='output'):
"""Plot read counts (in all 3 frames) and RNA coverage if provided for a
... | [
"def",
"plot_profile",
"(",
"ribo_counts",
",",
"transcript_name",
",",
"transcript_length",
",",
"start_stops",
",",
"read_lengths",
"=",
"None",
",",
"read_offsets",
"=",
"None",
",",
"rna_counts",
"=",
"None",
",",
"color_scheme",
"=",
"'default'",
",",
"html... | Plot read counts (in all 3 frames) and RNA coverage if provided for a
single transcript. | [
"Plot",
"read",
"counts",
"(",
"in",
"all",
"3",
"frames",
")",
"and",
"RNA",
"coverage",
"if",
"provided",
"for",
"a",
"single",
"transcript",
"."
] | train | https://github.com/vimalkvn/riboplot/blob/914515df54eccc2e726ba71e751c3260f2066d97/riboplot/riboplot.py#L148-L290 |
vimalkvn/riboplot | riboplot/riboplot.py | create_parser | def create_parser():
"""Argument parser. """
parser = argparse.ArgumentParser(
prog='riboplot.py', description='Plot and output read counts for a single transcript')
required = parser.add_argument_group('required arguments')
required.add_argument('-b', '--ribo_file', help='Ribo-Seq alignment fi... | python | def create_parser():
"""Argument parser. """
parser = argparse.ArgumentParser(
prog='riboplot.py', description='Plot and output read counts for a single transcript')
required = parser.add_argument_group('required arguments')
required.add_argument('-b', '--ribo_file', help='Ribo-Seq alignment fi... | [
"def",
"create_parser",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"prog",
"=",
"'riboplot.py'",
",",
"description",
"=",
"'Plot and output read counts for a single transcript'",
")",
"required",
"=",
"parser",
".",
"add_argument_group",
"("... | Argument parser. | [
"Argument",
"parser",
"."
] | train | https://github.com/vimalkvn/riboplot/blob/914515df54eccc2e726ba71e751c3260f2066d97/riboplot/riboplot.py#L293-L319 |
vimalkvn/riboplot | riboplot/riboplot.py | main | def main(args):
"""Main program"""
(ribo_file, rna_file, transcript_name, transcriptome_fasta, read_lengths,
read_offsets, output_path, html_file) = (
args.ribo_file, args.rna_file, args.transcript_name, args.transcriptome_fasta,
args.read_lengths, args.read_offsets, args.output_path, arg... | python | def main(args):
"""Main program"""
(ribo_file, rna_file, transcript_name, transcriptome_fasta, read_lengths,
read_offsets, output_path, html_file) = (
args.ribo_file, args.rna_file, args.transcript_name, args.transcriptome_fasta,
args.read_lengths, args.read_offsets, args.output_path, arg... | [
"def",
"main",
"(",
"args",
")",
":",
"(",
"ribo_file",
",",
"rna_file",
",",
"transcript_name",
",",
"transcriptome_fasta",
",",
"read_lengths",
",",
"read_offsets",
",",
"output_path",
",",
"html_file",
")",
"=",
"(",
"args",
".",
"ribo_file",
",",
"args",... | Main program | [
"Main",
"program"
] | train | https://github.com/vimalkvn/riboplot/blob/914515df54eccc2e726ba71e751c3260f2066d97/riboplot/riboplot.py#L322-L414 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | BaseMultiChoiceQuestionFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
self._choices_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'choices'),
'element_label': 'Choices',
'instructions':... | python | def _init_metadata(self):
"""stub"""
self._choices_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'choices'),
'element_label': 'Choices',
'instructions':... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"self",
".",
"_choices_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_object_form",
".",
"_authority",
",",
"self",
".",
"my_osid_object_form",
".",
"_namespace",
",",
"'choices'",
")"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L90-L135 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | BaseMultiChoiceQuestionFormRecord.clear_choice | def clear_choice(self, choice):
"""stub"""
if len(self.my_osid_object_form._my_map['choices']) == 0:
raise IllegalState('there are currently no choices defined for this question')
if (len(self.my_osid_object_form._my_map['choices']) == 1 and
choice in self.my_osid_obj... | python | def clear_choice(self, choice):
"""stub"""
if len(self.my_osid_object_form._my_map['choices']) == 0:
raise IllegalState('there are currently no choices defined for this question')
if (len(self.my_osid_object_form._my_map['choices']) == 1 and
choice in self.my_osid_obj... | [
"def",
"clear_choice",
"(",
"self",
",",
"choice",
")",
":",
"if",
"len",
"(",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"'choices'",
"]",
")",
"==",
"0",
":",
"raise",
"IllegalState",
"(",
"'there are currently no choices defined for this question'... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L141-L149 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | BaseMultiChoiceTextQuestionFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
super(BaseMultiChoiceTextQuestionFormRecord, self)._init_metadata()
self._choice_text_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
... | python | def _init_metadata(self):
"""stub"""
super(BaseMultiChoiceTextQuestionFormRecord, self)._init_metadata()
self._choice_text_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"super",
"(",
"BaseMultiChoiceTextQuestionFormRecord",
",",
"self",
")",
".",
"_init_metadata",
"(",
")",
"self",
".",
"_choice_text_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_object... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L196-L219 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | BaseMultiChoiceTextQuestionFormRecord.add_choice | def add_choice(self, text, name='', identifier=None):
"""stub"""
if not utilities.is_string(text):
raise InvalidArgument('text is not a string')
choice_display_text = self._choice_text_metadata['default_string_values'][0]
choice_display_text['text'] = text
if identifi... | python | def add_choice(self, text, name='', identifier=None):
"""stub"""
if not utilities.is_string(text):
raise InvalidArgument('text is not a string')
choice_display_text = self._choice_text_metadata['default_string_values'][0]
choice_display_text['text'] = text
if identifi... | [
"def",
"add_choice",
"(",
"self",
",",
"text",
",",
"name",
"=",
"''",
",",
"identifier",
"=",
"None",
")",
":",
"if",
"not",
"utilities",
".",
"is_string",
"(",
"text",
")",
":",
"raise",
"InvalidArgument",
"(",
"'text is not a string'",
")",
"choice_disp... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L221-L235 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | BaseMultiChoiceFileQuestionFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
super(BaseMultiChoiceFileQuestionFormRecord, self)._init_metadata()
self._choice_file_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
... | python | def _init_metadata(self):
"""stub"""
super(BaseMultiChoiceFileQuestionFormRecord, self)._init_metadata()
self._choice_file_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"super",
"(",
"BaseMultiChoiceFileQuestionFormRecord",
",",
"self",
")",
".",
"_init_metadata",
"(",
")",
"self",
".",
"_choice_file_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_object... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L312-L328 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | BaseMultiChoiceFileQuestionFormRecord.add_choice | def add_choice(self, asset_id, name='', identifier=None):
"""stub"""
if identifier is None:
identifier = str(ObjectId())
self.my_osid_object_form._my_map['choices'].append({
'id': identifier,
'assetId': str(asset_id),
'name': name
})
... | python | def add_choice(self, asset_id, name='', identifier=None):
"""stub"""
if identifier is None:
identifier = str(ObjectId())
self.my_osid_object_form._my_map['choices'].append({
'id': identifier,
'assetId': str(asset_id),
'name': name
})
... | [
"def",
"add_choice",
"(",
"self",
",",
"asset_id",
",",
"name",
"=",
"''",
",",
"identifier",
"=",
"None",
")",
":",
"if",
"identifier",
"is",
"None",
":",
"identifier",
"=",
"str",
"(",
"ObjectId",
"(",
")",
")",
"self",
".",
"my_osid_object_form",
".... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L330-L339 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | MultiChoiceTextAndFilesQuestionFormRecord._init_map | def _init_map(self):
"""stub"""
QuestionTextAndFilesMixin._init_map(self)
BaseMultiChoiceTextQuestionFormRecord._init_map(self)
super(MultiChoiceTextAndFilesQuestionFormRecord, self)._init_map() | python | def _init_map(self):
"""stub"""
QuestionTextAndFilesMixin._init_map(self)
BaseMultiChoiceTextQuestionFormRecord._init_map(self)
super(MultiChoiceTextAndFilesQuestionFormRecord, self)._init_map() | [
"def",
"_init_map",
"(",
"self",
")",
":",
"QuestionTextAndFilesMixin",
".",
"_init_map",
"(",
"self",
")",
"BaseMultiChoiceTextQuestionFormRecord",
".",
"_init_map",
"(",
"self",
")",
"super",
"(",
"MultiChoiceTextAndFilesQuestionFormRecord",
",",
"self",
")",
".",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L372-L376 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | MultiChoiceTextAndFilesQuestionFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
QuestionTextAndFilesMixin._init_metadata(self)
BaseMultiChoiceTextQuestionFormRecord._init_metadata(self)
super(MultiChoiceTextAndFilesQuestionFormRecord, self)._init_metadata() | python | def _init_metadata(self):
"""stub"""
QuestionTextAndFilesMixin._init_metadata(self)
BaseMultiChoiceTextQuestionFormRecord._init_metadata(self)
super(MultiChoiceTextAndFilesQuestionFormRecord, self)._init_metadata() | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"QuestionTextAndFilesMixin",
".",
"_init_metadata",
"(",
"self",
")",
"BaseMultiChoiceTextQuestionFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"super",
"(",
"MultiChoiceTextAndFilesQuestionFormRecord",
",",
"self",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L378-L382 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | MultiChoiceAnswerFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
self._choice_ids_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'choice_ids'),
'element_label': 'response set',
'ins... | python | def _init_metadata(self):
"""stub"""
self._choice_ids_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'choice_ids'),
'element_label': 'response set',
'ins... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"self",
".",
"_choice_ids_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_object_form",
".",
"_authority",
",",
"self",
".",
"my_osid_object_form",
".",
"_namespace",
",",
"'choice_ids'",... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L626-L654 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | MultiChoiceAnswerFormRecord.clear_choice_ids | def clear_choice_ids(self):
"""stub"""
if (self.get_choice_ids_metadata().is_read_only() or
self.get_choice_ids_metadata().is_required()):
raise NoAccess()
self.my_osid_object_form._my_map['choiceIds'] = \
self._choice_ids_metadata['default_object_values']... | python | def clear_choice_ids(self):
"""stub"""
if (self.get_choice_ids_metadata().is_read_only() or
self.get_choice_ids_metadata().is_required()):
raise NoAccess()
self.my_osid_object_form._my_map['choiceIds'] = \
self._choice_ids_metadata['default_object_values']... | [
"def",
"clear_choice_ids",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_choice_ids_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_choice_ids_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
"NoAccess... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L670-L676 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | MultiChoiceFeedbackAndFilesAnswerFormRecord._init_map | def _init_map(self):
"""stub"""
MultiChoiceAnswerFormRecord._init_map(self)
FilesAnswerFormRecord._init_map(self)
FeedbackAnswerFormRecord._init_map(self)
super(MultiChoiceFeedbackAndFilesAnswerFormRecord, self)._init_map() | python | def _init_map(self):
"""stub"""
MultiChoiceAnswerFormRecord._init_map(self)
FilesAnswerFormRecord._init_map(self)
FeedbackAnswerFormRecord._init_map(self)
super(MultiChoiceFeedbackAndFilesAnswerFormRecord, self)._init_map() | [
"def",
"_init_map",
"(",
"self",
")",
":",
"MultiChoiceAnswerFormRecord",
".",
"_init_map",
"(",
"self",
")",
"FilesAnswerFormRecord",
".",
"_init_map",
"(",
"self",
")",
"FeedbackAnswerFormRecord",
".",
"_init_map",
"(",
"self",
")",
"super",
"(",
"MultiChoiceFee... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L707-L712 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | MultiChoiceFeedbackAndFilesAnswerFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
MultiChoiceAnswerFormRecord._init_metadata(self)
FilesAnswerFormRecord._init_metadata(self)
FeedbackAnswerFormRecord._init_metadata(self)
super(MultiChoiceFeedbackAndFilesAnswerFormRecord, self)._init_metadata() | python | def _init_metadata(self):
"""stub"""
MultiChoiceAnswerFormRecord._init_metadata(self)
FilesAnswerFormRecord._init_metadata(self)
FeedbackAnswerFormRecord._init_metadata(self)
super(MultiChoiceFeedbackAndFilesAnswerFormRecord, self)._init_metadata() | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"MultiChoiceAnswerFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"FilesAnswerFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"FeedbackAnswerFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"super",
"(... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L714-L719 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | MultiLanguageMultipleChoiceQuestionRecord.get_choices | def get_choices(self):
"""stub"""
# ideally would return a displayText object in text ... except for legacy
# use cases like OEA, it expects a text string.
choices = []
# for current_choice in self.my_osid_object.object_map['choices']:
for current_choice in self.my_osid_o... | python | def get_choices(self):
"""stub"""
# ideally would return a displayText object in text ... except for legacy
# use cases like OEA, it expects a text string.
choices = []
# for current_choice in self.my_osid_object.object_map['choices']:
for current_choice in self.my_osid_o... | [
"def",
"get_choices",
"(",
"self",
")",
":",
"# ideally would return a displayText object in text ... except for legacy",
"# use cases like OEA, it expects a text string.",
"choices",
"=",
"[",
"]",
"# for current_choice in self.my_osid_object.object_map['choices']:",
"for",
"current_cho... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L799-L813 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | MultiLanguageMultipleChoiceQuestionFormRecord._init_map | def _init_map(self):
"""stub"""
super(MultiLanguageMultipleChoiceQuestionFormRecord, self)._init_map()
self.my_osid_object_form._my_map['choices'] = \
self._choices_metadata['default_object_values'][0] | python | def _init_map(self):
"""stub"""
super(MultiLanguageMultipleChoiceQuestionFormRecord, self)._init_map()
self.my_osid_object_form._my_map['choices'] = \
self._choices_metadata['default_object_values'][0] | [
"def",
"_init_map",
"(",
"self",
")",
":",
"super",
"(",
"MultiLanguageMultipleChoiceQuestionFormRecord",
",",
"self",
")",
".",
"_init_map",
"(",
")",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"'choices'",
"]",
"=",
"self",
".",
"_choices_metadat... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L834-L838 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | MultiLanguageMultipleChoiceQuestionFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
super(MultiLanguageMultipleChoiceQuestionFormRecord, self)._init_metadata()
self._choices_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
... | python | def _init_metadata(self):
"""stub"""
super(MultiLanguageMultipleChoiceQuestionFormRecord, self)._init_metadata()
self._choices_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"super",
"(",
"MultiLanguageMultipleChoiceQuestionFormRecord",
",",
"self",
")",
".",
"_init_metadata",
"(",
")",
"self",
".",
"_choices_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_ob... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L840-L856 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | MultiLanguageMultipleChoiceQuestionFormRecord.add_choice | def add_choice(self, choice, name='', identifier=None):
"""stub"""
if not isinstance(choice, DisplayText):
raise InvalidArgument('choice is not a displayText object')
if identifier is None:
identifier = str(ObjectId())
current_identifiers = [c['id'] for c in self.... | python | def add_choice(self, choice, name='', identifier=None):
"""stub"""
if not isinstance(choice, DisplayText):
raise InvalidArgument('choice is not a displayText object')
if identifier is None:
identifier = str(ObjectId())
current_identifiers = [c['id'] for c in self.... | [
"def",
"add_choice",
"(",
"self",
",",
"choice",
",",
"name",
"=",
"''",
",",
"identifier",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"choice",
",",
"DisplayText",
")",
":",
"raise",
"InvalidArgument",
"(",
"'choice is not a displayText object'",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L863-L882 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | MultiLanguageMultipleChoiceQuestionFormRecord.clear_choices | def clear_choices(self):
"""stub"""
if self.get_choices_metadata().is_read_only():
raise NoAccess()
self.my_osid_object_form._my_map['choices'] = \
self._choices_metadata['default_object_values'][0] | python | def clear_choices(self):
"""stub"""
if self.get_choices_metadata().is_read_only():
raise NoAccess()
self.my_osid_object_form._my_map['choices'] = \
self._choices_metadata['default_object_values'][0] | [
"def",
"clear_choices",
"(",
"self",
")",
":",
"if",
"self",
".",
"get_choices_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"NoAccess",
"(",
")",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"'choices'",
"]",
"=",
"self",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L884-L889 |
mitsei/dlkit | dlkit/records/assessment/basic/multi_choice_records.py | MultiLanguageMultipleChoiceQuestionFormRecord.clear_choice_texts | def clear_choice_texts(self, choice_id):
"""stub"""
if self.get_choices_metadata().is_read_only():
raise NoAccess()
updated_choices = []
for current_choice in self.my_osid_object_form._my_map['choices']:
if current_choice['id'] != choice_id:
update... | python | def clear_choice_texts(self, choice_id):
"""stub"""
if self.get_choices_metadata().is_read_only():
raise NoAccess()
updated_choices = []
for current_choice in self.my_osid_object_form._my_map['choices']:
if current_choice['id'] != choice_id:
update... | [
"def",
"clear_choice_texts",
"(",
"self",
",",
"choice_id",
")",
":",
"if",
"self",
".",
"get_choices_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"NoAccess",
"(",
")",
"updated_choices",
"=",
"[",
"]",
"for",
"current_choice",
"in",
"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/multi_choice_records.py#L892-L906 |
ND-CSE-30151/tock | tock/tables.py | read_csv | def read_csv(filename):
"""Reads a CSV file containing a tabular description of a transition function,
as found in Sipser. Major difference: instead of multiple header rows,
only a single header row whose entries might be tuples.
"""
with open(filename) as file:
table = list(csv.re... | python | def read_csv(filename):
"""Reads a CSV file containing a tabular description of a transition function,
as found in Sipser. Major difference: instead of multiple header rows,
only a single header row whose entries might be tuples.
"""
with open(filename) as file:
table = list(csv.re... | [
"def",
"read_csv",
"(",
"filename",
")",
":",
"with",
"open",
"(",
"filename",
")",
"as",
"file",
":",
"table",
"=",
"list",
"(",
"csv",
".",
"reader",
"(",
"file",
")",
")",
"m",
"=",
"from_table",
"(",
"table",
")",
"return",
"m"
] | Reads a CSV file containing a tabular description of a transition function,
as found in Sipser. Major difference: instead of multiple header rows,
only a single header row whose entries might be tuples. | [
"Reads",
"a",
"CSV",
"file",
"containing",
"a",
"tabular",
"description",
"of",
"a",
"transition",
"function",
"as",
"found",
"in",
"Sipser",
".",
"Major",
"difference",
":",
"instead",
"of",
"multiple",
"header",
"rows",
"only",
"a",
"single",
"header",
"ro... | train | https://github.com/ND-CSE-30151/tock/blob/b8d21901aaf0e6ac913c2afa855f5b5a882a16c6/tock/tables.py#L126-L135 |
ND-CSE-30151/tock | tock/tables.py | read_excel | def read_excel(filename, sheet=None):
"""Reads an Excel file containing a tabular description of a transition function,
as found in Sipser. Major difference: instead of multiple header rows,
only a single header row whose entries might be tuples.
"""
from openpyxl import load_workbook
... | python | def read_excel(filename, sheet=None):
"""Reads an Excel file containing a tabular description of a transition function,
as found in Sipser. Major difference: instead of multiple header rows,
only a single header row whose entries might be tuples.
"""
from openpyxl import load_workbook
... | [
"def",
"read_excel",
"(",
"filename",
",",
"sheet",
"=",
"None",
")",
":",
"from",
"openpyxl",
"import",
"load_workbook",
"wb",
"=",
"load_workbook",
"(",
"filename",
")",
"if",
"sheet",
"is",
"None",
":",
"ws",
"=",
"wb",
".",
"active",
"else",
":",
"... | Reads an Excel file containing a tabular description of a transition function,
as found in Sipser. Major difference: instead of multiple header rows,
only a single header row whose entries might be tuples. | [
"Reads",
"an",
"Excel",
"file",
"containing",
"a",
"tabular",
"description",
"of",
"a",
"transition",
"function",
"as",
"found",
"in",
"Sipser",
".",
"Major",
"difference",
":",
"instead",
"of",
"multiple",
"header",
"rows",
"only",
"a",
"single",
"header",
... | train | https://github.com/ND-CSE-30151/tock/blob/b8d21901aaf0e6ac913c2afa855f5b5a882a16c6/tock/tables.py#L137-L150 |
nrcharles/caelum | caelum/forecast.py | data | def data(place):
"""get forecast data."""
lat, lon = place
url = "https://api.forecast.io/forecast/%s/%s,%s?solar" % (APIKEY, lat,
lon)
w_data = json.loads(urllib2.urlopen(url).read())
return w_data | python | def data(place):
"""get forecast data."""
lat, lon = place
url = "https://api.forecast.io/forecast/%s/%s,%s?solar" % (APIKEY, lat,
lon)
w_data = json.loads(urllib2.urlopen(url).read())
return w_data | [
"def",
"data",
"(",
"place",
")",
":",
"lat",
",",
"lon",
"=",
"place",
"url",
"=",
"\"https://api.forecast.io/forecast/%s/%s,%s?solar\"",
"%",
"(",
"APIKEY",
",",
"lat",
",",
"lon",
")",
"w_data",
"=",
"json",
".",
"loads",
"(",
"urllib2",
".",
"urlopen",... | get forecast data. | [
"get",
"forecast",
"data",
"."
] | train | https://github.com/nrcharles/caelum/blob/9a8e65806385978556d7bb2e6870f003ff82023e/caelum/forecast.py#L13-L19 |
nrcharles/caelum | caelum/forecast.py | mangle | def mangle(data_point):
"""mangle data into expected format."""
temp_dict = {}
temp_dict.update(data_point)
temp_dict['utc_datetime'] = \
datetime.datetime.utcfromtimestamp(temp_dict['time'])
if 'solar' in data_point:
temp_dict['GHI (W/m^2)'] = data_point['solar']['ghi']
temp... | python | def mangle(data_point):
"""mangle data into expected format."""
temp_dict = {}
temp_dict.update(data_point)
temp_dict['utc_datetime'] = \
datetime.datetime.utcfromtimestamp(temp_dict['time'])
if 'solar' in data_point:
temp_dict['GHI (W/m^2)'] = data_point['solar']['ghi']
temp... | [
"def",
"mangle",
"(",
"data_point",
")",
":",
"temp_dict",
"=",
"{",
"}",
"temp_dict",
".",
"update",
"(",
"data_point",
")",
"temp_dict",
"[",
"'utc_datetime'",
"]",
"=",
"datetime",
".",
"datetime",
".",
"utcfromtimestamp",
"(",
"temp_dict",
"[",
"'time'",... | mangle data into expected format. | [
"mangle",
"data",
"into",
"expected",
"format",
"."
] | train | https://github.com/nrcharles/caelum/blob/9a8e65806385978556d7bb2e6870f003ff82023e/caelum/forecast.py#L22-L39 |
nrcharles/caelum | caelum/forecast.py | hourly | def hourly(place):
"""return data as list of dicts with all data filled in."""
# time in utc?
lat, lon = place
url = "https://api.forecast.io/forecast/%s/%s,%s?solar" % (APIKEY, lat,
lon)
w_data = json.loads(urllib2.urlopen(url).read())
... | python | def hourly(place):
"""return data as list of dicts with all data filled in."""
# time in utc?
lat, lon = place
url = "https://api.forecast.io/forecast/%s/%s,%s?solar" % (APIKEY, lat,
lon)
w_data = json.loads(urllib2.urlopen(url).read())
... | [
"def",
"hourly",
"(",
"place",
")",
":",
"# time in utc?",
"lat",
",",
"lon",
"=",
"place",
"url",
"=",
"\"https://api.forecast.io/forecast/%s/%s,%s?solar\"",
"%",
"(",
"APIKEY",
",",
"lat",
",",
"lon",
")",
"w_data",
"=",
"json",
".",
"loads",
"(",
"urllib2... | return data as list of dicts with all data filled in. | [
"return",
"data",
"as",
"list",
"of",
"dicts",
"with",
"all",
"data",
"filled",
"in",
"."
] | train | https://github.com/nrcharles/caelum/blob/9a8e65806385978556d7bb2e6870f003ff82023e/caelum/forecast.py#L44-L55 |
nrcharles/caelum | caelum/forecast.py | current | def current(place):
"""return data as list of dicts with all data filled in."""
lat, lon = place
url = "https://api.forecast.io/forecast/%s/%s,%s?solar" % (APIKEY, lat,
lon)
w_data = json.loads(urllib2.urlopen(url).read())
currently = w_... | python | def current(place):
"""return data as list of dicts with all data filled in."""
lat, lon = place
url = "https://api.forecast.io/forecast/%s/%s,%s?solar" % (APIKEY, lat,
lon)
w_data = json.loads(urllib2.urlopen(url).read())
currently = w_... | [
"def",
"current",
"(",
"place",
")",
":",
"lat",
",",
"lon",
"=",
"place",
"url",
"=",
"\"https://api.forecast.io/forecast/%s/%s,%s?solar\"",
"%",
"(",
"APIKEY",
",",
"lat",
",",
"lon",
")",
"w_data",
"=",
"json",
".",
"loads",
"(",
"urllib2",
".",
"urlope... | return data as list of dicts with all data filled in. | [
"return",
"data",
"as",
"list",
"of",
"dicts",
"with",
"all",
"data",
"filled",
"in",
"."
] | train | https://github.com/nrcharles/caelum/blob/9a8e65806385978556d7bb2e6870f003ff82023e/caelum/forecast.py#L58-L65 |
compmech/composites | composites/laminate.py | read_stack | def read_stack(stack, plyt=None, laminaprop=None, rho=None, plyts=None, laminaprops=None,
rhos=None, offset=0., calc_scf=True):
"""Read a laminate stacking sequence data.
An ``Laminate`` object is returned based on the inputs given.
Parameters
----------
stack : list
Angles of the ... | python | def read_stack(stack, plyt=None, laminaprop=None, rho=None, plyts=None, laminaprops=None,
rhos=None, offset=0., calc_scf=True):
"""Read a laminate stacking sequence data.
An ``Laminate`` object is returned based on the inputs given.
Parameters
----------
stack : list
Angles of the ... | [
"def",
"read_stack",
"(",
"stack",
",",
"plyt",
"=",
"None",
",",
"laminaprop",
"=",
"None",
",",
"rho",
"=",
"None",
",",
"plyts",
"=",
"None",
",",
"laminaprops",
"=",
"None",
",",
"rhos",
"=",
"None",
",",
"offset",
"=",
"0.",
",",
"calc_scf",
"... | Read a laminate stacking sequence data.
An ``Laminate`` object is returned based on the inputs given.
Parameters
----------
stack : list
Angles of the stacking sequence in degrees.
plyt : float, optional
When all plies have the same thickness, ``plyt`` can be supplied.
laminapr... | [
"Read",
"a",
"laminate",
"stacking",
"sequence",
"data",
"."
] | train | https://github.com/compmech/composites/blob/3c5d4fd6033898e35a5085063af5dbb81eb6a97d/composites/laminate.py#L16-L93 |
compmech/composites | composites/laminate.py | read_lamination_parameters | def read_lamination_parameters(thickness, laminaprop, rho,
xiA1, xiA2, xiA3, xiA4,
xiB1, xiB2, xiB3, xiB4,
xiD1, xiD2, xiD3, xiD4,
xiE1, xiE2, xiE3, xiE4):
r"""Calculates a laminate based on t... | python | def read_lamination_parameters(thickness, laminaprop, rho,
xiA1, xiA2, xiA3, xiA4,
xiB1, xiB2, xiB3, xiB4,
xiD1, xiD2, xiD3, xiD4,
xiE1, xiE2, xiE3, xiE4):
r"""Calculates a laminate based on t... | [
"def",
"read_lamination_parameters",
"(",
"thickness",
",",
"laminaprop",
",",
"rho",
",",
"xiA1",
",",
"xiA2",
",",
"xiA3",
",",
"xiA4",
",",
"xiB1",
",",
"xiB2",
",",
"xiB3",
",",
"xiB4",
",",
"xiD1",
",",
"xiD2",
",",
"xiD3",
",",
"xiD4",
",",
"xi... | r"""Calculates a laminate based on the lamination parameters.
The lamination parameters:
`\xi_{A1} \cdots \xi_{A4}`, `\xi_{B1} \cdots \xi_{B4}`,
`\xi_{C1} \cdots \xi_{C4}`, `\xi_{D1} \cdots \xi_{D4}`,
`\xi_{E1} \cdots \xi_{E4}`
are used to calculate the laminate constitutive matrix.
Paramet... | [
"r",
"Calculates",
"a",
"laminate",
"based",
"on",
"the",
"lamination",
"parameters",
"."
] | train | https://github.com/compmech/composites/blob/3c5d4fd6033898e35a5085063af5dbb81eb6a97d/composites/laminate.py#L96-L136 |
compmech/composites | composites/laminate.py | Laminate.calc_scf | def calc_scf(self):
"""Calculate improved shear correction factors
Reference:
Vlachoutsis, S. "Shear correction factors for plates and shells",
Int. Journal for Numerical Methods in Engineering, Vol. 33,
1537-1552, 1992.
http://onlinelibrary.wiley.com/d... | python | def calc_scf(self):
"""Calculate improved shear correction factors
Reference:
Vlachoutsis, S. "Shear correction factors for plates and shells",
Int. Journal for Numerical Methods in Engineering, Vol. 33,
1537-1552, 1992.
http://onlinelibrary.wiley.com/d... | [
"def",
"calc_scf",
"(",
"self",
")",
":",
"D1",
"=",
"0",
"R1",
"=",
"0",
"den1",
"=",
"0",
"D2",
"=",
"0",
"R2",
"=",
"0",
"den2",
"=",
"0",
"offset",
"=",
"self",
".",
"offset",
"zbot",
"=",
"-",
"self",
".",
"h",
"/",
"2",
"+",
"offset",... | Calculate improved shear correction factors
Reference:
Vlachoutsis, S. "Shear correction factors for plates and shells",
Int. Journal for Numerical Methods in Engineering, Vol. 33,
1537-1552, 1992.
http://onlinelibrary.wiley.com/doi/10.1002/nme.1620330712/full
... | [
"Calculate",
"improved",
"shear",
"correction",
"factors"
] | train | https://github.com/compmech/composites/blob/3c5d4fd6033898e35a5085063af5dbb81eb6a97d/composites/laminate.py#L204-L270 |
compmech/composites | composites/laminate.py | Laminate.calc_equivalent_modulus | def calc_equivalent_modulus(self):
"""Calculates the equivalent laminate properties.
The following attributes are calculated:
e1, e2, g12, nu12, nu21
"""
AI = np.matrix(self.ABD, dtype=np.float64).I
a11, a12, a22, a33 = AI[0,0], AI[0,1], AI[1,1], AI[2,2]
sel... | python | def calc_equivalent_modulus(self):
"""Calculates the equivalent laminate properties.
The following attributes are calculated:
e1, e2, g12, nu12, nu21
"""
AI = np.matrix(self.ABD, dtype=np.float64).I
a11, a12, a22, a33 = AI[0,0], AI[0,1], AI[1,1], AI[2,2]
sel... | [
"def",
"calc_equivalent_modulus",
"(",
"self",
")",
":",
"AI",
"=",
"np",
".",
"matrix",
"(",
"self",
".",
"ABD",
",",
"dtype",
"=",
"np",
".",
"float64",
")",
".",
"I",
"a11",
",",
"a12",
",",
"a22",
",",
"a33",
"=",
"AI",
"[",
"0",
",",
"0",
... | Calculates the equivalent laminate properties.
The following attributes are calculated:
e1, e2, g12, nu12, nu21 | [
"Calculates",
"the",
"equivalent",
"laminate",
"properties",
"."
] | train | https://github.com/compmech/composites/blob/3c5d4fd6033898e35a5085063af5dbb81eb6a97d/composites/laminate.py#L273-L286 |
compmech/composites | composites/laminate.py | Laminate.calc_lamination_parameters | def calc_lamination_parameters(self):
"""Calculate the lamination parameters.
The following attributes are calculated:
xiA, xiB, xiD, xiE
"""
if len(self.plies) == 0:
if self.xiA is None:
raise ValueError('Laminate with 0 plies!')
els... | python | def calc_lamination_parameters(self):
"""Calculate the lamination parameters.
The following attributes are calculated:
xiA, xiB, xiD, xiE
"""
if len(self.plies) == 0:
if self.xiA is None:
raise ValueError('Laminate with 0 plies!')
els... | [
"def",
"calc_lamination_parameters",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"plies",
")",
"==",
"0",
":",
"if",
"self",
".",
"xiA",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'Laminate with 0 plies!'",
")",
"else",
":",
"return",
"xiA... | Calculate the lamination parameters.
The following attributes are calculated:
xiA, xiB, xiD, xiE | [
"Calculate",
"the",
"lamination",
"parameters",
"."
] | train | https://github.com/compmech/composites/blob/3c5d4fd6033898e35a5085063af5dbb81eb6a97d/composites/laminate.py#L289-L353 |
compmech/composites | composites/laminate.py | Laminate.calc_ABDE_from_lamination_parameters | def calc_ABDE_from_lamination_parameters(self):
"""Use the ABDE matrix based on lamination parameters.
Given the lamination parameters ``xiA``, ``xiB``, ``xiC`` and ``xiD``,
the ABD matrix is calculated.
"""
# dummies used to unpack vector results
du1, du2, du3, du4, du... | python | def calc_ABDE_from_lamination_parameters(self):
"""Use the ABDE matrix based on lamination parameters.
Given the lamination parameters ``xiA``, ``xiB``, ``xiC`` and ``xiD``,
the ABD matrix is calculated.
"""
# dummies used to unpack vector results
du1, du2, du3, du4, du... | [
"def",
"calc_ABDE_from_lamination_parameters",
"(",
"self",
")",
":",
"# dummies used to unpack vector results",
"du1",
",",
"du2",
",",
"du3",
",",
"du4",
",",
"du5",
",",
"du6",
"=",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
"# A matrix term... | Use the ABDE matrix based on lamination parameters.
Given the lamination parameters ``xiA``, ``xiB``, ``xiC`` and ``xiD``,
the ABD matrix is calculated. | [
"Use",
"the",
"ABDE",
"matrix",
"based",
"on",
"lamination",
"parameters",
"."
] | train | https://github.com/compmech/composites/blob/3c5d4fd6033898e35a5085063af5dbb81eb6a97d/composites/laminate.py#L356-L410 |
compmech/composites | composites/laminate.py | Laminate.calc_constitutive_matrix | def calc_constitutive_matrix(self):
"""Calculates the laminate constitutive matrix
This is the commonly called ``ABD`` matrix with ``shape=(6, 6)`` when
the classical laminated plate theory is used, or the ``ABDE`` matrix
when the first-order shear deformation theory is used, containing... | python | def calc_constitutive_matrix(self):
"""Calculates the laminate constitutive matrix
This is the commonly called ``ABD`` matrix with ``shape=(6, 6)`` when
the classical laminated plate theory is used, or the ``ABDE`` matrix
when the first-order shear deformation theory is used, containing... | [
"def",
"calc_constitutive_matrix",
"(",
"self",
")",
":",
"self",
".",
"A_general",
"=",
"np",
".",
"zeros",
"(",
"[",
"5",
",",
"5",
"]",
",",
"dtype",
"=",
"np",
".",
"float64",
")",
"self",
".",
"B_general",
"=",
"np",
".",
"zeros",
"(",
"[",
... | Calculates the laminate constitutive matrix
This is the commonly called ``ABD`` matrix with ``shape=(6, 6)`` when
the classical laminated plate theory is used, or the ``ABDE`` matrix
when the first-order shear deformation theory is used, containing the
transverse shear terms. | [
"Calculates",
"the",
"laminate",
"constitutive",
"matrix"
] | train | https://github.com/compmech/composites/blob/3c5d4fd6033898e35a5085063af5dbb81eb6a97d/composites/laminate.py#L413-L449 |
compmech/composites | composites/laminate.py | Laminate.force_balanced_LP | def force_balanced_LP(self):
r"""Force balanced lamination parameters
The lamination parameters `\xi_{A2}` and `\xi_{A4}` are set to null
to force a balanced laminate.
"""
dummy, xiA1, xiA2, xiA3, xiA4 = self.xiA
self.xiA = np.array([1, xiA1, 0, xiA3, 0], dtype=np.float... | python | def force_balanced_LP(self):
r"""Force balanced lamination parameters
The lamination parameters `\xi_{A2}` and `\xi_{A4}` are set to null
to force a balanced laminate.
"""
dummy, xiA1, xiA2, xiA3, xiA4 = self.xiA
self.xiA = np.array([1, xiA1, 0, xiA3, 0], dtype=np.float... | [
"def",
"force_balanced_LP",
"(",
"self",
")",
":",
"dummy",
",",
"xiA1",
",",
"xiA2",
",",
"xiA3",
",",
"xiA4",
"=",
"self",
".",
"xiA",
"self",
".",
"xiA",
"=",
"np",
".",
"array",
"(",
"[",
"1",
",",
"xiA1",
",",
"0",
",",
"xiA3",
",",
"0",
... | r"""Force balanced lamination parameters
The lamination parameters `\xi_{A2}` and `\xi_{A4}` are set to null
to force a balanced laminate. | [
"r",
"Force",
"balanced",
"lamination",
"parameters"
] | train | https://github.com/compmech/composites/blob/3c5d4fd6033898e35a5085063af5dbb81eb6a97d/composites/laminate.py#L452-L461 |
compmech/composites | composites/laminate.py | Laminate.force_orthotropic | def force_orthotropic(self):
r"""Force an orthotropic laminate
The terms
`A_{13}`, `A_{23}`, `A_{31}`, `A_{32}`,
`B_{13}`, `B_{23}`, `B_{31}`, `B_{32}`,
`D_{13}`, `D_{23}`, `D_{31}`, `D_{32}` are set to zero to force an
orthotropic laminate.
"""
if self.... | python | def force_orthotropic(self):
r"""Force an orthotropic laminate
The terms
`A_{13}`, `A_{23}`, `A_{31}`, `A_{32}`,
`B_{13}`, `B_{23}`, `B_{31}`, `B_{32}`,
`D_{13}`, `D_{23}`, `D_{31}`, `D_{32}` are set to zero to force an
orthotropic laminate.
"""
if self.... | [
"def",
"force_orthotropic",
"(",
"self",
")",
":",
"if",
"self",
".",
"offset",
"!=",
"0.",
":",
"raise",
"RuntimeError",
"(",
"'Laminates with offset cannot be forced orthotropic!'",
")",
"self",
".",
"A",
"[",
"0",
",",
"2",
"]",
"=",
"0.",
"self",
".",
... | r"""Force an orthotropic laminate
The terms
`A_{13}`, `A_{23}`, `A_{31}`, `A_{32}`,
`B_{13}`, `B_{23}`, `B_{31}`, `B_{32}`,
`D_{13}`, `D_{23}`, `D_{31}`, `D_{32}` are set to zero to force an
orthotropic laminate. | [
"r",
"Force",
"an",
"orthotropic",
"laminate"
] | train | https://github.com/compmech/composites/blob/3c5d4fd6033898e35a5085063af5dbb81eb6a97d/composites/laminate.py#L475-L541 |
compmech/composites | composites/laminate.py | Laminate.force_symmetric | def force_symmetric(self):
"""Force a symmetric laminate
The `B` terms of the constitutive matrix are set to zero.
"""
if self.offset != 0.:
raise RuntimeError(
'Laminates with offset cannot be forced symmetric!')
self.B = np.zeros((3,3))
... | python | def force_symmetric(self):
"""Force a symmetric laminate
The `B` terms of the constitutive matrix are set to zero.
"""
if self.offset != 0.:
raise RuntimeError(
'Laminates with offset cannot be forced symmetric!')
self.B = np.zeros((3,3))
... | [
"def",
"force_symmetric",
"(",
"self",
")",
":",
"if",
"self",
".",
"offset",
"!=",
"0.",
":",
"raise",
"RuntimeError",
"(",
"'Laminates with offset cannot be forced symmetric!'",
")",
"self",
".",
"B",
"=",
"np",
".",
"zeros",
"(",
"(",
"3",
",",
"3",
")"... | Force a symmetric laminate
The `B` terms of the constitutive matrix are set to zero. | [
"Force",
"a",
"symmetric",
"laminate"
] | train | https://github.com/compmech/composites/blob/3c5d4fd6033898e35a5085063af5dbb81eb6a97d/composites/laminate.py#L544-L558 |
mitsei/dlkit | dlkit/handcar/grading/objects.py | GradeList.get_next_grade | def get_next_grade(self):
"""Gets the next ``Grade`` in this list.
return: (osid.grading.Grade) - the next ``Grade`` in this list.
The ``has_next()`` method should be used to test that a
next ``Grade`` is available before calling this method.
raise: IllegalState... | python | def get_next_grade(self):
"""Gets the next ``Grade`` in this list.
return: (osid.grading.Grade) - the next ``Grade`` in this list.
The ``has_next()`` method should be used to test that a
next ``Grade`` is available before calling this method.
raise: IllegalState... | [
"def",
"get_next_grade",
"(",
"self",
")",
":",
"try",
":",
"next_object",
"=",
"next",
"(",
"self",
")",
"except",
"StopIteration",
":",
"raise",
"IllegalState",
"(",
"'no more elements available in this list'",
")",
"except",
"Exception",
":",
"# Need to specify e... | Gets the next ``Grade`` in this list.
return: (osid.grading.Grade) - the next ``Grade`` in this list.
The ``has_next()`` method should be used to test that a
next ``Grade`` is available before calling this method.
raise: IllegalState - no more elements available in this... | [
"Gets",
"the",
"next",
"Grade",
"in",
"this",
"list",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/grading/objects.py#L126-L144 |
mitsei/dlkit | dlkit/handcar/grading/objects.py | GradeSystem.get_grade_ids | def get_grade_ids(self):
"""Gets the grade Ids in this system ranked from highest to lowest.
return: (osid.id.IdList) - the list of grades Ids
raise: IllegalState - is_based_on_grades() is false
compliance: mandatory - This method must be implemented.
"""
id_list = []
... | python | def get_grade_ids(self):
"""Gets the grade Ids in this system ranked from highest to lowest.
return: (osid.id.IdList) - the list of grades Ids
raise: IllegalState - is_based_on_grades() is false
compliance: mandatory - This method must be implemented.
"""
id_list = []
... | [
"def",
"get_grade_ids",
"(",
"self",
")",
":",
"id_list",
"=",
"[",
"]",
"for",
"grade_map",
"in",
"self",
".",
"_my_map",
"[",
"'grades'",
"]",
":",
"id_list",
".",
"append",
"(",
"Id",
"(",
"grade_map",
".",
"id",
")",
")",
"if",
"id_list",
"==",
... | Gets the grade Ids in this system ranked from highest to lowest.
return: (osid.id.IdList) - the list of grades Ids
raise: IllegalState - is_based_on_grades() is false
compliance: mandatory - This method must be implemented. | [
"Gets",
"the",
"grade",
"Ids",
"in",
"this",
"system",
"ranked",
"from",
"highest",
"to",
"lowest",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/grading/objects.py#L209-L223 |
alevinval/scheduling | scheduling/tasks.py | Task.wait_and_join | def wait_and_join(self, task):
""" Given a task, waits for it until it finishes
:param task: Task
:return:
"""
while not task.has_started:
time.sleep(self._polling_time)
task.thread.join() | python | def wait_and_join(self, task):
""" Given a task, waits for it until it finishes
:param task: Task
:return:
"""
while not task.has_started:
time.sleep(self._polling_time)
task.thread.join() | [
"def",
"wait_and_join",
"(",
"self",
",",
"task",
")",
":",
"while",
"not",
"task",
".",
"has_started",
":",
"time",
".",
"sleep",
"(",
"self",
".",
"_polling_time",
")",
"task",
".",
"thread",
".",
"join",
"(",
")"
] | Given a task, waits for it until it finishes
:param task: Task
:return: | [
"Given",
"a",
"task",
"waits",
"for",
"it",
"until",
"it",
"finishes",
":",
"param",
"task",
":",
"Task",
":",
"return",
":"
] | train | https://github.com/alevinval/scheduling/blob/127239712c0b73b929ca19b4b5c2855eebb7fcf0/scheduling/tasks.py#L37-L44 |
alevinval/scheduling | scheduling/tasks.py | Task.depends | def depends(self, *tasks):
""" Interfaces the GraphNode `depends` method """
nodes = [x.node for x in tasks]
self.node.depends(*nodes)
return self | python | def depends(self, *tasks):
""" Interfaces the GraphNode `depends` method """
nodes = [x.node for x in tasks]
self.node.depends(*nodes)
return self | [
"def",
"depends",
"(",
"self",
",",
"*",
"tasks",
")",
":",
"nodes",
"=",
"[",
"x",
".",
"node",
"for",
"x",
"in",
"tasks",
"]",
"self",
".",
"node",
".",
"depends",
"(",
"*",
"nodes",
")",
"return",
"self"
] | Interfaces the GraphNode `depends` method | [
"Interfaces",
"the",
"GraphNode",
"depends",
"method"
] | train | https://github.com/alevinval/scheduling/blob/127239712c0b73b929ca19b4b5c2855eebb7fcf0/scheduling/tasks.py#L46-L50 |
alevinval/scheduling | scheduling/tasks.py | Task.then | def then(self, *tasks):
""" Interfaces the GraphNode `then` method
"""
nodes = [x.node for x in tasks]
self.node.then(*nodes)
return self | python | def then(self, *tasks):
""" Interfaces the GraphNode `then` method
"""
nodes = [x.node for x in tasks]
self.node.then(*nodes)
return self | [
"def",
"then",
"(",
"self",
",",
"*",
"tasks",
")",
":",
"nodes",
"=",
"[",
"x",
".",
"node",
"for",
"x",
"in",
"tasks",
"]",
"self",
".",
"node",
".",
"then",
"(",
"*",
"nodes",
")",
"return",
"self"
] | Interfaces the GraphNode `then` method | [
"Interfaces",
"the",
"GraphNode",
"then",
"method"
] | train | https://github.com/alevinval/scheduling/blob/127239712c0b73b929ca19b4b5c2855eebb7fcf0/scheduling/tasks.py#L52-L57 |
alevinval/scheduling | scheduling/tasks.py | Task.add | def add(self, *tasks):
""" Interfaces the GraphNode `add` method
"""
nodes = [x.node for x in tasks]
self.node.add(*nodes)
return self | python | def add(self, *tasks):
""" Interfaces the GraphNode `add` method
"""
nodes = [x.node for x in tasks]
self.node.add(*nodes)
return self | [
"def",
"add",
"(",
"self",
",",
"*",
"tasks",
")",
":",
"nodes",
"=",
"[",
"x",
".",
"node",
"for",
"x",
"in",
"tasks",
"]",
"self",
".",
"node",
".",
"add",
"(",
"*",
"nodes",
")",
"return",
"self"
] | Interfaces the GraphNode `add` method | [
"Interfaces",
"the",
"GraphNode",
"add",
"method"
] | train | https://github.com/alevinval/scheduling/blob/127239712c0b73b929ca19b4b5c2855eebb7fcf0/scheduling/tasks.py#L59-L64 |
alevinval/scheduling | scheduling/tasks.py | Task._run | def _run(self):
""" Run the task respecting dependencies
"""
for node in self.node.relatives:
launch_node_task(node)
for node in self.node.relatives:
self.wait_and_join(node.task)
if self.node.parent:
while not self.node.parent.task.siblings_pe... | python | def _run(self):
""" Run the task respecting dependencies
"""
for node in self.node.relatives:
launch_node_task(node)
for node in self.node.relatives:
self.wait_and_join(node.task)
if self.node.parent:
while not self.node.parent.task.siblings_pe... | [
"def",
"_run",
"(",
"self",
")",
":",
"for",
"node",
"in",
"self",
".",
"node",
".",
"relatives",
":",
"launch_node_task",
"(",
"node",
")",
"for",
"node",
"in",
"self",
".",
"node",
".",
"relatives",
":",
"self",
".",
"wait_and_join",
"(",
"node",
"... | Run the task respecting dependencies | [
"Run",
"the",
"task",
"respecting",
"dependencies"
] | train | https://github.com/alevinval/scheduling/blob/127239712c0b73b929ca19b4b5c2855eebb7fcf0/scheduling/tasks.py#L66-L85 |
svetlyak40wt/python-cl-conditions | docs/conf.py | read_version | def read_version():
"""Read version from the first line starting with digit
"""
regex = re.compile('^(?P<number>\d.*?) .*$')
with open('../CHANGELOG.rst') as f:
for line in f:
match = regex.match(line)
if match:
return match.group('number') | python | def read_version():
"""Read version from the first line starting with digit
"""
regex = re.compile('^(?P<number>\d.*?) .*$')
with open('../CHANGELOG.rst') as f:
for line in f:
match = regex.match(line)
if match:
return match.group('number') | [
"def",
"read_version",
"(",
")",
":",
"regex",
"=",
"re",
".",
"compile",
"(",
"'^(?P<number>\\d.*?) .*$'",
")",
"with",
"open",
"(",
"'../CHANGELOG.rst'",
")",
"as",
"f",
":",
"for",
"line",
"in",
"f",
":",
"match",
"=",
"regex",
".",
"match",
"(",
"l... | Read version from the first line starting with digit | [
"Read",
"version",
"from",
"the",
"first",
"line",
"starting",
"with",
"digit"
] | train | https://github.com/svetlyak40wt/python-cl-conditions/blob/709dfd55f2b8cf7eb9b7d86a6b70c8a3feed4b10/docs/conf.py#L32-L41 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProfile.get_resource_record_types | def get_resource_record_types(self):
"""Gets all the resource record types supported.
return: (osid.type.TypeList) - the list of supported resource
record types
*compliance: mandatory -- This method must be implemented.*
"""
# Implemented from template for
... | python | def get_resource_record_types(self):
"""Gets all the resource record types supported.
return: (osid.type.TypeList) - the list of supported resource
record types
*compliance: mandatory -- This method must be implemented.*
"""
# Implemented from template for
... | [
"def",
"get_resource_record_types",
"(",
"self",
")",
":",
"# Implemented from template for",
"# osid.resource.ResourceProfile.get_resource_record_types_template",
"record_type_maps",
"=",
"get_registry",
"(",
"'RESOURCE_RECORD_TYPES'",
",",
"self",
".",
"_runtime",
")",
"record_... | Gets all the resource record types supported.
return: (osid.type.TypeList) - the list of supported resource
record types
*compliance: mandatory -- This method must be implemented.* | [
"Gets",
"all",
"the",
"resource",
"record",
"types",
"supported",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L198-L212 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceManager.get_resource_search_session_for_bin | def get_resource_search_session_for_bin(self, bin_id):
"""Gets a resource search session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
return: (osid.resource.ResourceSearchSession) - ``a
ResourceSearchSession``
raise: NotFound - ``bin_id`` not fo... | python | def get_resource_search_session_for_bin(self, bin_id):
"""Gets a resource search session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
return: (osid.resource.ResourceSearchSession) - ``a
ResourceSearchSession``
raise: NotFound - ``bin_id`` not fo... | [
"def",
"get_resource_search_session_for_bin",
"(",
"self",
",",
"bin_id",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_search",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"##",
"# Also include check to see if the catalog Id is found othe... | Gets a resource search session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
return: (osid.resource.ResourceSearchSession) - ``a
ResourceSearchSession``
raise: NotFound - ``bin_id`` not found
raise: NullArgument - ``bin_id`` is ``null``
... | [
"Gets",
"a",
"resource",
"search",
"session",
"for",
"the",
"given",
"bin",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L481-L503 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceManager.get_resource_agent_session | def get_resource_agent_session(self):
"""Gets the session for retrieving resource agent mappings.
return: (osid.resource.ResourceAgentSession) - a
``ResourceAgentSession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_resource_ag... | python | def get_resource_agent_session(self):
"""Gets the session for retrieving resource agent mappings.
return: (osid.resource.ResourceAgentSession) - a
``ResourceAgentSession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_resource_ag... | [
"def",
"get_resource_agent_session",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_agent",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"ResourceAgentSession",
"(",
... | Gets the session for retrieving resource agent mappings.
return: (osid.resource.ResourceAgentSession) - a
``ResourceAgentSession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_resource_agent()`` is
``false``
*com... | [
"Gets",
"the",
"session",
"for",
"retrieving",
"resource",
"agent",
"mappings",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L642-L657 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceManager.get_resource_agent_assignment_session_for_bin | def get_resource_agent_assignment_session_for_bin(self, bin_id):
"""Gets a resource agent session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
return: (osid.resource.ResourceAgentAssignmentSession) - a
``ResourceAgentAssignmentSession``
raise: N... | python | def get_resource_agent_assignment_session_for_bin(self, bin_id):
"""Gets a resource agent session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
return: (osid.resource.ResourceAgentAssignmentSession) - a
``ResourceAgentAssignmentSession``
raise: N... | [
"def",
"get_resource_agent_assignment_session_for_bin",
"(",
"self",
",",
"bin_id",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_agent_assignment",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"##",
"# Also include check to see if the cata... | Gets a resource agent session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
return: (osid.resource.ResourceAgentAssignmentSession) - a
``ResourceAgentAssignmentSession``
raise: NotFound - ``bin_id`` not found
raise: NullArgument - ``bin_id`` is ... | [
"Gets",
"a",
"resource",
"agent",
"session",
"for",
"the",
"given",
"bin",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L709-L731 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceManager.get_bin_admin_session | def get_bin_admin_session(self):
"""Gets the bin administrative session for creating, updating and deleteing bins.
return: (osid.resource.BinAdminSession) - a ``BinAdminSession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_bin_admin()`` is ``f... | python | def get_bin_admin_session(self):
"""Gets the bin administrative session for creating, updating and deleteing bins.
return: (osid.resource.BinAdminSession) - a ``BinAdminSession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_bin_admin()`` is ``f... | [
"def",
"get_bin_admin_session",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"supports_bin_admin",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"BinAdminSession",
"(",
"runtime",
... | Gets the bin administrative session for creating, updating and deleteing bins.
return: (osid.resource.BinAdminSession) - a ``BinAdminSession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_bin_admin()`` is ``false``
*compliance: optional -- This... | [
"Gets",
"the",
"bin",
"administrative",
"session",
"for",
"creating",
"updating",
"and",
"deleteing",
"bins",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L771-L784 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceManager.get_bin_hierarchy_session | def get_bin_hierarchy_session(self):
"""Gets the bin hierarchy traversal session.
return: (osid.resource.BinHierarchySession) - ``a
BinHierarchySession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_bin_hierarchy()`` is
... | python | def get_bin_hierarchy_session(self):
"""Gets the bin hierarchy traversal session.
return: (osid.resource.BinHierarchySession) - ``a
BinHierarchySession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_bin_hierarchy()`` is
... | [
"def",
"get_bin_hierarchy_session",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"supports_bin_hierarchy",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"BinHierarchySession",
"(",
"... | Gets the bin hierarchy traversal session.
return: (osid.resource.BinHierarchySession) - ``a
BinHierarchySession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_bin_hierarchy()`` is
``false``
*compliance: optional ... | [
"Gets",
"the",
"bin",
"hierarchy",
"traversal",
"session",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L789-L804 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.