repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceManager.get_bin_hierarchy_design_session | def get_bin_hierarchy_design_session(self):
"""Gets the bin hierarchy design session.
return: (osid.resource.BinHierarchyDesignSession) - a
``BinHierarchyDesignSession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_bin_hierarchy... | python | def get_bin_hierarchy_design_session(self):
"""Gets the bin hierarchy design session.
return: (osid.resource.BinHierarchyDesignSession) - a
``BinHierarchyDesignSession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_bin_hierarchy... | [
"def",
"get_bin_hierarchy_design_session",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"supports_bin_hierarchy_design",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"BinHierarchyDesign... | Gets the bin hierarchy design session.
return: (osid.resource.BinHierarchyDesignSession) - a
``BinHierarchyDesignSession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_bin_hierarchy_design()`` is
``false``
*compl... | [
"Gets",
"the",
"bin",
"hierarchy",
"design",
"session",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L809-L824 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_lookup_session | def get_resource_lookup_session(self, proxy):
"""Gets the ``OsidSession`` associated with the resource lookup service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceLookupSession) - ``a
ResourceLookupSession``
raise: NullArgument - ``proxy`` i... | python | def get_resource_lookup_session(self, proxy):
"""Gets the ``OsidSession`` associated with the resource lookup service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceLookupSession) - ``a
ResourceLookupSession``
raise: NullArgument - ``proxy`` i... | [
"def",
"get_resource_lookup_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_lookup",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"ResourceLo... | Gets the ``OsidSession`` associated with the resource lookup service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceLookupSession) - ``a
ResourceLookupSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to co... | [
"Gets",
"the",
"OsidSession",
"associated",
"with",
"the",
"resource",
"lookup",
"service",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L923-L940 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_lookup_session_for_bin | def get_resource_lookup_session_for_bin(self, bin_id, proxy):
"""Gets the ``OsidSession`` associated with the resource lookup service for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): ``a proxy``
return: (osid.resource.ResourceLookup... | python | def get_resource_lookup_session_for_bin(self, bin_id, proxy):
"""Gets the ``OsidSession`` associated with the resource lookup service for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): ``a proxy``
return: (osid.resource.ResourceLookup... | [
"def",
"get_resource_lookup_session_for_bin",
"(",
"self",
",",
"bin_id",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_lookup",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"##",
"# Also include check to see if the catalo... | Gets the ``OsidSession`` associated with the resource lookup service for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): ``a proxy``
return: (osid.resource.ResourceLookupSession) - ``a
ResourceLookupSession``
raise: No... | [
"Gets",
"the",
"OsidSession",
"associated",
"with",
"the",
"resource",
"lookup",
"service",
"for",
"the",
"given",
"bin",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L943-L966 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_query_session | def get_resource_query_session(self, proxy):
"""Gets a resource query session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceQuerySession) - ``a
ResourceQuerySession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed... | python | def get_resource_query_session(self, proxy):
"""Gets a resource query session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceQuerySession) - ``a
ResourceQuerySession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed... | [
"def",
"get_resource_query_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_query",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"ResourceQuer... | Gets a resource query session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceQuerySession) - ``a
ResourceQuerySession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to complete request
raise: Unimplemen... | [
"Gets",
"a",
"resource",
"query",
"session",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L969-L986 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_query_session_for_bin | def get_resource_query_session_for_bin(self, bin_id, proxy):
"""Gets a resource query session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceQuerySession) - ``a
ResourceQueryS... | python | def get_resource_query_session_for_bin(self, bin_id, proxy):
"""Gets a resource query session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceQuerySession) - ``a
ResourceQueryS... | [
"def",
"get_resource_query_session_for_bin",
"(",
"self",
",",
"bin_id",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_query",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"##",
"# Also include check to see if the catalog ... | Gets a resource query session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceQuerySession) - ``a
ResourceQuerySession``
raise: NotFound - ``bin_id`` not found
raise: ... | [
"Gets",
"a",
"resource",
"query",
"session",
"for",
"the",
"given",
"bin",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L989-L1012 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_search_session | def get_resource_search_session(self, proxy):
"""Gets a resource search session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceSearchSession) - ``a
ResourceSearchSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFa... | python | def get_resource_search_session(self, proxy):
"""Gets a resource search session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceSearchSession) - ``a
ResourceSearchSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFa... | [
"def",
"get_resource_search_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_search",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"ResourceSe... | Gets a resource search session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceSearchSession) - ``a
ResourceSearchSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to complete request
raise: Unimple... | [
"Gets",
"a",
"resource",
"search",
"session",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L1015-L1032 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_admin_session | def get_resource_admin_session(self, proxy):
"""Gets a resource administration session for creating, updating and deleting resources.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceAdminSession) - ``a
ResourceAdminSession``
raise: NullArgument ... | python | def get_resource_admin_session(self, proxy):
"""Gets a resource administration session for creating, updating and deleting resources.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceAdminSession) - ``a
ResourceAdminSession``
raise: NullArgument ... | [
"def",
"get_resource_admin_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_admin",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"ResourceAdmi... | Gets a resource administration session for creating, updating and deleting resources.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceAdminSession) - ``a
ResourceAdminSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed ... | [
"Gets",
"a",
"resource",
"administration",
"session",
"for",
"creating",
"updating",
"and",
"deleting",
"resources",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L1061-L1078 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_admin_session_for_bin | def get_resource_admin_session_for_bin(self, bin_id, proxy):
"""Gets a resource administration session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceAdminSession) - ``a
Resou... | python | def get_resource_admin_session_for_bin(self, bin_id, proxy):
"""Gets a resource administration session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceAdminSession) - ``a
Resou... | [
"def",
"get_resource_admin_session_for_bin",
"(",
"self",
",",
"bin_id",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_admin",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"##",
"# Also include check to see if the catalog ... | Gets a resource administration session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceAdminSession) - ``a
ResourceAdminSession``
raise: NotFound - ``bin_id`` not found
... | [
"Gets",
"a",
"resource",
"administration",
"session",
"for",
"the",
"given",
"bin",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L1081-L1104 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_notification_session | def get_resource_notification_session(self, resource_receiver, proxy):
"""Gets the resource notification session for the given bin.
arg: resource_receiver (osid.resource.ResourceReceiver):
notification callback
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.r... | python | def get_resource_notification_session(self, resource_receiver, proxy):
"""Gets the resource notification session for the given bin.
arg: resource_receiver (osid.resource.ResourceReceiver):
notification callback
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.r... | [
"def",
"get_resource_notification_session",
"(",
"self",
",",
"resource_receiver",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_notification",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"r... | Gets the resource notification session for the given bin.
arg: resource_receiver (osid.resource.ResourceReceiver):
notification callback
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceNotificationSession) - ``a
ResourceNotificationSes... | [
"Gets",
"the",
"resource",
"notification",
"session",
"for",
"the",
"given",
"bin",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L1107-L1127 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_notification_session_for_bin | def get_resource_notification_session_for_bin(self, resource_receiver, bin_id, proxy):
"""Gets the resource notification session for the given bin.
arg: resource_receiver (osid.resource.ResourceReceiver):
notification callback
arg: bin_id (osid.id.Id): the ``Id`` of the bi... | python | def get_resource_notification_session_for_bin(self, resource_receiver, bin_id, proxy):
"""Gets the resource notification session for the given bin.
arg: resource_receiver (osid.resource.ResourceReceiver):
notification callback
arg: bin_id (osid.id.Id): the ``Id`` of the bi... | [
"def",
"get_resource_notification_session_for_bin",
"(",
"self",
",",
"resource_receiver",
",",
"bin_id",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_notification",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"##",
... | Gets the resource notification session for the given bin.
arg: resource_receiver (osid.resource.ResourceReceiver):
notification callback
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceNotific... | [
"Gets",
"the",
"resource",
"notification",
"session",
"for",
"the",
"given",
"bin",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L1130-L1156 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_bin_session | def get_resource_bin_session(self, proxy):
"""Gets the session for retrieving resource to bin mappings.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceBinSession) - a
``ResourceBinSession``
raise: NullArgument - ``proxy`` is ``null``
ra... | python | def get_resource_bin_session(self, proxy):
"""Gets the session for retrieving resource to bin mappings.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceBinSession) - a
``ResourceBinSession``
raise: NullArgument - ``proxy`` is ``null``
ra... | [
"def",
"get_resource_bin_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_bin",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"ResourceBinSessi... | Gets the session for retrieving resource to bin mappings.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceBinSession) - a
``ResourceBinSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to complete request
... | [
"Gets",
"the",
"session",
"for",
"retrieving",
"resource",
"to",
"bin",
"mappings",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L1159-L1175 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_bin_assignment_session | def get_resource_bin_assignment_session(self, proxy):
"""Gets the session for assigning resource to bin mappings.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceBinAssignmentSession) - a
``ResourceBinAssignmentSession``
raise: NullArgument - ``... | python | def get_resource_bin_assignment_session(self, proxy):
"""Gets the session for assigning resource to bin mappings.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceBinAssignmentSession) - a
``ResourceBinAssignmentSession``
raise: NullArgument - ``... | [
"def",
"get_resource_bin_assignment_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_bin_assignment",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".... | Gets the session for assigning resource to bin mappings.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceBinAssignmentSession) - a
``ResourceBinAssignmentSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to c... | [
"Gets",
"the",
"session",
"for",
"assigning",
"resource",
"to",
"bin",
"mappings",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L1178-L1195 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_group_hierarchy_session | def get_group_hierarchy_session(self, proxy):
"""Gets the group hierarchy traversal session for the given resource group.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.BinHierarchySession) - ``a
GroupHierarchySession``
raise: NullArgument - ``proxy`` ... | python | def get_group_hierarchy_session(self, proxy):
"""Gets the group hierarchy traversal session for the given resource group.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.BinHierarchySession) - ``a
GroupHierarchySession``
raise: NullArgument - ``proxy`` ... | [
"def",
"get_group_hierarchy_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_group_hierarchy",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"BinHierarc... | Gets the group hierarchy traversal session for the given resource group.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.BinHierarchySession) - ``a
GroupHierarchySession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to c... | [
"Gets",
"the",
"group",
"hierarchy",
"traversal",
"session",
"for",
"the",
"given",
"resource",
"group",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L1198-L1215 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_agent_session_for_bin | def get_resource_agent_session_for_bin(self, bin_id, proxy):
"""Gets a resource agent session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceAgentSession) - a
``ResourceAgentS... | python | def get_resource_agent_session_for_bin(self, bin_id, proxy):
"""Gets a resource agent session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceAgentSession) - a
``ResourceAgentS... | [
"def",
"get_resource_agent_session_for_bin",
"(",
"self",
",",
"bin_id",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_agent",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"##",
"# Also include check to see if the catalog ... | Gets a resource agent session for the given bin.
arg: bin_id (osid.id.Id): the ``Id`` of the bin
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceAgentSession) - a
``ResourceAgentSession``
raise: NotFound - ``bin_id`` not found
raise: ... | [
"Gets",
"a",
"resource",
"agent",
"session",
"for",
"the",
"given",
"bin",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L1238-L1261 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_resource_agent_assignment_session | def get_resource_agent_assignment_session(self, proxy):
"""Gets the session for assigning agents to resources.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceAgentAssignmentSession) - a
``ResourceAgentAssignmentSession``
raise: NullArgument - `... | python | def get_resource_agent_assignment_session(self, proxy):
"""Gets the session for assigning agents to resources.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceAgentAssignmentSession) - a
``ResourceAgentAssignmentSession``
raise: NullArgument - `... | [
"def",
"get_resource_agent_assignment_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_resource_agent_assignment",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
... | Gets the session for assigning agents to resources.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.ResourceAgentAssignmentSession) - a
``ResourceAgentAssignmentSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to co... | [
"Gets",
"the",
"session",
"for",
"assigning",
"agents",
"to",
"resources",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L1264-L1281 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_bin_lookup_session | def get_bin_lookup_session(self, proxy):
"""Gets the bin lookup session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.BinLookupSession) - a
``BinLookupSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to c... | python | def get_bin_lookup_session(self, proxy):
"""Gets the bin lookup session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.BinLookupSession) - a
``BinLookupSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to c... | [
"def",
"get_bin_lookup_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_bin_lookup",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"BinLookupSession",
... | Gets the bin lookup session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.BinLookupSession) - a
``BinLookupSession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``su... | [
"Gets",
"the",
"bin",
"lookup",
"session",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L1310-L1326 |
mitsei/dlkit | dlkit/json_/resource/managers.py | ResourceProxyManager.get_bin_query_session | def get_bin_query_session(self, proxy):
"""Gets the bin query session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.BinQuerySession) - a ``BinQuerySession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to complete request
... | python | def get_bin_query_session(self, proxy):
"""Gets the bin query session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.BinQuerySession) - a ``BinQuerySession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to complete request
... | [
"def",
"get_bin_query_session",
"(",
"self",
",",
"proxy",
")",
":",
"if",
"not",
"self",
".",
"supports_bin_query",
"(",
")",
":",
"raise",
"errors",
".",
"Unimplemented",
"(",
")",
"# pylint: disable=no-member",
"return",
"sessions",
".",
"BinQuerySession",
"(... | Gets the bin query session.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.resource.BinQuerySession) - a ``BinQuerySession``
raise: NullArgument - ``proxy`` is ``null``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_bin_query()`... | [
"Gets",
"the",
"bin",
"query",
"session",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/resource/managers.py#L1329-L1344 |
peopledoc/django-agnocomplete | agnocomplete/register.py | register | def register(klass):
"Register a class into the agnocomplete registry."
logger.info("registering {}".format(klass.__name__))
AGNOCOMPLETE_REGISTRY[klass.slug] = klass | python | def register(klass):
"Register a class into the agnocomplete registry."
logger.info("registering {}".format(klass.__name__))
AGNOCOMPLETE_REGISTRY[klass.slug] = klass | [
"def",
"register",
"(",
"klass",
")",
":",
"logger",
".",
"info",
"(",
"\"registering {}\"",
".",
"format",
"(",
"klass",
".",
"__name__",
")",
")",
"AGNOCOMPLETE_REGISTRY",
"[",
"klass",
".",
"slug",
"]",
"=",
"klass"
] | Register a class into the agnocomplete registry. | [
"Register",
"a",
"class",
"into",
"the",
"agnocomplete",
"registry",
"."
] | train | https://github.com/peopledoc/django-agnocomplete/blob/9bf21db2f2036ba5059b843acd32902a09192053/agnocomplete/register.py#L10-L13 |
ytjia/utils-py | utils_py/time_seg_util.py | gen_slide_seg_list | def gen_slide_seg_list(mm_begin, mm_end, seg_duration, slide_step):
"""
生成时间片开始时刻列表,时间片以slide_step步长进行滑动
:param mm_begin:
:param mm_end:
:param seg_duration:
:param slide_step:
:return:
"""
seg_begin_list = [i for i in
range(mm_begin, mm_end - seg_duration + 1, ... | python | def gen_slide_seg_list(mm_begin, mm_end, seg_duration, slide_step):
"""
生成时间片开始时刻列表,时间片以slide_step步长进行滑动
:param mm_begin:
:param mm_end:
:param seg_duration:
:param slide_step:
:return:
"""
seg_begin_list = [i for i in
range(mm_begin, mm_end - seg_duration + 1, ... | [
"def",
"gen_slide_seg_list",
"(",
"mm_begin",
",",
"mm_end",
",",
"seg_duration",
",",
"slide_step",
")",
":",
"seg_begin_list",
"=",
"[",
"i",
"for",
"i",
"in",
"range",
"(",
"mm_begin",
",",
"mm_end",
"-",
"seg_duration",
"+",
"1",
",",
"slide_step",
")"... | 生成时间片开始时刻列表,时间片以slide_step步长进行滑动
:param mm_begin:
:param mm_end:
:param seg_duration:
:param slide_step:
:return: | [
"生成时间片开始时刻列表",
"时间片以slide_step步长进行滑动",
":",
"param",
"mm_begin",
":",
":",
"param",
"mm_end",
":",
":",
"param",
"seg_duration",
":",
":",
"param",
"slide_step",
":",
":",
"return",
":"
] | train | https://github.com/ytjia/utils-py/blob/68039b367e2e38fdecf234ecc625406b9e203ec0/utils_py/time_seg_util.py#L10-L22 |
ytjia/utils-py | utils_py/time_seg_util.py | get_slide_seg_list_belonged | def get_slide_seg_list_belonged(dt_str, seg_duration, slide_step=1,
fmt='%Y-%m-%d %H:%M:%S'):
"""
获取该时刻所属的所有时间片列表
:param dt_str: datetime string, eg: 2016-10-31 12:22:11
:param seg_duration: 时间片长度, unit: minute
:param slide_step: 滑动步长
:param fmt: datetime string f... | python | def get_slide_seg_list_belonged(dt_str, seg_duration, slide_step=1,
fmt='%Y-%m-%d %H:%M:%S'):
"""
获取该时刻所属的所有时间片列表
:param dt_str: datetime string, eg: 2016-10-31 12:22:11
:param seg_duration: 时间片长度, unit: minute
:param slide_step: 滑动步长
:param fmt: datetime string f... | [
"def",
"get_slide_seg_list_belonged",
"(",
"dt_str",
",",
"seg_duration",
",",
"slide_step",
"=",
"1",
",",
"fmt",
"=",
"'%Y-%m-%d %H:%M:%S'",
")",
":",
"dt",
"=",
"time_util",
".",
"str_to_datetime",
"(",
"dt_str",
",",
"fmt",
")",
"day_slide_seg_list",
"=",
... | 获取该时刻所属的所有时间片列表
:param dt_str: datetime string, eg: 2016-10-31 12:22:11
:param seg_duration: 时间片长度, unit: minute
:param slide_step: 滑动步长
:param fmt: datetime string format
:return: 时间片列表 | [
"获取该时刻所属的所有时间片列表",
":",
"param",
"dt_str",
":",
"datetime",
"string",
"eg",
":",
"2016",
"-",
"10",
"-",
"31",
"12",
":",
"22",
":",
"11",
":",
"param",
"seg_duration",
":",
"时间片长度",
"unit",
":",
"minute",
":",
"param",
"slide_step",
":",
"滑动步长",
":",
... | train | https://github.com/ytjia/utils-py/blob/68039b367e2e38fdecf234ecc625406b9e203ec0/utils_py/time_seg_util.py#L36-L50 |
ytjia/utils-py | utils_py/time_seg_util.py | get_still_seg_belonged | def get_still_seg_belonged(dt_str, seg_duration, fmt='%Y-%m-%d %H:%M:%S'):
"""
获取该时刻所属的非滑动时间片
:param dt_str: datetime string, eg: 2016-10-31 12:22:11
:param seg_duration: 时间片长度, unit: minute
:param fmt: datetime string format
:return:
"""
dt = time_util.str_to_datetime(dt_str, fmt)
m... | python | def get_still_seg_belonged(dt_str, seg_duration, fmt='%Y-%m-%d %H:%M:%S'):
"""
获取该时刻所属的非滑动时间片
:param dt_str: datetime string, eg: 2016-10-31 12:22:11
:param seg_duration: 时间片长度, unit: minute
:param fmt: datetime string format
:return:
"""
dt = time_util.str_to_datetime(dt_str, fmt)
m... | [
"def",
"get_still_seg_belonged",
"(",
"dt_str",
",",
"seg_duration",
",",
"fmt",
"=",
"'%Y-%m-%d %H:%M:%S'",
")",
":",
"dt",
"=",
"time_util",
".",
"str_to_datetime",
"(",
"dt_str",
",",
"fmt",
")",
"minutes_of_day",
"=",
"time_util",
".",
"get_minutes_of_day",
... | 获取该时刻所属的非滑动时间片
:param dt_str: datetime string, eg: 2016-10-31 12:22:11
:param seg_duration: 时间片长度, unit: minute
:param fmt: datetime string format
:return: | [
"获取该时刻所属的非滑动时间片",
":",
"param",
"dt_str",
":",
"datetime",
"string",
"eg",
":",
"2016",
"-",
"10",
"-",
"31",
"12",
":",
"22",
":",
"11",
":",
"param",
"seg_duration",
":",
"时间片长度",
"unit",
":",
"minute",
":",
"param",
"fmt",
":",
"datetime",
"string",... | train | https://github.com/ytjia/utils-py/blob/68039b367e2e38fdecf234ecc625406b9e203ec0/utils_py/time_seg_util.py#L53-L64 |
ytjia/utils-py | utils_py/time_seg_util.py | lie_in_seg | def lie_in_seg(dt, time_str, seg_duration):
"""
判断datetime是否在time_str为起点的时间片内
:param dt:
:param time_str: eg: '11:10:21'
:param seg_duration:
:return:
"""
minutes_of_day = time_util.get_minutes_of_day(dt)
range_begin = time_util.time_str_to_minutes(time_str)
if range_begin <= min... | python | def lie_in_seg(dt, time_str, seg_duration):
"""
判断datetime是否在time_str为起点的时间片内
:param dt:
:param time_str: eg: '11:10:21'
:param seg_duration:
:return:
"""
minutes_of_day = time_util.get_minutes_of_day(dt)
range_begin = time_util.time_str_to_minutes(time_str)
if range_begin <= min... | [
"def",
"lie_in_seg",
"(",
"dt",
",",
"time_str",
",",
"seg_duration",
")",
":",
"minutes_of_day",
"=",
"time_util",
".",
"get_minutes_of_day",
"(",
"dt",
")",
"range_begin",
"=",
"time_util",
".",
"time_str_to_minutes",
"(",
"time_str",
")",
"if",
"range_begin",... | 判断datetime是否在time_str为起点的时间片内
:param dt:
:param time_str: eg: '11:10:21'
:param seg_duration:
:return: | [
"判断datetime是否在time_str为起点的时间片内",
":",
"param",
"dt",
":",
":",
"param",
"time_str",
":",
"eg",
":",
"11",
":",
"10",
":",
"21",
":",
"param",
"seg_duration",
":",
":",
"return",
":"
] | train | https://github.com/ytjia/utils-py/blob/68039b367e2e38fdecf234ecc625406b9e203ec0/utils_py/time_seg_util.py#L67-L80 |
ytjia/utils-py | utils_py/time_seg_util.py | time_seg_to_index | def time_seg_to_index(time_str, slide_step):
"""
将时间片字符串转换为时间片索引值
:param time_str: eg: '11:10:21'
:param slide_step:
:return:
"""
minutes_idx = time_util.time_str_to_minutes(time_str)
time_seg_idx = minutes_idx // slide_step
return time_seg_idx | python | def time_seg_to_index(time_str, slide_step):
"""
将时间片字符串转换为时间片索引值
:param time_str: eg: '11:10:21'
:param slide_step:
:return:
"""
minutes_idx = time_util.time_str_to_minutes(time_str)
time_seg_idx = minutes_idx // slide_step
return time_seg_idx | [
"def",
"time_seg_to_index",
"(",
"time_str",
",",
"slide_step",
")",
":",
"minutes_idx",
"=",
"time_util",
".",
"time_str_to_minutes",
"(",
"time_str",
")",
"time_seg_idx",
"=",
"minutes_idx",
"//",
"slide_step",
"return",
"time_seg_idx"
] | 将时间片字符串转换为时间片索引值
:param time_str: eg: '11:10:21'
:param slide_step:
:return: | [
"将时间片字符串转换为时间片索引值",
":",
"param",
"time_str",
":",
"eg",
":",
"11",
":",
"10",
":",
"21",
":",
"param",
"slide_step",
":",
":",
"return",
":"
] | train | https://github.com/ytjia/utils-py/blob/68039b367e2e38fdecf234ecc625406b9e203ec0/utils_py/time_seg_util.py#L83-L92 |
ytjia/utils-py | utils_py/time_seg_util.py | index_to_time_seg | def index_to_time_seg(time_seg_idx, slide_step):
"""
将时间片索引值转换为时间片字符串
:param time_seg_idx:
:param slide_step:
:return:
"""
assert (time_seg_idx * slide_step < const.MINUTES_IN_A_DAY)
return time_util.minutes_to_time_str(time_seg_idx * slide_step) | python | def index_to_time_seg(time_seg_idx, slide_step):
"""
将时间片索引值转换为时间片字符串
:param time_seg_idx:
:param slide_step:
:return:
"""
assert (time_seg_idx * slide_step < const.MINUTES_IN_A_DAY)
return time_util.minutes_to_time_str(time_seg_idx * slide_step) | [
"def",
"index_to_time_seg",
"(",
"time_seg_idx",
",",
"slide_step",
")",
":",
"assert",
"(",
"time_seg_idx",
"*",
"slide_step",
"<",
"const",
".",
"MINUTES_IN_A_DAY",
")",
"return",
"time_util",
".",
"minutes_to_time_str",
"(",
"time_seg_idx",
"*",
"slide_step",
"... | 将时间片索引值转换为时间片字符串
:param time_seg_idx:
:param slide_step:
:return: | [
"将时间片索引值转换为时间片字符串",
":",
"param",
"time_seg_idx",
":",
":",
"param",
"slide_step",
":",
":",
"return",
":"
] | train | https://github.com/ytjia/utils-py/blob/68039b367e2e38fdecf234ecc625406b9e203ec0/utils_py/time_seg_util.py#L95-L103 |
theosysbio/means | src/means/approximation/mea/closure_normal.py | NormalClosure._get_covariance_symbol | def _get_covariance_symbol(self, q_counter, sp1_idx, sp2_idx):
r"""
Compute second order moments i.e. variances and covariances
Covariances equal to 0 in univariate case
:param q_counter: moment matrix
:param sp1_idx: index of one species
:param sp2_idx: index of another... | python | def _get_covariance_symbol(self, q_counter, sp1_idx, sp2_idx):
r"""
Compute second order moments i.e. variances and covariances
Covariances equal to 0 in univariate case
:param q_counter: moment matrix
:param sp1_idx: index of one species
:param sp2_idx: index of another... | [
"def",
"_get_covariance_symbol",
"(",
"self",
",",
"q_counter",
",",
"sp1_idx",
",",
"sp2_idx",
")",
":",
"# The diagonal positions in the matrix are the variances",
"if",
"sp1_idx",
"==",
"sp2_idx",
":",
"return",
"[",
"q",
".",
"symbol",
"for",
"q",
"in",
"q_cou... | r"""
Compute second order moments i.e. variances and covariances
Covariances equal to 0 in univariate case
:param q_counter: moment matrix
:param sp1_idx: index of one species
:param sp2_idx: index of another species
:return: second order moments matrix of size n_species... | [
"r",
"Compute",
"second",
"order",
"moments",
"i",
".",
"e",
".",
"variances",
"and",
"covariances",
"Covariances",
"equal",
"to",
"0",
"in",
"univariate",
"case"
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/closure_normal.py#L37-L58 |
theosysbio/means | src/means/approximation/mea/closure_normal.py | NormalClosure._compute_one_closed_central_moment | def _compute_one_closed_central_moment(self, moment, covariance_matrix):
r"""
Compute each row of closed central moment based on Isserlis' Theorem of calculating higher order moments
of multivariate normal distribution in terms of covariance matrix
:param moment: moment matrix
:... | python | def _compute_one_closed_central_moment(self, moment, covariance_matrix):
r"""
Compute each row of closed central moment based on Isserlis' Theorem of calculating higher order moments
of multivariate normal distribution in terms of covariance matrix
:param moment: moment matrix
:... | [
"def",
"_compute_one_closed_central_moment",
"(",
"self",
",",
"moment",
",",
"covariance_matrix",
")",
":",
"# If moment order is odd, higher order moments equals 0",
"if",
"moment",
".",
"order",
"%",
"2",
"!=",
"0",
":",
"return",
"sp",
".",
"Integer",
"(",
"0",
... | r"""
Compute each row of closed central moment based on Isserlis' Theorem of calculating higher order moments
of multivariate normal distribution in terms of covariance matrix
:param moment: moment matrix
:param covariance_matrix: matrix containing variances and covariances
:ret... | [
"r",
"Compute",
"each",
"row",
"of",
"closed",
"central",
"moment",
"based",
"on",
"Isserlis",
"Theorem",
"of",
"calculating",
"higher",
"order",
"moments",
"of",
"multivariate",
"normal",
"distribution",
"in",
"terms",
"of",
"covariance",
"matrix"
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/closure_normal.py#L61-L98 |
theosysbio/means | src/means/approximation/mea/closure_normal.py | NormalClosure._compute_closed_central_moments | def _compute_closed_central_moments(self, central_from_raw_exprs, n_counter, k_counter):
"""
Computes parametric expressions (e.g. in terms of mean, variance, covariances) for all central moments
up to max_order + 1 order.
:param central_from_raw_exprs:
:param n_counter: a list ... | python | def _compute_closed_central_moments(self, central_from_raw_exprs, n_counter, k_counter):
"""
Computes parametric expressions (e.g. in terms of mean, variance, covariances) for all central moments
up to max_order + 1 order.
:param central_from_raw_exprs:
:param n_counter: a list ... | [
"def",
"_compute_closed_central_moments",
"(",
"self",
",",
"central_from_raw_exprs",
",",
"n_counter",
",",
"k_counter",
")",
":",
"n_species",
"=",
"len",
"(",
"[",
"None",
"for",
"pm",
"in",
"k_counter",
"if",
"pm",
".",
"order",
"==",
"1",
"]",
")",
"c... | Computes parametric expressions (e.g. in terms of mean, variance, covariances) for all central moments
up to max_order + 1 order.
:param central_from_raw_exprs:
:param n_counter: a list of :class:`~means.core.descriptors.Moment`\s representing central moments
:type n_counter: list[:clas... | [
"Computes",
"parametric",
"expressions",
"(",
"e",
".",
"g",
".",
"in",
"terms",
"of",
"mean",
"variance",
"covariances",
")",
"for",
"all",
"central",
"moments",
"up",
"to",
"max_order",
"+",
"1",
"order",
"."
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/closure_normal.py#L101-L117 |
cnelson/python-fleet | fleet/http/unix_socket.py | UnixConnectionWithTimeout.connect | def connect(self):
"""Connect to the unix domain socket, which is passed to us as self.host
This is in host because the format we use for the unix domain socket is:
http+unix://%2Fpath%2Fto%2Fsocket.sock
"""
try:
self.sock = socket.socket(socket.AF_UNIX, s... | python | def connect(self):
"""Connect to the unix domain socket, which is passed to us as self.host
This is in host because the format we use for the unix domain socket is:
http+unix://%2Fpath%2Fto%2Fsocket.sock
"""
try:
self.sock = socket.socket(socket.AF_UNIX, s... | [
"def",
"connect",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"sock",
"=",
"socket",
".",
"socket",
"(",
"socket",
".",
"AF_UNIX",
",",
"socket",
".",
"SOCK_STREAM",
")",
"if",
"has_timeout",
"(",
"self",
".",
"timeout",
")",
":",
"self",
".",
... | Connect to the unix domain socket, which is passed to us as self.host
This is in host because the format we use for the unix domain socket is:
http+unix://%2Fpath%2Fto%2Fsocket.sock | [
"Connect",
"to",
"the",
"unix",
"domain",
"socket",
"which",
"is",
"passed",
"to",
"us",
"as",
"self",
".",
"host",
"This",
"is",
"in",
"host",
"because",
"the",
"format",
"we",
"use",
"for",
"the",
"unix",
"domain",
"socket",
"is",
":",
"http",
"+",
... | train | https://github.com/cnelson/python-fleet/blob/a11dcd8bb3986d1d8f0af90d2da7399c9cc54b4d/fleet/http/unix_socket.py#L37-L57 |
cmcdowell/weatherpy | weatherpy/wind.py | Wind.cardinal_direction | def cardinal_direction(self):
"""
Returns the cardinal direction of the
wind as a string. Possible returned values are N, E, S, W, and None.
315 degrees to 45 degrees exclusive -> N
45 degrees to 135 degrees exclusive -> E
135 degrees to 225 degrees exclusive -> S
... | python | def cardinal_direction(self):
"""
Returns the cardinal direction of the
wind as a string. Possible returned values are N, E, S, W, and None.
315 degrees to 45 degrees exclusive -> N
45 degrees to 135 degrees exclusive -> E
135 degrees to 225 degrees exclusive -> S
... | [
"def",
"cardinal_direction",
"(",
"self",
")",
":",
"if",
"self",
".",
"direction",
"is",
"None",
":",
"return",
"None",
"if",
"self",
".",
"direction",
">",
"360",
"or",
"self",
".",
"direction",
"<",
"0",
":",
"raise",
"Exception",
"(",
"'Direction out... | Returns the cardinal direction of the
wind as a string. Possible returned values are N, E, S, W, and None.
315 degrees to 45 degrees exclusive -> N
45 degrees to 135 degrees exclusive -> E
135 degrees to 225 degrees exclusive -> S
225 degrees to 315 degrees exclusive -> W
... | [
"Returns",
"the",
"cardinal",
"direction",
"of",
"the",
"wind",
"as",
"a",
"string",
".",
"Possible",
"returned",
"values",
"are",
"N",
"E",
"S",
"W",
"and",
"None",
"."
] | train | https://github.com/cmcdowell/weatherpy/blob/7da7bed9db946dfab9318d67aab5fbda1e4fed21/weatherpy/wind.py#L31-L56 |
mitsei/dlkit | dlkit/primordium/locale/types/language.py | get_type_data | def get_type_data(name):
"""Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type
"""
name = name.upper()
if name in ISO_LANGUAGE_CODES:
name = ISO_LANGUAGE_CODES[name]
if name in ISO_MAJOR_LANGUAGE_TYPES:
namespace = '639-2'
... | python | def get_type_data(name):
"""Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type
"""
name = name.upper()
if name in ISO_LANGUAGE_CODES:
name = ISO_LANGUAGE_CODES[name]
if name in ISO_MAJOR_LANGUAGE_TYPES:
namespace = '639-2'
... | [
"def",
"get_type_data",
"(",
"name",
")",
":",
"name",
"=",
"name",
".",
"upper",
"(",
")",
"if",
"name",
"in",
"ISO_LANGUAGE_CODES",
":",
"name",
"=",
"ISO_LANGUAGE_CODES",
"[",
"name",
"]",
"if",
"name",
"in",
"ISO_MAJOR_LANGUAGE_TYPES",
":",
"namespace",
... | Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type | [
"Return",
"dictionary",
"representation",
"of",
"type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/primordium/locale/types/language.py#L1234-L1261 |
delfick/harpoon | harpoon/option_spec/image_specs.py | image_name_spec.normalise_filled | def normalise_filled(self, meta, val):
"""Only care about valid image names"""
available = list(meta.everything["images"].keys())
val = sb.formatted(sb.string_spec(), formatter=MergedOptionStringFormatter).normalise(meta, val)
if val not in available:
raise BadConfiguration("... | python | def normalise_filled(self, meta, val):
"""Only care about valid image names"""
available = list(meta.everything["images"].keys())
val = sb.formatted(sb.string_spec(), formatter=MergedOptionStringFormatter).normalise(meta, val)
if val not in available:
raise BadConfiguration("... | [
"def",
"normalise_filled",
"(",
"self",
",",
"meta",
",",
"val",
")",
":",
"available",
"=",
"list",
"(",
"meta",
".",
"everything",
"[",
"\"images\"",
"]",
".",
"keys",
"(",
")",
")",
"val",
"=",
"sb",
".",
"formatted",
"(",
"sb",
".",
"string_spec"... | Only care about valid image names | [
"Only",
"care",
"about",
"valid",
"image",
"names"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/option_spec/image_specs.py#L20-L26 |
delfick/harpoon | harpoon/option_spec/image_specs.py | mount_spec.create_result | def create_result(self, local_path, container_path, permissions, meta, val, dividers):
"""Default permissions to rw"""
if permissions is NotSpecified:
permissions = 'rw'
return Mount(local_path, container_path, permissions) | python | def create_result(self, local_path, container_path, permissions, meta, val, dividers):
"""Default permissions to rw"""
if permissions is NotSpecified:
permissions = 'rw'
return Mount(local_path, container_path, permissions) | [
"def",
"create_result",
"(",
"self",
",",
"local_path",
",",
"container_path",
",",
"permissions",
",",
"meta",
",",
"val",
",",
"dividers",
")",
":",
"if",
"permissions",
"is",
"NotSpecified",
":",
"permissions",
"=",
"'rw'",
"return",
"Mount",
"(",
"local_... | Default permissions to rw | [
"Default",
"permissions",
"to",
"rw"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/option_spec/image_specs.py#L34-L38 |
delfick/harpoon | harpoon/option_spec/image_specs.py | env_spec.create_result | def create_result(self, env_name, other_val, meta, val, dividers):
"""Set default_val and set_val depending on the seperator"""
args = [env_name]
if other_val is NotSpecified:
other_val = None
if not dividers:
args.extend([None, None])
elif dividers[0] == ... | python | def create_result(self, env_name, other_val, meta, val, dividers):
"""Set default_val and set_val depending on the seperator"""
args = [env_name]
if other_val is NotSpecified:
other_val = None
if not dividers:
args.extend([None, None])
elif dividers[0] == ... | [
"def",
"create_result",
"(",
"self",
",",
"env_name",
",",
"other_val",
",",
"meta",
",",
"val",
",",
"dividers",
")",
":",
"args",
"=",
"[",
"env_name",
"]",
"if",
"other_val",
"is",
"NotSpecified",
":",
"other_val",
"=",
"None",
"if",
"not",
"dividers"... | Set default_val and set_val depending on the seperator | [
"Set",
"default_val",
"and",
"set_val",
"depending",
"on",
"the",
"seperator"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/option_spec/image_specs.py#L48-L59 |
delfick/harpoon | harpoon/option_spec/image_specs.py | link_spec.determine_2 | def determine_2(self, container_name, container_alias, meta, val):
""""Default the alias to the name of the container"""
if container_alias is not NotSpecified:
return container_alias
return container_name[container_name.rfind(":")+1:].replace('/', '-') | python | def determine_2(self, container_name, container_alias, meta, val):
""""Default the alias to the name of the container"""
if container_alias is not NotSpecified:
return container_alias
return container_name[container_name.rfind(":")+1:].replace('/', '-') | [
"def",
"determine_2",
"(",
"self",
",",
"container_name",
",",
"container_alias",
",",
"meta",
",",
"val",
")",
":",
"if",
"container_alias",
"is",
"not",
"NotSpecified",
":",
"return",
"container_alias",
"return",
"container_name",
"[",
"container_name",
".",
"... | Default the alias to the name of the container | [
"Default",
"the",
"alias",
"to",
"the",
"name",
"of",
"the",
"container"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/option_spec/image_specs.py#L67-L71 |
delfick/harpoon | harpoon/option_spec/image_specs.py | link_spec.alter_1 | def alter_1(self, given_container_name, container_name, meta, val):
"""Get the container_name of the container if a container is specified"""
meta.container = None
if not isinstance(container_name, six.string_types):
meta.container = container_name
container_name = contai... | python | def alter_1(self, given_container_name, container_name, meta, val):
"""Get the container_name of the container if a container is specified"""
meta.container = None
if not isinstance(container_name, six.string_types):
meta.container = container_name
container_name = contai... | [
"def",
"alter_1",
"(",
"self",
",",
"given_container_name",
",",
"container_name",
",",
"meta",
",",
"val",
")",
":",
"meta",
".",
"container",
"=",
"None",
"if",
"not",
"isinstance",
"(",
"container_name",
",",
"six",
".",
"string_types",
")",
":",
"meta"... | Get the container_name of the container if a container is specified | [
"Get",
"the",
"container_name",
"of",
"the",
"container",
"if",
"a",
"container",
"is",
"specified"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/option_spec/image_specs.py#L73-L79 |
delfick/harpoon | harpoon/option_spec/image_specs.py | port_spec.create_result | def create_result(self, ip, host_port, container_port, meta, val, dividers):
"""
The format is the same as the default docker cli client::
ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort
"""
if host_port in ('', NotSpecified) and contai... | python | def create_result(self, ip, host_port, container_port, meta, val, dividers):
"""
The format is the same as the default docker cli client::
ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort
"""
if host_port in ('', NotSpecified) and contai... | [
"def",
"create_result",
"(",
"self",
",",
"ip",
",",
"host_port",
",",
"container_port",
",",
"meta",
",",
"val",
",",
"dividers",
")",
":",
"if",
"host_port",
"in",
"(",
"''",
",",
"NotSpecified",
")",
"and",
"container_port",
"in",
"(",
"''",
",",
"N... | The format is the same as the default docker cli client::
ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort | [
"The",
"format",
"is",
"the",
"same",
"as",
"the",
"default",
"docker",
"cli",
"client",
"::"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/option_spec/image_specs.py#L90-L116 |
theosysbio/means | src/means/approximation/mea/eq_mixed_moments.py | DBetaOverDtCalculator.get | def get(self, k_vec, e_counter):
r"""
Provides the terms needed for equation 11 (see Ale et al. 2013).
This gives the expressions for :math:`\frac{d\beta}{dt}` in equation 9, these are the
time dependencies of the mixed moments
:param k_vec: :math:`k` in eq. 11
:param e_... | python | def get(self, k_vec, e_counter):
r"""
Provides the terms needed for equation 11 (see Ale et al. 2013).
This gives the expressions for :math:`\frac{d\beta}{dt}` in equation 9, these are the
time dependencies of the mixed moments
:param k_vec: :math:`k` in eq. 11
:param e_... | [
"def",
"get",
"(",
"self",
",",
"k_vec",
",",
"e_counter",
")",
":",
"if",
"len",
"(",
"e_counter",
")",
"==",
"0",
":",
"return",
"sp",
".",
"Matrix",
"(",
"1",
",",
"len",
"(",
"self",
".",
"__n_counter",
")",
",",
"lambda",
"i",
",",
"j",
":... | r"""
Provides the terms needed for equation 11 (see Ale et al. 2013).
This gives the expressions for :math:`\frac{d\beta}{dt}` in equation 9, these are the
time dependencies of the mixed moments
:param k_vec: :math:`k` in eq. 11
:param e_counter: :math:`e` in eq. 11
:ret... | [
"r",
"Provides",
"the",
"terms",
"needed",
"for",
"equation",
"11",
"(",
"see",
"Ale",
"et",
"al",
".",
"2013",
")",
".",
"This",
"gives",
"the",
"expressions",
"for",
":",
"math",
":",
"\\",
"frac",
"{",
"d",
"\\",
"beta",
"}",
"{",
"dt",
"}",
"... | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/eq_mixed_moments.py#L31-L75 |
theosysbio/means | src/means/approximation/mea/eq_mixed_moments.py | DBetaOverDtCalculator._make_f_of_x | def _make_f_of_x(self, k_vec, e_vec, reaction):
r"""
Calculates :math:`F():math:` in eq. 12 (see Ale et al. 2013) for a specific reaction , :math:`k` and :math:`e`
:param k_vec: the vector :math:`k`
:param e_vec: the vector :math:`e`
:param reaction: the equation of the reaction... | python | def _make_f_of_x(self, k_vec, e_vec, reaction):
r"""
Calculates :math:`F():math:` in eq. 12 (see Ale et al. 2013) for a specific reaction , :math:`k` and :math:`e`
:param k_vec: the vector :math:`k`
:param e_vec: the vector :math:`e`
:param reaction: the equation of the reaction... | [
"def",
"_make_f_of_x",
"(",
"self",
",",
"k_vec",
",",
"e_vec",
",",
"reaction",
")",
":",
"# product of all values of {x ^ (k - e)} for all combination of e and k",
"prod",
"=",
"product",
"(",
"[",
"var",
"**",
"(",
"k_vec",
"[",
"i",
"]",
"-",
"e_vec",
"[",
... | r"""
Calculates :math:`F():math:` in eq. 12 (see Ale et al. 2013) for a specific reaction , :math:`k` and :math:`e`
:param k_vec: the vector :math:`k`
:param e_vec: the vector :math:`e`
:param reaction: the equation of the reaction {:math:`a(x) in the model}
:return: :math:`F()` | [
"r",
"Calculates",
":",
"math",
":",
"F",
"()",
":",
"math",
":",
"in",
"eq",
".",
"12",
"(",
"see",
"Ale",
"et",
"al",
".",
"2013",
")",
"for",
"a",
"specific",
"reaction",
":",
"math",
":",
"k",
"and",
":",
"math",
":",
"e"
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/eq_mixed_moments.py#L78-L91 |
theosysbio/means | src/means/approximation/mea/eq_mixed_moments.py | DBetaOverDtCalculator._make_f_expectation | def _make_f_expectation(self, expr):
"""
Calculates :math:`<F>` in eq. 12 (see Ale et al. 2013) to calculate :math:`<F>` for EACH VARIABLE combination.
:param expr: an expression
:return: a column vector. Each row correspond to an element of counter.
:rtype: :class:`sympy.Matrix... | python | def _make_f_expectation(self, expr):
"""
Calculates :math:`<F>` in eq. 12 (see Ale et al. 2013) to calculate :math:`<F>` for EACH VARIABLE combination.
:param expr: an expression
:return: a column vector. Each row correspond to an element of counter.
:rtype: :class:`sympy.Matrix... | [
"def",
"_make_f_expectation",
"(",
"self",
",",
"expr",
")",
":",
"# compute derivatives for EACH ENTRY in COUNTER",
"derives",
"=",
"sp",
".",
"Matrix",
"(",
"[",
"derive_expr_from_counter_entry",
"(",
"expr",
",",
"self",
".",
"__species",
",",
"tuple",
"(",
"c"... | Calculates :math:`<F>` in eq. 12 (see Ale et al. 2013) to calculate :math:`<F>` for EACH VARIABLE combination.
:param expr: an expression
:return: a column vector. Each row correspond to an element of counter.
:rtype: :class:`sympy.Matrix` | [
"Calculates",
":",
"math",
":",
"<F",
">",
"in",
"eq",
".",
"12",
"(",
"see",
"Ale",
"et",
"al",
".",
"2013",
")",
"to",
"calculate",
":",
"math",
":",
"<F",
">",
"for",
"EACH",
"VARIABLE",
"combination",
"."
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/eq_mixed_moments.py#L94-L115 |
theosysbio/means | src/means/approximation/mea/eq_mixed_moments.py | DBetaOverDtCalculator._make_s_pow_e | def _make_s_pow_e(self, reac_idx, e_vec):
"""
Compute s^e in equation 11 (see Ale et al. 2013)
:param reac_idx: the index (that is the column in the stoichiometry matrix)
of the reaction to consider.
:type reac_idx: `int`
:param e_vec: the vector e
:return: a s... | python | def _make_s_pow_e(self, reac_idx, e_vec):
"""
Compute s^e in equation 11 (see Ale et al. 2013)
:param reac_idx: the index (that is the column in the stoichiometry matrix)
of the reaction to consider.
:type reac_idx: `int`
:param e_vec: the vector e
:return: a s... | [
"def",
"_make_s_pow_e",
"(",
"self",
",",
"reac_idx",
",",
"e_vec",
")",
":",
"return",
"product",
"(",
"[",
"self",
".",
"__stoichoimetry_matrix",
"[",
"i",
",",
"reac_idx",
"]",
"**",
"e",
"for",
"i",
",",
"e",
"in",
"enumerate",
"(",
"e_vec",
")",
... | Compute s^e in equation 11 (see Ale et al. 2013)
:param reac_idx: the index (that is the column in the stoichiometry matrix)
of the reaction to consider.
:type reac_idx: `int`
:param e_vec: the vector e
:return: a scalar (s^e) | [
"Compute",
"s^e",
"in",
"equation",
"11",
"(",
"see",
"Ale",
"et",
"al",
".",
"2013",
")"
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/eq_mixed_moments.py#L117-L127 |
delfick/harpoon | harpoon/amazon.py | catch_no_credentials | def catch_no_credentials(message, **info):
"""Turn a NoCredentialsError into a BadAmazon"""
try:
yield
except NoCredentialsError as error:
if hasattr(error, "response"):
info['error_code'] = error.response["ResponseMetadata"]["HTTPStatusCode"]
info['error_message'] = ... | python | def catch_no_credentials(message, **info):
"""Turn a NoCredentialsError into a BadAmazon"""
try:
yield
except NoCredentialsError as error:
if hasattr(error, "response"):
info['error_code'] = error.response["ResponseMetadata"]["HTTPStatusCode"]
info['error_message'] = ... | [
"def",
"catch_no_credentials",
"(",
"message",
",",
"*",
"*",
"info",
")",
":",
"try",
":",
"yield",
"except",
"NoCredentialsError",
"as",
"error",
":",
"if",
"hasattr",
"(",
"error",
",",
"\"response\"",
")",
":",
"info",
"[",
"'error_code'",
"]",
"=",
... | Turn a NoCredentialsError into a BadAmazon | [
"Turn",
"a",
"NoCredentialsError",
"into",
"a",
"BadAmazon"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/amazon.py#L16-L27 |
delfick/harpoon | harpoon/amazon.py | catch_boto_400 | def catch_boto_400(message, **info):
"""Turn a BotoServerError 400 into a BadAmazon"""
try:
yield
except ClientError as error:
if str(error.response["ResponseMetadata"]["HTTPStatusCode"]).startswith("4"):
error_message = error.response["Error"]["Message"]
raise BadAma... | python | def catch_boto_400(message, **info):
"""Turn a BotoServerError 400 into a BadAmazon"""
try:
yield
except ClientError as error:
if str(error.response["ResponseMetadata"]["HTTPStatusCode"]).startswith("4"):
error_message = error.response["Error"]["Message"]
raise BadAma... | [
"def",
"catch_boto_400",
"(",
"message",
",",
"*",
"*",
"info",
")",
":",
"try",
":",
"yield",
"except",
"ClientError",
"as",
"error",
":",
"if",
"str",
"(",
"error",
".",
"response",
"[",
"\"ResponseMetadata\"",
"]",
"[",
"\"HTTPStatusCode\"",
"]",
")",
... | Turn a BotoServerError 400 into a BadAmazon | [
"Turn",
"a",
"BotoServerError",
"400",
"into",
"a",
"BadAmazon"
] | train | https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/amazon.py#L30-L39 |
mitsei/dlkit | dlkit/aws_adapter/osid/managers.py | OsidProfile._initialize | def _initialize(self, runtime):
"""Common initializer for OsidManager and OsidProxyManager"""
if runtime is None:
raise NullArgument()
if self._my_runtime is not None:
raise IllegalState('this manager has already been initialized.')
self._my_runtime = runtime
... | python | def _initialize(self, runtime):
"""Common initializer for OsidManager and OsidProxyManager"""
if runtime is None:
raise NullArgument()
if self._my_runtime is not None:
raise IllegalState('this manager has already been initialized.')
self._my_runtime = runtime
... | [
"def",
"_initialize",
"(",
"self",
",",
"runtime",
")",
":",
"if",
"runtime",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"if",
"self",
".",
"_my_runtime",
"is",
"not",
"None",
":",
"raise",
"IllegalState",
"(",
"'this manager has already been initia... | Common initializer for OsidManager and OsidProxyManager | [
"Common",
"initializer",
"for",
"OsidManager",
"and",
"OsidProxyManager"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/aws_adapter/osid/managers.py#L24-L63 |
mitsei/dlkit | dlkit/primordium/locale/types/script.py | get_type_data | def get_type_data(name):
"""Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type
"""
name = name.upper()
try:
return {
'authority': 'ISO',
'namespace': '15924',
'identifier': name,
'domain': 'ISO... | python | def get_type_data(name):
"""Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type
"""
name = name.upper()
try:
return {
'authority': 'ISO',
'namespace': '15924',
'identifier': name,
'domain': 'ISO... | [
"def",
"get_type_data",
"(",
"name",
")",
":",
"name",
"=",
"name",
".",
"upper",
"(",
")",
"try",
":",
"return",
"{",
"'authority'",
":",
"'ISO'",
",",
"'namespace'",
":",
"'15924'",
",",
"'identifier'",
":",
"name",
",",
"'domain'",
":",
"'ISO Script T... | Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type | [
"Return",
"dictionary",
"representation",
"of",
"type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/primordium/locale/types/script.py#L168-L187 |
mitsei/dlkit | dlkit/json_/assessment/assessment_utilities.py | check_effective | def check_effective(func):
"""decorator, tests if an Assessment or Section is effective, raises error if not
Side benefit: raised NotFound on AssessmentSections and AssessmentTakens
"""
def wrapper(*args, **kwargs):
if ('assessment_section_id' in kwargs or
args and 'Section' in... | python | def check_effective(func):
"""decorator, tests if an Assessment or Section is effective, raises error if not
Side benefit: raised NotFound on AssessmentSections and AssessmentTakens
"""
def wrapper(*args, **kwargs):
if ('assessment_section_id' in kwargs or
args and 'Section' in... | [
"def",
"check_effective",
"(",
"func",
")",
":",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"(",
"'assessment_section_id'",
"in",
"kwargs",
"or",
"args",
"and",
"'Section'",
"in",
"args",
"[",
"1",
"]",
".",
"get_ident... | decorator, tests if an Assessment or Section is effective, raises error if not
Side benefit: raised NotFound on AssessmentSections and AssessmentTakens | [
"decorator",
"tests",
"if",
"an",
"Assessment",
"or",
"Section",
"is",
"effective",
"raises",
"error",
"if",
"not"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/assessment_utilities.py#L18-L43 |
mitsei/dlkit | dlkit/json_/assessment/assessment_utilities.py | get_first_part_id_for_assessment | def get_first_part_id_for_assessment(assessment_id, runtime=None, proxy=None, create=False, bank_id=None):
"""Gets the first part id, which represents the first section, of assessment"""
if create and bank_id is None:
raise NullArgument('Bank Id must be provided for create option')
try:
retu... | python | def get_first_part_id_for_assessment(assessment_id, runtime=None, proxy=None, create=False, bank_id=None):
"""Gets the first part id, which represents the first section, of assessment"""
if create and bank_id is None:
raise NullArgument('Bank Id must be provided for create option')
try:
retu... | [
"def",
"get_first_part_id_for_assessment",
"(",
"assessment_id",
",",
"runtime",
"=",
"None",
",",
"proxy",
"=",
"None",
",",
"create",
"=",
"False",
",",
"bank_id",
"=",
"None",
")",
":",
"if",
"create",
"and",
"bank_id",
"is",
"None",
":",
"raise",
"Null... | Gets the first part id, which represents the first section, of assessment | [
"Gets",
"the",
"first",
"part",
"id",
"which",
"represents",
"the",
"first",
"section",
"of",
"assessment"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/assessment_utilities.py#L46-L56 |
mitsei/dlkit | dlkit/json_/assessment/assessment_utilities.py | get_assessment_part_lookup_session | def get_assessment_part_lookup_session(runtime, proxy, section=None):
"""returns an assessment part lookup session, perhaps even a magic one"""
# This appears to share code with get_item_lookup_session
try:
config = runtime.get_configuration()
parameter_id = Id('parameter:magicAssessmentPart... | python | def get_assessment_part_lookup_session(runtime, proxy, section=None):
"""returns an assessment part lookup session, perhaps even a magic one"""
# This appears to share code with get_item_lookup_session
try:
config = runtime.get_configuration()
parameter_id = Id('parameter:magicAssessmentPart... | [
"def",
"get_assessment_part_lookup_session",
"(",
"runtime",
",",
"proxy",
",",
"section",
"=",
"None",
")",
":",
"# This appears to share code with get_item_lookup_session",
"try",
":",
"config",
"=",
"runtime",
".",
"get_configuration",
"(",
")",
"parameter_id",
"=",
... | returns an assessment part lookup session, perhaps even a magic one | [
"returns",
"an",
"assessment",
"part",
"lookup",
"session",
"perhaps",
"even",
"a",
"magic",
"one"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/assessment_utilities.py#L252-L271 |
mitsei/dlkit | dlkit/json_/assessment/assessment_utilities.py | get_assessment_section | def get_assessment_section(section_id, runtime=None, proxy=None):
"""Gets a Section given a section_id"""
from .mixins import LoadedSection
collection = JSONClientValidated('assessment',
collection='AssessmentSection',
runtime=runtime... | python | def get_assessment_section(section_id, runtime=None, proxy=None):
"""Gets a Section given a section_id"""
from .mixins import LoadedSection
collection = JSONClientValidated('assessment',
collection='AssessmentSection',
runtime=runtime... | [
"def",
"get_assessment_section",
"(",
"section_id",
",",
"runtime",
"=",
"None",
",",
"proxy",
"=",
"None",
")",
":",
"from",
".",
"mixins",
"import",
"LoadedSection",
"collection",
"=",
"JSONClientValidated",
"(",
"'assessment'",
",",
"collection",
"=",
"'Asses... | Gets a Section given a section_id | [
"Gets",
"a",
"Section",
"given",
"a",
"section_id"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/assessment_utilities.py#L308-L315 |
mitsei/dlkit | dlkit/json_/assessment/assessment_utilities.py | update_parent_sequence_map | def update_parent_sequence_map(child_part, delete=False):
"""Updates the child map of a simple sequence assessment assessment part"""
if child_part.has_parent_part():
object_map = child_part.get_assessment_part()._my_map
database = 'assessment_authoring'
collection_type = 'AssessmentPart... | python | def update_parent_sequence_map(child_part, delete=False):
"""Updates the child map of a simple sequence assessment assessment part"""
if child_part.has_parent_part():
object_map = child_part.get_assessment_part()._my_map
database = 'assessment_authoring'
collection_type = 'AssessmentPart... | [
"def",
"update_parent_sequence_map",
"(",
"child_part",
",",
"delete",
"=",
"False",
")",
":",
"if",
"child_part",
".",
"has_parent_part",
"(",
")",
":",
"object_map",
"=",
"child_part",
".",
"get_assessment_part",
"(",
")",
".",
"_my_map",
"database",
"=",
"'... | Updates the child map of a simple sequence assessment assessment part | [
"Updates",
"the",
"child",
"map",
"of",
"a",
"simple",
"sequence",
"assessment",
"assessment",
"part"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/assessment_utilities.py#L345-L364 |
mitsei/dlkit | dlkit/json_/assessment/assessment_utilities.py | remove_from_parent_sequence_map | def remove_from_parent_sequence_map(assessment_part_admin_session, assessment_part_id):
"""Updates the child map of a simple sequence assessment assessment part to remove child part"""
apls = get_assessment_part_lookup_session(runtime=assessment_part_admin_session._runtime,
... | python | def remove_from_parent_sequence_map(assessment_part_admin_session, assessment_part_id):
"""Updates the child map of a simple sequence assessment assessment part to remove child part"""
apls = get_assessment_part_lookup_session(runtime=assessment_part_admin_session._runtime,
... | [
"def",
"remove_from_parent_sequence_map",
"(",
"assessment_part_admin_session",
",",
"assessment_part_id",
")",
":",
"apls",
"=",
"get_assessment_part_lookup_session",
"(",
"runtime",
"=",
"assessment_part_admin_session",
".",
"_runtime",
",",
"proxy",
"=",
"assessment_part_a... | Updates the child map of a simple sequence assessment assessment part to remove child part | [
"Updates",
"the",
"child",
"map",
"of",
"a",
"simple",
"sequence",
"assessment",
"assessment",
"part",
"to",
"remove",
"child",
"part"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/assessment_utilities.py#L367-L374 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_primary_expr_no_brace_1 | def p_primary_expr_no_brace_1(self, p):
"""primary_expr_no_brace : identifier"""
p[1]._mangle_candidate = True
p[1]._in_expression = True
p[0] = p[1] | python | def p_primary_expr_no_brace_1(self, p):
"""primary_expr_no_brace : identifier"""
p[1]._mangle_candidate = True
p[1]._in_expression = True
p[0] = p[1] | [
"def",
"p_primary_expr_no_brace_1",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"1",
"]",
".",
"_mangle_candidate",
"=",
"True",
"p",
"[",
"1",
"]",
".",
"_in_expression",
"=",
"True",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]"
] | primary_expr_no_brace : identifier | [
"primary_expr_no_brace",
":",
"identifier"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L226-L230 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_array_literal_2 | def p_array_literal_2(self, p):
"""array_literal : LBRACKET element_list RBRACKET
| LBRACKET element_list COMMA elision_opt RBRACKET
"""
items = p[2]
if len(p) == 6:
items.extend(p[4])
p[0] = ast.Array(items=items) | python | def p_array_literal_2(self, p):
"""array_literal : LBRACKET element_list RBRACKET
| LBRACKET element_list COMMA elision_opt RBRACKET
"""
items = p[2]
if len(p) == 6:
items.extend(p[4])
p[0] = ast.Array(items=items) | [
"def",
"p_array_literal_2",
"(",
"self",
",",
"p",
")",
":",
"items",
"=",
"p",
"[",
"2",
"]",
"if",
"len",
"(",
"p",
")",
"==",
"6",
":",
"items",
".",
"extend",
"(",
"p",
"[",
"4",
"]",
")",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Array",
... | array_literal : LBRACKET element_list RBRACKET
| LBRACKET element_list COMMA elision_opt RBRACKET | [
"array_literal",
":",
"LBRACKET",
"element_list",
"RBRACKET",
"|",
"LBRACKET",
"element_list",
"COMMA",
"elision_opt",
"RBRACKET"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L251-L258 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_elision | def p_elision(self, p):
"""elision : COMMA
| elision COMMA
"""
if len(p) == 2:
p[0] = [ast.Elision(p[1])]
else:
p[1].append(ast.Elision(p[2]))
p[0] = p[1] | python | def p_elision(self, p):
"""elision : COMMA
| elision COMMA
"""
if len(p) == 2:
p[0] = [ast.Elision(p[1])]
else:
p[1].append(ast.Elision(p[2]))
p[0] = p[1] | [
"def",
"p_elision",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"[",
"ast",
".",
"Elision",
"(",
"p",
"[",
"1",
"]",
")",
"]",
"else",
":",
"p",
"[",
"1",
"]",
".",
"append",
"("... | elision : COMMA
| elision COMMA | [
"elision",
":",
"COMMA",
"|",
"elision",
"COMMA"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L280-L288 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_object_literal | def p_object_literal(self, p):
"""object_literal : LBRACE RBRACE
| LBRACE property_list RBRACE
| LBRACE property_list COMMA RBRACE
"""
if len(p) == 3:
p[0] = ast.Object()
else:
p[0] = ast.Object(properties=p[2]) | python | def p_object_literal(self, p):
"""object_literal : LBRACE RBRACE
| LBRACE property_list RBRACE
| LBRACE property_list COMMA RBRACE
"""
if len(p) == 3:
p[0] = ast.Object()
else:
p[0] = ast.Object(properties=p[2]) | [
"def",
"p_object_literal",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"3",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Object",
"(",
")",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Object",
"(",
"properties",
... | object_literal : LBRACE RBRACE
| LBRACE property_list RBRACE
| LBRACE property_list COMMA RBRACE | [
"object_literal",
":",
"LBRACE",
"RBRACE",
"|",
"LBRACE",
"property_list",
"RBRACE",
"|",
"LBRACE",
"property_list",
"COMMA",
"RBRACE"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L290-L298 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_property_assignment | def p_property_assignment(self, p):
"""property_assignment \
: property_name COLON assignment_expr
| GETPROP property_name LPAREN RPAREN LBRACE function_body RBRACE
| SETPROP property_name LPAREN formal_parameter_list RPAREN \
LBRACE function_body RBRACE... | python | def p_property_assignment(self, p):
"""property_assignment \
: property_name COLON assignment_expr
| GETPROP property_name LPAREN RPAREN LBRACE function_body RBRACE
| SETPROP property_name LPAREN formal_parameter_list RPAREN \
LBRACE function_body RBRACE... | [
"def",
"p_property_assignment",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"4",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Assign",
"(",
"left",
"=",
"p",
"[",
"1",
"]",
",",
"op",
"=",
"p",
"[",
"2",
"]",
",",
"ri... | property_assignment \
: property_name COLON assignment_expr
| GETPROP property_name LPAREN RPAREN LBRACE function_body RBRACE
| SETPROP property_name LPAREN formal_parameter_list RPAREN \
LBRACE function_body RBRACE | [
"property_assignment",
"\\",
":",
"property_name",
"COLON",
"assignment_expr",
"|",
"GETPROP",
"property_name",
"LPAREN",
"RPAREN",
"LBRACE",
"function_body",
"RBRACE",
"|",
"SETPROP",
"property_name",
"LPAREN",
"formal_parameter_list",
"RPAREN",
"\\",
"LBRACE",
"function... | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L311-L324 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_member_expr | def p_member_expr(self, p):
"""member_expr : primary_expr
| function_expr
| member_expr LBRACKET expr RBRACKET
| member_expr PERIOD identifier
| NEW member_expr arguments
"""
if len(p) == 2:
p... | python | def p_member_expr(self, p):
"""member_expr : primary_expr
| function_expr
| member_expr LBRACKET expr RBRACKET
| member_expr PERIOD identifier
| NEW member_expr arguments
"""
if len(p) == 2:
p... | [
"def",
"p_member_expr",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"elif",
"p",
"[",
"1",
"]",
"==",
"'new'",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"NewE... | member_expr : primary_expr
| function_expr
| member_expr LBRACKET expr RBRACKET
| member_expr PERIOD identifier
| NEW member_expr arguments | [
"member_expr",
":",
"primary_expr",
"|",
"function_expr",
"|",
"member_expr",
"LBRACKET",
"expr",
"RBRACKET",
"|",
"member_expr",
"PERIOD",
"identifier",
"|",
"NEW",
"member_expr",
"arguments"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L334-L348 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_member_expr_nobf | def p_member_expr_nobf(self, p):
"""member_expr_nobf : primary_expr_no_brace
| function_expr
| member_expr_nobf LBRACKET expr RBRACKET
| member_expr_nobf PERIOD identifier
| NEW member_expr arguments
... | python | def p_member_expr_nobf(self, p):
"""member_expr_nobf : primary_expr_no_brace
| function_expr
| member_expr_nobf LBRACKET expr RBRACKET
| member_expr_nobf PERIOD identifier
| NEW member_expr arguments
... | [
"def",
"p_member_expr_nobf",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"elif",
"p",
"[",
"1",
"]",
"==",
"'new'",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
... | member_expr_nobf : primary_expr_no_brace
| function_expr
| member_expr_nobf LBRACKET expr RBRACKET
| member_expr_nobf PERIOD identifier
| NEW member_expr arguments | [
"member_expr_nobf",
":",
"primary_expr_no_brace",
"|",
"function_expr",
"|",
"member_expr_nobf",
"LBRACKET",
"expr",
"RBRACKET",
"|",
"member_expr_nobf",
"PERIOD",
"identifier",
"|",
"NEW",
"member_expr",
"arguments"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L350-L364 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_new_expr | def p_new_expr(self, p):
"""new_expr : member_expr
| NEW new_expr
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.NewExpr(p[2]) | python | def p_new_expr(self, p):
"""new_expr : member_expr
| NEW new_expr
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.NewExpr(p[2]) | [
"def",
"p_new_expr",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"NewExpr",
"(",
"p",
"[",
"2",
"]",
")"
] | new_expr : member_expr
| NEW new_expr | [
"new_expr",
":",
"member_expr",
"|",
"NEW",
"new_expr"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L366-L373 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_new_expr_nobf | def p_new_expr_nobf(self, p):
"""new_expr_nobf : member_expr_nobf
| NEW new_expr
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.NewExpr(p[2]) | python | def p_new_expr_nobf(self, p):
"""new_expr_nobf : member_expr_nobf
| NEW new_expr
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.NewExpr(p[2]) | [
"def",
"p_new_expr_nobf",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"NewExpr",
"(",
"p",
"[",
"2",
"]",
")... | new_expr_nobf : member_expr_nobf
| NEW new_expr | [
"new_expr_nobf",
":",
"member_expr_nobf",
"|",
"NEW",
"new_expr"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L375-L382 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_call_expr | def p_call_expr(self, p):
"""call_expr : member_expr arguments
| call_expr arguments
| call_expr LBRACKET expr RBRACKET
| call_expr PERIOD identifier
"""
if len(p) == 3:
p[0] = ast.FunctionCall(p[1], p[2])
elif le... | python | def p_call_expr(self, p):
"""call_expr : member_expr arguments
| call_expr arguments
| call_expr LBRACKET expr RBRACKET
| call_expr PERIOD identifier
"""
if len(p) == 3:
p[0] = ast.FunctionCall(p[1], p[2])
elif le... | [
"def",
"p_call_expr",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"3",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"FunctionCall",
"(",
"p",
"[",
"1",
"]",
",",
"p",
"[",
"2",
"]",
")",
"elif",
"len",
"(",
"p",
")",
... | call_expr : member_expr arguments
| call_expr arguments
| call_expr LBRACKET expr RBRACKET
| call_expr PERIOD identifier | [
"call_expr",
":",
"member_expr",
"arguments",
"|",
"call_expr",
"arguments",
"|",
"call_expr",
"LBRACKET",
"expr",
"RBRACKET",
"|",
"call_expr",
"PERIOD",
"identifier"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L384-L395 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_call_expr_nobf | def p_call_expr_nobf(self, p):
"""call_expr_nobf : member_expr_nobf arguments
| call_expr_nobf arguments
| call_expr_nobf LBRACKET expr RBRACKET
| call_expr_nobf PERIOD identifier
"""
if len(p) == 3:
p[0] =... | python | def p_call_expr_nobf(self, p):
"""call_expr_nobf : member_expr_nobf arguments
| call_expr_nobf arguments
| call_expr_nobf LBRACKET expr RBRACKET
| call_expr_nobf PERIOD identifier
"""
if len(p) == 3:
p[0] =... | [
"def",
"p_call_expr_nobf",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"3",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"FunctionCall",
"(",
"p",
"[",
"1",
"]",
",",
"p",
"[",
"2",
"]",
")",
"elif",
"len",
"(",
"p",
"... | call_expr_nobf : member_expr_nobf arguments
| call_expr_nobf arguments
| call_expr_nobf LBRACKET expr RBRACKET
| call_expr_nobf PERIOD identifier | [
"call_expr_nobf",
":",
"member_expr_nobf",
"arguments",
"|",
"call_expr_nobf",
"arguments",
"|",
"call_expr_nobf",
"LBRACKET",
"expr",
"RBRACKET",
"|",
"call_expr_nobf",
"PERIOD",
"identifier"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L397-L408 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_postfix_expr | def p_postfix_expr(self, p):
"""postfix_expr : left_hand_side_expr
| left_hand_side_expr PLUSPLUS
| left_hand_side_expr MINUSMINUS
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.UnaryOp(op=p[2], value=p[1], postfix... | python | def p_postfix_expr(self, p):
"""postfix_expr : left_hand_side_expr
| left_hand_side_expr PLUSPLUS
| left_hand_side_expr MINUSMINUS
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.UnaryOp(op=p[2], value=p[1], postfix... | [
"def",
"p_postfix_expr",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"UnaryOp",
"(",
"op",
"=",
"p",
"[",
"2... | postfix_expr : left_hand_side_expr
| left_hand_side_expr PLUSPLUS
| left_hand_side_expr MINUSMINUS | [
"postfix_expr",
":",
"left_hand_side_expr",
"|",
"left_hand_side_expr",
"PLUSPLUS",
"|",
"left_hand_side_expr",
"MINUSMINUS"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L440-L448 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_multiplicative_expr | def p_multiplicative_expr(self, p):
"""multiplicative_expr : unary_expr
| multiplicative_expr MULT unary_expr
| multiplicative_expr DIV unary_expr
| multiplicative_expr MOD unary_expr
"""
if len(p) == 2:... | python | def p_multiplicative_expr(self, p):
"""multiplicative_expr : unary_expr
| multiplicative_expr MULT unary_expr
| multiplicative_expr DIV unary_expr
| multiplicative_expr MOD unary_expr
"""
if len(p) == 2:... | [
"def",
"p_multiplicative_expr",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"BinOp",
"(",
"op",
"=",
"p",
"[",... | multiplicative_expr : unary_expr
| multiplicative_expr MULT unary_expr
| multiplicative_expr DIV unary_expr
| multiplicative_expr MOD unary_expr | [
"multiplicative_expr",
":",
"unary_expr",
"|",
"multiplicative_expr",
"MULT",
"unary_expr",
"|",
"multiplicative_expr",
"DIV",
"unary_expr",
"|",
"multiplicative_expr",
"MOD",
"unary_expr"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L487-L496 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_conditional_expr | def p_conditional_expr(self, p):
"""
conditional_expr \
: logical_or_expr
| logical_or_expr CONDOP assignment_expr COLON assignment_expr
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.Conditional(
predicate=p[1], c... | python | def p_conditional_expr(self, p):
"""
conditional_expr \
: logical_or_expr
| logical_or_expr CONDOP assignment_expr COLON assignment_expr
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.Conditional(
predicate=p[1], c... | [
"def",
"p_conditional_expr",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Conditional",
"(",
"predicate",
"=",
"... | conditional_expr \
: logical_or_expr
| logical_or_expr CONDOP assignment_expr COLON assignment_expr | [
"conditional_expr",
"\\",
":",
"logical_or_expr",
"|",
"logical_or_expr",
"CONDOP",
"assignment_expr",
"COLON",
"assignment_expr"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L783-L793 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_assignment_expr | def p_assignment_expr(self, p):
"""
assignment_expr \
: conditional_expr
| left_hand_side_expr assignment_operator assignment_expr
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.Assign(left=p[1], op=p[2], right=p[3]) | python | def p_assignment_expr(self, p):
"""
assignment_expr \
: conditional_expr
| left_hand_side_expr assignment_operator assignment_expr
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.Assign(left=p[1], op=p[2], right=p[3]) | [
"def",
"p_assignment_expr",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Assign",
"(",
"left",
"=",
"p",
"[",
... | assignment_expr \
: conditional_expr
| left_hand_side_expr assignment_operator assignment_expr | [
"assignment_expr",
"\\",
":",
"conditional_expr",
"|",
"left_hand_side_expr",
"assignment_operator",
"assignment_expr"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L821-L830 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_expr | def p_expr(self, p):
"""expr : assignment_expr
| expr COMMA assignment_expr
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.Comma(left=p[1], right=p[3]) | python | def p_expr(self, p):
"""expr : assignment_expr
| expr COMMA assignment_expr
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.Comma(left=p[1], right=p[3]) | [
"def",
"p_expr",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Comma",
"(",
"left",
"=",
"p",
"[",
"1",
"]"... | expr : assignment_expr
| expr COMMA assignment_expr | [
"expr",
":",
"assignment_expr",
"|",
"expr",
"COMMA",
"assignment_expr"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L871-L878 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_expr_noin | def p_expr_noin(self, p):
"""expr_noin : assignment_expr_noin
| expr_noin COMMA assignment_expr_noin
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.Comma(left=p[1], right=p[3]) | python | def p_expr_noin(self, p):
"""expr_noin : assignment_expr_noin
| expr_noin COMMA assignment_expr_noin
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.Comma(left=p[1], right=p[3]) | [
"def",
"p_expr_noin",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Comma",
"(",
"left",
"=",
"p",
"[",
"1",
... | expr_noin : assignment_expr_noin
| expr_noin COMMA assignment_expr_noin | [
"expr_noin",
":",
"assignment_expr_noin",
"|",
"expr_noin",
"COMMA",
"assignment_expr_noin"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L880-L887 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_expr_nobf | def p_expr_nobf(self, p):
"""expr_nobf : assignment_expr_nobf
| expr_nobf COMMA assignment_expr
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.Comma(left=p[1], right=p[3]) | python | def p_expr_nobf(self, p):
"""expr_nobf : assignment_expr_nobf
| expr_nobf COMMA assignment_expr
"""
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ast.Comma(left=p[1], right=p[3]) | [
"def",
"p_expr_nobf",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Comma",
"(",
"left",
"=",
"p",
"[",
"1",
... | expr_nobf : assignment_expr_nobf
| expr_nobf COMMA assignment_expr | [
"expr_nobf",
":",
"assignment_expr_nobf",
"|",
"expr_nobf",
"COMMA",
"assignment_expr"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L889-L896 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_variable_declaration | def p_variable_declaration(self, p):
"""variable_declaration : identifier
| identifier initializer
"""
if len(p) == 2:
p[0] = ast.VarDecl(p[1])
else:
p[0] = ast.VarDecl(p[1], p[2]) | python | def p_variable_declaration(self, p):
"""variable_declaration : identifier
| identifier initializer
"""
if len(p) == 2:
p[0] = ast.VarDecl(p[1])
else:
p[0] = ast.VarDecl(p[1], p[2]) | [
"def",
"p_variable_declaration",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"VarDecl",
"(",
"p",
"[",
"1",
"]",
")",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
... | variable_declaration : identifier
| identifier initializer | [
"variable_declaration",
":",
"identifier",
"|",
"identifier",
"initializer"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L929-L936 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_variable_declaration_noin | def p_variable_declaration_noin(self, p):
"""variable_declaration_noin : identifier
| identifier initializer_noin
"""
if len(p) == 2:
p[0] = ast.VarDecl(p[1])
else:
p[0] = ast.VarDecl(p[1], p[2]) | python | def p_variable_declaration_noin(self, p):
"""variable_declaration_noin : identifier
| identifier initializer_noin
"""
if len(p) == 2:
p[0] = ast.VarDecl(p[1])
else:
p[0] = ast.VarDecl(p[1], p[2]) | [
"def",
"p_variable_declaration_noin",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"VarDecl",
"(",
"p",
"[",
"1",
"]",
")",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".... | variable_declaration_noin : identifier
| identifier initializer_noin | [
"variable_declaration_noin",
":",
"identifier",
"|",
"identifier",
"initializer_noin"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L938-L945 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_if_statement_1 | def p_if_statement_1(self, p):
"""if_statement : IF LPAREN expr RPAREN statement"""
p[0] = ast.If(predicate=p[3], consequent=p[5]) | python | def p_if_statement_1(self, p):
"""if_statement : IF LPAREN expr RPAREN statement"""
p[0] = ast.If(predicate=p[3], consequent=p[5]) | [
"def",
"p_if_statement_1",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"If",
"(",
"predicate",
"=",
"p",
"[",
"3",
"]",
",",
"consequent",
"=",
"p",
"[",
"5",
"]",
")"
] | if_statement : IF LPAREN expr RPAREN statement | [
"if_statement",
":",
"IF",
"LPAREN",
"expr",
"RPAREN",
"statement"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L968-L970 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_if_statement_2 | def p_if_statement_2(self, p):
"""if_statement : IF LPAREN expr RPAREN statement ELSE statement"""
p[0] = ast.If(predicate=p[3], consequent=p[5], alternative=p[7]) | python | def p_if_statement_2(self, p):
"""if_statement : IF LPAREN expr RPAREN statement ELSE statement"""
p[0] = ast.If(predicate=p[3], consequent=p[5], alternative=p[7]) | [
"def",
"p_if_statement_2",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"If",
"(",
"predicate",
"=",
"p",
"[",
"3",
"]",
",",
"consequent",
"=",
"p",
"[",
"5",
"]",
",",
"alternative",
"=",
"p",
"[",
"7",
"]",
")"
] | if_statement : IF LPAREN expr RPAREN statement ELSE statement | [
"if_statement",
":",
"IF",
"LPAREN",
"expr",
"RPAREN",
"statement",
"ELSE",
"statement"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L972-L974 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_iteration_statement_1 | def p_iteration_statement_1(self, p):
"""
iteration_statement \
: DO statement WHILE LPAREN expr RPAREN SEMI
| DO statement WHILE LPAREN expr RPAREN auto_semi
"""
p[0] = ast.DoWhile(predicate=p[5], statement=p[2]) | python | def p_iteration_statement_1(self, p):
"""
iteration_statement \
: DO statement WHILE LPAREN expr RPAREN SEMI
| DO statement WHILE LPAREN expr RPAREN auto_semi
"""
p[0] = ast.DoWhile(predicate=p[5], statement=p[2]) | [
"def",
"p_iteration_statement_1",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"DoWhile",
"(",
"predicate",
"=",
"p",
"[",
"5",
"]",
",",
"statement",
"=",
"p",
"[",
"2",
"]",
")"
] | iteration_statement \
: DO statement WHILE LPAREN expr RPAREN SEMI
| DO statement WHILE LPAREN expr RPAREN auto_semi | [
"iteration_statement",
"\\",
":",
"DO",
"statement",
"WHILE",
"LPAREN",
"expr",
"RPAREN",
"SEMI",
"|",
"DO",
"statement",
"WHILE",
"LPAREN",
"expr",
"RPAREN",
"auto_semi"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L977-L983 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_iteration_statement_2 | def p_iteration_statement_2(self, p):
"""iteration_statement : WHILE LPAREN expr RPAREN statement"""
p[0] = ast.While(predicate=p[3], statement=p[5]) | python | def p_iteration_statement_2(self, p):
"""iteration_statement : WHILE LPAREN expr RPAREN statement"""
p[0] = ast.While(predicate=p[3], statement=p[5]) | [
"def",
"p_iteration_statement_2",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"While",
"(",
"predicate",
"=",
"p",
"[",
"3",
"]",
",",
"statement",
"=",
"p",
"[",
"5",
"]",
")"
] | iteration_statement : WHILE LPAREN expr RPAREN statement | [
"iteration_statement",
":",
"WHILE",
"LPAREN",
"expr",
"RPAREN",
"statement"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L985-L987 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_iteration_statement_3 | def p_iteration_statement_3(self, p):
"""
iteration_statement \
: FOR LPAREN expr_noin_opt SEMI expr_opt SEMI expr_opt RPAREN \
statement
| FOR LPAREN VAR variable_declaration_list_noin SEMI expr_opt SEMI\
expr_opt RPAREN statement
"""
... | python | def p_iteration_statement_3(self, p):
"""
iteration_statement \
: FOR LPAREN expr_noin_opt SEMI expr_opt SEMI expr_opt RPAREN \
statement
| FOR LPAREN VAR variable_declaration_list_noin SEMI expr_opt SEMI\
expr_opt RPAREN statement
"""
... | [
"def",
"p_iteration_statement_3",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"10",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"For",
"(",
"init",
"=",
"p",
"[",
"3",
"]",
",",
"cond",
"=",
"p",
"[",
"5",
"]",
",",
"... | iteration_statement \
: FOR LPAREN expr_noin_opt SEMI expr_opt SEMI expr_opt RPAREN \
statement
| FOR LPAREN VAR variable_declaration_list_noin SEMI expr_opt SEMI\
expr_opt RPAREN statement | [
"iteration_statement",
"\\",
":",
"FOR",
"LPAREN",
"expr_noin_opt",
"SEMI",
"expr_opt",
"SEMI",
"expr_opt",
"RPAREN",
"\\",
"statement",
"|",
"FOR",
"LPAREN",
"VAR",
"variable_declaration_list_noin",
"SEMI",
"expr_opt",
"SEMI",
"\\",
"expr_opt",
"RPAREN",
"statement"
... | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L989-L1001 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_iteration_statement_4 | def p_iteration_statement_4(self, p):
"""
iteration_statement \
: FOR LPAREN left_hand_side_expr IN expr RPAREN statement
"""
p[0] = ast.ForIn(item=p[3], iterable=p[5], statement=p[7]) | python | def p_iteration_statement_4(self, p):
"""
iteration_statement \
: FOR LPAREN left_hand_side_expr IN expr RPAREN statement
"""
p[0] = ast.ForIn(item=p[3], iterable=p[5], statement=p[7]) | [
"def",
"p_iteration_statement_4",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"ForIn",
"(",
"item",
"=",
"p",
"[",
"3",
"]",
",",
"iterable",
"=",
"p",
"[",
"5",
"]",
",",
"statement",
"=",
"p",
"[",
"7",
"]",
")"
] | iteration_statement \
: FOR LPAREN left_hand_side_expr IN expr RPAREN statement | [
"iteration_statement",
"\\",
":",
"FOR",
"LPAREN",
"left_hand_side_expr",
"IN",
"expr",
"RPAREN",
"statement"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1003-L1008 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_iteration_statement_5 | def p_iteration_statement_5(self, p):
"""
iteration_statement : \
FOR LPAREN VAR identifier IN expr RPAREN statement
"""
p[0] = ast.ForIn(item=ast.VarDecl(p[4]), iterable=p[6], statement=p[8]) | python | def p_iteration_statement_5(self, p):
"""
iteration_statement : \
FOR LPAREN VAR identifier IN expr RPAREN statement
"""
p[0] = ast.ForIn(item=ast.VarDecl(p[4]), iterable=p[6], statement=p[8]) | [
"def",
"p_iteration_statement_5",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"ForIn",
"(",
"item",
"=",
"ast",
".",
"VarDecl",
"(",
"p",
"[",
"4",
"]",
")",
",",
"iterable",
"=",
"p",
"[",
"6",
"]",
",",
"statement",
... | iteration_statement : \
FOR LPAREN VAR identifier IN expr RPAREN statement | [
"iteration_statement",
":",
"\\",
"FOR",
"LPAREN",
"VAR",
"identifier",
"IN",
"expr",
"RPAREN",
"statement"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1010-L1015 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_iteration_statement_6 | def p_iteration_statement_6(self, p):
"""
iteration_statement \
: FOR LPAREN VAR identifier initializer_noin IN expr RPAREN statement
"""
p[0] = ast.ForIn(item=ast.VarDecl(identifier=p[4], initializer=p[5]),
iterable=p[7], statement=p[9]) | python | def p_iteration_statement_6(self, p):
"""
iteration_statement \
: FOR LPAREN VAR identifier initializer_noin IN expr RPAREN statement
"""
p[0] = ast.ForIn(item=ast.VarDecl(identifier=p[4], initializer=p[5]),
iterable=p[7], statement=p[9]) | [
"def",
"p_iteration_statement_6",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"ForIn",
"(",
"item",
"=",
"ast",
".",
"VarDecl",
"(",
"identifier",
"=",
"p",
"[",
"4",
"]",
",",
"initializer",
"=",
"p",
"[",
"5",
"]",
"... | iteration_statement \
: FOR LPAREN VAR identifier initializer_noin IN expr RPAREN statement | [
"iteration_statement",
"\\",
":",
"FOR",
"LPAREN",
"VAR",
"identifier",
"initializer_noin",
"IN",
"expr",
"RPAREN",
"statement"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1017-L1023 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_with_statement | def p_with_statement(self, p):
"""with_statement : WITH LPAREN expr RPAREN statement"""
p[0] = ast.With(expr=p[3], statement=p[5]) | python | def p_with_statement(self, p):
"""with_statement : WITH LPAREN expr RPAREN statement"""
p[0] = ast.With(expr=p[3], statement=p[5]) | [
"def",
"p_with_statement",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"With",
"(",
"expr",
"=",
"p",
"[",
"3",
"]",
",",
"statement",
"=",
"p",
"[",
"5",
"]",
")"
] | with_statement : WITH LPAREN expr RPAREN statement | [
"with_statement",
":",
"WITH",
"LPAREN",
"expr",
"RPAREN",
"statement"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1078-L1080 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_switch_statement | def p_switch_statement(self, p):
"""switch_statement : SWITCH LPAREN expr RPAREN case_block"""
cases = []
default = None
# iterate over return values from case_block
for item in p[5]:
if isinstance(item, ast.Default):
default = item
elif is... | python | def p_switch_statement(self, p):
"""switch_statement : SWITCH LPAREN expr RPAREN case_block"""
cases = []
default = None
# iterate over return values from case_block
for item in p[5]:
if isinstance(item, ast.Default):
default = item
elif is... | [
"def",
"p_switch_statement",
"(",
"self",
",",
"p",
")",
":",
"cases",
"=",
"[",
"]",
"default",
"=",
"None",
"# iterate over return values from case_block",
"for",
"item",
"in",
"p",
"[",
"5",
"]",
":",
"if",
"isinstance",
"(",
"item",
",",
"ast",
".",
... | switch_statement : SWITCH LPAREN expr RPAREN case_block | [
"switch_statement",
":",
"SWITCH",
"LPAREN",
"expr",
"RPAREN",
"case_block"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1083-L1094 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_case_clause | def p_case_clause(self, p):
"""case_clause : CASE expr COLON source_elements"""
p[0] = ast.Case(expr=p[2], elements=p[4]) | python | def p_case_clause(self, p):
"""case_clause : CASE expr COLON source_elements"""
p[0] = ast.Case(expr=p[2], elements=p[4]) | [
"def",
"p_case_clause",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Case",
"(",
"expr",
"=",
"p",
"[",
"2",
"]",
",",
"elements",
"=",
"p",
"[",
"4",
"]",
")"
] | case_clause : CASE expr COLON source_elements | [
"case_clause",
":",
"CASE",
"expr",
"COLON",
"source_elements"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1120-L1122 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_labelled_statement | def p_labelled_statement(self, p):
"""labelled_statement : identifier COLON statement"""
p[0] = ast.Label(identifier=p[1], statement=p[3]) | python | def p_labelled_statement(self, p):
"""labelled_statement : identifier COLON statement"""
p[0] = ast.Label(identifier=p[1], statement=p[3]) | [
"def",
"p_labelled_statement",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Label",
"(",
"identifier",
"=",
"p",
"[",
"1",
"]",
",",
"statement",
"=",
"p",
"[",
"3",
"]",
")"
] | labelled_statement : identifier COLON statement | [
"labelled_statement",
":",
"identifier",
"COLON",
"statement"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1129-L1131 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_try_statement_1 | def p_try_statement_1(self, p):
"""try_statement : TRY block catch"""
p[0] = ast.Try(statements=p[2], catch=p[3]) | python | def p_try_statement_1(self, p):
"""try_statement : TRY block catch"""
p[0] = ast.Try(statements=p[2], catch=p[3]) | [
"def",
"p_try_statement_1",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Try",
"(",
"statements",
"=",
"p",
"[",
"2",
"]",
",",
"catch",
"=",
"p",
"[",
"3",
"]",
")"
] | try_statement : TRY block catch | [
"try_statement",
":",
"TRY",
"block",
"catch"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1141-L1143 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_try_statement_2 | def p_try_statement_2(self, p):
"""try_statement : TRY block finally"""
p[0] = ast.Try(statements=p[2], fin=p[3]) | python | def p_try_statement_2(self, p):
"""try_statement : TRY block finally"""
p[0] = ast.Try(statements=p[2], fin=p[3]) | [
"def",
"p_try_statement_2",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Try",
"(",
"statements",
"=",
"p",
"[",
"2",
"]",
",",
"fin",
"=",
"p",
"[",
"3",
"]",
")"
] | try_statement : TRY block finally | [
"try_statement",
":",
"TRY",
"block",
"finally"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1145-L1147 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_try_statement_3 | def p_try_statement_3(self, p):
"""try_statement : TRY block catch finally"""
p[0] = ast.Try(statements=p[2], catch=p[3], fin=p[4]) | python | def p_try_statement_3(self, p):
"""try_statement : TRY block catch finally"""
p[0] = ast.Try(statements=p[2], catch=p[3], fin=p[4]) | [
"def",
"p_try_statement_3",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Try",
"(",
"statements",
"=",
"p",
"[",
"2",
"]",
",",
"catch",
"=",
"p",
"[",
"3",
"]",
",",
"fin",
"=",
"p",
"[",
"4",
"]",
")"
] | try_statement : TRY block catch finally | [
"try_statement",
":",
"TRY",
"block",
"catch",
"finally"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1149-L1151 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_catch | def p_catch(self, p):
"""catch : CATCH LPAREN identifier RPAREN block"""
p[0] = ast.Catch(identifier=p[3], elements=p[5]) | python | def p_catch(self, p):
"""catch : CATCH LPAREN identifier RPAREN block"""
p[0] = ast.Catch(identifier=p[3], elements=p[5]) | [
"def",
"p_catch",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Catch",
"(",
"identifier",
"=",
"p",
"[",
"3",
"]",
",",
"elements",
"=",
"p",
"[",
"5",
"]",
")"
] | catch : CATCH LPAREN identifier RPAREN block | [
"catch",
":",
"CATCH",
"LPAREN",
"identifier",
"RPAREN",
"block"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1153-L1155 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_function_declaration | def p_function_declaration(self, p):
"""
function_declaration \
: FUNCTION identifier LPAREN RPAREN LBRACE function_body RBRACE
| FUNCTION identifier LPAREN formal_parameter_list RPAREN LBRACE \
function_body RBRACE
"""
if len(p) == 8:
... | python | def p_function_declaration(self, p):
"""
function_declaration \
: FUNCTION identifier LPAREN RPAREN LBRACE function_body RBRACE
| FUNCTION identifier LPAREN formal_parameter_list RPAREN LBRACE \
function_body RBRACE
"""
if len(p) == 8:
... | [
"def",
"p_function_declaration",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"8",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"FuncDecl",
"(",
"identifier",
"=",
"p",
"[",
"2",
"]",
",",
"parameters",
"=",
"None",
",",
"ele... | function_declaration \
: FUNCTION identifier LPAREN RPAREN LBRACE function_body RBRACE
| FUNCTION identifier LPAREN formal_parameter_list RPAREN LBRACE \
function_body RBRACE | [
"function_declaration",
"\\",
":",
"FUNCTION",
"identifier",
"LPAREN",
"RPAREN",
"LBRACE",
"function_body",
"RBRACE",
"|",
"FUNCTION",
"identifier",
"LPAREN",
"formal_parameter_list",
"RPAREN",
"LBRACE",
"\\",
"function_body",
"RBRACE"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1169-L1181 |
mdiener/grace | grace/py27/slimit/parser.py | Parser.p_function_expr_1 | def p_function_expr_1(self, p):
"""
function_expr \
: FUNCTION LPAREN RPAREN LBRACE function_body RBRACE
| FUNCTION LPAREN formal_parameter_list RPAREN \
LBRACE function_body RBRACE
"""
if len(p) == 7:
p[0] = ast.FuncExpr(
... | python | def p_function_expr_1(self, p):
"""
function_expr \
: FUNCTION LPAREN RPAREN LBRACE function_body RBRACE
| FUNCTION LPAREN formal_parameter_list RPAREN \
LBRACE function_body RBRACE
"""
if len(p) == 7:
p[0] = ast.FuncExpr(
... | [
"def",
"p_function_expr_1",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"7",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"FuncExpr",
"(",
"identifier",
"=",
"None",
",",
"parameters",
"=",
"None",
",",
"elements",
"=",
"p",
... | function_expr \
: FUNCTION LPAREN RPAREN LBRACE function_body RBRACE
| FUNCTION LPAREN formal_parameter_list RPAREN \
LBRACE function_body RBRACE | [
"function_expr",
"\\",
":",
"FUNCTION",
"LPAREN",
"RPAREN",
"LBRACE",
"function_body",
"RBRACE",
"|",
"FUNCTION",
"LPAREN",
"formal_parameter_list",
"RPAREN",
"\\",
"LBRACE",
"function_body",
"RBRACE"
] | train | https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/parser.py#L1183-L1195 |
mitsei/dlkit | dlkit/authz_adapter/utilities.py | raise_null_argument | def raise_null_argument(func):
"""decorator, to intercept num argument TypeError and raise as NullArgument"""
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except TypeError as ex:
if any(statement in ex.args[0] for statement in ['takes exactly',
... | python | def raise_null_argument(func):
"""decorator, to intercept num argument TypeError and raise as NullArgument"""
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except TypeError as ex:
if any(statement in ex.args[0] for statement in ['takes exactly',
... | [
"def",
"raise_null_argument",
"(",
"func",
")",
":",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"return",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"except",
"TypeError",
"as",
"ex",
":",
"if",
... | decorator, to intercept num argument TypeError and raise as NullArgument | [
"decorator",
"to",
"intercept",
"num",
"argument",
"TypeError",
"and",
"raise",
"as",
"NullArgument"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/utilities.py#L26-L37 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/renderers/crab.py | list_provincie_adapter | def list_provincie_adapter(obj, request):
"""
Adapter for rendering a list of
:class:`crabpy.gateway.crab.Provincie` to json.
"""
return {
'niscode': obj.niscode,
'naam': obj.naam,
'gewest': {
'id': obj.gewest.id,
'naam': obj.gewest.naam
}
... | python | def list_provincie_adapter(obj, request):
"""
Adapter for rendering a list of
:class:`crabpy.gateway.crab.Provincie` to json.
"""
return {
'niscode': obj.niscode,
'naam': obj.naam,
'gewest': {
'id': obj.gewest.id,
'naam': obj.gewest.naam
}
... | [
"def",
"list_provincie_adapter",
"(",
"obj",
",",
"request",
")",
":",
"return",
"{",
"'niscode'",
":",
"obj",
".",
"niscode",
",",
"'naam'",
":",
"obj",
".",
"naam",
",",
"'gewest'",
":",
"{",
"'id'",
":",
"obj",
".",
"gewest",
".",
"id",
",",
"'naa... | Adapter for rendering a list of
:class:`crabpy.gateway.crab.Provincie` to json. | [
"Adapter",
"for",
"rendering",
"a",
"list",
"of",
":",
"class",
":",
"crabpy",
".",
"gateway",
".",
"crab",
".",
"Provincie",
"to",
"json",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/renderers/crab.py#L31-L43 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/renderers/crab.py | list_straten_adapter | def list_straten_adapter(obj, request):
"""
Adapter for rendering a list of
:class:`crabpy.gateway.crab.Straat` to json.
"""
return {
'id': obj.id,
'label': obj.label,
'status': {
'id': obj.status.id,
'naam': obj.status.naam,
'definitie': o... | python | def list_straten_adapter(obj, request):
"""
Adapter for rendering a list of
:class:`crabpy.gateway.crab.Straat` to json.
"""
return {
'id': obj.id,
'label': obj.label,
'status': {
'id': obj.status.id,
'naam': obj.status.naam,
'definitie': o... | [
"def",
"list_straten_adapter",
"(",
"obj",
",",
"request",
")",
":",
"return",
"{",
"'id'",
":",
"obj",
".",
"id",
",",
"'label'",
":",
"obj",
".",
"label",
",",
"'status'",
":",
"{",
"'id'",
":",
"obj",
".",
"status",
".",
"id",
",",
"'naam'",
":"... | Adapter for rendering a list of
:class:`crabpy.gateway.crab.Straat` to json. | [
"Adapter",
"for",
"rendering",
"a",
"list",
"of",
":",
"class",
":",
"crabpy",
".",
"gateway",
".",
"crab",
".",
"Straat",
"to",
"json",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/renderers/crab.py#L69-L82 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/renderers/crab.py | list_huisnummers_adapter | def list_huisnummers_adapter(obj, request):
"""
Adapter for rendering a list of
:class:`crabpy.gateway.crab.Huisnummer` to json.
"""
return {
'id': obj.id,
'status': {
'id': obj.status.id,
'naam': obj.status.naam,
'definitie': obj.status.definitie
... | python | def list_huisnummers_adapter(obj, request):
"""
Adapter for rendering a list of
:class:`crabpy.gateway.crab.Huisnummer` to json.
"""
return {
'id': obj.id,
'status': {
'id': obj.status.id,
'naam': obj.status.naam,
'definitie': obj.status.definitie
... | [
"def",
"list_huisnummers_adapter",
"(",
"obj",
",",
"request",
")",
":",
"return",
"{",
"'id'",
":",
"obj",
".",
"id",
",",
"'status'",
":",
"{",
"'id'",
":",
"obj",
".",
"status",
".",
"id",
",",
"'naam'",
":",
"obj",
".",
"status",
".",
"naam",
"... | Adapter for rendering a list of
:class:`crabpy.gateway.crab.Huisnummer` to json. | [
"Adapter",
"for",
"rendering",
"a",
"list",
"of",
":",
"class",
":",
"crabpy",
".",
"gateway",
".",
"crab",
".",
"Huisnummer",
"to",
"json",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/renderers/crab.py#L85-L98 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/renderers/crab.py | list_gebouwen_adapter | def list_gebouwen_adapter(obj, request):
"""
Adapter for rendering a list of
:class:`crabpy.gateway.crab.Gebouw` to json.
"""
return {
'id': obj.id,
'aard': {
'id': obj.aard.id,
'naam': obj.aard.naam,
'definitie': obj.aard.definitie
},
... | python | def list_gebouwen_adapter(obj, request):
"""
Adapter for rendering a list of
:class:`crabpy.gateway.crab.Gebouw` to json.
"""
return {
'id': obj.id,
'aard': {
'id': obj.aard.id,
'naam': obj.aard.naam,
'definitie': obj.aard.definitie
},
... | [
"def",
"list_gebouwen_adapter",
"(",
"obj",
",",
"request",
")",
":",
"return",
"{",
"'id'",
":",
"obj",
".",
"id",
",",
"'aard'",
":",
"{",
"'id'",
":",
"obj",
".",
"aard",
".",
"id",
",",
"'naam'",
":",
"obj",
".",
"aard",
".",
"naam",
",",
"'d... | Adapter for rendering a list of
:class:`crabpy.gateway.crab.Gebouw` to json. | [
"Adapter",
"for",
"rendering",
"a",
"list",
"of",
":",
"class",
":",
"crabpy",
".",
"gateway",
".",
"crab",
".",
"Gebouw",
"to",
"json",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/renderers/crab.py#L111-L128 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/renderers/crab.py | list_subadres_adapter | def list_subadres_adapter(obj, request):
"""
Adapter for rendering a list of
:class:`crabpy.gateway.crab.Subadres` to json.
"""
return {
'id': obj.id,
'subadres': obj.subadres,
'status': {
'id': obj.status.id,
'naam': obj.status.naam,
'defi... | python | def list_subadres_adapter(obj, request):
"""
Adapter for rendering a list of
:class:`crabpy.gateway.crab.Subadres` to json.
"""
return {
'id': obj.id,
'subadres': obj.subadres,
'status': {
'id': obj.status.id,
'naam': obj.status.naam,
'defi... | [
"def",
"list_subadres_adapter",
"(",
"obj",
",",
"request",
")",
":",
"return",
"{",
"'id'",
":",
"obj",
".",
"id",
",",
"'subadres'",
":",
"obj",
".",
"subadres",
",",
"'status'",
":",
"{",
"'id'",
":",
"obj",
".",
"status",
".",
"id",
",",
"'naam'"... | Adapter for rendering a list of
:class:`crabpy.gateway.crab.Subadres` to json. | [
"Adapter",
"for",
"rendering",
"a",
"list",
"of",
":",
"class",
":",
"crabpy",
".",
"gateway",
".",
"crab",
".",
"Subadres",
"to",
"json",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/renderers/crab.py#L131-L144 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/renderers/crab.py | list_adresposities_adapter | def list_adresposities_adapter(obj, request):
"""
Adapter for rendering a list of
:class:`crabpy.gateway.crab.Adrespositie` to json.
"""
return {
'id': obj.id,
'herkomst': {
'id': obj.herkomst.id,
'naam': obj.herkomst.naam,
'definitie': obj.herkoms... | python | def list_adresposities_adapter(obj, request):
"""
Adapter for rendering a list of
:class:`crabpy.gateway.crab.Adrespositie` to json.
"""
return {
'id': obj.id,
'herkomst': {
'id': obj.herkomst.id,
'naam': obj.herkomst.naam,
'definitie': obj.herkoms... | [
"def",
"list_adresposities_adapter",
"(",
"obj",
",",
"request",
")",
":",
"return",
"{",
"'id'",
":",
"obj",
".",
"id",
",",
"'herkomst'",
":",
"{",
"'id'",
":",
"obj",
".",
"herkomst",
".",
"id",
",",
"'naam'",
":",
"obj",
".",
"herkomst",
".",
"na... | Adapter for rendering a list of
:class:`crabpy.gateway.crab.Adrespositie` to json. | [
"Adapter",
"for",
"rendering",
"a",
"list",
"of",
":",
"class",
":",
"crabpy",
".",
"gateway",
".",
"crab",
".",
"Adrespositie",
"to",
"json",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/renderers/crab.py#L157-L169 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/renderers/crab.py | item_gewest_adapter | def item_gewest_adapter(obj, request):
"""
Adapter for rendering an object of
:class:`crabpy.gateway.crab.Gewest` to json.
"""
return {
'id': obj.id,
'namen': obj._namen,
'centroid': obj.centroid,
'bounding_box': obj.bounding_box
} | python | def item_gewest_adapter(obj, request):
"""
Adapter for rendering an object of
:class:`crabpy.gateway.crab.Gewest` to json.
"""
return {
'id': obj.id,
'namen': obj._namen,
'centroid': obj.centroid,
'bounding_box': obj.bounding_box
} | [
"def",
"item_gewest_adapter",
"(",
"obj",
",",
"request",
")",
":",
"return",
"{",
"'id'",
":",
"obj",
".",
"id",
",",
"'namen'",
":",
"obj",
".",
"_namen",
",",
"'centroid'",
":",
"obj",
".",
"centroid",
",",
"'bounding_box'",
":",
"obj",
".",
"boundi... | Adapter for rendering an object of
:class:`crabpy.gateway.crab.Gewest` to json. | [
"Adapter",
"for",
"rendering",
"an",
"object",
"of",
":",
"class",
":",
"crabpy",
".",
"gateway",
".",
"crab",
".",
"Gewest",
"to",
"json",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/renderers/crab.py#L196-L206 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/renderers/crab.py | item_provincie_adapter | def item_provincie_adapter(obj, request):
"""
Adapter for rendering a object of
:class:`crabpy.gateway.crab.Provincie` to json.
"""
return {
'niscode': obj.niscode,
'naam': obj.naam,
'gewest': {
'id': obj.gewest.id,
'naam': obj.gewest.naam
}
... | python | def item_provincie_adapter(obj, request):
"""
Adapter for rendering a object of
:class:`crabpy.gateway.crab.Provincie` to json.
"""
return {
'niscode': obj.niscode,
'naam': obj.naam,
'gewest': {
'id': obj.gewest.id,
'naam': obj.gewest.naam
}
... | [
"def",
"item_provincie_adapter",
"(",
"obj",
",",
"request",
")",
":",
"return",
"{",
"'niscode'",
":",
"obj",
".",
"niscode",
",",
"'naam'",
":",
"obj",
".",
"naam",
",",
"'gewest'",
":",
"{",
"'id'",
":",
"obj",
".",
"gewest",
".",
"id",
",",
"'naa... | Adapter for rendering a object of
:class:`crabpy.gateway.crab.Provincie` to json. | [
"Adapter",
"for",
"rendering",
"a",
"object",
"of",
":",
"class",
":",
"crabpy",
".",
"gateway",
".",
"crab",
".",
"Provincie",
"to",
"json",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/renderers/crab.py#L209-L221 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/renderers/crab.py | item_gemeente_adapter | def item_gemeente_adapter(obj, request):
"""
Adapter for rendering an object of
:class:`crabpy.gateway.crab.Gemeente` to json.
"""
return {
'id': obj.id,
'niscode': obj.niscode,
'naam': obj.naam,
'centroid': obj.centroid,
'bounding_box': obj.bounding_box,
... | python | def item_gemeente_adapter(obj, request):
"""
Adapter for rendering an object of
:class:`crabpy.gateway.crab.Gemeente` to json.
"""
return {
'id': obj.id,
'niscode': obj.niscode,
'naam': obj.naam,
'centroid': obj.centroid,
'bounding_box': obj.bounding_box,
... | [
"def",
"item_gemeente_adapter",
"(",
"obj",
",",
"request",
")",
":",
"return",
"{",
"'id'",
":",
"obj",
".",
"id",
",",
"'niscode'",
":",
"obj",
".",
"niscode",
",",
"'naam'",
":",
"obj",
".",
"naam",
",",
"'centroid'",
":",
"obj",
".",
"centroid",
... | Adapter for rendering an object of
:class:`crabpy.gateway.crab.Gemeente` to json. | [
"Adapter",
"for",
"rendering",
"an",
"object",
"of",
":",
"class",
":",
"crabpy",
".",
"gateway",
".",
"crab",
".",
"Gemeente",
"to",
"json",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/renderers/crab.py#L224-L249 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/renderers/crab.py | item_deelgemeente_adapter | def item_deelgemeente_adapter(obj, request):
"""
Adapter for rendering a object of
:class:`crabpy.gateway.crab.Deelgemeente` to json.
"""
return {
'id': obj.id,
'naam': obj.naam,
'gemeente': {
'id': obj.gemeente.id,
'naam': obj.gemeente.naam
}
... | python | def item_deelgemeente_adapter(obj, request):
"""
Adapter for rendering a object of
:class:`crabpy.gateway.crab.Deelgemeente` to json.
"""
return {
'id': obj.id,
'naam': obj.naam,
'gemeente': {
'id': obj.gemeente.id,
'naam': obj.gemeente.naam
}
... | [
"def",
"item_deelgemeente_adapter",
"(",
"obj",
",",
"request",
")",
":",
"return",
"{",
"'id'",
":",
"obj",
".",
"id",
",",
"'naam'",
":",
"obj",
".",
"naam",
",",
"'gemeente'",
":",
"{",
"'id'",
":",
"obj",
".",
"gemeente",
".",
"id",
",",
"'naam'"... | Adapter for rendering a object of
:class:`crabpy.gateway.crab.Deelgemeente` to json. | [
"Adapter",
"for",
"rendering",
"a",
"object",
"of",
":",
"class",
":",
"crabpy",
".",
"gateway",
".",
"crab",
".",
"Deelgemeente",
"to",
"json",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/renderers/crab.py#L252-L264 |
OnroerendErfgoed/crabpy_pyramid | crabpy_pyramid/renderers/crab.py | item_straat_adapter | def item_straat_adapter(obj, request):
"""
Adapter for rendering an object of
:class:`crabpy.gateway.crab.Straat` to json.
"""
return {
'id': obj.id,
'label': obj.label,
'namen': obj.namen,
'status': {
'id': obj.status.id,
'naam': obj.status.na... | python | def item_straat_adapter(obj, request):
"""
Adapter for rendering an object of
:class:`crabpy.gateway.crab.Straat` to json.
"""
return {
'id': obj.id,
'label': obj.label,
'namen': obj.namen,
'status': {
'id': obj.status.id,
'naam': obj.status.na... | [
"def",
"item_straat_adapter",
"(",
"obj",
",",
"request",
")",
":",
"return",
"{",
"'id'",
":",
"obj",
".",
"id",
",",
"'label'",
":",
"obj",
".",
"label",
",",
"'namen'",
":",
"obj",
".",
"namen",
",",
"'status'",
":",
"{",
"'id'",
":",
"obj",
"."... | Adapter for rendering an object of
:class:`crabpy.gateway.crab.Straat` to json. | [
"Adapter",
"for",
"rendering",
"an",
"object",
"of",
":",
"class",
":",
"crabpy",
".",
"gateway",
".",
"crab",
".",
"Straat",
"to",
"json",
"."
] | train | https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/b727ea55838d71575db96e987b536a0bac9f6a7a/crabpy_pyramid/renderers/crab.py#L267-L301 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.