repository_name stringlengths 7 55 | func_path_in_repository stringlengths 4 223 | func_name stringlengths 1 134 | whole_func_string stringlengths 75 104k | language stringclasses 1
value | func_code_string stringlengths 75 104k | func_code_tokens listlengths 19 28.4k | func_documentation_string stringlengths 1 46.9k | func_documentation_tokens listlengths 1 1.97k | split_name stringclasses 1
value | func_code_url stringlengths 87 315 |
|---|---|---|---|---|---|---|---|---|---|---|
IBMStreams/pypi.streamsx | streamsx/scripts/extract.py | _extract_from_toolkit | def _extract_from_toolkit(args):
"""
Look at all the modules in opt/python/streams (opt/python/streams/*.py)
and extract any spl decorated function as an operator.
"""
extractor = _Extractor(args)
if extractor._cmd_args.verbose:
print("spl-python-extract:", __version__)
print("T... | python | def _extract_from_toolkit(args):
"""
Look at all the modules in opt/python/streams (opt/python/streams/*.py)
and extract any spl decorated function as an operator.
"""
extractor = _Extractor(args)
if extractor._cmd_args.verbose:
print("spl-python-extract:", __version__)
print("T... | [
"def",
"_extract_from_toolkit",
"(",
"args",
")",
":",
"extractor",
"=",
"_Extractor",
"(",
"args",
")",
"if",
"extractor",
".",
"_cmd_args",
".",
"verbose",
":",
"print",
"(",
"\"spl-python-extract:\"",
",",
"__version__",
")",
"print",
"(",
"\"Topology toolkit... | Look at all the modules in opt/python/streams (opt/python/streams/*.py)
and extract any spl decorated function as an operator. | [
"Look",
"at",
"all",
"the",
"modules",
"in",
"opt",
"/",
"python",
"/",
"streams",
"(",
"opt",
"/",
"python",
"/",
"streams",
"/",
"*",
".",
"py",
")",
"and",
"extract",
"any",
"spl",
"decorated",
"function",
"as",
"an",
"operator",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/scripts/extract.py#L506-L557 |
IBMStreams/pypi.streamsx | streamsx/scripts/extract.py | _Extractor._copy_globalization_resources | def _copy_globalization_resources(self):
'''Copy the language resource files for python api functions
This function copies the TopologySplpy Resource files from Topology toolkit directory
into the impl/nl folder of the project.
Returns: the list with the copied locale strings'''
... | python | def _copy_globalization_resources(self):
'''Copy the language resource files for python api functions
This function copies the TopologySplpy Resource files from Topology toolkit directory
into the impl/nl folder of the project.
Returns: the list with the copied locale strings'''
... | [
"def",
"_copy_globalization_resources",
"(",
"self",
")",
":",
"rootDir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"_topology_tk_dir",
"(",
")",
",",
"\"impl\"",
",",
"\"nl\"",
")",
"languageList",
"=",
"[",
"]",
"for",
"dirName",
"in",
"os",
".",
"list... | Copy the language resource files for python api functions
This function copies the TopologySplpy Resource files from Topology toolkit directory
into the impl/nl folder of the project.
Returns: the list with the copied locale strings | [
"Copy",
"the",
"language",
"resource",
"files",
"for",
"python",
"api",
"functions",
"This",
"function",
"copies",
"the",
"TopologySplpy",
"Resource",
"files",
"from",
"Topology",
"toolkit",
"directory",
"into",
"the",
"impl",
"/",
"nl",
"folder",
"of",
"the",
... | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/scripts/extract.py#L219-L246 |
IBMStreams/pypi.streamsx | streamsx/scripts/extract.py | _Extractor._setup_info_xml | def _setup_info_xml(self, languageList):
'''Setup the info.xml file
This function prepares or checks the info.xml file in the project directory
- if the info.xml does not exist in the project directory, it copies the template info.xml into the project directory.
The project na... | python | def _setup_info_xml(self, languageList):
'''Setup the info.xml file
This function prepares or checks the info.xml file in the project directory
- if the info.xml does not exist in the project directory, it copies the template info.xml into the project directory.
The project na... | [
"def",
"_setup_info_xml",
"(",
"self",
",",
"languageList",
")",
":",
"infoXmlFile",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_tk_dir",
",",
"'info.xml'",
")",
"print",
"(",
"'Check info.xml:'",
",",
"infoXmlFile",
")",
"try",
":",
"Topology... | Setup the info.xml file
This function prepares or checks the info.xml file in the project directory
- if the info.xml does not exist in the project directory, it copies the template info.xml into the project directory.
The project name is obtained from the project directory name
... | [
"Setup",
"the",
"info",
".",
"xml",
"file",
"This",
"function",
"prepares",
"or",
"checks",
"the",
"info",
".",
"xml",
"file",
"in",
"the",
"project",
"directory",
"-",
"if",
"the",
"info",
".",
"xml",
"does",
"not",
"exist",
"in",
"the",
"project",
"d... | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/scripts/extract.py#L442-L504 |
IBMStreams/pypi.streamsx | streamsx/scripts/info.py | main | def main(args=None):
""" Output information about `streamsx` and the environment.
Useful for support to get key information for use of `streamsx`
and Python in IBM Streams.
"""
_parse_args(args)
streamsx._streams._version._mismatch_check('streamsx.topology.context')
srp = pkg_res... | python | def main(args=None):
""" Output information about `streamsx` and the environment.
Useful for support to get key information for use of `streamsx`
and Python in IBM Streams.
"""
_parse_args(args)
streamsx._streams._version._mismatch_check('streamsx.topology.context')
srp = pkg_res... | [
"def",
"main",
"(",
"args",
"=",
"None",
")",
":",
"_parse_args",
"(",
"args",
")",
"streamsx",
".",
"_streams",
".",
"_version",
".",
"_mismatch_check",
"(",
"'streamsx.topology.context'",
")",
"srp",
"=",
"pkg_resources",
".",
"working_set",
".",
"find",
"... | Output information about `streamsx` and the environment.
Useful for support to get key information for use of `streamsx`
and Python in IBM Streams. | [
"Output",
"information",
"about",
"streamsx",
"and",
"the",
"environment",
".",
"Useful",
"for",
"support",
"to",
"get",
"key",
"information",
"for",
"use",
"of",
"streamsx",
"and",
"Python",
"in",
"IBM",
"Streams",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/scripts/info.py#L15-L44 |
IBMStreams/pypi.streamsx | streamsx/topology/state.py | ConsistentRegionConfig.operator_driven | def operator_driven(drain_timeout=_DEFAULT_DRAIN, reset_timeout=_DEFAULT_RESET, max_consecutive_attempts=_DEFAULT_ATTEMPTS):
"""Define an operator-driven consistent region configuration.
The source operator triggers drain and checkpoint cycles for the region.
Args:
drain_timeout: Th... | python | def operator_driven(drain_timeout=_DEFAULT_DRAIN, reset_timeout=_DEFAULT_RESET, max_consecutive_attempts=_DEFAULT_ATTEMPTS):
"""Define an operator-driven consistent region configuration.
The source operator triggers drain and checkpoint cycles for the region.
Args:
drain_timeout: Th... | [
"def",
"operator_driven",
"(",
"drain_timeout",
"=",
"_DEFAULT_DRAIN",
",",
"reset_timeout",
"=",
"_DEFAULT_RESET",
",",
"max_consecutive_attempts",
"=",
"_DEFAULT_ATTEMPTS",
")",
":",
"return",
"ConsistentRegionConfig",
"(",
"trigger",
"=",
"ConsistentRegionConfig",
".",... | Define an operator-driven consistent region configuration.
The source operator triggers drain and checkpoint cycles for the region.
Args:
drain_timeout: The drain timeout, as either a :py:class:`datetime.timedelta` value or the number of seconds as a `float`. If not specified, the default ... | [
"Define",
"an",
"operator",
"-",
"driven",
"consistent",
"region",
"configuration",
".",
"The",
"source",
"operator",
"triggers",
"drain",
"and",
"checkpoint",
"cycles",
"for",
"the",
"region",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/topology/state.py#L177-L190 |
IBMStreams/pypi.streamsx | streamsx/topology/state.py | ConsistentRegionConfig.periodic | def periodic(period, drain_timeout=_DEFAULT_DRAIN, reset_timeout=_DEFAULT_RESET, max_consecutive_attempts=_DEFAULT_ATTEMPTS):
"""Create a periodic consistent region configuration.
The IBM Streams runtime will trigger a drain and checkpoint
the region periodically at the time interval specified b... | python | def periodic(period, drain_timeout=_DEFAULT_DRAIN, reset_timeout=_DEFAULT_RESET, max_consecutive_attempts=_DEFAULT_ATTEMPTS):
"""Create a periodic consistent region configuration.
The IBM Streams runtime will trigger a drain and checkpoint
the region periodically at the time interval specified b... | [
"def",
"periodic",
"(",
"period",
",",
"drain_timeout",
"=",
"_DEFAULT_DRAIN",
",",
"reset_timeout",
"=",
"_DEFAULT_RESET",
",",
"max_consecutive_attempts",
"=",
"_DEFAULT_ATTEMPTS",
")",
":",
"return",
"ConsistentRegionConfig",
"(",
"trigger",
"=",
"ConsistentRegionCon... | Create a periodic consistent region configuration.
The IBM Streams runtime will trigger a drain and checkpoint
the region periodically at the time interval specified by `period`.
Args:
period: The trigger period. This may be either a :py:class:`datetime.timedelta` value or th... | [
"Create",
"a",
"periodic",
"consistent",
"region",
"configuration",
".",
"The",
"IBM",
"Streams",
"runtime",
"will",
"trigger",
"a",
"drain",
"and",
"checkpoint",
"the",
"region",
"periodically",
"at",
"the",
"time",
"interval",
"specified",
"by",
"period",
".",... | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/topology/state.py#L193-L208 |
IBMStreams/pypi.streamsx | streamsx/spl/types.py | _get_timestamp_tuple | def _get_timestamp_tuple(ts):
"""
Internal method to get a timestamp tuple from a value.
Handles input being a datetime or a Timestamp.
"""
if isinstance(ts, datetime.datetime):
return Timestamp.from_datetime(ts).tuple()
elif isinstance(ts, Timestamp):
return ts
raise... | python | def _get_timestamp_tuple(ts):
"""
Internal method to get a timestamp tuple from a value.
Handles input being a datetime or a Timestamp.
"""
if isinstance(ts, datetime.datetime):
return Timestamp.from_datetime(ts).tuple()
elif isinstance(ts, Timestamp):
return ts
raise... | [
"def",
"_get_timestamp_tuple",
"(",
"ts",
")",
":",
"if",
"isinstance",
"(",
"ts",
",",
"datetime",
".",
"datetime",
")",
":",
"return",
"Timestamp",
".",
"from_datetime",
"(",
"ts",
")",
".",
"tuple",
"(",
")",
"elif",
"isinstance",
"(",
"ts",
",",
"T... | Internal method to get a timestamp tuple from a value.
Handles input being a datetime or a Timestamp. | [
"Internal",
"method",
"to",
"get",
"a",
"timestamp",
"tuple",
"from",
"a",
"value",
".",
"Handles",
"input",
"being",
"a",
"datetime",
"or",
"a",
"Timestamp",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/spl/types.py#L155-L164 |
IBMStreams/pypi.streamsx | streamsx/spl/types.py | Timestamp.from_datetime | def from_datetime(dt, machine_id=0):
"""
Convert a datetime to an SPL `Timestamp`.
Args:
dt(datetime.datetime): Datetime to be converted.
machine_id(int): Machine identifier.
Returns:
Timestamp: Datetime converted to Timestamp.
"""
... | python | def from_datetime(dt, machine_id=0):
"""
Convert a datetime to an SPL `Timestamp`.
Args:
dt(datetime.datetime): Datetime to be converted.
machine_id(int): Machine identifier.
Returns:
Timestamp: Datetime converted to Timestamp.
"""
... | [
"def",
"from_datetime",
"(",
"dt",
",",
"machine_id",
"=",
"0",
")",
":",
"td",
"=",
"dt",
"-",
"Timestamp",
".",
"_EPOCH",
"seconds",
"=",
"td",
".",
"days",
"*",
"3600",
"*",
"24",
"seconds",
"+=",
"td",
".",
"seconds",
"return",
"Timestamp",
"(",
... | Convert a datetime to an SPL `Timestamp`.
Args:
dt(datetime.datetime): Datetime to be converted.
machine_id(int): Machine identifier.
Returns:
Timestamp: Datetime converted to Timestamp. | [
"Convert",
"a",
"datetime",
"to",
"an",
"SPL",
"Timestamp",
".",
"Args",
":",
"dt",
"(",
"datetime",
".",
"datetime",
")",
":",
"Datetime",
"to",
"be",
"converted",
".",
"machine_id",
"(",
"int",
")",
":",
"Machine",
"identifier",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/spl/types.py#L63-L77 |
IBMStreams/pypi.streamsx | streamsx/spl/toolkit.py | add_toolkit | def add_toolkit(topology, location):
"""Add an SPL toolkit to a topology.
Args:
topology(Topology): Topology to include toolkit in.
location(str): Location of the toolkit directory.
"""
import streamsx.topology.topology
assert isinstance(topology, streamsx.topology.topology.Topology... | python | def add_toolkit(topology, location):
"""Add an SPL toolkit to a topology.
Args:
topology(Topology): Topology to include toolkit in.
location(str): Location of the toolkit directory.
"""
import streamsx.topology.topology
assert isinstance(topology, streamsx.topology.topology.Topology... | [
"def",
"add_toolkit",
"(",
"topology",
",",
"location",
")",
":",
"import",
"streamsx",
".",
"topology",
".",
"topology",
"assert",
"isinstance",
"(",
"topology",
",",
"streamsx",
".",
"topology",
".",
"topology",
".",
"Topology",
")",
"tkinfo",
"=",
"dict",... | Add an SPL toolkit to a topology.
Args:
topology(Topology): Topology to include toolkit in.
location(str): Location of the toolkit directory. | [
"Add",
"an",
"SPL",
"toolkit",
"to",
"a",
"topology",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/spl/toolkit.py#L25-L36 |
IBMStreams/pypi.streamsx | streamsx/spl/toolkit.py | add_toolkit_dependency | def add_toolkit_dependency(topology, name, version):
"""Add a version dependency on an SPL toolkit to a topology.
To specify a range of versions for the dependent toolkits,
use brackets (``[]``) or parentheses. Use brackets to represent an
inclusive range and parentheses to represent an exclusive range... | python | def add_toolkit_dependency(topology, name, version):
"""Add a version dependency on an SPL toolkit to a topology.
To specify a range of versions for the dependent toolkits,
use brackets (``[]``) or parentheses. Use brackets to represent an
inclusive range and parentheses to represent an exclusive range... | [
"def",
"add_toolkit_dependency",
"(",
"topology",
",",
"name",
",",
"version",
")",
":",
"import",
"streamsx",
".",
"topology",
".",
"topology",
"assert",
"isinstance",
"(",
"topology",
",",
"streamsx",
".",
"topology",
".",
"topology",
".",
"Topology",
")",
... | Add a version dependency on an SPL toolkit to a topology.
To specify a range of versions for the dependent toolkits,
use brackets (``[]``) or parentheses. Use brackets to represent an
inclusive range and parentheses to represent an exclusive range.
The following examples describe how to specify a depen... | [
"Add",
"a",
"version",
"dependency",
"on",
"an",
"SPL",
"toolkit",
"to",
"a",
"topology",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/spl/toolkit.py#L38-L67 |
IBMStreams/pypi.streamsx | streamsx/scripts/runner.py | submit | def submit(args=None):
""" Performs the submit according to arguments and
returns an object describing the result.
"""
streamsx._streams._version._mismatch_check('streamsx.topology.context')
cmd_args = _parse_args(args)
if cmd_args.topology is not None:
app = _get_topology_app(cmd_args)
... | python | def submit(args=None):
""" Performs the submit according to arguments and
returns an object describing the result.
"""
streamsx._streams._version._mismatch_check('streamsx.topology.context')
cmd_args = _parse_args(args)
if cmd_args.topology is not None:
app = _get_topology_app(cmd_args)
... | [
"def",
"submit",
"(",
"args",
"=",
"None",
")",
":",
"streamsx",
".",
"_streams",
".",
"_version",
".",
"_mismatch_check",
"(",
"'streamsx.topology.context'",
")",
"cmd_args",
"=",
"_parse_args",
"(",
"args",
")",
"if",
"cmd_args",
".",
"topology",
"is",
"no... | Performs the submit according to arguments and
returns an object describing the result. | [
"Performs",
"the",
"submit",
"according",
"to",
"arguments",
"and",
"returns",
"an",
"object",
"describing",
"the",
"result",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/scripts/runner.py#L44-L61 |
IBMStreams/pypi.streamsx | streamsx/scripts/runner.py | _parse_args | def _parse_args(args):
""" Argument parsing
"""
cmd_parser = argparse.ArgumentParser(description='Execute a Streams application using a Streaming Analytics service.')
ctx_group = cmd_parser.add_mutually_exclusive_group(required=True)
ctx_group.add_argument('--service-name', help='Submit to Streamin... | python | def _parse_args(args):
""" Argument parsing
"""
cmd_parser = argparse.ArgumentParser(description='Execute a Streams application using a Streaming Analytics service.')
ctx_group = cmd_parser.add_mutually_exclusive_group(required=True)
ctx_group.add_argument('--service-name', help='Submit to Streamin... | [
"def",
"_parse_args",
"(",
"args",
")",
":",
"cmd_parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Execute a Streams application using a Streaming Analytics service.'",
")",
"ctx_group",
"=",
"cmd_parser",
".",
"add_mutually_exclusive_group",
"(",... | Argument parsing | [
"Argument",
"parsing"
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/scripts/runner.py#L70-L90 |
IBMStreams/pypi.streamsx | streamsx/scripts/runner.py | _define_jco_args | def _define_jco_args(cmd_parser):
"""
Define job configuration arguments.
Returns groups defined, currently one.
"""
jo_group = cmd_parser.add_argument_group('Job options', 'Job configuration options')
jo_group.add_argument('--job-name', help='Job name')
jo_group.add_argument('--preload', a... | python | def _define_jco_args(cmd_parser):
"""
Define job configuration arguments.
Returns groups defined, currently one.
"""
jo_group = cmd_parser.add_argument_group('Job options', 'Job configuration options')
jo_group.add_argument('--job-name', help='Job name')
jo_group.add_argument('--preload', a... | [
"def",
"_define_jco_args",
"(",
"cmd_parser",
")",
":",
"jo_group",
"=",
"cmd_parser",
".",
"add_argument_group",
"(",
"'Job options'",
",",
"'Job configuration options'",
")",
"jo_group",
".",
"add_argument",
"(",
"'--job-name'",
",",
"help",
"=",
"'Job name'",
")"... | Define job configuration arguments.
Returns groups defined, currently one. | [
"Define",
"job",
"configuration",
"arguments",
".",
"Returns",
"groups",
"defined",
"currently",
"one",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/scripts/runner.py#L92-L107 |
IBMStreams/pypi.streamsx | streamsx/scripts/runner.py | _submit_topology | def _submit_topology(cmd_args, app):
"""Submit a Python topology to the service.
This includes an SPL main composite wrapped in a Python topology.
"""
cfg = app.cfg
if cmd_args.create_bundle:
ctxtype = ctx.ContextTypes.BUNDLE
elif cmd_args.service_name:
cfg[ctx.ConfigParams.FORCE... | python | def _submit_topology(cmd_args, app):
"""Submit a Python topology to the service.
This includes an SPL main composite wrapped in a Python topology.
"""
cfg = app.cfg
if cmd_args.create_bundle:
ctxtype = ctx.ContextTypes.BUNDLE
elif cmd_args.service_name:
cfg[ctx.ConfigParams.FORCE... | [
"def",
"_submit_topology",
"(",
"cmd_args",
",",
"app",
")",
":",
"cfg",
"=",
"app",
".",
"cfg",
"if",
"cmd_args",
".",
"create_bundle",
":",
"ctxtype",
"=",
"ctx",
".",
"ContextTypes",
".",
"BUNDLE",
"elif",
"cmd_args",
".",
"service_name",
":",
"cfg",
... | Submit a Python topology to the service.
This includes an SPL main composite wrapped in a Python topology. | [
"Submit",
"a",
"Python",
"topology",
"to",
"the",
"service",
".",
"This",
"includes",
"an",
"SPL",
"main",
"composite",
"wrapped",
"in",
"a",
"Python",
"topology",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/scripts/runner.py#L155-L167 |
IBMStreams/pypi.streamsx | streamsx/scripts/runner.py | _submit_bundle | def _submit_bundle(cmd_args, app):
"""Submit an existing bundle to the service"""
sac = streamsx.rest.StreamingAnalyticsConnection(service_name=cmd_args.service_name)
sas = sac.get_streaming_analytics()
sr = sas.submit_job(bundle=app.app, job_config=app.cfg[ctx.ConfigParams.JOB_CONFIG])
if 'exceptio... | python | def _submit_bundle(cmd_args, app):
"""Submit an existing bundle to the service"""
sac = streamsx.rest.StreamingAnalyticsConnection(service_name=cmd_args.service_name)
sas = sac.get_streaming_analytics()
sr = sas.submit_job(bundle=app.app, job_config=app.cfg[ctx.ConfigParams.JOB_CONFIG])
if 'exceptio... | [
"def",
"_submit_bundle",
"(",
"cmd_args",
",",
"app",
")",
":",
"sac",
"=",
"streamsx",
".",
"rest",
".",
"StreamingAnalyticsConnection",
"(",
"service_name",
"=",
"cmd_args",
".",
"service_name",
")",
"sas",
"=",
"sac",
".",
"get_streaming_analytics",
"(",
")... | Submit an existing bundle to the service | [
"Submit",
"an",
"existing",
"bundle",
"to",
"the",
"service"
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/scripts/runner.py#L169-L184 |
IBMStreams/pypi.streamsx | streamsx/spl/spl.py | pipe | def pipe(wrapped):
"""
Decorator to create an SPL operator from a function.
A pipe SPL operator with a single input port and a single
output port. For each tuple on the input port the
function is called passing the contents of the tuple.
SPL attributes from the tuple are passed by position... | python | def pipe(wrapped):
"""
Decorator to create an SPL operator from a function.
A pipe SPL operator with a single input port and a single
output port. For each tuple on the input port the
function is called passing the contents of the tuple.
SPL attributes from the tuple are passed by position... | [
"def",
"pipe",
"(",
"wrapped",
")",
":",
"if",
"not",
"inspect",
".",
"isfunction",
"(",
"wrapped",
")",
":",
"raise",
"TypeError",
"(",
"'A function is required'",
")",
"return",
"_wrapforsplop",
"(",
"_OperatorType",
".",
"Pipe",
",",
"wrapped",
",",
"'pos... | Decorator to create an SPL operator from a function.
A pipe SPL operator with a single input port and a single
output port. For each tuple on the input port the
function is called passing the contents of the tuple.
SPL attributes from the tuple are passed by position.
The value returned f... | [
"Decorator",
"to",
"create",
"an",
"SPL",
"operator",
"from",
"a",
"function",
".",
"A",
"pipe",
"SPL",
"operator",
"with",
"a",
"single",
"input",
"port",
"and",
"a",
"single",
"output",
"port",
".",
"For",
"each",
"tuple",
"on",
"the",
"input",
"port",... | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/spl/spl.py#L663-L683 |
IBMStreams/pypi.streamsx | streamsx/spl/spl.py | _define_fixed | def _define_fixed(wrapped, callable_):
"""For the callable see how many positional parameters are required"""
is_class = inspect.isclass(wrapped)
style = callable_._splpy_style if hasattr(callable_, '_splpy_style') else wrapped._splpy_style
if style == 'dictionary':
return -1
fixed_count =... | python | def _define_fixed(wrapped, callable_):
"""For the callable see how many positional parameters are required"""
is_class = inspect.isclass(wrapped)
style = callable_._splpy_style if hasattr(callable_, '_splpy_style') else wrapped._splpy_style
if style == 'dictionary':
return -1
fixed_count =... | [
"def",
"_define_fixed",
"(",
"wrapped",
",",
"callable_",
")",
":",
"is_class",
"=",
"inspect",
".",
"isclass",
"(",
"wrapped",
")",
"style",
"=",
"callable_",
".",
"_splpy_style",
"if",
"hasattr",
"(",
"callable_",
",",
"'_splpy_style'",
")",
"else",
"wrapp... | For the callable see how many positional parameters are required | [
"For",
"the",
"callable",
"see",
"how",
"many",
"positional",
"parameters",
"are",
"required"
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/spl/spl.py#L829-L855 |
IBMStreams/pypi.streamsx | streamsx/spl/spl.py | ignore | def ignore(wrapped):
"""
Decorator to ignore a Python function.
If a Python callable is decorated with ``@spl.ignore``
then function is ignored by ``spl-python-extract.py``.
Args:
wrapped: Function that will be ignored.
"""
@functools.wraps(wrapped)
def _ignore(*args, **kw... | python | def ignore(wrapped):
"""
Decorator to ignore a Python function.
If a Python callable is decorated with ``@spl.ignore``
then function is ignored by ``spl-python-extract.py``.
Args:
wrapped: Function that will be ignored.
"""
@functools.wraps(wrapped)
def _ignore(*args, **kw... | [
"def",
"ignore",
"(",
"wrapped",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"wrapped",
")",
"def",
"_ignore",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"wrapped",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"_ignore",
... | Decorator to ignore a Python function.
If a Python callable is decorated with ``@spl.ignore``
then function is ignored by ``spl-python-extract.py``.
Args:
wrapped: Function that will be ignored. | [
"Decorator",
"to",
"ignore",
"a",
"Python",
"function",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/spl/spl.py#L1082-L1097 |
IBMStreams/pypi.streamsx | streamsx/spl/spl.py | sink | def sink(wrapped):
"""Creates an SPL operator with a single input port.
A SPL operator with a single input port and no output ports.
For each tuple on the input port the decorated function
is called passing the contents of the tuple.
.. deprecated:: 1.8
Recommended to use :py:class:`@spl.f... | python | def sink(wrapped):
"""Creates an SPL operator with a single input port.
A SPL operator with a single input port and no output ports.
For each tuple on the input port the decorated function
is called passing the contents of the tuple.
.. deprecated:: 1.8
Recommended to use :py:class:`@spl.f... | [
"def",
"sink",
"(",
"wrapped",
")",
":",
"if",
"not",
"inspect",
".",
"isfunction",
"(",
"wrapped",
")",
":",
"raise",
"TypeError",
"(",
"'A function is required'",
")",
"return",
"_wrapforsplop",
"(",
"_OperatorType",
".",
"Sink",
",",
"wrapped",
",",
"'pos... | Creates an SPL operator with a single input port.
A SPL operator with a single input port and no output ports.
For each tuple on the input port the decorated function
is called passing the contents of the tuple.
.. deprecated:: 1.8
Recommended to use :py:class:`@spl.for_each <for_each>` instea... | [
"Creates",
"an",
"SPL",
"operator",
"with",
"a",
"single",
"input",
"port",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/spl/spl.py#L1100-L1113 |
IBMStreams/pypi.streamsx | streamsx/spl/spl.py | PrimitiveOperator.submit | def submit(self, port_id, tuple_):
"""Submit a tuple to the output port.
The value to be submitted (``tuple_``) can be a ``None`` (nothing will be submitted),
``tuple``, ``dict` or ``list`` of those types. For details
on how the ``tuple_`` is mapped to an SPL tuple see :ref:`submit-from... | python | def submit(self, port_id, tuple_):
"""Submit a tuple to the output port.
The value to be submitted (``tuple_``) can be a ``None`` (nothing will be submitted),
``tuple``, ``dict` or ``list`` of those types. For details
on how the ``tuple_`` is mapped to an SPL tuple see :ref:`submit-from... | [
"def",
"submit",
"(",
"self",
",",
"port_id",
",",
"tuple_",
")",
":",
"port_index",
"=",
"self",
".",
"_splpy_output_ports",
"[",
"port_id",
"]",
"ec",
".",
"_submit",
"(",
"self",
",",
"port_index",
",",
"tuple_",
")"
] | Submit a tuple to the output port.
The value to be submitted (``tuple_``) can be a ``None`` (nothing will be submitted),
``tuple``, ``dict` or ``list`` of those types. For details
on how the ``tuple_`` is mapped to an SPL tuple see :ref:`submit-from-python`.
Args:
port_id:... | [
"Submit",
"a",
"tuple",
"to",
"the",
"output",
"port",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/spl/spl.py#L1174-L1188 |
IBMStreams/pypi.streamsx | streamsx/spl/runtime.py | _splpy_convert_tuple | def _splpy_convert_tuple(attributes):
"""Create a function that converts tuples to
be submitted as dict objects into Python tuples
with the value by position.
Return function handles tuple,dict,list[tuple|dict|None],None
"""
def _to_tuples(tuple_):
if isinstance(tuple_, tuple):
... | python | def _splpy_convert_tuple(attributes):
"""Create a function that converts tuples to
be submitted as dict objects into Python tuples
with the value by position.
Return function handles tuple,dict,list[tuple|dict|None],None
"""
def _to_tuples(tuple_):
if isinstance(tuple_, tuple):
... | [
"def",
"_splpy_convert_tuple",
"(",
"attributes",
")",
":",
"def",
"_to_tuples",
"(",
"tuple_",
")",
":",
"if",
"isinstance",
"(",
"tuple_",
",",
"tuple",
")",
":",
"return",
"tuple_",
"if",
"isinstance",
"(",
"tuple_",
",",
"dict",
")",
":",
"return",
"... | Create a function that converts tuples to
be submitted as dict objects into Python tuples
with the value by position.
Return function handles tuple,dict,list[tuple|dict|None],None | [
"Create",
"a",
"function",
"that",
"converts",
"tuples",
"to",
"be",
"submitted",
"as",
"dict",
"objects",
"into",
"Python",
"tuples",
"with",
"the",
"value",
"by",
"position",
".",
"Return",
"function",
"handles",
"tuple",
"dict",
"list",
"[",
"tuple|dict|Non... | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/spl/runtime.py#L74-L94 |
IBMStreams/pypi.streamsx | streamsx/spl/runtime.py | _splpy_primitive_input_fns | def _splpy_primitive_input_fns(obj):
"""Convert the list of class input functions to be
instance functions against obj.
Used by @spl.primitive_operator SPL cpp template.
"""
ofns = list()
for fn in obj._splpy_input_ports:
ofns.append(getattr(obj, fn.__name__))
return ofns | python | def _splpy_primitive_input_fns(obj):
"""Convert the list of class input functions to be
instance functions against obj.
Used by @spl.primitive_operator SPL cpp template.
"""
ofns = list()
for fn in obj._splpy_input_ports:
ofns.append(getattr(obj, fn.__name__))
return ofns | [
"def",
"_splpy_primitive_input_fns",
"(",
"obj",
")",
":",
"ofns",
"=",
"list",
"(",
")",
"for",
"fn",
"in",
"obj",
".",
"_splpy_input_ports",
":",
"ofns",
".",
"append",
"(",
"getattr",
"(",
"obj",
",",
"fn",
".",
"__name__",
")",
")",
"return",
"ofns... | Convert the list of class input functions to be
instance functions against obj.
Used by @spl.primitive_operator SPL cpp template. | [
"Convert",
"the",
"list",
"of",
"class",
"input",
"functions",
"to",
"be",
"instance",
"functions",
"against",
"obj",
".",
"Used",
"by"
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/spl/runtime.py#L117-L125 |
IBMStreams/pypi.streamsx | streamsx/spl/runtime.py | _splpy_all_ports_ready | def _splpy_all_ports_ready(callable_):
"""Call all_ports_ready for a primitive operator."""
if hasattr(type(callable_), 'all_ports_ready'):
try:
return callable_.all_ports_ready()
except:
ei = sys.exc_info()
if streamsx._streams._runtime._call_exit(callable_, ... | python | def _splpy_all_ports_ready(callable_):
"""Call all_ports_ready for a primitive operator."""
if hasattr(type(callable_), 'all_ports_ready'):
try:
return callable_.all_ports_ready()
except:
ei = sys.exc_info()
if streamsx._streams._runtime._call_exit(callable_, ... | [
"def",
"_splpy_all_ports_ready",
"(",
"callable_",
")",
":",
"if",
"hasattr",
"(",
"type",
"(",
"callable_",
")",
",",
"'all_ports_ready'",
")",
":",
"try",
":",
"return",
"callable_",
".",
"all_ports_ready",
"(",
")",
"except",
":",
"ei",
"=",
"sys",
".",... | Call all_ports_ready for a primitive operator. | [
"Call",
"all_ports_ready",
"for",
"a",
"primitive",
"operator",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/spl/runtime.py#L127-L137 |
cmorisse/ikp3db | ikp3db.py | set_trace | def set_trace(a_frame=None):
""" Breaks on the line that invoked this function or at given frame.
User can then resume execution.
To call set_trace() use:
.. code-block:: python
import ikp3db ; ikp3db.set_trace()
:param a_frame: The frame at which to break on.
:type a_frame: ... | python | def set_trace(a_frame=None):
""" Breaks on the line that invoked this function or at given frame.
User can then resume execution.
To call set_trace() use:
.. code-block:: python
import ikp3db ; ikp3db.set_trace()
:param a_frame: The frame at which to break on.
:type a_frame: ... | [
"def",
"set_trace",
"(",
"a_frame",
"=",
"None",
")",
":",
"if",
"not",
"ikpdb",
":",
"return",
"\"Error: IKP3db must be launched before calling ikpd.set_trace().\"",
"if",
"a_frame",
"is",
"None",
":",
"a_frame",
"=",
"sys",
".",
"_getframe",
"(",
")",
".",
"f_... | Breaks on the line that invoked this function or at given frame.
User can then resume execution.
To call set_trace() use:
.. code-block:: python
import ikp3db ; ikp3db.set_trace()
:param a_frame: The frame at which to break on.
:type a_frame: frame
:return: An error mess... | [
"Breaks",
"on",
"the",
"line",
"that",
"invoked",
"this",
"function",
"or",
"at",
"given",
"frame",
".",
"User",
"can",
"then",
"resume",
"execution",
".",
"To",
"call",
"set_trace",
"()",
"use",
":",
"..",
"code",
"-",
"block",
"::",
"python"
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1787-L1810 |
cmorisse/ikp3db | ikp3db.py | post_mortem | def post_mortem(trace_back=None, exc_info=None):
""" Breaks on a traceback and send all execution information to the debugger
client. If the interpreter is handling an exception at this traceback,
exception information is sent to _line_tracer() which will transmit it to
the debugging client.
Call... | python | def post_mortem(trace_back=None, exc_info=None):
""" Breaks on a traceback and send all execution information to the debugger
client. If the interpreter is handling an exception at this traceback,
exception information is sent to _line_tracer() which will transmit it to
the debugging client.
Call... | [
"def",
"post_mortem",
"(",
"trace_back",
"=",
"None",
",",
"exc_info",
"=",
"None",
")",
":",
"if",
"not",
"ikpdb",
":",
"return",
"\"Error: IKP3db must be launched before calling ikpd.post_mortem().\"",
"if",
"exc_info",
":",
"trace_back",
"=",
"exc_info",
"[",
"2"... | Breaks on a traceback and send all execution information to the debugger
client. If the interpreter is handling an exception at this traceback,
exception information is sent to _line_tracer() which will transmit it to
the debugging client.
Caller can also pass an *exc_info* that will be used to extra... | [
"Breaks",
"on",
"a",
"traceback",
"and",
"send",
"all",
"execution",
"information",
"to",
"the",
"debugger",
"client",
".",
"If",
"the",
"interpreter",
"is",
"handling",
"an",
"exception",
"at",
"this",
"traceback",
"exception",
"information",
"is",
"sent",
"t... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1812-L1862 |
cmorisse/ikp3db | ikp3db.py | IKPdbLogger.setup | def setup(cls, ikpdb_log_arg):
""" activates DEBUG logging level based on the `ikpdb_log_arg`
parameter string.
`ikpdb_log_arg` corresponds to the `--ikpdb-log` command line argument.
`ikpdb_log_arg` is composed of a serie of letters that set the `DEBUG`
lo... | python | def setup(cls, ikpdb_log_arg):
""" activates DEBUG logging level based on the `ikpdb_log_arg`
parameter string.
`ikpdb_log_arg` corresponds to the `--ikpdb-log` command line argument.
`ikpdb_log_arg` is composed of a serie of letters that set the `DEBUG`
lo... | [
"def",
"setup",
"(",
"cls",
",",
"ikpdb_log_arg",
")",
":",
"if",
"not",
"ikpdb_log_arg",
":",
"return",
"IKPdbLogger",
".",
"enabled",
"=",
"True",
"logging_configuration_string",
"=",
"ikpdb_log_arg",
".",
"lower",
"(",
")",
"for",
"letter",
"in",
"logging_c... | activates DEBUG logging level based on the `ikpdb_log_arg`
parameter string.
`ikpdb_log_arg` corresponds to the `--ikpdb-log` command line argument.
`ikpdb_log_arg` is composed of a serie of letters that set the `DEBUG`
logging level on the components of the debugg... | [
"activates",
"DEBUG",
"logging",
"level",
"based",
"on",
"the",
"ikpdb_log_arg",
"parameter",
"string",
".",
"ikpdb_log_arg",
"corresponds",
"to",
"the",
"--",
"ikpdb",
"-",
"log",
"command",
"line",
"argument",
".",
"ikpdb_log_arg",
"is",
"composed",
"of",
"a",... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L127-L167 |
cmorisse/ikp3db | ikp3db.py | IKPdbConnectionHandler.send | def send(self, command, _id=None, result={}, frames=[], threads=None,
error_messages=[], warning_messages=[], info_messages=[],
exception=None):
""" Build a message from parameters and send it to debugger.
:param command: The command sent to the debugger client.
... | python | def send(self, command, _id=None, result={}, frames=[], threads=None,
error_messages=[], warning_messages=[], info_messages=[],
exception=None):
""" Build a message from parameters and send it to debugger.
:param command: The command sent to the debugger client.
... | [
"def",
"send",
"(",
"self",
",",
"command",
",",
"_id",
"=",
"None",
",",
"result",
"=",
"{",
"}",
",",
"frames",
"=",
"[",
"]",
",",
"threads",
"=",
"None",
",",
"error_messages",
"=",
"[",
"]",
",",
"warning_messages",
"=",
"[",
"]",
",",
"info... | Build a message from parameters and send it to debugger.
:param command: The command sent to the debugger client.
:type command: str
:param _id: Unique id of the sent message. Right now, it's always `None`
for messages by debugger to client.
:type _i... | [
"Build",
"a",
"message",
"from",
"parameters",
"and",
"send",
"it",
"to",
"debugger",
".",
":",
"param",
"command",
":",
"The",
"command",
"sent",
"to",
"the",
"debugger",
"client",
".",
":",
"type",
"command",
":",
"str",
":",
"param",
"_id",
":",
"Un... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L228-L284 |
cmorisse/ikp3db | ikp3db.py | IKPdbConnectionHandler.reply | def reply(self, obj, result, command_exec_status='ok', info_messages=[],
warning_messages=[], error_messages=[]):
"""Build a response from a previouslsy received command message, send it
and return number of sent bytes.
:param result: Used to send back the result of th... | python | def reply(self, obj, result, command_exec_status='ok', info_messages=[],
warning_messages=[], error_messages=[]):
"""Build a response from a previouslsy received command message, send it
and return number of sent bytes.
:param result: Used to send back the result of th... | [
"def",
"reply",
"(",
"self",
",",
"obj",
",",
"result",
",",
"command_exec_status",
"=",
"'ok'",
",",
"info_messages",
"=",
"[",
"]",
",",
"warning_messages",
"=",
"[",
"]",
",",
"error_messages",
"=",
"[",
"]",
")",
":",
"with",
"self",
".",
"_connect... | Build a response from a previouslsy received command message, send it
and return number of sent bytes.
:param result: Used to send back the result of the command execution to
the debugger client.
:type result: dict
See send() above for others paramete... | [
"Build",
"a",
"response",
"from",
"a",
"previouslsy",
"received",
"command",
"message",
"send",
"it",
"and",
"return",
"number",
"of",
"sent",
"bytes",
".",
":",
"param",
"result",
":",
"Used",
"to",
"send",
"back",
"the",
"result",
"of",
"the",
"command",... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L286-L310 |
cmorisse/ikp3db | ikp3db.py | IKPdbConnectionHandler.receive | def receive(self, ikpdb):
"""Waits for a message from the debugger and returns it as a dict.
"""
# with self._connection_lock:
while self._network_loop:
_logger.n_debug("Enter socket.recv(%s) with self._received_data = %s",
self.SOCKET_BUFFER_SIZE... | python | def receive(self, ikpdb):
"""Waits for a message from the debugger and returns it as a dict.
"""
# with self._connection_lock:
while self._network_loop:
_logger.n_debug("Enter socket.recv(%s) with self._received_data = %s",
self.SOCKET_BUFFER_SIZE... | [
"def",
"receive",
"(",
"self",
",",
"ikpdb",
")",
":",
"# with self._connection_lock:",
"while",
"self",
".",
"_network_loop",
":",
"_logger",
".",
"n_debug",
"(",
"\"Enter socket.recv(%s) with self._received_data = %s\"",
",",
"self",
".",
"SOCKET_BUFFER_SIZE",
",",
... | Waits for a message from the debugger and returns it as a dict. | [
"Waits",
"for",
"a",
"message",
"from",
"the",
"debugger",
"and",
"returns",
"it",
"as",
"a",
"dict",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L312-L391 |
cmorisse/ikp3db | ikp3db.py | IKBreakpoint.clear | def clear(self):
""" Clear a breakpoint by removing it from all lists.
"""
del IKBreakpoint.breakpoints_by_file_and_line[self.file_name, self.line_number]
IKBreakpoint.breakpoints_by_number[self.number] = None
IKBreakpoint.breakpoints_files[self.file_name].remove(self.line_number... | python | def clear(self):
""" Clear a breakpoint by removing it from all lists.
"""
del IKBreakpoint.breakpoints_by_file_and_line[self.file_name, self.line_number]
IKBreakpoint.breakpoints_by_number[self.number] = None
IKBreakpoint.breakpoints_files[self.file_name].remove(self.line_number... | [
"def",
"clear",
"(",
"self",
")",
":",
"del",
"IKBreakpoint",
".",
"breakpoints_by_file_and_line",
"[",
"self",
".",
"file_name",
",",
"self",
".",
"line_number",
"]",
"IKBreakpoint",
".",
"breakpoints_by_number",
"[",
"self",
".",
"number",
"]",
"=",
"None",
... | Clear a breakpoint by removing it from all lists. | [
"Clear",
"a",
"breakpoint",
"by",
"removing",
"it",
"from",
"all",
"lists",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L473-L481 |
cmorisse/ikp3db | ikp3db.py | IKBreakpoint.update_active_breakpoint_flag | def update_active_breakpoint_flag(cls):
""" Checks all breakpoints to find wether at least one is active and
update `any_active_breakpoint` accordingly.
"""
cls.any_active_breakpoint=any([bp.enabled for bp in cls.breakpoints_by_number if bp]) | python | def update_active_breakpoint_flag(cls):
""" Checks all breakpoints to find wether at least one is active and
update `any_active_breakpoint` accordingly.
"""
cls.any_active_breakpoint=any([bp.enabled for bp in cls.breakpoints_by_number if bp]) | [
"def",
"update_active_breakpoint_flag",
"(",
"cls",
")",
":",
"cls",
".",
"any_active_breakpoint",
"=",
"any",
"(",
"[",
"bp",
".",
"enabled",
"for",
"bp",
"in",
"cls",
".",
"breakpoints_by_number",
"if",
"bp",
"]",
")"
] | Checks all breakpoints to find wether at least one is active and
update `any_active_breakpoint` accordingly. | [
"Checks",
"all",
"breakpoints",
"to",
"find",
"wether",
"at",
"least",
"one",
"is",
"active",
"and",
"update",
"any_active_breakpoint",
"accordingly",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L484-L488 |
cmorisse/ikp3db | ikp3db.py | IKBreakpoint.lookup_effective_breakpoint | def lookup_effective_breakpoint(cls, file_name, line_number, frame):
""" Checks if there is an enabled breakpoint at given file_name and
line_number. Check breakpoint condition if any.
:return: found, enabled and condition verified breakpoint or None
:rtype: IKPdbBreakpoint or ... | python | def lookup_effective_breakpoint(cls, file_name, line_number, frame):
""" Checks if there is an enabled breakpoint at given file_name and
line_number. Check breakpoint condition if any.
:return: found, enabled and condition verified breakpoint or None
:rtype: IKPdbBreakpoint or ... | [
"def",
"lookup_effective_breakpoint",
"(",
"cls",
",",
"file_name",
",",
"line_number",
",",
"frame",
")",
":",
"bp",
"=",
"cls",
".",
"breakpoints_by_file_and_line",
".",
"get",
"(",
"(",
"file_name",
",",
"line_number",
")",
",",
"None",
")",
"if",
"not",
... | Checks if there is an enabled breakpoint at given file_name and
line_number. Check breakpoint condition if any.
:return: found, enabled and condition verified breakpoint or None
:rtype: IKPdbBreakpoint or None | [
"Checks",
"if",
"there",
"is",
"an",
"enabled",
"breakpoint",
"at",
"given",
"file_name",
"and",
"line_number",
".",
"Check",
"breakpoint",
"condition",
"if",
"any",
".",
":",
"return",
":",
"found",
"enabled",
"and",
"condition",
"verified",
"breakpoint",
"or... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L491-L512 |
cmorisse/ikp3db | ikp3db.py | IKBreakpoint.get_breakpoints_list | def get_breakpoints_list(cls):
""":return: a list of all breakpoints.
:rtype: a list of dict with this keys: `breakpoint_number`, `bp.number`,
`file_name`, `line_number`, `condition`, `enabled`.
Warning: IKPDb line numbers are 1 based so line number conversion
... | python | def get_breakpoints_list(cls):
""":return: a list of all breakpoints.
:rtype: a list of dict with this keys: `breakpoint_number`, `bp.number`,
`file_name`, `line_number`, `condition`, `enabled`.
Warning: IKPDb line numbers are 1 based so line number conversion
... | [
"def",
"get_breakpoints_list",
"(",
"cls",
")",
":",
"breakpoints_list",
"=",
"[",
"]",
"for",
"bp",
"in",
"cls",
".",
"breakpoints_by_number",
":",
"if",
"bp",
":",
"# breakpoint #0 exists and is always None",
"bp_dict",
"=",
"{",
"'breakpoint_number'",
":",
"bp"... | :return: a list of all breakpoints.
:rtype: a list of dict with this keys: `breakpoint_number`, `bp.number`,
`file_name`, `line_number`, `condition`, `enabled`.
Warning: IKPDb line numbers are 1 based so line number conversion
must be done by clients (eg. inouk.i... | [
":",
"return",
":",
"a",
"list",
"of",
"all",
"breakpoints",
".",
":",
"rtype",
":",
"a",
"list",
"of",
"dict",
"with",
"this",
"keys",
":",
"breakpoint_number",
"bp",
".",
"number",
"file_name",
"line_number",
"condition",
"enabled",
".",
"Warning",
":",
... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L515-L534 |
cmorisse/ikp3db | ikp3db.py | IKBreakpoint.disable_all_breakpoints | def disable_all_breakpoints(cls):
""" Disable all breakpoints and udate `active_breakpoint_flag`.
"""
for bp in cls.breakpoints_by_number:
if bp: # breakpoint #0 exists and is always None
bp.enabled = False
cls.update_active_breakpoint_flag()
return | python | def disable_all_breakpoints(cls):
""" Disable all breakpoints and udate `active_breakpoint_flag`.
"""
for bp in cls.breakpoints_by_number:
if bp: # breakpoint #0 exists and is always None
bp.enabled = False
cls.update_active_breakpoint_flag()
return | [
"def",
"disable_all_breakpoints",
"(",
"cls",
")",
":",
"for",
"bp",
"in",
"cls",
".",
"breakpoints_by_number",
":",
"if",
"bp",
":",
"# breakpoint #0 exists and is always None",
"bp",
".",
"enabled",
"=",
"False",
"cls",
".",
"update_active_breakpoint_flag",
"(",
... | Disable all breakpoints and udate `active_breakpoint_flag`. | [
"Disable",
"all",
"breakpoints",
"and",
"udate",
"active_breakpoint_flag",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L537-L544 |
cmorisse/ikp3db | ikp3db.py | IKBreakpoint.backup_breakpoints_state | def backup_breakpoints_state(cls):
""" Returns the state of all breakpoints in a list that can be used
later to restore all breakpoints state"""
all_breakpoints_state = []
for bp in cls.breakpoints_by_number:
if bp:
all_breakpoints_state.append((bp.number,
... | python | def backup_breakpoints_state(cls):
""" Returns the state of all breakpoints in a list that can be used
later to restore all breakpoints state"""
all_breakpoints_state = []
for bp in cls.breakpoints_by_number:
if bp:
all_breakpoints_state.append((bp.number,
... | [
"def",
"backup_breakpoints_state",
"(",
"cls",
")",
":",
"all_breakpoints_state",
"=",
"[",
"]",
"for",
"bp",
"in",
"cls",
".",
"breakpoints_by_number",
":",
"if",
"bp",
":",
"all_breakpoints_state",
".",
"append",
"(",
"(",
"bp",
".",
"number",
",",
"bp",
... | Returns the state of all breakpoints in a list that can be used
later to restore all breakpoints state | [
"Returns",
"the",
"state",
"of",
"all",
"breakpoints",
"in",
"a",
"list",
"that",
"can",
"be",
"used",
"later",
"to",
"restore",
"all",
"breakpoints",
"state"
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L547-L556 |
cmorisse/ikp3db | ikp3db.py | IKBreakpoint.restore_breakpoints_state | def restore_breakpoints_state(cls, breakpoints_state_list):
"""Restore the state of breakpoints given a list provided by
backup_breakpoints_state(). If list of breakpoint has changed
since backup missing or added breakpoints are ignored.
breakpoints_state_list is a list of tup... | python | def restore_breakpoints_state(cls, breakpoints_state_list):
"""Restore the state of breakpoints given a list provided by
backup_breakpoints_state(). If list of breakpoint has changed
since backup missing or added breakpoints are ignored.
breakpoints_state_list is a list of tup... | [
"def",
"restore_breakpoints_state",
"(",
"cls",
",",
"breakpoints_state_list",
")",
":",
"for",
"breakpoint_state",
"in",
"breakpoints_state_list",
":",
"bp",
"=",
"cls",
".",
"breakpoints_by_number",
"[",
"breakpoint_state",
"[",
"0",
"]",
"]",
"if",
"bp",
":",
... | Restore the state of breakpoints given a list provided by
backup_breakpoints_state(). If list of breakpoint has changed
since backup missing or added breakpoints are ignored.
breakpoints_state_list is a list of tuple. Each tuple is of form:
(breakpoint_number, enabled, conditi... | [
"Restore",
"the",
"state",
"of",
"breakpoints",
"given",
"a",
"list",
"provided",
"by",
"backup_breakpoints_state",
"()",
".",
"If",
"list",
"of",
"breakpoint",
"has",
"changed",
"since",
"backup",
"missing",
"or",
"added",
"breakpoints",
"are",
"ignored",
".",
... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L559-L573 |
cmorisse/ikp3db | ikp3db.py | IKPdb.canonic | def canonic(self, file_name):
""" returns canonical version of a file name.
A canonical file name is an absolute, lowercase normalized path
to a given file.
"""
if file_name == "<" + file_name[1:-1] + ">":
return file_name
c_file_name = self.file_name_cache.g... | python | def canonic(self, file_name):
""" returns canonical version of a file name.
A canonical file name is an absolute, lowercase normalized path
to a given file.
"""
if file_name == "<" + file_name[1:-1] + ">":
return file_name
c_file_name = self.file_name_cache.g... | [
"def",
"canonic",
"(",
"self",
",",
"file_name",
")",
":",
"if",
"file_name",
"==",
"\"<\"",
"+",
"file_name",
"[",
"1",
":",
"-",
"1",
"]",
"+",
"\">\"",
":",
"return",
"file_name",
"c_file_name",
"=",
"self",
".",
"file_name_cache",
".",
"get",
"(",
... | returns canonical version of a file name.
A canonical file name is an absolute, lowercase normalized path
to a given file. | [
"returns",
"canonical",
"version",
"of",
"a",
"file",
"name",
".",
"A",
"canonical",
"file",
"name",
"is",
"an",
"absolute",
"lowercase",
"normalized",
"path",
"to",
"a",
"given",
"file",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L645-L657 |
cmorisse/ikp3db | ikp3db.py | IKPdb.normalize_path_in | def normalize_path_in(self, client_file_name):
"""Translate a (possibly incomplete) file or module name received from debugging client
into an absolute file name.
"""
_logger.p_debug("normalize_path_in(%s) with os.getcwd()=>%s", client_file_name, os.getcwd())
# remove cl... | python | def normalize_path_in(self, client_file_name):
"""Translate a (possibly incomplete) file or module name received from debugging client
into an absolute file name.
"""
_logger.p_debug("normalize_path_in(%s) with os.getcwd()=>%s", client_file_name, os.getcwd())
# remove cl... | [
"def",
"normalize_path_in",
"(",
"self",
",",
"client_file_name",
")",
":",
"_logger",
".",
"p_debug",
"(",
"\"normalize_path_in(%s) with os.getcwd()=>%s\"",
",",
"client_file_name",
",",
"os",
".",
"getcwd",
"(",
")",
")",
"# remove client CWD from file_path",
"if",
... | Translate a (possibly incomplete) file or module name received from debugging client
into an absolute file name. | [
"Translate",
"a",
"(",
"possibly",
"incomplete",
")",
"file",
"or",
"module",
"name",
"received",
"from",
"debugging",
"client",
"into",
"an",
"absolute",
"file",
"name",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L659-L704 |
cmorisse/ikp3db | ikp3db.py | IKPdb.normalize_path_out | def normalize_path_out(self, path):
"""Normalizes path sent to client
:param path: path to normalize
:return: normalized path
"""
if path.startswith(self._CWD):
normalized_path = path[len(self._CWD):]
else:
normalized_path = path
# For remo... | python | def normalize_path_out(self, path):
"""Normalizes path sent to client
:param path: path to normalize
:return: normalized path
"""
if path.startswith(self._CWD):
normalized_path = path[len(self._CWD):]
else:
normalized_path = path
# For remo... | [
"def",
"normalize_path_out",
"(",
"self",
",",
"path",
")",
":",
"if",
"path",
".",
"startswith",
"(",
"self",
".",
"_CWD",
")",
":",
"normalized_path",
"=",
"path",
"[",
"len",
"(",
"self",
".",
"_CWD",
")",
":",
"]",
"else",
":",
"normalized_path",
... | Normalizes path sent to client
:param path: path to normalize
:return: normalized path | [
"Normalizes",
"path",
"sent",
"to",
"client",
":",
"param",
"path",
":",
"path",
"to",
"normalize",
":",
"return",
":",
"normalized",
"path"
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L706-L719 |
cmorisse/ikp3db | ikp3db.py | IKPdb.object_properties_count | def object_properties_count(self, o):
""" returns the number of user browsable properties of an object. """
o_type = type(o)
if isinstance(o, (dict, list, tuple, set)):
return len(o)
elif isinstance(o, (type(None), bool, float,
str, int,
... | python | def object_properties_count(self, o):
""" returns the number of user browsable properties of an object. """
o_type = type(o)
if isinstance(o, (dict, list, tuple, set)):
return len(o)
elif isinstance(o, (type(None), bool, float,
str, int,
... | [
"def",
"object_properties_count",
"(",
"self",
",",
"o",
")",
":",
"o_type",
"=",
"type",
"(",
"o",
")",
"if",
"isinstance",
"(",
"o",
",",
"(",
"dict",
",",
"list",
",",
"tuple",
",",
"set",
")",
")",
":",
"return",
"len",
"(",
"o",
")",
"elif",... | returns the number of user browsable properties of an object. | [
"returns",
"the",
"number",
"of",
"user",
"browsable",
"properties",
"of",
"an",
"object",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L722-L764 |
cmorisse/ikp3db | ikp3db.py | IKPdb.extract_object_properties | def extract_object_properties(self, o, limit_size=False):
"""Extracts all properties from an object (eg. f_locals, f_globals,
user dict, instance ...) and returns them as an array of variables.
"""
try:
prop_str = repr(o)[:512]
except:
prop_str = "Error w... | python | def extract_object_properties(self, o, limit_size=False):
"""Extracts all properties from an object (eg. f_locals, f_globals,
user dict, instance ...) and returns them as an array of variables.
"""
try:
prop_str = repr(o)[:512]
except:
prop_str = "Error w... | [
"def",
"extract_object_properties",
"(",
"self",
",",
"o",
",",
"limit_size",
"=",
"False",
")",
":",
"try",
":",
"prop_str",
"=",
"repr",
"(",
"o",
")",
"[",
":",
"512",
"]",
"except",
":",
"prop_str",
"=",
"\"Error while extracting value\"",
"_logger",
"... | Extracts all properties from an object (eg. f_locals, f_globals,
user dict, instance ...) and returns them as an array of variables. | [
"Extracts",
"all",
"properties",
"from",
"an",
"object",
"(",
"eg",
".",
"f_locals",
"f_globals",
"user",
"dict",
"instance",
"...",
")",
"and",
"returns",
"them",
"as",
"an",
"array",
"of",
"variables",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L766-L842 |
cmorisse/ikp3db | ikp3db.py | IKPdb.extract_name_value_type | def extract_name_value_type(self, name, value, limit_size=False):
"""Extracts value of any object, eventually reduces it's size and
returns name, truncated value and type (for str with size appended)
"""
MAX_STRING_LEN_TO_RETURN = 487
try:
t_value = repr(value)
... | python | def extract_name_value_type(self, name, value, limit_size=False):
"""Extracts value of any object, eventually reduces it's size and
returns name, truncated value and type (for str with size appended)
"""
MAX_STRING_LEN_TO_RETURN = 487
try:
t_value = repr(value)
... | [
"def",
"extract_name_value_type",
"(",
"self",
",",
"name",
",",
"value",
",",
"limit_size",
"=",
"False",
")",
":",
"MAX_STRING_LEN_TO_RETURN",
"=",
"487",
"try",
":",
"t_value",
"=",
"repr",
"(",
"value",
")",
"except",
":",
"t_value",
"=",
"\"Error while ... | Extracts value of any object, eventually reduces it's size and
returns name, truncated value and type (for str with size appended) | [
"Extracts",
"value",
"of",
"any",
"object",
"eventually",
"reduces",
"it",
"s",
"size",
"and",
"returns",
"name",
"truncated",
"value",
"and",
"type",
"(",
"for",
"str",
"with",
"size",
"appended",
")"
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L844-L872 |
cmorisse/ikp3db | ikp3db.py | IKPdb.dump_frames | def dump_frames(self, frame):
""" dumps frames chain in a representation suitable for serialization
and remote (debugger) client usage.
"""
current_thread = threading.currentThread()
frames = []
frame_browser = frame
# Browse the frame chain as far as... | python | def dump_frames(self, frame):
""" dumps frames chain in a representation suitable for serialization
and remote (debugger) client usage.
"""
current_thread = threading.currentThread()
frames = []
frame_browser = frame
# Browse the frame chain as far as... | [
"def",
"dump_frames",
"(",
"self",
",",
"frame",
")",
":",
"current_thread",
"=",
"threading",
".",
"currentThread",
"(",
")",
"frames",
"=",
"[",
"]",
"frame_browser",
"=",
"frame",
"# Browse the frame chain as far as we can",
"_logger",
".",
"f_debug",
"(",
"\... | dumps frames chain in a representation suitable for serialization
and remote (debugger) client usage. | [
"dumps",
"frames",
"chain",
"in",
"a",
"representation",
"suitable",
"for",
"serialization",
"and",
"remote",
"(",
"debugger",
")",
"client",
"usage",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L874-L920 |
cmorisse/ikp3db | ikp3db.py | IKPdb.evaluate | def evaluate(self, frame_id, expression, global_context=False, disable_break=False):
"""Evaluates 'expression' in the context of the frame identified by
'frame_id' or globally.
Breakpoints are disabled depending on 'disable_break' value.
Returns a tuple of value and type both as str.
... | python | def evaluate(self, frame_id, expression, global_context=False, disable_break=False):
"""Evaluates 'expression' in the context of the frame identified by
'frame_id' or globally.
Breakpoints are disabled depending on 'disable_break' value.
Returns a tuple of value and type both as str.
... | [
"def",
"evaluate",
"(",
"self",
",",
"frame_id",
",",
"expression",
",",
"global_context",
"=",
"False",
",",
"disable_break",
"=",
"False",
")",
":",
"if",
"disable_break",
":",
"breakpoints_backup",
"=",
"IKBreakpoint",
".",
"backup_breakpoints_state",
"(",
")... | Evaluates 'expression' in the context of the frame identified by
'frame_id' or globally.
Breakpoints are disabled depending on 'disable_break' value.
Returns a tuple of value and type both as str.
Note that - depending on the CGI_ESCAPE_EVALUATE_OUTPUT attribute - value is
escap... | [
"Evaluates",
"expression",
"in",
"the",
"context",
"of",
"the",
"frame",
"identified",
"by",
"frame_id",
"or",
"globally",
".",
"Breakpoints",
"are",
"disabled",
"depending",
"on",
"disable_break",
"value",
".",
"Returns",
"a",
"tuple",
"of",
"value",
"and",
"... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L922-L993 |
cmorisse/ikp3db | ikp3db.py | IKPdb.let_variable | def let_variable(self, frame_id, var_name, expression_value):
""" Let a frame's var with a value by building then eval a let
expression with breakoints disabled.
"""
breakpoints_backup = IKBreakpoint.backup_breakpoints_state()
IKBreakpoint.disable_all_breakpoints()
let_... | python | def let_variable(self, frame_id, var_name, expression_value):
""" Let a frame's var with a value by building then eval a let
expression with breakoints disabled.
"""
breakpoints_backup = IKBreakpoint.backup_breakpoints_state()
IKBreakpoint.disable_all_breakpoints()
let_... | [
"def",
"let_variable",
"(",
"self",
",",
"frame_id",
",",
"var_name",
",",
"expression_value",
")",
":",
"breakpoints_backup",
"=",
"IKBreakpoint",
".",
"backup_breakpoints_state",
"(",
")",
"IKBreakpoint",
".",
"disable_all_breakpoints",
"(",
")",
"let_expression",
... | Let a frame's var with a value by building then eval a let
expression with breakoints disabled. | [
"Let",
"a",
"frame",
"s",
"var",
"with",
"a",
"value",
"by",
"building",
"then",
"eval",
"a",
"let",
"expression",
"with",
"breakoints",
"disabled",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L995-L1023 |
cmorisse/ikp3db | ikp3db.py | IKPdb.setup_step_into | def setup_step_into(self, frame, pure=False):
"""Setup debugger for a "stepInto"
"""
self.frame_calling = frame
if pure:
self.frame_stop = None
else:
self.frame_stop = frame
self.frame_return = None
self.frame_suspend = False
self.p... | python | def setup_step_into(self, frame, pure=False):
"""Setup debugger for a "stepInto"
"""
self.frame_calling = frame
if pure:
self.frame_stop = None
else:
self.frame_stop = frame
self.frame_return = None
self.frame_suspend = False
self.p... | [
"def",
"setup_step_into",
"(",
"self",
",",
"frame",
",",
"pure",
"=",
"False",
")",
":",
"self",
".",
"frame_calling",
"=",
"frame",
"if",
"pure",
":",
"self",
".",
"frame_stop",
"=",
"None",
"else",
":",
"self",
".",
"frame_stop",
"=",
"frame",
"self... | Setup debugger for a "stepInto" | [
"Setup",
"debugger",
"for",
"a",
"stepInto"
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1035-L1046 |
cmorisse/ikp3db | ikp3db.py | IKPdb.setup_step_out | def setup_step_out(self, frame):
"""Setup debugger for a "stepOut"
"""
self.frame_calling = None
self.frame_stop = None
self.frame_return = frame.f_back
self.frame_suspend = False
self.pending_stop = True
return | python | def setup_step_out(self, frame):
"""Setup debugger for a "stepOut"
"""
self.frame_calling = None
self.frame_stop = None
self.frame_return = frame.f_back
self.frame_suspend = False
self.pending_stop = True
return | [
"def",
"setup_step_out",
"(",
"self",
",",
"frame",
")",
":",
"self",
".",
"frame_calling",
"=",
"None",
"self",
".",
"frame_stop",
"=",
"None",
"self",
".",
"frame_return",
"=",
"frame",
".",
"f_back",
"self",
".",
"frame_suspend",
"=",
"False",
"self",
... | Setup debugger for a "stepOut" | [
"Setup",
"debugger",
"for",
"a",
"stepOut"
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1048-L1056 |
cmorisse/ikp3db | ikp3db.py | IKPdb.setup_suspend | def setup_suspend(self):
"""Setup debugger to "suspend" execution
"""
self.frame_calling = None
self.frame_stop = None
self.frame_return = None
self.frame_suspend = True
self.pending_stop = True
self.enable_tracing()
return | python | def setup_suspend(self):
"""Setup debugger to "suspend" execution
"""
self.frame_calling = None
self.frame_stop = None
self.frame_return = None
self.frame_suspend = True
self.pending_stop = True
self.enable_tracing()
return | [
"def",
"setup_suspend",
"(",
"self",
")",
":",
"self",
".",
"frame_calling",
"=",
"None",
"self",
".",
"frame_stop",
"=",
"None",
"self",
".",
"frame_return",
"=",
"None",
"self",
".",
"frame_suspend",
"=",
"True",
"self",
".",
"pending_stop",
"=",
"True",... | Setup debugger to "suspend" execution | [
"Setup",
"debugger",
"to",
"suspend",
"execution"
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1058-L1067 |
cmorisse/ikp3db | ikp3db.py | IKPdb.setup_resume | def setup_resume(self):
""" Setup debugger to "resume" execution
"""
self.frame_calling = None
self.frame_stop = None
self.frame_return = None
self.frame_suspend = False
self.pending_stop = False
if not IKBreakpoint.any_active_breakpoint:
self.... | python | def setup_resume(self):
""" Setup debugger to "resume" execution
"""
self.frame_calling = None
self.frame_stop = None
self.frame_return = None
self.frame_suspend = False
self.pending_stop = False
if not IKBreakpoint.any_active_breakpoint:
self.... | [
"def",
"setup_resume",
"(",
"self",
")",
":",
"self",
".",
"frame_calling",
"=",
"None",
"self",
".",
"frame_stop",
"=",
"None",
"self",
".",
"frame_return",
"=",
"None",
"self",
".",
"frame_suspend",
"=",
"False",
"self",
".",
"pending_stop",
"=",
"False"... | Setup debugger to "resume" execution | [
"Setup",
"debugger",
"to",
"resume",
"execution"
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1069-L1079 |
cmorisse/ikp3db | ikp3db.py | IKPdb.should_stop_here | def should_stop_here(self, frame):
""" Called by dispatch function to check wether debugger must stop at
this frame.
Note that we test 'step into' first to give a chance to 'stepOver' in
case user click on 'stepInto' on a 'no call' line.
"""
# TODO: Optimization => define... | python | def should_stop_here(self, frame):
""" Called by dispatch function to check wether debugger must stop at
this frame.
Note that we test 'step into' first to give a chance to 'stepOver' in
case user click on 'stepInto' on a 'no call' line.
"""
# TODO: Optimization => define... | [
"def",
"should_stop_here",
"(",
"self",
",",
"frame",
")",
":",
"# TODO: Optimization => defines a set of modules / names where _tracer",
"# is never registered. This will replace skip",
"#if self.skip and self.is_skipped_module(frame.f_globals.get('__name__')):",
"# return False",
"# ste... | Called by dispatch function to check wether debugger must stop at
this frame.
Note that we test 'step into' first to give a chance to 'stepOver' in
case user click on 'stepInto' on a 'no call' line. | [
"Called",
"by",
"dispatch",
"function",
"to",
"check",
"wether",
"debugger",
"must",
"stop",
"at",
"this",
"frame",
".",
"Note",
"that",
"we",
"test",
"step",
"into",
"first",
"to",
"give",
"a",
"chance",
"to",
"stepOver",
"in",
"case",
"user",
"click",
... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1089-L1113 |
cmorisse/ikp3db | ikp3db.py | IKPdb.should_break_here | def should_break_here(self, frame):
"""Check wether there is a breakpoint at this frame."""
# Next line commented out for performance
#_logger.b_debug("should_break_here(filename=%s, lineno=%s) with breaks=%s",
# frame.f_code.co_filename,
# frame.f_l... | python | def should_break_here(self, frame):
"""Check wether there is a breakpoint at this frame."""
# Next line commented out for performance
#_logger.b_debug("should_break_here(filename=%s, lineno=%s) with breaks=%s",
# frame.f_code.co_filename,
# frame.f_l... | [
"def",
"should_break_here",
"(",
"self",
",",
"frame",
")",
":",
"# Next line commented out for performance",
"#_logger.b_debug(\"should_break_here(filename=%s, lineno=%s) with breaks=%s\",",
"# frame.f_code.co_filename,",
"# frame.f_lineno,",
"# ... | Check wether there is a breakpoint at this frame. | [
"Check",
"wether",
"there",
"is",
"a",
"breakpoint",
"at",
"this",
"frame",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1115-L1129 |
cmorisse/ikp3db | ikp3db.py | IKPdb.get_threads | def get_threads(self):
"""Returns a dict of all threads and indicates thread being debugged.
key is thread ident and values thread info.
Information from this list can be used to swap thread being debugged.
"""
thread_list = {}
for thread in threading.enumerate():
... | python | def get_threads(self):
"""Returns a dict of all threads and indicates thread being debugged.
key is thread ident and values thread info.
Information from this list can be used to swap thread being debugged.
"""
thread_list = {}
for thread in threading.enumerate():
... | [
"def",
"get_threads",
"(",
"self",
")",
":",
"thread_list",
"=",
"{",
"}",
"for",
"thread",
"in",
"threading",
".",
"enumerate",
"(",
")",
":",
"thread_ident",
"=",
"thread",
".",
"ident",
"thread_list",
"[",
"thread_ident",
"]",
"=",
"{",
"\"ident\"",
"... | Returns a dict of all threads and indicates thread being debugged.
key is thread ident and values thread info.
Information from this list can be used to swap thread being debugged. | [
"Returns",
"a",
"dict",
"of",
"all",
"threads",
"and",
"indicates",
"thread",
"being",
"debugged",
".",
"key",
"is",
"thread",
"ident",
"and",
"values",
"thread",
"info",
".",
"Information",
"from",
"this",
"list",
"can",
"be",
"used",
"to",
"swap",
"threa... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1131-L1145 |
cmorisse/ikp3db | ikp3db.py | IKPdb.set_debugged_thread | def set_debugged_thread(self, target_thread_ident=None):
""" Allows to reset or set the thread to debug. """
if target_thread_ident is None:
self.debugged_thread_ident = None
self.debugged_thread_name = ''
return {
"result": self.get_threads(),
... | python | def set_debugged_thread(self, target_thread_ident=None):
""" Allows to reset or set the thread to debug. """
if target_thread_ident is None:
self.debugged_thread_ident = None
self.debugged_thread_name = ''
return {
"result": self.get_threads(),
... | [
"def",
"set_debugged_thread",
"(",
"self",
",",
"target_thread_ident",
"=",
"None",
")",
":",
"if",
"target_thread_ident",
"is",
"None",
":",
"self",
".",
"debugged_thread_ident",
"=",
"None",
"self",
".",
"debugged_thread_name",
"=",
"''",
"return",
"{",
"\"res... | Allows to reset or set the thread to debug. | [
"Allows",
"to",
"reset",
"or",
"set",
"the",
"thread",
"to",
"debug",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1148-L1176 |
cmorisse/ikp3db | ikp3db.py | IKPdb._line_tracer | def _line_tracer(self, frame, exc_info=False):
"""This function is called when debugger has decided that it must
stop or break at this frame."""
# next logging statement commented for performance
_logger.f_debug("user_line() with "
"threadName=%s, frame=%s, frame... | python | def _line_tracer(self, frame, exc_info=False):
"""This function is called when debugger has decided that it must
stop or break at this frame."""
# next logging statement commented for performance
_logger.f_debug("user_line() with "
"threadName=%s, frame=%s, frame... | [
"def",
"_line_tracer",
"(",
"self",
",",
"frame",
",",
"exc_info",
"=",
"False",
")",
":",
"# next logging statement commented for performance",
"_logger",
".",
"f_debug",
"(",
"\"user_line() with \"",
"\"threadName=%s, frame=%s, frame.f_code=%s, self.mainpyfile=%s,\"",
"\"self... | This function is called when debugger has decided that it must
stop or break at this frame. | [
"This",
"function",
"is",
"called",
"when",
"debugger",
"has",
"decided",
"that",
"it",
"must",
"stop",
"or",
"break",
"at",
"this",
"frame",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1179-L1298 |
cmorisse/ikp3db | ikp3db.py | IKPdb.dump_tracing_state | def dump_tracing_state(self, context):
""" A debug tool to dump all threads tracing state
"""
_logger.x_debug("Dumping all threads Tracing state: (%s)" % context)
_logger.x_debug(" self.tracing_enabled=%s" % self.tracing_enabled)
_logger.x_debug(" self.execution_started=%s... | python | def dump_tracing_state(self, context):
""" A debug tool to dump all threads tracing state
"""
_logger.x_debug("Dumping all threads Tracing state: (%s)" % context)
_logger.x_debug(" self.tracing_enabled=%s" % self.tracing_enabled)
_logger.x_debug(" self.execution_started=%s... | [
"def",
"dump_tracing_state",
"(",
"self",
",",
"context",
")",
":",
"_logger",
".",
"x_debug",
"(",
"\"Dumping all threads Tracing state: (%s)\"",
"%",
"context",
")",
"_logger",
".",
"x_debug",
"(",
"\" self.tracing_enabled=%s\"",
"%",
"self",
".",
"tracing_enable... | A debug tool to dump all threads tracing state | [
"A",
"debug",
"tool",
"to",
"dump",
"all",
"threads",
"tracing",
"state"
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1353-L1383 |
cmorisse/ikp3db | ikp3db.py | IKPdb.enable_tracing | def enable_tracing(self):
""" Enable tracing if it is disabled and debugged program is running,
else do nothing.
Do this on all threads but the debugger thread.
:return: True if tracing has been enabled, False else.
"""
_logger.x_debug("entering enable_tracing()")
... | python | def enable_tracing(self):
""" Enable tracing if it is disabled and debugged program is running,
else do nothing.
Do this on all threads but the debugger thread.
:return: True if tracing has been enabled, False else.
"""
_logger.x_debug("entering enable_tracing()")
... | [
"def",
"enable_tracing",
"(",
"self",
")",
":",
"_logger",
".",
"x_debug",
"(",
"\"entering enable_tracing()\"",
")",
"# uncomment next line to get debugger tracing info",
"#self.dump_tracing_state(\"before enable_tracing()\")",
"if",
"not",
"self",
".",
"tracing_enabled",
"and... | Enable tracing if it is disabled and debugged program is running,
else do nothing.
Do this on all threads but the debugger thread.
:return: True if tracing has been enabled, False else. | [
"Enable",
"tracing",
"if",
"it",
"is",
"disabled",
"and",
"debugged",
"program",
"is",
"running",
"else",
"do",
"nothing",
".",
"Do",
"this",
"on",
"all",
"threads",
"but",
"the",
"debugger",
"thread",
".",
":",
"return",
":",
"True",
"if",
"tracing",
"h... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1385-L1409 |
cmorisse/ikp3db | ikp3db.py | IKPdb.disable_tracing | def disable_tracing(self):
""" Disable tracing if it is disabled and debugged program is running,
else do nothing.
:return: False if tracing has been disabled, True else.
"""
_logger.x_debug("disable_tracing()")
#self.dump_tracing_state("before disable_tracing()")
... | python | def disable_tracing(self):
""" Disable tracing if it is disabled and debugged program is running,
else do nothing.
:return: False if tracing has been disabled, True else.
"""
_logger.x_debug("disable_tracing()")
#self.dump_tracing_state("before disable_tracing()")
... | [
"def",
"disable_tracing",
"(",
"self",
")",
":",
"_logger",
".",
"x_debug",
"(",
"\"disable_tracing()\"",
")",
"#self.dump_tracing_state(\"before disable_tracing()\")",
"if",
"self",
".",
"tracing_enabled",
"and",
"self",
".",
"execution_started",
":",
"threading",
".",... | Disable tracing if it is disabled and debugged program is running,
else do nothing.
:return: False if tracing has been disabled, True else. | [
"Disable",
"tracing",
"if",
"it",
"is",
"disabled",
"and",
"debugged",
"program",
"is",
"running",
"else",
"do",
"nothing",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1411-L1424 |
cmorisse/ikp3db | ikp3db.py | IKPdb.set_breakpoint | def set_breakpoint(self, file_name, line_number, condition=None, enabled=True):
""" Create a breakpoint, register it in the class's lists and returns
a tuple of (error_message, break_number)
"""
c_file_name = self.canonic(file_name)
import linecache
line = linecache.getli... | python | def set_breakpoint(self, file_name, line_number, condition=None, enabled=True):
""" Create a breakpoint, register it in the class's lists and returns
a tuple of (error_message, break_number)
"""
c_file_name = self.canonic(file_name)
import linecache
line = linecache.getli... | [
"def",
"set_breakpoint",
"(",
"self",
",",
"file_name",
",",
"line_number",
",",
"condition",
"=",
"None",
",",
"enabled",
"=",
"True",
")",
":",
"c_file_name",
"=",
"self",
".",
"canonic",
"(",
"file_name",
")",
"import",
"linecache",
"line",
"=",
"lineca... | Create a breakpoint, register it in the class's lists and returns
a tuple of (error_message, break_number) | [
"Create",
"a",
"breakpoint",
"register",
"it",
"in",
"the",
"class",
"s",
"lists",
"and",
"returns",
"a",
"tuple",
"of",
"(",
"error_message",
"break_number",
")"
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1426-L1440 |
cmorisse/ikp3db | ikp3db.py | IKPdb.change_breakpoint_state | def change_breakpoint_state(self, bp_number, enabled, condition=None):
""" Change breakpoint status or `condition` expression.
:param bp_number: number of breakpoint to change
:return: None or an error message (string)
"""
if not (0 <= bp_number < len(IKBreakpoint.break... | python | def change_breakpoint_state(self, bp_number, enabled, condition=None):
""" Change breakpoint status or `condition` expression.
:param bp_number: number of breakpoint to change
:return: None or an error message (string)
"""
if not (0 <= bp_number < len(IKBreakpoint.break... | [
"def",
"change_breakpoint_state",
"(",
"self",
",",
"bp_number",
",",
"enabled",
",",
"condition",
"=",
"None",
")",
":",
"if",
"not",
"(",
"0",
"<=",
"bp_number",
"<",
"len",
"(",
"IKBreakpoint",
".",
"breakpoints_by_number",
")",
")",
":",
"return",
"\"F... | Change breakpoint status or `condition` expression.
:param bp_number: number of breakpoint to change
:return: None or an error message (string) | [
"Change",
"breakpoint",
"status",
"or",
"condition",
"expression",
".",
":",
"param",
"bp_number",
":",
"number",
"of",
"breakpoint",
"to",
"change",
":",
"return",
":",
"None",
"or",
"an",
"error",
"message",
"(",
"string",
")"
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1442-L1466 |
cmorisse/ikp3db | ikp3db.py | IKPdb.clear_breakpoint | def clear_breakpoint(self, breakpoint_number):
""" Delete a breakpoint identified by it's number.
:param breakpoint_number: index of breakpoint to delete
:type breakpoint_number: int
:return: an error message or None
"""
if not (0 <= breakpoint_number < len(IKB... | python | def clear_breakpoint(self, breakpoint_number):
""" Delete a breakpoint identified by it's number.
:param breakpoint_number: index of breakpoint to delete
:type breakpoint_number: int
:return: an error message or None
"""
if not (0 <= breakpoint_number < len(IKB... | [
"def",
"clear_breakpoint",
"(",
"self",
",",
"breakpoint_number",
")",
":",
"if",
"not",
"(",
"0",
"<=",
"breakpoint_number",
"<",
"len",
"(",
"IKBreakpoint",
".",
"breakpoints_by_number",
")",
")",
":",
"return",
"\"Found no breakpoint numbered %s\"",
"%",
"break... | Delete a breakpoint identified by it's number.
:param breakpoint_number: index of breakpoint to delete
:type breakpoint_number: int
:return: an error message or None | [
"Delete",
"a",
"breakpoint",
"identified",
"by",
"it",
"s",
"number",
".",
":",
"param",
"breakpoint_number",
":",
"index",
"of",
"breakpoint",
"to",
"delete",
":",
"type",
"breakpoint_number",
":",
"int",
":",
"return",
":",
"an",
"error",
"message",
"or",
... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1468-L1488 |
cmorisse/ikp3db | ikp3db.py | IKPdb._runscript | def _runscript(self, filename):
""" Launchs debugged program execution using the execfile() builtin.
We reset and setup the __main__ dict to allow the script to run
in __main__ namespace. This is required for imports from __main__ to
run correctly.
Note tha... | python | def _runscript(self, filename):
""" Launchs debugged program execution using the execfile() builtin.
We reset and setup the __main__ dict to allow the script to run
in __main__ namespace. This is required for imports from __main__ to
run correctly.
Note tha... | [
"def",
"_runscript",
"(",
"self",
",",
"filename",
")",
":",
"import",
"__main__",
"__main__",
".",
"__dict__",
".",
"clear",
"(",
")",
"__main__",
".",
"__dict__",
".",
"update",
"(",
"{",
"\"__name__\"",
":",
"\"__main__\"",
",",
"\"__file__\"",
":",
"fi... | Launchs debugged program execution using the execfile() builtin.
We reset and setup the __main__ dict to allow the script to run
in __main__ namespace. This is required for imports from __main__ to
run correctly.
Note that this has the effect to wipe IKP3db's vars ... | [
"Launchs",
"debugged",
"program",
"execution",
"using",
"the",
"execfile",
"()",
"builtin",
".",
"We",
"reset",
"and",
"setup",
"the",
"__main__",
"dict",
"to",
"allow",
"the",
"script",
"to",
"run",
"in",
"__main__",
"namespace",
".",
"This",
"is",
"require... | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1490-L1531 |
cmorisse/ikp3db | ikp3db.py | IKPdb.command_loop | def command_loop(self, run_script_event):
""" This is the debugger command loop that processes (protocol) client
requests.
"""
while True:
obj = remote_client.receive(self)
command = obj["command"]
# TODO: ensure we always have a command if receive r... | python | def command_loop(self, run_script_event):
""" This is the debugger command loop that processes (protocol) client
requests.
"""
while True:
obj = remote_client.receive(self)
command = obj["command"]
# TODO: ensure we always have a command if receive r... | [
"def",
"command_loop",
"(",
"self",
",",
"run_script_event",
")",
":",
"while",
"True",
":",
"obj",
"=",
"remote_client",
".",
"receive",
"(",
"self",
")",
"command",
"=",
"obj",
"[",
"\"command\"",
"]",
"# TODO: ensure we always have a command if receive returns",
... | This is the debugger command loop that processes (protocol) client
requests. | [
"This",
"is",
"the",
"debugger",
"command",
"loop",
"that",
"processes",
"(",
"protocol",
")",
"client",
"requests",
"."
] | train | https://github.com/cmorisse/ikp3db/blob/a0f318d4e8494b2e6f2f07ec0f1202ca023c920f/ikp3db.py#L1533-L1784 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | _ResourceElement._get_elements | def _get_elements(self, url, key, eclass, id=None, name=None):
"""Get elements matching `id` or `name`
Args:
url(str): url of children.
key(str): key in the returned JSON.
eclass(subclass type of :py:class:`_ResourceElement`): element class to create instances of.
... | python | def _get_elements(self, url, key, eclass, id=None, name=None):
"""Get elements matching `id` or `name`
Args:
url(str): url of children.
key(str): key in the returned JSON.
eclass(subclass type of :py:class:`_ResourceElement`): element class to create instances of.
... | [
"def",
"_get_elements",
"(",
"self",
",",
"url",
",",
"key",
",",
"eclass",
",",
"id",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"id",
"is",
"not",
"None",
"and",
"name",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"id and ... | Get elements matching `id` or `name`
Args:
url(str): url of children.
key(str): key in the returned JSON.
eclass(subclass type of :py:class:`_ResourceElement`): element class to create instances of.
id(str, optional): only return resources whose `id` property mat... | [
"Get",
"elements",
"matching",
"id",
"or",
"name"
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L113-L134 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | _ResourceElement._get_element_by_id | def _get_element_by_id(self, url, key, eclass, id):
"""Get a single element matching an `id`
Args:
url(str): url of children.
key(str): key in the returned JSON.
eclass(subclass type of :py:class:`_ResourceElement`): element class to create instances of.
... | python | def _get_element_by_id(self, url, key, eclass, id):
"""Get a single element matching an `id`
Args:
url(str): url of children.
key(str): key in the returned JSON.
eclass(subclass type of :py:class:`_ResourceElement`): element class to create instances of.
... | [
"def",
"_get_element_by_id",
"(",
"self",
",",
"url",
",",
"key",
",",
"eclass",
",",
"id",
")",
":",
"elements",
"=",
"self",
".",
"_get_elements",
"(",
"url",
",",
"key",
",",
"eclass",
",",
"id",
"=",
"id",
")",
"if",
"not",
"elements",
":",
"ra... | Get a single element matching an `id`
Args:
url(str): url of children.
key(str): key in the returned JSON.
eclass(subclass type of :py:class:`_ResourceElement`): element class to create instances of.
id(str): return resources whose `id` property matches the given... | [
"Get",
"a",
"single",
"element",
"matching",
"an",
"id"
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L136-L156 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | View.get_domain | def get_domain(self):
"""Get the Streams domain for the instance that owns this view.
Returns:
Domain: Streams domain for the instance owning this view.
"""
if hasattr(self, 'domain'):
return Domain(self.rest_client.make_request(self.domain), self.rest_client) | python | def get_domain(self):
"""Get the Streams domain for the instance that owns this view.
Returns:
Domain: Streams domain for the instance owning this view.
"""
if hasattr(self, 'domain'):
return Domain(self.rest_client.make_request(self.domain), self.rest_client) | [
"def",
"get_domain",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'domain'",
")",
":",
"return",
"Domain",
"(",
"self",
".",
"rest_client",
".",
"make_request",
"(",
"self",
".",
"domain",
")",
",",
"self",
".",
"rest_client",
")"
] | Get the Streams domain for the instance that owns this view.
Returns:
Domain: Streams domain for the instance owning this view. | [
"Get",
"the",
"Streams",
"domain",
"for",
"the",
"instance",
"that",
"owns",
"this",
"view",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L559-L566 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | View.get_instance | def get_instance(self):
"""Get the Streams instance that owns this view.
Returns:
Instance: Streams instance owning this view.
"""
return Instance(self.rest_client.make_request(self.instance), self.rest_client) | python | def get_instance(self):
"""Get the Streams instance that owns this view.
Returns:
Instance: Streams instance owning this view.
"""
return Instance(self.rest_client.make_request(self.instance), self.rest_client) | [
"def",
"get_instance",
"(",
"self",
")",
":",
"return",
"Instance",
"(",
"self",
".",
"rest_client",
".",
"make_request",
"(",
"self",
".",
"instance",
")",
",",
"self",
".",
"rest_client",
")"
] | Get the Streams instance that owns this view.
Returns:
Instance: Streams instance owning this view. | [
"Get",
"the",
"Streams",
"instance",
"that",
"owns",
"this",
"view",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L568-L574 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | View.get_job | def get_job(self):
"""Get the Streams job that owns this view.
Returns:
Job: Streams Job owning this view.
"""
return Job(self.rest_client.make_request(self.job), self.rest_client) | python | def get_job(self):
"""Get the Streams job that owns this view.
Returns:
Job: Streams Job owning this view.
"""
return Job(self.rest_client.make_request(self.job), self.rest_client) | [
"def",
"get_job",
"(",
"self",
")",
":",
"return",
"Job",
"(",
"self",
".",
"rest_client",
".",
"make_request",
"(",
"self",
".",
"job",
")",
",",
"self",
".",
"rest_client",
")"
] | Get the Streams job that owns this view.
Returns:
Job: Streams Job owning this view. | [
"Get",
"the",
"Streams",
"job",
"that",
"owns",
"this",
"view",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L576-L582 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | View.stop_data_fetch | def stop_data_fetch(self):
"""Stops the thread that fetches data from the Streams view server.
"""
if self._data_fetcher:
self._data_fetcher.stop.set()
self._data_fetcher = None | python | def stop_data_fetch(self):
"""Stops the thread that fetches data from the Streams view server.
"""
if self._data_fetcher:
self._data_fetcher.stop.set()
self._data_fetcher = None | [
"def",
"stop_data_fetch",
"(",
"self",
")",
":",
"if",
"self",
".",
"_data_fetcher",
":",
"self",
".",
"_data_fetcher",
".",
"stop",
".",
"set",
"(",
")",
"self",
".",
"_data_fetcher",
"=",
"None"
] | Stops the thread that fetches data from the Streams view server. | [
"Stops",
"the",
"thread",
"that",
"fetches",
"data",
"from",
"the",
"Streams",
"view",
"server",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L584-L589 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | View.start_data_fetch | def start_data_fetch(self):
"""Starts a thread that fetches data from the Streams view server.
Each item in the returned `Queue` represents a single tuple
on the stream the view is attached to.
Returns:
queue.Queue: Queue containing view data.
.. note:: Thi... | python | def start_data_fetch(self):
"""Starts a thread that fetches data from the Streams view server.
Each item in the returned `Queue` represents a single tuple
on the stream the view is attached to.
Returns:
queue.Queue: Queue containing view data.
.. note:: Thi... | [
"def",
"start_data_fetch",
"(",
"self",
")",
":",
"self",
".",
"stop_data_fetch",
"(",
")",
"self",
".",
"_data_fetcher",
"=",
"_ViewDataFetcher",
"(",
"self",
",",
"self",
".",
"_tuple_fn",
")",
"t",
"=",
"threading",
".",
"Thread",
"(",
"target",
"=",
... | Starts a thread that fetches data from the Streams view server.
Each item in the returned `Queue` represents a single tuple
on the stream the view is attached to.
Returns:
queue.Queue: Queue containing view data.
.. note:: This is a queue of the tuples coverted to ... | [
"Starts",
"a",
"thread",
"that",
"fetches",
"data",
"from",
"the",
"Streams",
"view",
"server",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L591-L607 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | View.fetch_tuples | def fetch_tuples(self, max_tuples=20, timeout=None):
"""
Fetch a number of tuples from this view.
Fetching of data must have been started with
:py:meth:`start_data_fetch` before calling this method.
If ``timeout`` is ``None`` then the returned list will
contain ``max_tu... | python | def fetch_tuples(self, max_tuples=20, timeout=None):
"""
Fetch a number of tuples from this view.
Fetching of data must have been started with
:py:meth:`start_data_fetch` before calling this method.
If ``timeout`` is ``None`` then the returned list will
contain ``max_tu... | [
"def",
"fetch_tuples",
"(",
"self",
",",
"max_tuples",
"=",
"20",
",",
"timeout",
"=",
"None",
")",
":",
"tuples",
"=",
"list",
"(",
")",
"if",
"timeout",
"is",
"None",
":",
"while",
"len",
"(",
"tuples",
")",
"<",
"max_tuples",
":",
"fetcher",
"=",
... | Fetch a number of tuples from this view.
Fetching of data must have been started with
:py:meth:`start_data_fetch` before calling this method.
If ``timeout`` is ``None`` then the returned list will
contain ``max_tuples`` tuples. Otherwise if the timeout is reached
the list may c... | [
"Fetch",
"a",
"number",
"of",
"tuples",
"from",
"this",
"view",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L609-L650 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | View.display | def display(self, duration=None, period=2):
"""Display a view within a Jupyter or IPython notebook.
Provides an easy mechanism to visualize data on a stream
using a view.
Tuples are fetched from the view and displayed in a table
within the notebook cell using a ``pandas.DataFra... | python | def display(self, duration=None, period=2):
"""Display a view within a Jupyter or IPython notebook.
Provides an easy mechanism to visualize data on a stream
using a view.
Tuples are fetched from the view and displayed in a table
within the notebook cell using a ``pandas.DataFra... | [
"def",
"display",
"(",
"self",
",",
"duration",
"=",
"None",
",",
"period",
"=",
"2",
")",
":",
"import",
"ipywidgets",
"as",
"widgets",
"vn",
"=",
"widgets",
".",
"Text",
"(",
"value",
"=",
"self",
".",
"description",
",",
"description",
"=",
"self",
... | Display a view within a Jupyter or IPython notebook.
Provides an easy mechanism to visualize data on a stream
using a view.
Tuples are fetched from the view and displayed in a table
within the notebook cell using a ``pandas.DataFrame``.
The table is continually updated with the... | [
"Display",
"a",
"view",
"within",
"a",
"Jupyter",
"or",
"IPython",
"notebook",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L652-L690 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | View.get_view_items | def get_view_items(self):
"""Get a list of :py:class:`ViewItem` elements associated with this view.
Returns:
list(ViewItem): List of ViewItem(s) associated with this view.
"""
view_items = [ViewItem(json_view_items, self.rest_client) for json_view_items
... | python | def get_view_items(self):
"""Get a list of :py:class:`ViewItem` elements associated with this view.
Returns:
list(ViewItem): List of ViewItem(s) associated with this view.
"""
view_items = [ViewItem(json_view_items, self.rest_client) for json_view_items
... | [
"def",
"get_view_items",
"(",
"self",
")",
":",
"view_items",
"=",
"[",
"ViewItem",
"(",
"json_view_items",
",",
"self",
".",
"rest_client",
")",
"for",
"json_view_items",
"in",
"self",
".",
"rest_client",
".",
"make_request",
"(",
"self",
".",
"viewItems",
... | Get a list of :py:class:`ViewItem` elements associated with this view.
Returns:
list(ViewItem): List of ViewItem(s) associated with this view. | [
"Get",
"a",
"list",
"of",
":",
"py",
":",
"class",
":",
"ViewItem",
"elements",
"associated",
"with",
"this",
"view",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L733-L742 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | Job.retrieve_log_trace | def retrieve_log_trace(self, filename=None, dir=None):
"""Retrieves the application log and trace files of the job
and saves them as a compressed tar file.
An existing file with the same name will be overwritten.
Args:
filename (str): name of the created tar file. Defaults ... | python | def retrieve_log_trace(self, filename=None, dir=None):
"""Retrieves the application log and trace files of the job
and saves them as a compressed tar file.
An existing file with the same name will be overwritten.
Args:
filename (str): name of the created tar file. Defaults ... | [
"def",
"retrieve_log_trace",
"(",
"self",
",",
"filename",
"=",
"None",
",",
"dir",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"\"applicationLogTrace\"",
")",
"and",
"self",
".",
"applicationLogTrace",
"is",
"not",
"None",
":",
"logger",
"."... | Retrieves the application log and trace files of the job
and saves them as a compressed tar file.
An existing file with the same name will be overwritten.
Args:
filename (str): name of the created tar file. Defaults to `job_<id>_<timestamp>.tar.gz` where `id` is the job identifier ... | [
"Retrieves",
"the",
"application",
"log",
"and",
"trace",
"files",
"of",
"the",
"job",
"and",
"saves",
"them",
"as",
"a",
"compressed",
"tar",
"file",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L815-L838 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | Job.get_views | def get_views(self, name=None):
"""Get the list of :py:class:`~streamsx.rest_primitives.View` elements associated with this job.
Args:
name(str, optional): Returns view(s) matching `name`. `name` can be a regular expression. If `name`
is not supplied, then all views associated... | python | def get_views(self, name=None):
"""Get the list of :py:class:`~streamsx.rest_primitives.View` elements associated with this job.
Args:
name(str, optional): Returns view(s) matching `name`. `name` can be a regular expression. If `name`
is not supplied, then all views associated... | [
"def",
"get_views",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"return",
"self",
".",
"_get_elements",
"(",
"self",
".",
"views",
",",
"'views'",
",",
"View",
",",
"name",
"=",
"name",
")"
] | Get the list of :py:class:`~streamsx.rest_primitives.View` elements associated with this job.
Args:
name(str, optional): Returns view(s) matching `name`. `name` can be a regular expression. If `name`
is not supplied, then all views associated with this instance are returned.
... | [
"Get",
"the",
"list",
"of",
":",
"py",
":",
"class",
":",
"~streamsx",
".",
"rest_primitives",
".",
"View",
"elements",
"associated",
"with",
"this",
"job",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L840-L858 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | Job.get_operators | def get_operators(self, name=None):
"""Get the list of :py:class:`Operator` elements associated with this job.
Args:
name(str): Only return operators matching `name`, where `name` can be a regular expression. If
`name` is not supplied, then all operators for this job are re... | python | def get_operators(self, name=None):
"""Get the list of :py:class:`Operator` elements associated with this job.
Args:
name(str): Only return operators matching `name`, where `name` can be a regular expression. If
`name` is not supplied, then all operators for this job are re... | [
"def",
"get_operators",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"return",
"self",
".",
"_get_elements",
"(",
"self",
".",
"operators",
",",
"'operators'",
",",
"Operator",
",",
"name",
"=",
"name",
")"
] | Get the list of :py:class:`Operator` elements associated with this job.
Args:
name(str): Only return operators matching `name`, where `name` can be a regular expression. If
`name` is not supplied, then all operators for this job are returned.
Returns:
list(Oper... | [
"Get",
"the",
"list",
"of",
":",
"py",
":",
"class",
":",
"Operator",
"elements",
"associated",
"with",
"this",
"job",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L894-L914 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | Job.cancel | def cancel(self, force=False):
"""Cancel this job.
Args:
force (bool, optional): Forcefully cancel this job.
Returns:
bool: True if the job was cancelled, otherwise False if an error occurred.
"""
return self.rest_client._sc._delegator._cancel_job(self, ... | python | def cancel(self, force=False):
"""Cancel this job.
Args:
force (bool, optional): Forcefully cancel this job.
Returns:
bool: True if the job was cancelled, otherwise False if an error occurred.
"""
return self.rest_client._sc._delegator._cancel_job(self, ... | [
"def",
"cancel",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"return",
"self",
".",
"rest_client",
".",
"_sc",
".",
"_delegator",
".",
"_cancel_job",
"(",
"self",
",",
"force",
")"
] | Cancel this job.
Args:
force (bool, optional): Forcefully cancel this job.
Returns:
bool: True if the job was cancelled, otherwise False if an error occurred. | [
"Cancel",
"this",
"job",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L942-L951 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | Operator.get_metrics | def get_metrics(self, name=None):
"""Get metrics for this operator.
Args:
name(str, optional): Only return metrics matching `name`, where `name` can be a regular expression. If
`name` is not supplied, then all metrics for this operator are returned.
Returns:
... | python | def get_metrics(self, name=None):
"""Get metrics for this operator.
Args:
name(str, optional): Only return metrics matching `name`, where `name` can be a regular expression. If
`name` is not supplied, then all metrics for this operator are returned.
Returns:
... | [
"def",
"get_metrics",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"return",
"self",
".",
"_get_elements",
"(",
"self",
".",
"metrics",
",",
"'metrics'",
",",
"Metric",
",",
"name",
"=",
"name",
")"
] | Get metrics for this operator.
Args:
name(str, optional): Only return metrics matching `name`, where `name` can be a regular expression. If
`name` is not supplied, then all metrics for this operator are returned.
Returns:
list(Metric): List of matching metrics... | [
"Get",
"metrics",
"for",
"this",
"operator",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L971-L989 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | Operator.get_host | def get_host(self):
"""Get resource this operator is currently executing in.
If the operator is running on an externally
managed resource ``None`` is returned.
Returns:
Host: Resource this operator is running on.
.. versionadded:: 1.9
"""
if ha... | python | def get_host(self):
"""Get resource this operator is currently executing in.
If the operator is running on an externally
managed resource ``None`` is returned.
Returns:
Host: Resource this operator is running on.
.. versionadded:: 1.9
"""
if ha... | [
"def",
"get_host",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'host'",
")",
"and",
"self",
".",
"host",
":",
"return",
"Host",
"(",
"self",
".",
"rest_client",
".",
"make_request",
"(",
"self",
".",
"host",
")",
",",
"self",
".",
"r... | Get resource this operator is currently executing in.
If the operator is running on an externally
managed resource ``None`` is returned.
Returns:
Host: Resource this operator is running on.
.. versionadded:: 1.9 | [
"Get",
"resource",
"this",
"operator",
"is",
"currently",
"executing",
"in",
".",
"If",
"the",
"operator",
"is",
"running",
"on",
"an",
"externally",
"managed",
"resource",
"None",
"is",
"returned",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L991-L1002 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | Operator.get_pe | def get_pe(self):
"""Get the Streams processing element this operator is executing in.
Returns:
PE: Processing element for this operator.
.. versionadded:: 1.9
"""
return PE(self.rest_client.make_request(self.pe), self.rest_client) | python | def get_pe(self):
"""Get the Streams processing element this operator is executing in.
Returns:
PE: Processing element for this operator.
.. versionadded:: 1.9
"""
return PE(self.rest_client.make_request(self.pe), self.rest_client) | [
"def",
"get_pe",
"(",
"self",
")",
":",
"return",
"PE",
"(",
"self",
".",
"rest_client",
".",
"make_request",
"(",
"self",
".",
"pe",
")",
",",
"self",
".",
"rest_client",
")"
] | Get the Streams processing element this operator is executing in.
Returns:
PE: Processing element for this operator.
.. versionadded:: 1.9 | [
"Get",
"the",
"Streams",
"processing",
"element",
"this",
"operator",
"is",
"executing",
"in",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1004-L1012 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | PE.retrieve_trace | def retrieve_trace(self, filename=None, dir=None):
"""Retrieves the application trace files for this PE
and saves them as a plain text file.
An existing file with the same name will be overwritten.
Args:
filename (str): name of the created file. Defaults to `pe_<id>_<timest... | python | def retrieve_trace(self, filename=None, dir=None):
"""Retrieves the application trace files for this PE
and saves them as a plain text file.
An existing file with the same name will be overwritten.
Args:
filename (str): name of the created file. Defaults to `pe_<id>_<timest... | [
"def",
"retrieve_trace",
"(",
"self",
",",
"filename",
"=",
"None",
",",
"dir",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"\"applicationTrace\"",
")",
"and",
"self",
".",
"applicationTrace",
"is",
"not",
"None",
":",
"logger",
".",
"debug... | Retrieves the application trace files for this PE
and saves them as a plain text file.
An existing file with the same name will be overwritten.
Args:
filename (str): name of the created file. Defaults to `pe_<id>_<timestamp>.trace` where `id` is the PE identifier and `timestamp` is... | [
"Retrieves",
"the",
"application",
"trace",
"files",
"for",
"this",
"PE",
"and",
"saves",
"them",
"as",
"a",
"plain",
"text",
"file",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1199-L1221 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | PE.retrieve_console_log | def retrieve_console_log(self, filename=None, dir=None):
"""Retrieves the application console log (standard out and error)
files for this PE and saves them as a plain text file.
An existing file with the same name will be overwritten.
Args:
filename (str): name of the creat... | python | def retrieve_console_log(self, filename=None, dir=None):
"""Retrieves the application console log (standard out and error)
files for this PE and saves them as a plain text file.
An existing file with the same name will be overwritten.
Args:
filename (str): name of the creat... | [
"def",
"retrieve_console_log",
"(",
"self",
",",
"filename",
"=",
"None",
",",
"dir",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"\"consoleLog\"",
")",
"and",
"self",
".",
"consoleLog",
"is",
"not",
"None",
":",
"logger",
".",
"debug",
"... | Retrieves the application console log (standard out and error)
files for this PE and saves them as a plain text file.
An existing file with the same name will be overwritten.
Args:
filename (str): name of the created file. Defaults to `pe_<id>_<timestamp>.stdouterr` where `id` is t... | [
"Retrieves",
"the",
"application",
"console",
"log",
"(",
"standard",
"out",
"and",
"error",
")",
"files",
"for",
"this",
"PE",
"and",
"saves",
"them",
"as",
"a",
"plain",
"text",
"file",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1223-L1245 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | PE.get_resource_allocation | def get_resource_allocation(self):
"""Get the :py:class:`ResourceAllocation` element tance.
Returns:
ResourceAllocation: Resource allocation used to access information about the resource where this PE is running.
.. versionadded:: 1.9
"""
if hasattr(self, 'resourceA... | python | def get_resource_allocation(self):
"""Get the :py:class:`ResourceAllocation` element tance.
Returns:
ResourceAllocation: Resource allocation used to access information about the resource where this PE is running.
.. versionadded:: 1.9
"""
if hasattr(self, 'resourceA... | [
"def",
"get_resource_allocation",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'resourceAllocation'",
")",
":",
"return",
"ResourceAllocation",
"(",
"self",
".",
"rest_client",
".",
"make_request",
"(",
"self",
".",
"resourceAllocation",
")",
",",
... | Get the :py:class:`ResourceAllocation` element tance.
Returns:
ResourceAllocation: Resource allocation used to access information about the resource where this PE is running.
.. versionadded:: 1.9 | [
"Get",
"the",
":",
"py",
":",
"class",
":",
"ResourceAllocation",
"element",
"tance",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1269-L1278 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | ResourceAllocation.get_resource | def get_resource(self):
"""Get the :py:class:`Resource` of the resource allocation.
Returns:
Resource: Resource for this allocation.
.. versionadded:: 1.9
"""
return Resource(self.rest_client.make_request(self.resource), self.rest_client) | python | def get_resource(self):
"""Get the :py:class:`Resource` of the resource allocation.
Returns:
Resource: Resource for this allocation.
.. versionadded:: 1.9
"""
return Resource(self.rest_client.make_request(self.resource), self.rest_client) | [
"def",
"get_resource",
"(",
"self",
")",
":",
"return",
"Resource",
"(",
"self",
".",
"rest_client",
".",
"make_request",
"(",
"self",
".",
"resource",
")",
",",
"self",
".",
"rest_client",
")"
] | Get the :py:class:`Resource` of the resource allocation.
Returns:
Resource: Resource for this allocation.
.. versionadded:: 1.9 | [
"Get",
"the",
":",
"py",
":",
"class",
":",
"Resource",
"of",
"the",
"resource",
"allocation",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1320-L1328 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | ResourceAllocation.get_jobs | def get_jobs(self, name=None):
"""Retrieves jobs running on this resource in its instance.
Args:
name (str, optional): Only return jobs containing property **name** that matches `name`. `name` can be a
regular expression. If `name` is not supplied, then all jobs are returned... | python | def get_jobs(self, name=None):
"""Retrieves jobs running on this resource in its instance.
Args:
name (str, optional): Only return jobs containing property **name** that matches `name`. `name` can be a
regular expression. If `name` is not supplied, then all jobs are returned... | [
"def",
"get_jobs",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"if",
"self",
".",
"applicationResource",
":",
"return",
"self",
".",
"_get_elements",
"(",
"self",
".",
"jobs",
",",
"'jobs'",
",",
"Job",
",",
"None",
",",
"name",
")",
"else",
":"... | Retrieves jobs running on this resource in its instance.
Args:
name (str, optional): Only return jobs containing property **name** that matches `name`. `name` can be a
regular expression. If `name` is not supplied, then all jobs are returned.
Returns:
list(Job):... | [
"Retrieves",
"jobs",
"running",
"on",
"this",
"resource",
"in",
"its",
"instance",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1345-L1361 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | ExportedStream.get_operator_output_port | def get_operator_output_port(self):
"""Get the output port of this exported stream.
Returns:
OperatorOutputPort: Output port of this exported stream.
"""
return OperatorOutputPort(self.rest_client.make_request(self.operatorOutputPort), self.rest_client) | python | def get_operator_output_port(self):
"""Get the output port of this exported stream.
Returns:
OperatorOutputPort: Output port of this exported stream.
"""
return OperatorOutputPort(self.rest_client.make_request(self.operatorOutputPort), self.rest_client) | [
"def",
"get_operator_output_port",
"(",
"self",
")",
":",
"return",
"OperatorOutputPort",
"(",
"self",
".",
"rest_client",
".",
"make_request",
"(",
"self",
".",
"operatorOutputPort",
")",
",",
"self",
".",
"rest_client",
")"
] | Get the output port of this exported stream.
Returns:
OperatorOutputPort: Output port of this exported stream. | [
"Get",
"the",
"output",
"port",
"of",
"this",
"exported",
"stream",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1435-L1441 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | ExportedStream._as_published_topic | def _as_published_topic(self):
"""This stream as a PublishedTopic if it is published otherwise None
"""
oop = self.get_operator_output_port()
if not hasattr(oop, 'export'):
return
export = oop.export
if export['type'] != 'properties':
return
... | python | def _as_published_topic(self):
"""This stream as a PublishedTopic if it is published otherwise None
"""
oop = self.get_operator_output_port()
if not hasattr(oop, 'export'):
return
export = oop.export
if export['type'] != 'properties':
return
... | [
"def",
"_as_published_topic",
"(",
"self",
")",
":",
"oop",
"=",
"self",
".",
"get_operator_output_port",
"(",
")",
"if",
"not",
"hasattr",
"(",
"oop",
",",
"'export'",
")",
":",
"return",
"export",
"=",
"oop",
".",
"export",
"if",
"export",
"[",
"'type'... | This stream as a PublishedTopic if it is published otherwise None | [
"This",
"stream",
"as",
"a",
"PublishedTopic",
"if",
"it",
"is",
"published",
"otherwise",
"None"
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1443-L1476 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | Instance.of_service | def of_service(config):
"""Connect to an IBM Streams service instance running in IBM Cloud Private for Data.
The instance is specified in `config`. The configuration may be code injected from the list of services
in a Jupyter notebook running in ICPD or manually created. The code that selects a... | python | def of_service(config):
"""Connect to an IBM Streams service instance running in IBM Cloud Private for Data.
The instance is specified in `config`. The configuration may be code injected from the list of services
in a Jupyter notebook running in ICPD or manually created. The code that selects a... | [
"def",
"of_service",
"(",
"config",
")",
":",
"service",
"=",
"Instance",
".",
"_find_service_def",
"(",
"config",
")",
"if",
"not",
"service",
":",
"raise",
"ValueError",
"(",
")",
"endpoint",
"=",
"service",
"[",
"'connection_info'",
"]",
".",
"get",
"("... | Connect to an IBM Streams service instance running in IBM Cloud Private for Data.
The instance is specified in `config`. The configuration may be code injected from the list of services
in a Jupyter notebook running in ICPD or manually created. The code that selects a service instance by name is::
... | [
"Connect",
"to",
"an",
"IBM",
"Streams",
"service",
"instance",
"running",
"in",
"IBM",
"Cloud",
"Private",
"for",
"Data",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1541-L1579 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | Instance.get_job | def get_job(self, id):
"""Retrieves a job matching the given `id`
Args:
id (str): Job `id` to match.
Returns:
Job: Job matching the given `id`
Raises:
ValueError: No resource matches given `id` or multiple resources matching given `id`
"""
... | python | def get_job(self, id):
"""Retrieves a job matching the given `id`
Args:
id (str): Job `id` to match.
Returns:
Job: Job matching the given `id`
Raises:
ValueError: No resource matches given `id` or multiple resources matching given `id`
"""
... | [
"def",
"get_job",
"(",
"self",
",",
"id",
")",
":",
"return",
"self",
".",
"_get_element_by_id",
"(",
"self",
".",
"jobs",
",",
"'jobs'",
",",
"Job",
",",
"str",
"(",
"id",
")",
")"
] | Retrieves a job matching the given `id`
Args:
id (str): Job `id` to match.
Returns:
Job: Job matching the given `id`
Raises:
ValueError: No resource matches given `id` or multiple resources matching given `id` | [
"Retrieves",
"a",
"job",
"matching",
"the",
"given",
"id"
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1717-L1729 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | Instance.get_published_topics | def get_published_topics(self):
"""Get a list of published topics for this instance.
Streams applications publish streams to a a topic that can be subscribed to by other
applications. This allows a microservice approach where publishers
and subscribers are independent of each other.
... | python | def get_published_topics(self):
"""Get a list of published topics for this instance.
Streams applications publish streams to a a topic that can be subscribed to by other
applications. This allows a microservice approach where publishers
and subscribers are independent of each other.
... | [
"def",
"get_published_topics",
"(",
"self",
")",
":",
"published_topics",
"=",
"[",
"]",
"# A topic can be published multiple times",
"# (typically with the same schema) but the",
"# returned list only wants to contain a topic,schema",
"# pair once. I.e. the list of topics being published ... | Get a list of published topics for this instance.
Streams applications publish streams to a a topic that can be subscribed to by other
applications. This allows a microservice approach where publishers
and subscribers are independent of each other.
A published stream has a topic and a ... | [
"Get",
"a",
"list",
"of",
"published",
"topics",
"for",
"this",
"instance",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1765-L1802 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | Instance.get_application_configurations | def get_application_configurations(self, name=None):
"""Retrieves application configurations for this instance.
Args:
name (str, optional): Only return application configurations containing property **name** that matches `name`. `name` can be a
regular expression. If `name` ... | python | def get_application_configurations(self, name=None):
"""Retrieves application configurations for this instance.
Args:
name (str, optional): Only return application configurations containing property **name** that matches `name`. `name` can be a
regular expression. If `name` ... | [
"def",
"get_application_configurations",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'applicationConfigurations'",
")",
":",
"return",
"self",
".",
"_get_elements",
"(",
"self",
".",
"applicationConfigurations",
",",
"'ap... | Retrieves application configurations for this instance.
Args:
name (str, optional): Only return application configurations containing property **name** that matches `name`. `name` can be a
regular expression. If `name` is not supplied, then all application configurations are returne... | [
"Retrieves",
"application",
"configurations",
"for",
"this",
"instance",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1844-L1857 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | Instance.create_application_configuration | def create_application_configuration(self, name, properties, description=None):
"""Create an application configuration.
Args:
name (str, optional): Only return application configurations containing property **name** that matches `name`. `name` can be a
.. versionadded 1.12
"... | python | def create_application_configuration(self, name, properties, description=None):
"""Create an application configuration.
Args:
name (str, optional): Only return application configurations containing property **name** that matches `name`. `name` can be a
.. versionadded 1.12
"... | [
"def",
"create_application_configuration",
"(",
"self",
",",
"name",
",",
"properties",
",",
"description",
"=",
"None",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'applicationConfigurations'",
")",
":",
"raise",
"NotImplementedError",
"(",
")",
"cv",
... | Create an application configuration.
Args:
name (str, optional): Only return application configurations containing property **name** that matches `name`. `name` can be a
.. versionadded 1.12 | [
"Create",
"an",
"application",
"configuration",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L1859-L1875 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | StreamingAnalyticsService.submit_job | def submit_job(self, bundle, job_config=None):
"""Submit a Streams Application Bundle (sab file) to
this Streaming Analytics service.
Args:
bundle(str): path to a Streams application bundle (sab file)
containing the application to be submitted
job... | python | def submit_job(self, bundle, job_config=None):
"""Submit a Streams Application Bundle (sab file) to
this Streaming Analytics service.
Args:
bundle(str): path to a Streams application bundle (sab file)
containing the application to be submitted
job... | [
"def",
"submit_job",
"(",
"self",
",",
"bundle",
",",
"job_config",
"=",
"None",
")",
":",
"return",
"self",
".",
"_delegator",
".",
"_submit_job",
"(",
"bundle",
"=",
"bundle",
",",
"job_config",
"=",
"job_config",
")"
] | Submit a Streams Application Bundle (sab file) to
this Streaming Analytics service.
Args:
bundle(str): path to a Streams application bundle (sab file)
containing the application to be submitted
job_config(JobConfig): a job configuration overlay
... | [
"Submit",
"a",
"Streams",
"Application",
"Bundle",
"(",
"sab",
"file",
")",
"to",
"this",
"Streaming",
"Analytics",
"service",
".",
"Args",
":",
"bundle",
"(",
"str",
")",
":",
"path",
"to",
"a",
"Streams",
"application",
"bundle",
"(",
"sab",
"file",
")... | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L2074-L2088 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | StreamingAnalyticsService.cancel_job | def cancel_job(self, job_id=None, job_name=None):
"""Cancel a running job.
Args:
job_id (str, optional): Identifier of job to be canceled.
job_name (str, optional): Name of job to be canceled.
Returns:
dict: JSON response for the job cancel operation.
... | python | def cancel_job(self, job_id=None, job_name=None):
"""Cancel a running job.
Args:
job_id (str, optional): Identifier of job to be canceled.
job_name (str, optional): Name of job to be canceled.
Returns:
dict: JSON response for the job cancel operation.
... | [
"def",
"cancel_job",
"(",
"self",
",",
"job_id",
"=",
"None",
",",
"job_name",
"=",
"None",
")",
":",
"return",
"self",
".",
"_delegator",
".",
"cancel_job",
"(",
"job_id",
"=",
"job_id",
",",
"job_name",
"=",
"job_name",
")"
] | Cancel a running job.
Args:
job_id (str, optional): Identifier of job to be canceled.
job_name (str, optional): Name of job to be canceled.
Returns:
dict: JSON response for the job cancel operation. | [
"Cancel",
"a",
"running",
"job",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L2090-L2100 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | _StreamingAnalyticsServiceV2Delegator._get_jobs_url | def _get_jobs_url(self):
"""Get & save jobs URL from the status call."""
if self._jobs_url is None:
self.get_instance_status()
if self._jobs_url is None:
raise ValueError("Cannot obtain jobs URL")
return self._jobs_url | python | def _get_jobs_url(self):
"""Get & save jobs URL from the status call."""
if self._jobs_url is None:
self.get_instance_status()
if self._jobs_url is None:
raise ValueError("Cannot obtain jobs URL")
return self._jobs_url | [
"def",
"_get_jobs_url",
"(",
"self",
")",
":",
"if",
"self",
".",
"_jobs_url",
"is",
"None",
":",
"self",
".",
"get_instance_status",
"(",
")",
"if",
"self",
".",
"_jobs_url",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Cannot obtain jobs URL\"",
")",
... | Get & save jobs URL from the status call. | [
"Get",
"&",
"save",
"jobs",
"URL",
"from",
"the",
"status",
"call",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L2140-L2146 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | _StreamingAnalyticsServiceV1Delegator.cancel_job | def cancel_job(self, job_id=None, job_name=None):
"""Cancel a running job.
Args:
job_id (str, optional): Identifier of job to be canceled.
job_name (str, optional): Name of job to be canceled.
Returns:
dict: JSON response for the job cancel operation.
... | python | def cancel_job(self, job_id=None, job_name=None):
"""Cancel a running job.
Args:
job_id (str, optional): Identifier of job to be canceled.
job_name (str, optional): Name of job to be canceled.
Returns:
dict: JSON response for the job cancel operation.
... | [
"def",
"cancel_job",
"(",
"self",
",",
"job_id",
"=",
"None",
",",
"job_name",
"=",
"None",
")",
":",
"payload",
"=",
"{",
"}",
"if",
"job_name",
"is",
"not",
"None",
":",
"payload",
"[",
"'job_name'",
"]",
"=",
"job_name",
"if",
"job_id",
"is",
"not... | Cancel a running job.
Args:
job_id (str, optional): Identifier of job to be canceled.
job_name (str, optional): Name of job to be canceled.
Returns:
dict: JSON response for the job cancel operation. | [
"Cancel",
"a",
"running",
"job",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L2265-L2284 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | _StreamingAnalyticsServiceV1Delegator.start_instance | def start_instance(self):
"""Start the instance for this Streaming Analytics service.
Returns:
dict: JSON response for the instance start operation.
"""
start_url = self._get_url('start_path')
res = self.rest_client.session.put(start_url, json={})
_handle_htt... | python | def start_instance(self):
"""Start the instance for this Streaming Analytics service.
Returns:
dict: JSON response for the instance start operation.
"""
start_url = self._get_url('start_path')
res = self.rest_client.session.put(start_url, json={})
_handle_htt... | [
"def",
"start_instance",
"(",
"self",
")",
":",
"start_url",
"=",
"self",
".",
"_get_url",
"(",
"'start_path'",
")",
"res",
"=",
"self",
".",
"rest_client",
".",
"session",
".",
"put",
"(",
"start_url",
",",
"json",
"=",
"{",
"}",
")",
"_handle_http_erro... | Start the instance for this Streaming Analytics service.
Returns:
dict: JSON response for the instance start operation. | [
"Start",
"the",
"instance",
"for",
"this",
"Streaming",
"Analytics",
"service",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L2286-L2295 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | _StreamingAnalyticsServiceV1Delegator.stop_instance | def stop_instance(self):
"""Stop the instance for this Streaming Analytics service.
Returns:
dict: JSON response for the instance stop operation.
"""
stop_url = self._get_url('stop_path')
res = self.rest_client.session.put(stop_url, json={})
_handle_http_erro... | python | def stop_instance(self):
"""Stop the instance for this Streaming Analytics service.
Returns:
dict: JSON response for the instance stop operation.
"""
stop_url = self._get_url('stop_path')
res = self.rest_client.session.put(stop_url, json={})
_handle_http_erro... | [
"def",
"stop_instance",
"(",
"self",
")",
":",
"stop_url",
"=",
"self",
".",
"_get_url",
"(",
"'stop_path'",
")",
"res",
"=",
"self",
".",
"rest_client",
".",
"session",
".",
"put",
"(",
"stop_url",
",",
"json",
"=",
"{",
"}",
")",
"_handle_http_errors",... | Stop the instance for this Streaming Analytics service.
Returns:
dict: JSON response for the instance stop operation. | [
"Stop",
"the",
"instance",
"for",
"this",
"Streaming",
"Analytics",
"service",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L2297-L2306 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | _StreamingAnalyticsServiceV1Delegator.get_instance_status | def get_instance_status(self):
"""Get the status the instance for this Streaming Analytics service.
Returns:
dict: JSON response for the instance status operation.
"""
status_url = self._get_url('status_path')
res = self.rest_client.session.get(status_url)
_h... | python | def get_instance_status(self):
"""Get the status the instance for this Streaming Analytics service.
Returns:
dict: JSON response for the instance status operation.
"""
status_url = self._get_url('status_path')
res = self.rest_client.session.get(status_url)
_h... | [
"def",
"get_instance_status",
"(",
"self",
")",
":",
"status_url",
"=",
"self",
".",
"_get_url",
"(",
"'status_path'",
")",
"res",
"=",
"self",
".",
"rest_client",
".",
"session",
".",
"get",
"(",
"status_url",
")",
"_handle_http_errors",
"(",
"res",
")",
... | Get the status the instance for this Streaming Analytics service.
Returns:
dict: JSON response for the instance status operation. | [
"Get",
"the",
"status",
"the",
"instance",
"for",
"this",
"Streaming",
"Analytics",
"service",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L2308-L2317 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | ApplicationBundle.submit_job | def submit_job(self, job_config=None):
"""Submit this Streams Application Bundle (sab file) to
its associated instance.
Args:
job_config(JobConfig): a job configuration overlay
Returns:
Job: Resulting job instance.
"""
job_id = se... | python | def submit_job(self, job_config=None):
"""Submit this Streams Application Bundle (sab file) to
its associated instance.
Args:
job_config(JobConfig): a job configuration overlay
Returns:
Job: Resulting job instance.
"""
job_id = se... | [
"def",
"submit_job",
"(",
"self",
",",
"job_config",
"=",
"None",
")",
":",
"job_id",
"=",
"self",
".",
"_delegator",
".",
"_submit_bundle",
"(",
"self",
",",
"job_config",
")",
"return",
"self",
".",
"_instance",
".",
"get_job",
"(",
"job_id",
")"
] | Submit this Streams Application Bundle (sab file) to
its associated instance.
Args:
job_config(JobConfig): a job configuration overlay
Returns:
Job: Resulting job instance. | [
"Submit",
"this",
"Streams",
"Application",
"Bundle",
"(",
"sab",
"file",
")",
"to",
"its",
"associated",
"instance",
".",
"Args",
":",
"job_config",
"(",
"JobConfig",
")",
":",
"a",
"job",
"configuration",
"overlay",
"Returns",
":",
"Job",
":",
"Resulting",... | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L2362-L2373 |
IBMStreams/pypi.streamsx | streamsx/rest_primitives.py | _StreamsV4Delegator._cancel_job | def _cancel_job(self, job, force):
"""Cancel job using streamtool."""
import streamsx.st as st
if st._has_local_install:
return st._cancel_job(job.id, force,
domain_id=job.get_instance().get_domain().id, instance_id=job.get_instance().id)
return False | python | def _cancel_job(self, job, force):
"""Cancel job using streamtool."""
import streamsx.st as st
if st._has_local_install:
return st._cancel_job(job.id, force,
domain_id=job.get_instance().get_domain().id, instance_id=job.get_instance().id)
return False | [
"def",
"_cancel_job",
"(",
"self",
",",
"job",
",",
"force",
")",
":",
"import",
"streamsx",
".",
"st",
"as",
"st",
"if",
"st",
".",
"_has_local_install",
":",
"return",
"st",
".",
"_cancel_job",
"(",
"job",
".",
"id",
",",
"force",
",",
"domain_id",
... | Cancel job using streamtool. | [
"Cancel",
"job",
"using",
"streamtool",
"."
] | train | https://github.com/IBMStreams/pypi.streamsx/blob/abd67b4757120f6f805787fba390f53e9df9cdd8/streamsx/rest_primitives.py#L2419-L2425 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.