repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
partition
stringclasses
1 value
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
__ensure_suffix_stem
def __ensure_suffix_stem(t, suffix): """ Ensure that the target t has the given suffix, and return the file's stem. """ tpath = str(t) if not tpath.endswith(suffix): stem = tpath tpath += suffix return tpath, stem else: stem, ext = os.path.splitext(tpath) ...
python
def __ensure_suffix_stem(t, suffix): """ Ensure that the target t has the given suffix, and return the file's stem. """ tpath = str(t) if not tpath.endswith(suffix): stem = tpath tpath += suffix return tpath, stem else: stem, ext = os.path.splitext(tpath) ...
[ "def", "__ensure_suffix_stem", "(", "t", ",", "suffix", ")", ":", "tpath", "=", "str", "(", "t", ")", "if", "not", "tpath", ".", "endswith", "(", "suffix", ")", ":", "stem", "=", "tpath", "tpath", "+=", "suffix", "return", "tpath", ",", "stem", "else...
Ensure that the target t has the given suffix, and return the file's stem.
[ "Ensure", "that", "the", "target", "t", "has", "the", "given", "suffix", "and", "return", "the", "file", "s", "stem", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L121-L132
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
__create_output_dir
def __create_output_dir(base_dir): """ Ensure that the output directory base_dir exists. """ root, tail = os.path.split(base_dir) dir = None if tail: if base_dir.endswith('/'): dir = base_dir else: dir = root else: if base_dir.endswith('/'): ...
python
def __create_output_dir(base_dir): """ Ensure that the output directory base_dir exists. """ root, tail = os.path.split(base_dir) dir = None if tail: if base_dir.endswith('/'): dir = base_dir else: dir = root else: if base_dir.endswith('/'): ...
[ "def", "__create_output_dir", "(", "base_dir", ")", ":", "root", ",", "tail", "=", "os", ".", "path", ".", "split", "(", "base_dir", ")", "dir", "=", "None", "if", "tail", ":", "if", "base_dir", ".", "endswith", "(", "'/'", ")", ":", "dir", "=", "b...
Ensure that the output directory base_dir exists.
[ "Ensure", "that", "the", "output", "directory", "base_dir", "exists", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L142-L156
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
__detect_cl_tool
def __detect_cl_tool(env, chainkey, cdict, cpriority=None): """ Helper function, picks a command line tool from the list and initializes its environment variables. """ if env.get(chainkey,'') == '': clpath = '' if cpriority is None: cpriority = cdict.keys() for c...
python
def __detect_cl_tool(env, chainkey, cdict, cpriority=None): """ Helper function, picks a command line tool from the list and initializes its environment variables. """ if env.get(chainkey,'') == '': clpath = '' if cpriority is None: cpriority = cdict.keys() for c...
[ "def", "__detect_cl_tool", "(", "env", ",", "chainkey", ",", "cdict", ",", "cpriority", "=", "None", ")", ":", "if", "env", ".", "get", "(", "chainkey", ",", "''", ")", "==", "''", ":", "clpath", "=", "''", "if", "cpriority", "is", "None", ":", "cp...
Helper function, picks a command line tool from the list and initializes its environment variables.
[ "Helper", "function", "picks", "a", "command", "line", "tool", "from", "the", "list", "and", "initializes", "its", "environment", "variables", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L176-L196
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
_detect
def _detect(env): """ Detect all the command line tools that we might need for creating the requested output formats. """ global prefer_xsltproc if env.get('DOCBOOK_PREFER_XSLTPROC',''): prefer_xsltproc = True if ((not has_libxml2 and not has_lxml) or (prefer_xsltproc))...
python
def _detect(env): """ Detect all the command line tools that we might need for creating the requested output formats. """ global prefer_xsltproc if env.get('DOCBOOK_PREFER_XSLTPROC',''): prefer_xsltproc = True if ((not has_libxml2 and not has_lxml) or (prefer_xsltproc))...
[ "def", "_detect", "(", "env", ")", ":", "global", "prefer_xsltproc", "if", "env", ".", "get", "(", "'DOCBOOK_PREFER_XSLTPROC'", ",", "''", ")", ":", "prefer_xsltproc", "=", "True", "if", "(", "(", "not", "has_libxml2", "and", "not", "has_lxml", ")", "or", ...
Detect all the command line tools that we might need for creating the requested output formats.
[ "Detect", "all", "the", "command", "line", "tools", "that", "we", "might", "need", "for", "creating", "the", "requested", "output", "formats", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L198-L213
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
__xml_scan
def __xml_scan(node, env, path, arg): """ Simple XML file scanner, detecting local images and XIncludes as implicit dependencies. """ # Does the node exist yet? if not os.path.isfile(str(node)): return [] if env.get('DOCBOOK_SCANENT',''): # Use simple pattern matching for system ent...
python
def __xml_scan(node, env, path, arg): """ Simple XML file scanner, detecting local images and XIncludes as implicit dependencies. """ # Does the node exist yet? if not os.path.isfile(str(node)): return [] if env.get('DOCBOOK_SCANENT',''): # Use simple pattern matching for system ent...
[ "def", "__xml_scan", "(", "node", ",", "env", ",", "path", ",", "arg", ")", ":", "if", "not", "os", ".", "path", ".", "isfile", "(", "str", "(", "node", ")", ")", ":", "return", "[", "]", "if", "env", ".", "get", "(", "'DOCBOOK_SCANENT'", ",", ...
Simple XML file scanner, detecting local images and XIncludes as implicit dependencies.
[ "Simple", "XML", "file", "scanner", "detecting", "local", "images", "and", "XIncludes", "as", "implicit", "dependencies", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L221-L272
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
__xinclude_libxml2
def __xinclude_libxml2(target, source, env): """ Resolving XIncludes, using the libxml2 module. """ doc = libxml2.readFile(str(source[0]), None, libxml2.XML_PARSE_NOENT) doc.xincludeProcessFlags(libxml2.XML_PARSE_NOENT) doc.saveFile(str(target[0])) doc.freeDoc() return None
python
def __xinclude_libxml2(target, source, env): """ Resolving XIncludes, using the libxml2 module. """ doc = libxml2.readFile(str(source[0]), None, libxml2.XML_PARSE_NOENT) doc.xincludeProcessFlags(libxml2.XML_PARSE_NOENT) doc.saveFile(str(target[0])) doc.freeDoc() return None
[ "def", "__xinclude_libxml2", "(", "target", ",", "source", ",", "env", ")", ":", "doc", "=", "libxml2", ".", "readFile", "(", "str", "(", "source", "[", "0", "]", ")", ",", "None", ",", "libxml2", ".", "XML_PARSE_NOENT", ")", "doc", ".", "xincludeProce...
Resolving XIncludes, using the libxml2 module.
[ "Resolving", "XIncludes", "using", "the", "libxml2", "module", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L361-L370
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
__xinclude_lxml
def __xinclude_lxml(target, source, env): """ Resolving XIncludes, using the lxml module. """ from lxml import etree doc = etree.parse(str(source[0])) doc.xinclude() try: doc.write(str(target[0]), xml_declaration=True, encoding="UTF-8", pretty_print=True) ...
python
def __xinclude_lxml(target, source, env): """ Resolving XIncludes, using the lxml module. """ from lxml import etree doc = etree.parse(str(source[0])) doc.xinclude() try: doc.write(str(target[0]), xml_declaration=True, encoding="UTF-8", pretty_print=True) ...
[ "def", "__xinclude_lxml", "(", "target", ",", "source", ",", "env", ")", ":", "from", "lxml", "import", "etree", "doc", "=", "etree", ".", "parse", "(", "str", "(", "source", "[", "0", "]", ")", ")", "doc", ".", "xinclude", "(", ")", "try", ":", ...
Resolving XIncludes, using the lxml module.
[ "Resolving", "XIncludes", "using", "the", "lxml", "module", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L372-L386
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
DocbookHtml
def DocbookHtml(env, target, source=None, *args, **kw): """ A pseudo-Builder, providing a Docbook toolchain for HTML output. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAUL...
python
def DocbookHtml(env, target, source=None, *args, **kw): """ A pseudo-Builder, providing a Docbook toolchain for HTML output. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAUL...
[ "def", "DocbookHtml", "(", "env", ",", "target", ",", "source", "=", "None", ",", "*", "args", ",", "**", "kw", ")", ":", "target", ",", "source", "=", "__extend_targets_sources", "(", "target", ",", "source", ")", "__init_xsl_stylesheet", "(", "kw", ","...
A pseudo-Builder, providing a Docbook toolchain for HTML output.
[ "A", "pseudo", "-", "Builder", "providing", "a", "Docbook", "toolchain", "for", "HTML", "output", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L550-L570
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
DocbookMan
def DocbookMan(env, target, source=None, *args, **kw): """ A pseudo-Builder, providing a Docbook toolchain for Man page output. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT...
python
def DocbookMan(env, target, source=None, *args, **kw): """ A pseudo-Builder, providing a Docbook toolchain for Man page output. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT...
[ "def", "DocbookMan", "(", "env", ",", "target", ",", "source", "=", "None", ",", "*", "args", ",", "**", "kw", ")", ":", "target", ",", "source", "=", "__extend_targets_sources", "(", "target", ",", "source", ")", "__init_xsl_stylesheet", "(", "kw", ",",...
A pseudo-Builder, providing a Docbook toolchain for Man page output.
[ "A", "pseudo", "-", "Builder", "providing", "a", "Docbook", "toolchain", "for", "Man", "page", "output", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L666-L731
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
DocbookSlidesPdf
def DocbookSlidesPdf(env, target, source=None, *args, **kw): """ A pseudo-Builder, providing a Docbook toolchain for PDF slides output. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet __init_xsl_stylesheet(kw, env, '$DOCBOOK...
python
def DocbookSlidesPdf(env, target, source=None, *args, **kw): """ A pseudo-Builder, providing a Docbook toolchain for PDF slides output. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet __init_xsl_stylesheet(kw, env, '$DOCBOOK...
[ "def", "DocbookSlidesPdf", "(", "env", ",", "target", ",", "source", "=", "None", ",", "*", "args", ",", "**", "kw", ")", ":", "target", ",", "source", "=", "__extend_targets_sources", "(", "target", ",", "source", ")", "__init_xsl_stylesheet", "(", "kw", ...
A pseudo-Builder, providing a Docbook toolchain for PDF slides output.
[ "A", "pseudo", "-", "Builder", "providing", "a", "Docbook", "toolchain", "for", "PDF", "slides", "output", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L733-L755
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
DocbookSlidesHtml
def DocbookSlidesHtml(env, target, source=None, *args, **kw): """ A pseudo-Builder, providing a Docbook toolchain for HTML slides output. """ # Init list of targets/sources if not SCons.Util.is_List(target): target = [target] if not source: source = target target = ['inde...
python
def DocbookSlidesHtml(env, target, source=None, *args, **kw): """ A pseudo-Builder, providing a Docbook toolchain for HTML slides output. """ # Init list of targets/sources if not SCons.Util.is_List(target): target = [target] if not source: source = target target = ['inde...
[ "def", "DocbookSlidesHtml", "(", "env", ",", "target", ",", "source", "=", "None", ",", "*", "args", ",", "**", "kw", ")", ":", "if", "not", "SCons", ".", "Util", ".", "is_List", "(", "target", ")", ":", "target", "=", "[", "target", "]", "if", "...
A pseudo-Builder, providing a Docbook toolchain for HTML slides output.
[ "A", "pseudo", "-", "Builder", "providing", "a", "Docbook", "toolchain", "for", "HTML", "slides", "output", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L757-L790
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
DocbookXInclude
def DocbookXInclude(env, target, source, *args, **kw): """ A pseudo-Builder, for resolving XIncludes in a separate processing step. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Setup builder __builder = __select_builder(__xinclude_lxml_build...
python
def DocbookXInclude(env, target, source, *args, **kw): """ A pseudo-Builder, for resolving XIncludes in a separate processing step. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Setup builder __builder = __select_builder(__xinclude_lxml_build...
[ "def", "DocbookXInclude", "(", "env", ",", "target", ",", "source", ",", "*", "args", ",", "**", "kw", ")", ":", "target", ",", "source", "=", "__extend_targets_sources", "(", "target", ",", "source", ")", "__builder", "=", "__select_builder", "(", "__xinc...
A pseudo-Builder, for resolving XIncludes in a separate processing step.
[ "A", "pseudo", "-", "Builder", "for", "resolving", "XIncludes", "in", "a", "separate", "processing", "step", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L792-L807
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
DocbookXslt
def DocbookXslt(env, target, source=None, *args, **kw): """ A pseudo-Builder, applying a simple XSL transformation to the input file. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet kw['DOCBOOK_XSL'] = kw.get('xsl', 'tra...
python
def DocbookXslt(env, target, source=None, *args, **kw): """ A pseudo-Builder, applying a simple XSL transformation to the input file. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet kw['DOCBOOK_XSL'] = kw.get('xsl', 'tra...
[ "def", "DocbookXslt", "(", "env", ",", "target", ",", "source", "=", "None", ",", "*", "args", ",", "**", "kw", ")", ":", "target", ",", "source", "=", "__extend_targets_sources", "(", "target", ",", "source", ")", "kw", "[", "'DOCBOOK_XSL'", "]", "=",...
A pseudo-Builder, applying a simple XSL transformation to the input file.
[ "A", "pseudo", "-", "Builder", "applying", "a", "simple", "XSL", "transformation", "to", "the", "input", "file", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L809-L829
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py
generate
def generate(env): """Add Builders and construction variables for docbook to an Environment.""" env.SetDefault( # Default names for customized XSL stylesheets DOCBOOK_DEFAULT_XSL_EPUB = '', DOCBOOK_DEFAULT_XSL_HTML = '', DOCBOOK_DEFAULT_XSL_HTMLCHUNKED = '', DOCBOOK_DEFA...
python
def generate(env): """Add Builders and construction variables for docbook to an Environment.""" env.SetDefault( # Default names for customized XSL stylesheets DOCBOOK_DEFAULT_XSL_EPUB = '', DOCBOOK_DEFAULT_XSL_HTML = '', DOCBOOK_DEFAULT_XSL_HTMLCHUNKED = '', DOCBOOK_DEFA...
[ "def", "generate", "(", "env", ")", ":", "env", ".", "SetDefault", "(", "DOCBOOK_DEFAULT_XSL_EPUB", "=", "''", ",", "DOCBOOK_DEFAULT_XSL_HTML", "=", "''", ",", "DOCBOOK_DEFAULT_XSL_HTMLCHUNKED", "=", "''", ",", "DOCBOOK_DEFAULT_XSL_HTMLHELP", "=", "''", ",", "DOCB...
Add Builders and construction variables for docbook to an Environment.
[ "Add", "Builders", "and", "construction", "variables", "for", "docbook", "to", "an", "Environment", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L832-L879
train
iotile/coretools
iotilecore/iotile/core/utilities/rcfile.py
RCFile.save
def save(self): """Update the configuration file on disk with the current contents of self.contents. Previous contents are overwritten. """ try: with open(self.path, "w") as f: f.writelines(self.contents) except IOError as e: raise Interna...
python
def save(self): """Update the configuration file on disk with the current contents of self.contents. Previous contents are overwritten. """ try: with open(self.path, "w") as f: f.writelines(self.contents) except IOError as e: raise Interna...
[ "def", "save", "(", "self", ")", ":", "try", ":", "with", "open", "(", "self", ".", "path", ",", "\"w\"", ")", "as", "f", ":", "f", ".", "writelines", "(", "self", ".", "contents", ")", "except", "IOError", "as", "e", ":", "raise", "InternalError",...
Update the configuration file on disk with the current contents of self.contents. Previous contents are overwritten.
[ "Update", "the", "configuration", "file", "on", "disk", "with", "the", "current", "contents", "of", "self", ".", "contents", ".", "Previous", "contents", "are", "overwritten", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/utilities/rcfile.py#L52-L61
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/device_server.py
WebSocketDeviceServer.probe_message
async def probe_message(self, _message, context): """Handle a probe message. See :meth:`AbstractDeviceAdapter.probe`. """ client_id = context.user_data await self.probe(client_id)
python
async def probe_message(self, _message, context): """Handle a probe message. See :meth:`AbstractDeviceAdapter.probe`. """ client_id = context.user_data await self.probe(client_id)
[ "async", "def", "probe_message", "(", "self", ",", "_message", ",", "context", ")", ":", "client_id", "=", "context", ".", "user_data", "await", "self", ".", "probe", "(", "client_id", ")" ]
Handle a probe message. See :meth:`AbstractDeviceAdapter.probe`.
[ "Handle", "a", "probe", "message", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/device_server.py#L111-L118
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/device_server.py
WebSocketDeviceServer.connect_message
async def connect_message(self, message, context): """Handle a connect message. See :meth:`AbstractDeviceAdapter.connect`. """ conn_string = message.get('connection_string') client_id = context.user_data await self.connect(client_id, conn_string)
python
async def connect_message(self, message, context): """Handle a connect message. See :meth:`AbstractDeviceAdapter.connect`. """ conn_string = message.get('connection_string') client_id = context.user_data await self.connect(client_id, conn_string)
[ "async", "def", "connect_message", "(", "self", ",", "message", ",", "context", ")", ":", "conn_string", "=", "message", ".", "get", "(", "'connection_string'", ")", "client_id", "=", "context", ".", "user_data", "await", "self", ".", "connect", "(", "client...
Handle a connect message. See :meth:`AbstractDeviceAdapter.connect`.
[ "Handle", "a", "connect", "message", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/device_server.py#L120-L128
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/device_server.py
WebSocketDeviceServer.disconnect_message
async def disconnect_message(self, message, context): """Handle a disconnect message. See :meth:`AbstractDeviceAdapter.disconnect`. """ conn_string = message.get('connection_string') client_id = context.user_data await self.disconnect(client_id, conn_string)
python
async def disconnect_message(self, message, context): """Handle a disconnect message. See :meth:`AbstractDeviceAdapter.disconnect`. """ conn_string = message.get('connection_string') client_id = context.user_data await self.disconnect(client_id, conn_string)
[ "async", "def", "disconnect_message", "(", "self", ",", "message", ",", "context", ")", ":", "conn_string", "=", "message", ".", "get", "(", "'connection_string'", ")", "client_id", "=", "context", ".", "user_data", "await", "self", ".", "disconnect", "(", "...
Handle a disconnect message. See :meth:`AbstractDeviceAdapter.disconnect`.
[ "Handle", "a", "disconnect", "message", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/device_server.py#L130-L139
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/device_server.py
WebSocketDeviceServer.open_interface_message
async def open_interface_message(self, message, context): """Handle an open_interface message. See :meth:`AbstractDeviceAdapter.open_interface`. """ conn_string = message.get('connection_string') interface = message.get('interface') client_id = context.user_data ...
python
async def open_interface_message(self, message, context): """Handle an open_interface message. See :meth:`AbstractDeviceAdapter.open_interface`. """ conn_string = message.get('connection_string') interface = message.get('interface') client_id = context.user_data ...
[ "async", "def", "open_interface_message", "(", "self", ",", "message", ",", "context", ")", ":", "conn_string", "=", "message", ".", "get", "(", "'connection_string'", ")", "interface", "=", "message", ".", "get", "(", "'interface'", ")", "client_id", "=", "...
Handle an open_interface message. See :meth:`AbstractDeviceAdapter.open_interface`.
[ "Handle", "an", "open_interface", "message", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/device_server.py#L141-L151
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/device_server.py
WebSocketDeviceServer.close_interface_message
async def close_interface_message(self, message, context): """Handle a close_interface message. See :meth:`AbstractDeviceAdapter.close_interface`. """ conn_string = message.get('connection_string') interface = message.get('interface') client_id = context.user_data ...
python
async def close_interface_message(self, message, context): """Handle a close_interface message. See :meth:`AbstractDeviceAdapter.close_interface`. """ conn_string = message.get('connection_string') interface = message.get('interface') client_id = context.user_data ...
[ "async", "def", "close_interface_message", "(", "self", ",", "message", ",", "context", ")", ":", "conn_string", "=", "message", ".", "get", "(", "'connection_string'", ")", "interface", "=", "message", ".", "get", "(", "'interface'", ")", "client_id", "=", ...
Handle a close_interface message. See :meth:`AbstractDeviceAdapter.close_interface`.
[ "Handle", "a", "close_interface", "message", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/device_server.py#L153-L163
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/device_server.py
WebSocketDeviceServer.send_rpc_message
async def send_rpc_message(self, message, context): """Handle a send_rpc message. See :meth:`AbstractDeviceAdapter.send_rpc`. """ conn_string = message.get('connection_string') rpc_id = message.get('rpc_id') address = message.get('address') timeout = message.get...
python
async def send_rpc_message(self, message, context): """Handle a send_rpc message. See :meth:`AbstractDeviceAdapter.send_rpc`. """ conn_string = message.get('connection_string') rpc_id = message.get('rpc_id') address = message.get('address') timeout = message.get...
[ "async", "def", "send_rpc_message", "(", "self", ",", "message", ",", "context", ")", ":", "conn_string", "=", "message", ".", "get", "(", "'connection_string'", ")", "rpc_id", "=", "message", ".", "get", "(", "'rpc_id'", ")", "address", "=", "message", "....
Handle a send_rpc message. See :meth:`AbstractDeviceAdapter.send_rpc`.
[ "Handle", "a", "send_rpc", "message", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/device_server.py#L165-L197
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/device_server.py
WebSocketDeviceServer.send_script_message
async def send_script_message(self, message, context): """Handle a send_script message. See :meth:`AbstractDeviceAdapter.send_script`. """ script = message.get('script') conn_string = message.get('connection_string') client_id = context.user_data if message.get...
python
async def send_script_message(self, message, context): """Handle a send_script message. See :meth:`AbstractDeviceAdapter.send_script`. """ script = message.get('script') conn_string = message.get('connection_string') client_id = context.user_data if message.get...
[ "async", "def", "send_script_message", "(", "self", ",", "message", ",", "context", ")", ":", "script", "=", "message", ".", "get", "(", "'script'", ")", "conn_string", "=", "message", ".", "get", "(", "'connection_string'", ")", "client_id", "=", "context",...
Handle a send_script message. See :meth:`AbstractDeviceAdapter.send_script`.
[ "Handle", "a", "send_script", "message", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/device_server.py#L199-L212
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/device_server.py
WebSocketDeviceServer.debug_command_message
async def debug_command_message(self, message, context): """Handle a debug message. See :meth:`AbstractDeviceAdapter.debug`. """ conn_string = message.get('connection_string') command = message.get('command') args = message.get('args') client_id = context.user_d...
python
async def debug_command_message(self, message, context): """Handle a debug message. See :meth:`AbstractDeviceAdapter.debug`. """ conn_string = message.get('connection_string') command = message.get('command') args = message.get('args') client_id = context.user_d...
[ "async", "def", "debug_command_message", "(", "self", ",", "message", ",", "context", ")", ":", "conn_string", "=", "message", ".", "get", "(", "'connection_string'", ")", "command", "=", "message", ".", "get", "(", "'command'", ")", "args", "=", "message", ...
Handle a debug message. See :meth:`AbstractDeviceAdapter.debug`.
[ "Handle", "a", "debug", "message", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/device_server.py#L214-L226
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/device_server.py
WebSocketDeviceServer.client_event_handler
async def client_event_handler(self, client_id, event_tuple, user_data): """Forward an event on behalf of a client. This method is called by StandardDeviceServer when it has an event that should be sent to a client. Args: client_id (str): The client that we should send this...
python
async def client_event_handler(self, client_id, event_tuple, user_data): """Forward an event on behalf of a client. This method is called by StandardDeviceServer when it has an event that should be sent to a client. Args: client_id (str): The client that we should send this...
[ "async", "def", "client_event_handler", "(", "self", ",", "client_id", ",", "event_tuple", ",", "user_data", ")", ":", "conn_string", ",", "event_name", ",", "event", "=", "event_tuple", "if", "event_name", "==", "'report'", ":", "report", "=", "event", ".", ...
Forward an event on behalf of a client. This method is called by StandardDeviceServer when it has an event that should be sent to a client. Args: client_id (str): The client that we should send this event to event_tuple (tuple): The conn_string, event_name and event ...
[ "Forward", "an", "event", "on", "behalf", "of", "a", "client", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/device_server.py#L228-L275
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/sunf90.py
generate
def generate(env): """Add Builders and construction variables for sun f90 compiler to an Environment.""" add_all_to_env(env) fcomp = env.Detect(compilers) or 'f90' env['FORTRAN'] = fcomp env['F90'] = fcomp env['SHFORTRAN'] = '$FORTRAN' env['SHF90'] = '$F90' env['SHFORT...
python
def generate(env): """Add Builders and construction variables for sun f90 compiler to an Environment.""" add_all_to_env(env) fcomp = env.Detect(compilers) or 'f90' env['FORTRAN'] = fcomp env['F90'] = fcomp env['SHFORTRAN'] = '$FORTRAN' env['SHF90'] = '$F90' env['SHFORT...
[ "def", "generate", "(", "env", ")", ":", "add_all_to_env", "(", "env", ")", "fcomp", "=", "env", ".", "Detect", "(", "compilers", ")", "or", "'f90'", "env", "[", "'FORTRAN'", "]", "=", "fcomp", "env", "[", "'F90'", "]", "=", "fcomp", "env", "[", "'...
Add Builders and construction variables for sun f90 compiler to an Environment.
[ "Add", "Builders", "and", "construction", "variables", "for", "sun", "f90", "compiler", "to", "an", "Environment", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/sunf90.py#L42-L55
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py
Builder
def Builder(**kw): """A factory for builder objects.""" composite = None if 'generator' in kw: if 'action' in kw: raise UserError("You must not specify both an action and a generator.") kw['action'] = SCons.Action.CommandGeneratorAction(kw['generator'], {}) del kw['genera...
python
def Builder(**kw): """A factory for builder objects.""" composite = None if 'generator' in kw: if 'action' in kw: raise UserError("You must not specify both an action and a generator.") kw['action'] = SCons.Action.CommandGeneratorAction(kw['generator'], {}) del kw['genera...
[ "def", "Builder", "(", "**", "kw", ")", ":", "composite", "=", "None", "if", "'generator'", "in", "kw", ":", "if", "'action'", "in", "kw", ":", "raise", "UserError", "(", "\"You must not specify both an action and a generator.\"", ")", "kw", "[", "'action'", "...
A factory for builder objects.
[ "A", "factory", "for", "builder", "objects", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py#L240-L280
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py
_node_errors
def _node_errors(builder, env, tlist, slist): """Validate that the lists of target and source nodes are legal for this builder and environment. Raise errors or issue warnings as appropriate. """ # First, figure out if there are any errors in the way the targets # were specified. for t in t...
python
def _node_errors(builder, env, tlist, slist): """Validate that the lists of target and source nodes are legal for this builder and environment. Raise errors or issue warnings as appropriate. """ # First, figure out if there are any errors in the way the targets # were specified. for t in t...
[ "def", "_node_errors", "(", "builder", ",", "env", ",", "tlist", ",", "slist", ")", ":", "for", "t", "in", "tlist", ":", "if", "t", ".", "side_effect", ":", "raise", "UserError", "(", "\"Multiple ways to build the same target were specified for: %s\"", "%", "t",...
Validate that the lists of target and source nodes are legal for this builder and environment. Raise errors or issue warnings as appropriate.
[ "Validate", "that", "the", "lists", "of", "target", "and", "source", "nodes", "are", "legal", "for", "this", "builder", "and", "environment", ".", "Raise", "errors", "or", "issue", "warnings", "as", "appropriate", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py#L282-L329
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py
is_a_Builder
def is_a_Builder(obj): """"Returns True if the specified obj is one of our Builder classes. The test is complicated a bit by the fact that CompositeBuilder is a proxy, not a subclass of BuilderBase. """ return (isinstance(obj, BuilderBase) or isinstance(obj, CompositeBuilder) ...
python
def is_a_Builder(obj): """"Returns True if the specified obj is one of our Builder classes. The test is complicated a bit by the fact that CompositeBuilder is a proxy, not a subclass of BuilderBase. """ return (isinstance(obj, BuilderBase) or isinstance(obj, CompositeBuilder) ...
[ "def", "is_a_Builder", "(", "obj", ")", ":", "return", "(", "isinstance", "(", "obj", ",", "BuilderBase", ")", "or", "isinstance", "(", "obj", ",", "CompositeBuilder", ")", "or", "callable", "(", "obj", ")", ")" ]
Returns True if the specified obj is one of our Builder classes. The test is complicated a bit by the fact that CompositeBuilder is a proxy, not a subclass of BuilderBase.
[ "Returns", "True", "if", "the", "specified", "obj", "is", "one", "of", "our", "Builder", "classes", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py#L874-L882
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py
BuilderBase.get_name
def get_name(self, env): """Attempts to get the name of the Builder. Look at the BUILDERS variable of env, expecting it to be a dictionary containing this Builder, and return the key of the dictionary. If there's no key, then return a directly-configured name (if there is one) ...
python
def get_name(self, env): """Attempts to get the name of the Builder. Look at the BUILDERS variable of env, expecting it to be a dictionary containing this Builder, and return the key of the dictionary. If there's no key, then return a directly-configured name (if there is one) ...
[ "def", "get_name", "(", "self", ",", "env", ")", ":", "try", ":", "index", "=", "list", "(", "env", "[", "'BUILDERS'", "]", ".", "values", "(", ")", ")", ".", "index", "(", "self", ")", "return", "list", "(", "env", "[", "'BUILDERS'", "]", ".", ...
Attempts to get the name of the Builder. Look at the BUILDERS variable of env, expecting it to be a dictionary containing this Builder, and return the key of the dictionary. If there's no key, then return a directly-configured name (if there is one) or the name of the class (by default...
[ "Attempts", "to", "get", "the", "name", "of", "the", "Builder", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py#L443-L458
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py
BuilderBase._create_nodes
def _create_nodes(self, env, target = None, source = None): """Create and return lists of target and source nodes. """ src_suf = self.get_src_suffix(env) target_factory = env.get_factory(self.target_factory) source_factory = env.get_factory(self.source_factory) source =...
python
def _create_nodes(self, env, target = None, source = None): """Create and return lists of target and source nodes. """ src_suf = self.get_src_suffix(env) target_factory = env.get_factory(self.target_factory) source_factory = env.get_factory(self.source_factory) source =...
[ "def", "_create_nodes", "(", "self", ",", "env", ",", "target", "=", "None", ",", "source", "=", "None", ")", ":", "src_suf", "=", "self", ".", "get_src_suffix", "(", "env", ")", "target_factory", "=", "env", ".", "get_factory", "(", "self", ".", "targ...
Create and return lists of target and source nodes.
[ "Create", "and", "return", "lists", "of", "target", "and", "source", "nodes", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py#L485-L546
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py
BuilderBase._get_sdict
def _get_sdict(self, env): """ Returns a dictionary mapping all of the source suffixes of all src_builders of this Builder to the underlying Builder that should be called first. This dictionary is used for each target specified, so we save a lot of extra computation by m...
python
def _get_sdict(self, env): """ Returns a dictionary mapping all of the source suffixes of all src_builders of this Builder to the underlying Builder that should be called first. This dictionary is used for each target specified, so we save a lot of extra computation by m...
[ "def", "_get_sdict", "(", "self", ",", "env", ")", ":", "sdict", "=", "{", "}", "for", "bld", "in", "self", ".", "get_src_builders", "(", "env", ")", ":", "for", "suf", "in", "bld", ".", "src_suffixes", "(", "env", ")", ":", "sdict", "[", "suf", ...
Returns a dictionary mapping all of the source suffixes of all src_builders of this Builder to the underlying Builder that should be called first. This dictionary is used for each target specified, so we save a lot of extra computation by memoizing it for each construction envir...
[ "Returns", "a", "dictionary", "mapping", "all", "of", "the", "source", "suffixes", "of", "all", "src_builders", "of", "this", "Builder", "to", "the", "underlying", "Builder", "that", "should", "be", "called", "first", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py#L703-L727
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py
BuilderBase.get_src_builders
def get_src_builders(self, env): """ Returns the list of source Builders for this Builder. This exists mainly to look up Builders referenced as strings in the 'BUILDER' variable of the construction environment and cache the result. """ memo_key = id(env) ...
python
def get_src_builders(self, env): """ Returns the list of source Builders for this Builder. This exists mainly to look up Builders referenced as strings in the 'BUILDER' variable of the construction environment and cache the result. """ memo_key = id(env) ...
[ "def", "get_src_builders", "(", "self", ",", "env", ")", ":", "memo_key", "=", "id", "(", "env", ")", "try", ":", "memo_dict", "=", "self", ".", "_memo", "[", "'get_src_builders'", "]", "except", "KeyError", ":", "memo_dict", "=", "{", "}", "self", "."...
Returns the list of source Builders for this Builder. This exists mainly to look up Builders referenced as strings in the 'BUILDER' variable of the construction environment and cache the result.
[ "Returns", "the", "list", "of", "source", "Builders", "for", "this", "Builder", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py#L776-L806
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py
BuilderBase.subst_src_suffixes
def subst_src_suffixes(self, env): """ The suffix list may contain construction variable expansions, so we have to evaluate the individual strings. To avoid doing this over and over, we memoize the results for each construction environment. """ memo_key = id(env)...
python
def subst_src_suffixes(self, env): """ The suffix list may contain construction variable expansions, so we have to evaluate the individual strings. To avoid doing this over and over, we memoize the results for each construction environment. """ memo_key = id(env)...
[ "def", "subst_src_suffixes", "(", "self", ",", "env", ")", ":", "memo_key", "=", "id", "(", "env", ")", "try", ":", "memo_dict", "=", "self", ".", "_memo", "[", "'subst_src_suffixes'", "]", "except", "KeyError", ":", "memo_dict", "=", "{", "}", "self", ...
The suffix list may contain construction variable expansions, so we have to evaluate the individual strings. To avoid doing this over and over, we memoize the results for each construction environment.
[ "The", "suffix", "list", "may", "contain", "construction", "variable", "expansions", "so", "we", "have", "to", "evaluate", "the", "individual", "strings", ".", "To", "avoid", "doing", "this", "over", "and", "over", "we", "memoize", "the", "results", "for", "...
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py#L812-L832
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py
BuilderBase.src_suffixes
def src_suffixes(self, env): """ Returns the list of source suffixes for all src_builders of this Builder. This is essentially a recursive descent of the src_builder "tree." (This value isn't cached because there may be changes in a src_builder many levels deep that we c...
python
def src_suffixes(self, env): """ Returns the list of source suffixes for all src_builders of this Builder. This is essentially a recursive descent of the src_builder "tree." (This value isn't cached because there may be changes in a src_builder many levels deep that we c...
[ "def", "src_suffixes", "(", "self", ",", "env", ")", ":", "sdict", "=", "{", "}", "suffixes", "=", "self", ".", "subst_src_suffixes", "(", "env", ")", "for", "s", "in", "suffixes", ":", "sdict", "[", "s", "]", "=", "1", "for", "builder", "in", "sel...
Returns the list of source suffixes for all src_builders of this Builder. This is essentially a recursive descent of the src_builder "tree." (This value isn't cached because there may be changes in a src_builder many levels deep that we can't see.)
[ "Returns", "the", "list", "of", "source", "suffixes", "for", "all", "src_builders", "of", "this", "Builder", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Builder.py#L834-L852
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/aixlink.py
generate
def generate(env): """ Add Builders and construction variables for Visual Age linker to an Environment. """ link.generate(env) env['SMARTLINKFLAGS'] = smart_linkflags env['LINKFLAGS'] = SCons.Util.CLVar('$SMARTLINKFLAGS') env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -qmkshr...
python
def generate(env): """ Add Builders and construction variables for Visual Age linker to an Environment. """ link.generate(env) env['SMARTLINKFLAGS'] = smart_linkflags env['LINKFLAGS'] = SCons.Util.CLVar('$SMARTLINKFLAGS') env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -qmkshr...
[ "def", "generate", "(", "env", ")", ":", "link", ".", "generate", "(", "env", ")", "env", "[", "'SMARTLINKFLAGS'", "]", "=", "smart_linkflags", "env", "[", "'LINKFLAGS'", "]", "=", "SCons", ".", "Util", ".", "CLVar", "(", "'$SMARTLINKFLAGS'", ")", "env",...
Add Builders and construction variables for Visual Age linker to an Environment.
[ "Add", "Builders", "and", "construction", "variables", "for", "Visual", "Age", "linker", "to", "an", "Environment", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/aixlink.py#L55-L65
train
iotile/coretools
iotilecore/iotile/core/hw/update/records/reflash_tile.py
_parse_target
def _parse_target(target): """Parse a binary targeting information structure. This function only supports extracting the slot number or controller from the target and will raise an ArgumentError if more complicated targeting is desired. Args: target (bytes): The binary targeting data blob....
python
def _parse_target(target): """Parse a binary targeting information structure. This function only supports extracting the slot number or controller from the target and will raise an ArgumentError if more complicated targeting is desired. Args: target (bytes): The binary targeting data blob....
[ "def", "_parse_target", "(", "target", ")", ":", "if", "len", "(", "target", ")", "!=", "8", ":", "raise", "ArgumentError", "(", "\"Invalid targeting data length\"", ",", "expected", "=", "8", ",", "length", "=", "len", "(", "target", ")", ")", "slot", "...
Parse a binary targeting information structure. This function only supports extracting the slot number or controller from the target and will raise an ArgumentError if more complicated targeting is desired. Args: target (bytes): The binary targeting data blob. Returns: dict: The p...
[ "Parse", "a", "binary", "targeting", "information", "structure", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/update/records/reflash_tile.py#L165-L188
train
iotile/coretools
iotileemulate/iotile/emulate/internal/rpc_queue.py
RPCQueue.put_task
def put_task(self, func, args, response): """Place a task onto the RPC queue. This temporary functionality will go away but it lets you run a task synchronously with RPC dispatch by placing it onto the RCP queue. Args: func (callable): The function to execute ...
python
def put_task(self, func, args, response): """Place a task onto the RPC queue. This temporary functionality will go away but it lets you run a task synchronously with RPC dispatch by placing it onto the RCP queue. Args: func (callable): The function to execute ...
[ "def", "put_task", "(", "self", ",", "func", ",", "args", ",", "response", ")", ":", "self", ".", "_rpc_queue", ".", "put_nowait", "(", "(", "func", ",", "args", ",", "response", ")", ")" ]
Place a task onto the RPC queue. This temporary functionality will go away but it lets you run a task synchronously with RPC dispatch by placing it onto the RCP queue. Args: func (callable): The function to execute args (iterable): The function arguments ...
[ "Place", "a", "task", "onto", "the", "RPC", "queue", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/rpc_queue.py#L44-L58
train
iotile/coretools
iotileemulate/iotile/emulate/internal/rpc_queue.py
RPCQueue.put_rpc
def put_rpc(self, address, rpc_id, arg_payload, response): """Place an RPC onto the RPC queue. The rpc will be dispatched asynchronously by the background dispatch task. This method must be called from the event loop. This method does not block. Args: address (int...
python
def put_rpc(self, address, rpc_id, arg_payload, response): """Place an RPC onto the RPC queue. The rpc will be dispatched asynchronously by the background dispatch task. This method must be called from the event loop. This method does not block. Args: address (int...
[ "def", "put_rpc", "(", "self", ",", "address", ",", "rpc_id", ",", "arg_payload", ",", "response", ")", ":", "self", ".", "_rpc_queue", ".", "put_nowait", "(", "(", "address", ",", "rpc_id", ",", "arg_payload", ",", "response", ")", ")" ]
Place an RPC onto the RPC queue. The rpc will be dispatched asynchronously by the background dispatch task. This method must be called from the event loop. This method does not block. Args: address (int): The address of the tile with the RPC rpc_id (int): The ...
[ "Place", "an", "RPC", "onto", "the", "RPC", "queue", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/rpc_queue.py#L60-L74
train
iotile/coretools
iotileemulate/iotile/emulate/internal/rpc_queue.py
RPCQueue.stop
async def stop(self): """Stop the rpc queue from inside the event loop.""" if self._rpc_task is not None: self._rpc_task.cancel() try: await self._rpc_task except asyncio.CancelledError: pass self._rpc_task = None
python
async def stop(self): """Stop the rpc queue from inside the event loop.""" if self._rpc_task is not None: self._rpc_task.cancel() try: await self._rpc_task except asyncio.CancelledError: pass self._rpc_task = None
[ "async", "def", "stop", "(", "self", ")", ":", "if", "self", ".", "_rpc_task", "is", "not", "None", ":", "self", ".", "_rpc_task", ".", "cancel", "(", ")", "try", ":", "await", "self", ".", "_rpc_task", "except", "asyncio", ".", "CancelledError", ":", ...
Stop the rpc queue from inside the event loop.
[ "Stop", "the", "rpc", "queue", "from", "inside", "the", "event", "loop", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/rpc_queue.py#L152-L163
train
iotile/coretools
iotilecore/iotile/core/hw/debug/sparse_memory.py
SparseMemory.add_segment
def add_segment(self, address, data, overwrite=False): """Add a contiguous segment of data to this memory map If the segment overlaps with a segment already added , an ArgumentError is raised unless the overwrite flag is True. Params: address (int): The starting address for...
python
def add_segment(self, address, data, overwrite=False): """Add a contiguous segment of data to this memory map If the segment overlaps with a segment already added , an ArgumentError is raised unless the overwrite flag is True. Params: address (int): The starting address for...
[ "def", "add_segment", "(", "self", ",", "address", ",", "data", ",", "overwrite", "=", "False", ")", ":", "seg_type", "=", "self", ".", "_classify_segment", "(", "address", ",", "len", "(", "data", ")", ")", "if", "not", "isinstance", "(", "seg_type", ...
Add a contiguous segment of data to this memory map If the segment overlaps with a segment already added , an ArgumentError is raised unless the overwrite flag is True. Params: address (int): The starting address for this segment data (bytearray): The data to add ...
[ "Add", "a", "contiguous", "segment", "of", "data", "to", "this", "memory", "map" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/debug/sparse_memory.py#L24-L42
train
iotile/coretools
iotilecore/iotile/core/hw/debug/sparse_memory.py
SparseMemory._create_slice
def _create_slice(self, key): """Create a slice in a memory segment corresponding to a key.""" if isinstance(key, slice): step = key.step if step is None: step = 1 if step != 1: raise ArgumentError("You cannot slice with a step that i...
python
def _create_slice(self, key): """Create a slice in a memory segment corresponding to a key.""" if isinstance(key, slice): step = key.step if step is None: step = 1 if step != 1: raise ArgumentError("You cannot slice with a step that i...
[ "def", "_create_slice", "(", "self", ",", "key", ")", ":", "if", "isinstance", "(", "key", ",", "slice", ")", ":", "step", "=", "key", ".", "step", "if", "step", "is", "None", ":", "step", "=", "1", "if", "step", "!=", "1", ":", "raise", "Argumen...
Create a slice in a memory segment corresponding to a key.
[ "Create", "a", "slice", "in", "a", "memory", "segment", "corresponding", "to", "a", "key", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/debug/sparse_memory.py#L44-L76
train
iotile/coretools
iotilecore/iotile/core/hw/debug/sparse_memory.py
SparseMemory._classify_segment
def _classify_segment(self, address, length): """Determine how a new data segment fits into our existing world Params: address (int): The address we wish to classify length (int): The length of the segment Returns: int: One of SparseMemoryMap.prepended ...
python
def _classify_segment(self, address, length): """Determine how a new data segment fits into our existing world Params: address (int): The address we wish to classify length (int): The length of the segment Returns: int: One of SparseMemoryMap.prepended ...
[ "def", "_classify_segment", "(", "self", ",", "address", ",", "length", ")", ":", "end_address", "=", "address", "+", "length", "-", "1", "_", ",", "start_seg", "=", "self", ".", "_find_address", "(", "address", ")", "_", ",", "end_seg", "=", "self", "...
Determine how a new data segment fits into our existing world Params: address (int): The address we wish to classify length (int): The length of the segment Returns: int: One of SparseMemoryMap.prepended
[ "Determine", "how", "a", "new", "data", "segment", "fits", "into", "our", "existing", "world" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/debug/sparse_memory.py#L105-L124
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/ifort.py
generate
def generate(env): """Add Builders and construction variables for ifort to an Environment.""" # ifort supports Fortran 90 and Fortran 95 # Additionally, ifort recognizes more file extensions. fscan = FortranScan("FORTRANPATH") SCons.Tool.SourceFileScanner.add_scanner('.i', fscan) SCons.Tool.Sour...
python
def generate(env): """Add Builders and construction variables for ifort to an Environment.""" # ifort supports Fortran 90 and Fortran 95 # Additionally, ifort recognizes more file extensions. fscan = FortranScan("FORTRANPATH") SCons.Tool.SourceFileScanner.add_scanner('.i', fscan) SCons.Tool.Sour...
[ "def", "generate", "(", "env", ")", ":", "fscan", "=", "FortranScan", "(", "\"FORTRANPATH\"", ")", "SCons", ".", "Tool", ".", "SourceFileScanner", ".", "add_scanner", "(", "'.i'", ",", "fscan", ")", "SCons", ".", "Tool", ".", "SourceFileScanner", ".", "add...
Add Builders and construction variables for ifort to an Environment.
[ "Add", "Builders", "and", "construction", "variables", "for", "ifort", "to", "an", "Environment", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/ifort.py#L41-L79
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Job.py
Jobs.run
def run(self, postfunc=lambda: None): """Run the jobs. postfunc() will be invoked after the jobs has run. It will be invoked even if the jobs are interrupted by a keyboard interrupt (well, in fact by a signal such as either SIGINT, SIGTERM or SIGHUP). The execution of postfunc()...
python
def run(self, postfunc=lambda: None): """Run the jobs. postfunc() will be invoked after the jobs has run. It will be invoked even if the jobs are interrupted by a keyboard interrupt (well, in fact by a signal such as either SIGINT, SIGTERM or SIGHUP). The execution of postfunc()...
[ "def", "run", "(", "self", ",", "postfunc", "=", "lambda", ":", "None", ")", ":", "self", ".", "_setup_sig_handler", "(", ")", "try", ":", "self", ".", "job", ".", "start", "(", ")", "finally", ":", "postfunc", "(", ")", "self", ".", "_reset_sig_hand...
Run the jobs. postfunc() will be invoked after the jobs has run. It will be invoked even if the jobs are interrupted by a keyboard interrupt (well, in fact by a signal such as either SIGINT, SIGTERM or SIGHUP). The execution of postfunc() is protected against keyboard interrupts...
[ "Run", "the", "jobs", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Job.py#L100-L114
train
iotile/coretools
transport_plugins/native_ble/iotile_transport_native_ble/connection_manager.py
ConnectionAction.expired
def expired(self): """Boolean property if this action has expired """ if self.timeout is None: return False return monotonic() - self.start_time > self.timeout
python
def expired(self): """Boolean property if this action has expired """ if self.timeout is None: return False return monotonic() - self.start_time > self.timeout
[ "def", "expired", "(", "self", ")", ":", "if", "self", ".", "timeout", "is", "None", ":", "return", "False", "return", "monotonic", "(", ")", "-", "self", ".", "start_time", ">", "self", ".", "timeout" ]
Boolean property if this action has expired
[ "Boolean", "property", "if", "this", "action", "has", "expired" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/native_ble/iotile_transport_native_ble/connection_manager.py#L37-L43
train
iotile/coretools
transport_plugins/native_ble/iotile_transport_native_ble/connection_manager.py
ConnectionManager.begin_connection
def begin_connection(self, connection_id, internal_id, callback, context, timeout): """Asynchronously begin a connection attempt Args: connection_id (int): The external connection id internal_id (string): An internal identifier for the connection callback (callable):...
python
def begin_connection(self, connection_id, internal_id, callback, context, timeout): """Asynchronously begin a connection attempt Args: connection_id (int): The external connection id internal_id (string): An internal identifier for the connection callback (callable):...
[ "def", "begin_connection", "(", "self", ",", "connection_id", ",", "internal_id", ",", "callback", ",", "context", ",", "timeout", ")", ":", "data", "=", "{", "'callback'", ":", "callback", ",", "'connection_id'", ":", "connection_id", ",", "'internal_id'", ":...
Asynchronously begin a connection attempt Args: connection_id (int): The external connection id internal_id (string): An internal identifier for the connection callback (callable): The function to be called when the connection attempt finishes con...
[ "Asynchronously", "begin", "a", "connection", "attempt" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/native_ble/iotile_transport_native_ble/connection_manager.py#L337-L358
train
iotile/coretools
transport_plugins/native_ble/iotile_transport_native_ble/connection_manager.py
ConnectionManager.begin_operation
def begin_operation(self, conn_or_internal_id, op_name, callback, timeout): """Begin an operation on a connection Args: conn_or_internal_id (string, int): Either an integer connection id or a string internal_id op_name (string): The name of the operation that we ...
python
def begin_operation(self, conn_or_internal_id, op_name, callback, timeout): """Begin an operation on a connection Args: conn_or_internal_id (string, int): Either an integer connection id or a string internal_id op_name (string): The name of the operation that we ...
[ "def", "begin_operation", "(", "self", ",", "conn_or_internal_id", ",", "op_name", ",", "callback", ",", "timeout", ")", ":", "data", "=", "{", "'id'", ":", "conn_or_internal_id", ",", "'callback'", ":", "callback", ",", "'operation_name'", ":", "op_name", "}"...
Begin an operation on a connection Args: conn_or_internal_id (string, int): Either an integer connection id or a string internal_id op_name (string): The name of the operation that we are starting (stored in the connection's microstate) callba...
[ "Begin", "an", "operation", "on", "a", "connection" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/native_ble/iotile_transport_native_ble/connection_manager.py#L611-L632
train
iotile/coretools
transport_plugins/native_ble/iotile_transport_native_ble/connection_manager.py
ConnectionManager._begin_operation_action
def _begin_operation_action(self, action): """Begin an attempted operation. Args: action (ConnectionAction): the action object describing what we are operating on """ conn_key = action.data['id'] callback = action.data['callback'] if self._g...
python
def _begin_operation_action(self, action): """Begin an attempted operation. Args: action (ConnectionAction): the action object describing what we are operating on """ conn_key = action.data['id'] callback = action.data['callback'] if self._g...
[ "def", "_begin_operation_action", "(", "self", ",", "action", ")", ":", "conn_key", "=", "action", ".", "data", "[", "'id'", "]", "callback", "=", "action", ".", "data", "[", "'callback'", "]", "if", "self", ".", "_get_connection_state", "(", "conn_key", "...
Begin an attempted operation. Args: action (ConnectionAction): the action object describing what we are operating on
[ "Begin", "an", "attempted", "operation", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/native_ble/iotile_transport_native_ble/connection_manager.py#L634-L652
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py
AsyncValidatingWSClient.allow_exception
def allow_exception(self, exc_class): """Allow raising this class of exceptions from commands. When a command fails on the server side due to an exception, by default it is turned into a string and raised on the client side as an ExternalError. The original class name is sent but ignor...
python
def allow_exception(self, exc_class): """Allow raising this class of exceptions from commands. When a command fails on the server side due to an exception, by default it is turned into a string and raised on the client side as an ExternalError. The original class name is sent but ignor...
[ "def", "allow_exception", "(", "self", ",", "exc_class", ")", ":", "name", "=", "exc_class", ".", "__name__", "self", ".", "_allowed_exceptions", "[", "name", "]", "=", "exc_class" ]
Allow raising this class of exceptions from commands. When a command fails on the server side due to an exception, by default it is turned into a string and raised on the client side as an ExternalError. The original class name is sent but ignored. If you would like to instead raise a...
[ "Allow", "raising", "this", "class", "of", "exceptions", "from", "commands", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py#L53-L72
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py
AsyncValidatingWSClient.start
async def start(self, name="websocket_client"): """Connect to the websocket server. This method will spawn a background task in the designated event loop that will run until stop() is called. You can control the name of the background task for debugging purposes using the name paramete...
python
async def start(self, name="websocket_client"): """Connect to the websocket server. This method will spawn a background task in the designated event loop that will run until stop() is called. You can control the name of the background task for debugging purposes using the name paramete...
[ "async", "def", "start", "(", "self", ",", "name", "=", "\"websocket_client\"", ")", ":", "self", ".", "_con", "=", "await", "websockets", ".", "connect", "(", "self", ".", "url", ")", "self", ".", "_connection_task", "=", "self", ".", "_loop", ".", "a...
Connect to the websocket server. This method will spawn a background task in the designated event loop that will run until stop() is called. You can control the name of the background task for debugging purposes using the name parameter. The name is not used in anyway except for debug...
[ "Connect", "to", "the", "websocket", "server", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py#L74-L87
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py
AsyncValidatingWSClient.stop
async def stop(self): """Stop this websocket client and disconnect from the server. This method is idempotent and may be called multiple times. If called when there is no active connection, it will simply return. """ if self._connection_task is None: return ...
python
async def stop(self): """Stop this websocket client and disconnect from the server. This method is idempotent and may be called multiple times. If called when there is no active connection, it will simply return. """ if self._connection_task is None: return ...
[ "async", "def", "stop", "(", "self", ")", ":", "if", "self", ".", "_connection_task", "is", "None", ":", "return", "try", ":", "await", "self", ".", "_connection_task", ".", "stop", "(", ")", "finally", ":", "self", ".", "_con", "=", "None", "self", ...
Stop this websocket client and disconnect from the server. This method is idempotent and may be called multiple times. If called when there is no active connection, it will simply return.
[ "Stop", "this", "websocket", "client", "and", "disconnect", "from", "the", "server", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py#L89-L104
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py
AsyncValidatingWSClient.send_command
async def send_command(self, command, args, validator, timeout=10.0): """Send a command and synchronously wait for a single response. Args: command (string): The command name args (dict): Optional arguments. validator (Verifier): A SchemaVerifier to verify the respon...
python
async def send_command(self, command, args, validator, timeout=10.0): """Send a command and synchronously wait for a single response. Args: command (string): The command name args (dict): Optional arguments. validator (Verifier): A SchemaVerifier to verify the respon...
[ "async", "def", "send_command", "(", "self", ",", "command", ",", "args", ",", "validator", ",", "timeout", "=", "10.0", ")", ":", "if", "self", ".", "_con", "is", "None", ":", "raise", "ExternalError", "(", "\"No websock connection established\"", ")", "cmd...
Send a command and synchronously wait for a single response. Args: command (string): The command name args (dict): Optional arguments. validator (Verifier): A SchemaVerifier to verify the response payload. timeout (float): The maximum time to wait...
[ "Send", "a", "command", "and", "synchronously", "wait", "for", "a", "single", "response", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py#L106-L151
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py
AsyncValidatingWSClient._manage_connection
async def _manage_connection(self): """Internal coroutine for managing the client connection.""" try: while True: message = await self._con.recv() try: unpacked = unpack(message) except Exception: # pylint:disable=broad-e...
python
async def _manage_connection(self): """Internal coroutine for managing the client connection.""" try: while True: message = await self._con.recv() try: unpacked = unpack(message) except Exception: # pylint:disable=broad-e...
[ "async", "def", "_manage_connection", "(", "self", ")", ":", "try", ":", "while", "True", ":", "message", "=", "await", "self", ".", "_con", ".", "recv", "(", ")", "try", ":", "unpacked", "=", "unpack", "(", "message", ")", "except", "Exception", ":", ...
Internal coroutine for managing the client connection.
[ "Internal", "coroutine", "for", "managing", "the", "client", "connection", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py#L164-L190
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py
AsyncValidatingWSClient.register_event
def register_event(self, name, callback, validator): """Register a callback to receive events. Every event with the matching name will have its payload validated using validator and then will be passed to callback if validation succeeds. Callback must be a normal callback funct...
python
def register_event(self, name, callback, validator): """Register a callback to receive events. Every event with the matching name will have its payload validated using validator and then will be passed to callback if validation succeeds. Callback must be a normal callback funct...
[ "def", "register_event", "(", "self", ",", "name", ",", "callback", ",", "validator", ")", ":", "async", "def", "_validate_and_call", "(", "message", ")", ":", "payload", "=", "message", ".", "get", "(", "'payload'", ")", "try", ":", "payload", "=", "val...
Register a callback to receive events. Every event with the matching name will have its payload validated using validator and then will be passed to callback if validation succeeds. Callback must be a normal callback function, coroutines are not allowed. If you need to run a c...
[ "Register", "a", "callback", "to", "receive", "events", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py#L192-L230
train
iotile/coretools
transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py
AsyncValidatingWSClient.post_command
def post_command(self, command, args): """Post a command asynchronously and don't wait for a response. There is no notification of any error that could happen during command execution. A log message will be generated if an error occurred. The command's response is discarded. ...
python
def post_command(self, command, args): """Post a command asynchronously and don't wait for a response. There is no notification of any error that could happen during command execution. A log message will be generated if an error occurred. The command's response is discarded. ...
[ "def", "post_command", "(", "self", ",", "command", ",", "args", ")", ":", "self", ".", "_loop", ".", "log_coroutine", "(", "self", ".", "send_command", "(", "command", ",", "args", ",", "Verifier", "(", ")", ")", ")" ]
Post a command asynchronously and don't wait for a response. There is no notification of any error that could happen during command execution. A log message will be generated if an error occurred. The command's response is discarded. This method is thread-safe and may be called from ...
[ "Post", "a", "command", "asynchronously", "and", "don", "t", "wait", "for", "a", "response", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/websocket/iotile_transport_websocket/generic/async_client.py#L232-L248
train
iotile/coretools
iotilesensorgraph/iotile/sg/processors.py
copy_all_a
def copy_all_a(input_a, *other_inputs, **kwargs): """Copy all readings in input a into the output. All other inputs are skipped so that after this function runs there are no readings left in any of the input walkers when the function finishes, even if it generated no output readings. Returns: ...
python
def copy_all_a(input_a, *other_inputs, **kwargs): """Copy all readings in input a into the output. All other inputs are skipped so that after this function runs there are no readings left in any of the input walkers when the function finishes, even if it generated no output readings. Returns: ...
[ "def", "copy_all_a", "(", "input_a", ",", "*", "other_inputs", ",", "**", "kwargs", ")", ":", "output", "=", "[", "]", "while", "input_a", ".", "count", "(", ")", ">", "0", ":", "output", ".", "append", "(", "input_a", ".", "pop", "(", ")", ")", ...
Copy all readings in input a into the output. All other inputs are skipped so that after this function runs there are no readings left in any of the input walkers when the function finishes, even if it generated no output readings. Returns: list(IOTileReading)
[ "Copy", "all", "readings", "in", "input", "a", "into", "the", "output", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/processors.py#L13-L31
train
iotile/coretools
iotilesensorgraph/iotile/sg/processors.py
copy_count_a
def copy_count_a(input_a, *other_inputs, **kwargs): """Copy the latest reading from input a into the output. All other inputs are skipped to that after this function runs there are no readings left in any of the input walkers even if no output is generated. Returns: list(IOTileReading) ...
python
def copy_count_a(input_a, *other_inputs, **kwargs): """Copy the latest reading from input a into the output. All other inputs are skipped to that after this function runs there are no readings left in any of the input walkers even if no output is generated. Returns: list(IOTileReading) ...
[ "def", "copy_count_a", "(", "input_a", ",", "*", "other_inputs", ",", "**", "kwargs", ")", ":", "count", "=", "input_a", ".", "count", "(", ")", "input_a", ".", "skip_all", "(", ")", "for", "input_x", "in", "other_inputs", ":", "input_x", ".", "skip_all"...
Copy the latest reading from input a into the output. All other inputs are skipped to that after this function runs there are no readings left in any of the input walkers even if no output is generated. Returns: list(IOTileReading)
[ "Copy", "the", "latest", "reading", "from", "input", "a", "into", "the", "output", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/processors.py#L63-L81
train
iotile/coretools
iotilesensorgraph/iotile/sg/processors.py
call_rpc
def call_rpc(*inputs, **kwargs): """Call an RPC based on the encoded value read from input b. The response of the RPC must be a 4 byte value that is used as the output of this call. The encoded RPC must be a 32 bit value encoded as "BBH": B: ignored, should be 0 B: the address of the t...
python
def call_rpc(*inputs, **kwargs): """Call an RPC based on the encoded value read from input b. The response of the RPC must be a 4 byte value that is used as the output of this call. The encoded RPC must be a 32 bit value encoded as "BBH": B: ignored, should be 0 B: the address of the t...
[ "def", "call_rpc", "(", "*", "inputs", ",", "**", "kwargs", ")", ":", "rpc_executor", "=", "kwargs", "[", "'rpc_executor'", "]", "output", "=", "[", "]", "try", ":", "value", "=", "inputs", "[", "1", "]", ".", "pop", "(", ")", "addr", "=", "value",...
Call an RPC based on the encoded value read from input b. The response of the RPC must be a 4 byte value that is used as the output of this call. The encoded RPC must be a 32 bit value encoded as "BBH": B: ignored, should be 0 B: the address of the tile that we should call H: The i...
[ "Call", "an", "RPC", "based", "on", "the", "encoded", "value", "read", "from", "input", "b", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/processors.py#L84-L118
train
iotile/coretools
iotilesensorgraph/iotile/sg/processors.py
trigger_streamer
def trigger_streamer(*inputs, **kwargs): """Trigger a streamer based on the index read from input b. Returns: list(IOTileReading) """ streamer_marker = kwargs['mark_streamer'] try: reading = inputs[1].pop() except StreamEmptyError: return [] finally: for in...
python
def trigger_streamer(*inputs, **kwargs): """Trigger a streamer based on the index read from input b. Returns: list(IOTileReading) """ streamer_marker = kwargs['mark_streamer'] try: reading = inputs[1].pop() except StreamEmptyError: return [] finally: for in...
[ "def", "trigger_streamer", "(", "*", "inputs", ",", "**", "kwargs", ")", ":", "streamer_marker", "=", "kwargs", "[", "'mark_streamer'", "]", "try", ":", "reading", "=", "inputs", "[", "1", "]", ".", "pop", "(", ")", "except", "StreamEmptyError", ":", "re...
Trigger a streamer based on the index read from input b. Returns: list(IOTileReading)
[ "Trigger", "a", "streamer", "based", "on", "the", "index", "read", "from", "input", "b", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/processors.py#L121-L143
train
iotile/coretools
iotilesensorgraph/iotile/sg/processors.py
subtract_afromb
def subtract_afromb(*inputs, **kwargs): """Subtract stream a from stream b. Returns: list(IOTileReading) """ try: value_a = inputs[0].pop() value_b = inputs[1].pop() return [IOTileReading(0, 0, value_b.value - value_a.value)] except StreamEmptyError: return...
python
def subtract_afromb(*inputs, **kwargs): """Subtract stream a from stream b. Returns: list(IOTileReading) """ try: value_a = inputs[0].pop() value_b = inputs[1].pop() return [IOTileReading(0, 0, value_b.value - value_a.value)] except StreamEmptyError: return...
[ "def", "subtract_afromb", "(", "*", "inputs", ",", "**", "kwargs", ")", ":", "try", ":", "value_a", "=", "inputs", "[", "0", "]", ".", "pop", "(", ")", "value_b", "=", "inputs", "[", "1", "]", ".", "pop", "(", ")", "return", "[", "IOTileReading", ...
Subtract stream a from stream b. Returns: list(IOTileReading)
[ "Subtract", "stream", "a", "from", "stream", "b", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/processors.py#L146-L159
train
iotile/coretools
iotileemulate/iotile/emulate/virtual/emulation_mixin.py
_clean_intenum
def _clean_intenum(obj): """Remove all IntEnum classes from a map.""" if isinstance(obj, dict): for key, value in obj.items(): if isinstance(value, IntEnum): obj[key] = value.value elif isinstance(value, (dict, list)): obj[key] = _clean_intenum(va...
python
def _clean_intenum(obj): """Remove all IntEnum classes from a map.""" if isinstance(obj, dict): for key, value in obj.items(): if isinstance(value, IntEnum): obj[key] = value.value elif isinstance(value, (dict, list)): obj[key] = _clean_intenum(va...
[ "def", "_clean_intenum", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "dict", ")", ":", "for", "key", ",", "value", "in", "obj", ".", "items", "(", ")", ":", "if", "isinstance", "(", "value", ",", "IntEnum", ")", ":", "obj", "[", "k...
Remove all IntEnum classes from a map.
[ "Remove", "all", "IntEnum", "classes", "from", "a", "map", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/virtual/emulation_mixin.py#L177-L193
train
iotile/coretools
iotileemulate/iotile/emulate/virtual/emulation_mixin.py
EmulationMixin._track_change
def _track_change(self, name, value, formatter=None): """Track that a change happened. This function is only needed for manually recording changes that are not captured by changes to properties of this object that are tracked automatically. Classes that inherit from `emulation_mixin` s...
python
def _track_change(self, name, value, formatter=None): """Track that a change happened. This function is only needed for manually recording changes that are not captured by changes to properties of this object that are tracked automatically. Classes that inherit from `emulation_mixin` s...
[ "def", "_track_change", "(", "self", ",", "name", ",", "value", ",", "formatter", "=", "None", ")", ":", "self", ".", "_emulation_log", ".", "track_change", "(", "self", ".", "_emulation_address", ",", "name", ",", "value", ",", "formatter", ")" ]
Track that a change happened. This function is only needed for manually recording changes that are not captured by changes to properties of this object that are tracked automatically. Classes that inherit from `emulation_mixin` should use this function to record interesting changes in ...
[ "Track", "that", "a", "change", "happened", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/virtual/emulation_mixin.py#L50-L76
train
iotile/coretools
iotileemulate/iotile/emulate/virtual/emulation_mixin.py
EmulationMixin.save_state
def save_state(self, out_path): """Save the current state of this emulated object to a file. Args: out_path (str): The path to save the dumped state of this emulated object. """ state = self.dump_state() # Remove all IntEnums from state since they c...
python
def save_state(self, out_path): """Save the current state of this emulated object to a file. Args: out_path (str): The path to save the dumped state of this emulated object. """ state = self.dump_state() # Remove all IntEnums from state since they c...
[ "def", "save_state", "(", "self", ",", "out_path", ")", ":", "state", "=", "self", ".", "dump_state", "(", ")", "state", "=", "_clean_intenum", "(", "state", ")", "with", "open", "(", "out_path", ",", "\"w\"", ")", "as", "outfile", ":", "json", ".", ...
Save the current state of this emulated object to a file. Args: out_path (str): The path to save the dumped state of this emulated object.
[ "Save", "the", "current", "state", "of", "this", "emulated", "object", "to", "a", "file", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/virtual/emulation_mixin.py#L96-L111
train
iotile/coretools
iotileemulate/iotile/emulate/virtual/emulation_mixin.py
EmulationMixin.load_state
def load_state(self, in_path): """Load the current state of this emulated object from a file. The file should have been produced by a previous call to save_state. Args: in_path (str): The path to the saved state dump that you wish to load. """ with ...
python
def load_state(self, in_path): """Load the current state of this emulated object from a file. The file should have been produced by a previous call to save_state. Args: in_path (str): The path to the saved state dump that you wish to load. """ with ...
[ "def", "load_state", "(", "self", ",", "in_path", ")", ":", "with", "open", "(", "in_path", ",", "\"r\"", ")", "as", "infile", ":", "state", "=", "json", ".", "load", "(", "infile", ")", "self", ".", "restore_state", "(", "state", ")" ]
Load the current state of this emulated object from a file. The file should have been produced by a previous call to save_state. Args: in_path (str): The path to the saved state dump that you wish to load.
[ "Load", "the", "current", "state", "of", "this", "emulated", "object", "from", "a", "file", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/virtual/emulation_mixin.py#L113-L126
train
iotile/coretools
iotileemulate/iotile/emulate/virtual/emulation_mixin.py
EmulationMixin.load_scenario
def load_scenario(self, scenario_name, **kwargs): """Load a scenario into the emulated object. Scenarios are specific states of an an object that can be customized with keyword parameters. Typical examples are: - data logger with full storage - device with low battery indi...
python
def load_scenario(self, scenario_name, **kwargs): """Load a scenario into the emulated object. Scenarios are specific states of an an object that can be customized with keyword parameters. Typical examples are: - data logger with full storage - device with low battery indi...
[ "def", "load_scenario", "(", "self", ",", "scenario_name", ",", "**", "kwargs", ")", ":", "scenario", "=", "self", ".", "_known_scenarios", ".", "get", "(", "scenario_name", ")", "if", "scenario", "is", "None", ":", "raise", "ArgumentError", "(", "\"Unknown ...
Load a scenario into the emulated object. Scenarios are specific states of an an object that can be customized with keyword parameters. Typical examples are: - data logger with full storage - device with low battery indication on Args: scenario_name (str): The...
[ "Load", "a", "scenario", "into", "the", "emulated", "object", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/virtual/emulation_mixin.py#L128-L149
train
iotile/coretools
iotileemulate/iotile/emulate/virtual/emulation_mixin.py
EmulationMixin.register_scenario
def register_scenario(self, scenario_name, handler): """Register a scenario handler for this object. Scenario handlers are callable functions with no positional arguments that can be called by name with the load_scenario function and should prepare the emulated object into a known state...
python
def register_scenario(self, scenario_name, handler): """Register a scenario handler for this object. Scenario handlers are callable functions with no positional arguments that can be called by name with the load_scenario function and should prepare the emulated object into a known state...
[ "def", "register_scenario", "(", "self", ",", "scenario_name", ",", "handler", ")", ":", "if", "scenario_name", "in", "self", ".", "_known_scenarios", ":", "raise", "ArgumentError", "(", "\"Attempted to add the same scenario name twice\"", ",", "scenario_name", "=", "...
Register a scenario handler for this object. Scenario handlers are callable functions with no positional arguments that can be called by name with the load_scenario function and should prepare the emulated object into a known state. The purpose of a scenario is to make it easy to get a...
[ "Register", "a", "scenario", "handler", "for", "this", "object", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/virtual/emulation_mixin.py#L151-L174
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/hpcc.py
generate
def generate(env): """Add Builders and construction variables for aCC & cc to an Environment.""" cc.generate(env) env['CXX'] = 'aCC' env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS +Z')
python
def generate(env): """Add Builders and construction variables for aCC & cc to an Environment.""" cc.generate(env) env['CXX'] = 'aCC' env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS +Z')
[ "def", "generate", "(", "env", ")", ":", "cc", ".", "generate", "(", "env", ")", "env", "[", "'CXX'", "]", "=", "'aCC'", "env", "[", "'SHCCFLAGS'", "]", "=", "SCons", ".", "Util", ".", "CLVar", "(", "'$CCFLAGS +Z'", ")" ]
Add Builders and construction variables for aCC & cc to an Environment.
[ "Add", "Builders", "and", "construction", "variables", "for", "aCC", "&", "cc", "to", "an", "Environment", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/hpcc.py#L39-L44
train
iotile/coretools
iotilesensorgraph/iotile/sg/optimizer/optimizer.py
SensorGraphOptimizer.add_pass
def add_pass(self, name, opt_pass, before=None, after=None): """Add an optimization pass to the optimizer. Optimization passes have a name that allows them to be enabled or disabled by name. By default all optimization passed are enabled and unordered. You can explicitly speci...
python
def add_pass(self, name, opt_pass, before=None, after=None): """Add an optimization pass to the optimizer. Optimization passes have a name that allows them to be enabled or disabled by name. By default all optimization passed are enabled and unordered. You can explicitly speci...
[ "def", "add_pass", "(", "self", ",", "name", ",", "opt_pass", ",", "before", "=", "None", ",", "after", "=", "None", ")", ":", "if", "before", "is", "None", ":", "before", "=", "[", "]", "if", "after", "is", "None", ":", "after", "=", "[", "]", ...
Add an optimization pass to the optimizer. Optimization passes have a name that allows them to be enabled or disabled by name. By default all optimization passed are enabled and unordered. You can explicitly specify passes by name that this pass must run before or after this p...
[ "Add", "an", "optimization", "pass", "to", "the", "optimizer", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/optimizer/optimizer.py#L24-L49
train
iotile/coretools
iotilesensorgraph/iotile/sg/optimizer/optimizer.py
SensorGraphOptimizer._order_pases
def _order_pases(self, passes): """Topologically sort optimization passes. This ensures that the resulting passes are run in order respecting before/after constraints. Args: passes (iterable): An iterable of pass names that should be included in the optimiza...
python
def _order_pases(self, passes): """Topologically sort optimization passes. This ensures that the resulting passes are run in order respecting before/after constraints. Args: passes (iterable): An iterable of pass names that should be included in the optimiza...
[ "def", "_order_pases", "(", "self", ",", "passes", ")", ":", "passes", "=", "set", "(", "passes", ")", "pass_deps", "=", "{", "}", "for", "opt", "in", "passes", ":", "_", ",", "before", ",", "after", "=", "self", ".", "_known_passes", "[", "opt", "...
Topologically sort optimization passes. This ensures that the resulting passes are run in order respecting before/after constraints. Args: passes (iterable): An iterable of pass names that should be included in the optimization passes run.
[ "Topologically", "sort", "optimization", "passes", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/optimizer/optimizer.py#L51-L86
train
iotile/coretools
iotilesensorgraph/iotile/sg/optimizer/optimizer.py
SensorGraphOptimizer.optimize
def optimize(self, sensor_graph, model): """Optimize a sensor graph by running optimization passes. The passes are run one at a time and modify the sensor graph for future passes. Args: sensor_graph (SensorGraph): The graph to be optimized model (DeviceModel): T...
python
def optimize(self, sensor_graph, model): """Optimize a sensor graph by running optimization passes. The passes are run one at a time and modify the sensor graph for future passes. Args: sensor_graph (SensorGraph): The graph to be optimized model (DeviceModel): T...
[ "def", "optimize", "(", "self", ",", "sensor_graph", ",", "model", ")", ":", "passes", "=", "self", ".", "_order_pases", "(", "self", ".", "_known_passes", ".", "keys", "(", ")", ")", "for", "opt_name", "in", "passes", ":", "rerun", "=", "True", "pass_...
Optimize a sensor graph by running optimization passes. The passes are run one at a time and modify the sensor graph for future passes. Args: sensor_graph (SensorGraph): The graph to be optimized model (DeviceModel): The device that we are optimizing for...
[ "Optimize", "a", "sensor", "graph", "by", "running", "optimization", "passes", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/optimizer/optimizer.py#L88-L108
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConscript.py
get_calling_namespaces
def get_calling_namespaces(): """Return the locals and globals for the function that called into this module in the current call stack.""" try: 1//0 except ZeroDivisionError: # Don't start iterating with the current stack-frame to # prevent creating reference cycles (f_back is safe). ...
python
def get_calling_namespaces(): """Return the locals and globals for the function that called into this module in the current call stack.""" try: 1//0 except ZeroDivisionError: # Don't start iterating with the current stack-frame to # prevent creating reference cycles (f_back is safe). ...
[ "def", "get_calling_namespaces", "(", ")", ":", "try", ":", "1", "//", "0", "except", "ZeroDivisionError", ":", "frame", "=", "sys", ".", "exc_info", "(", ")", "[", "2", "]", ".", "tb_frame", ".", "f_back", "while", "frame", ".", "f_globals", ".", "get...
Return the locals and globals for the function that called into this module in the current call stack.
[ "Return", "the", "locals", "and", "globals", "for", "the", "function", "that", "called", "into", "this", "module", "in", "the", "current", "call", "stack", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConscript.py#L70-L89
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConscript.py
annotate
def annotate(node): """Annotate a node with the stack frame describing the SConscript file and line number that created it.""" tb = sys.exc_info()[2] while tb and stack_bottom not in tb.tb_frame.f_locals: tb = tb.tb_next if not tb: # We did not find any exec of an SConscript file: wh...
python
def annotate(node): """Annotate a node with the stack frame describing the SConscript file and line number that created it.""" tb = sys.exc_info()[2] while tb and stack_bottom not in tb.tb_frame.f_locals: tb = tb.tb_next if not tb: # We did not find any exec of an SConscript file: wh...
[ "def", "annotate", "(", "node", ")", ":", "tb", "=", "sys", ".", "exc_info", "(", ")", "[", "2", "]", "while", "tb", "and", "stack_bottom", "not", "in", "tb", ".", "tb_frame", ".", "f_locals", ":", "tb", "=", "tb", ".", "tb_next", "if", "not", "t...
Annotate a node with the stack frame describing the SConscript file and line number that created it.
[ "Annotate", "a", "node", "with", "the", "stack", "frame", "describing", "the", "SConscript", "file", "and", "line", "number", "that", "created", "it", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConscript.py#L331-L340
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConscript.py
BuildDefaultGlobals
def BuildDefaultGlobals(): """ Create a dictionary containing all the default globals for SConstruct and SConscript files. """ global GlobalDict if GlobalDict is None: GlobalDict = {} import SCons.Script d = SCons.Script.__dict__ def not_a_module(m, d=d, mtype=t...
python
def BuildDefaultGlobals(): """ Create a dictionary containing all the default globals for SConstruct and SConscript files. """ global GlobalDict if GlobalDict is None: GlobalDict = {} import SCons.Script d = SCons.Script.__dict__ def not_a_module(m, d=d, mtype=t...
[ "def", "BuildDefaultGlobals", "(", ")", ":", "global", "GlobalDict", "if", "GlobalDict", "is", "None", ":", "GlobalDict", "=", "{", "}", "import", "SCons", ".", "Script", "d", "=", "SCons", ".", "Script", ".", "__dict__", "def", "not_a_module", "(", "m", ...
Create a dictionary containing all the default globals for SConstruct and SConscript files.
[ "Create", "a", "dictionary", "containing", "all", "the", "default", "globals", "for", "SConstruct", "and", "SConscript", "files", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConscript.py#L617-L634
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConscript.py
SConsEnvironment._exceeds_version
def _exceeds_version(self, major, minor, v_major, v_minor): """Return 1 if 'major' and 'minor' are greater than the version in 'v_major' and 'v_minor', and 0 otherwise.""" return (major > v_major or (major == v_major and minor > v_minor))
python
def _exceeds_version(self, major, minor, v_major, v_minor): """Return 1 if 'major' and 'minor' are greater than the version in 'v_major' and 'v_minor', and 0 otherwise.""" return (major > v_major or (major == v_major and minor > v_minor))
[ "def", "_exceeds_version", "(", "self", ",", "major", ",", "minor", ",", "v_major", ",", "v_minor", ")", ":", "return", "(", "major", ">", "v_major", "or", "(", "major", "==", "v_major", "and", "minor", ">", "v_minor", ")", ")" ]
Return 1 if 'major' and 'minor' are greater than the version in 'v_major' and 'v_minor', and 0 otherwise.
[ "Return", "1", "if", "major", "and", "minor", "are", "greater", "than", "the", "version", "in", "v_major", "and", "v_minor", "and", "0", "otherwise", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConscript.py#L359-L362
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConscript.py
SConsEnvironment.EnsureSConsVersion
def EnsureSConsVersion(self, major, minor, revision=0): """Exit abnormally if the SCons version is not late enough.""" # split string to avoid replacement during build process if SCons.__version__ == '__' + 'VERSION__': SCons.Warnings.warn(SCons.Warnings.DevelopmentVersionWarning, ...
python
def EnsureSConsVersion(self, major, minor, revision=0): """Exit abnormally if the SCons version is not late enough.""" # split string to avoid replacement during build process if SCons.__version__ == '__' + 'VERSION__': SCons.Warnings.warn(SCons.Warnings.DevelopmentVersionWarning, ...
[ "def", "EnsureSConsVersion", "(", "self", ",", "major", ",", "minor", ",", "revision", "=", "0", ")", ":", "if", "SCons", ".", "__version__", "==", "'__'", "+", "'VERSION__'", ":", "SCons", ".", "Warnings", ".", "warn", "(", "SCons", ".", "Warnings", "...
Exit abnormally if the SCons version is not late enough.
[ "Exit", "abnormally", "if", "the", "SCons", "version", "is", "not", "late", "enough", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConscript.py#L462-L477
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConscript.py
SConsEnvironment.EnsurePythonVersion
def EnsurePythonVersion(self, major, minor): """Exit abnormally if the Python version is not late enough.""" if sys.version_info < (major, minor): v = sys.version.split()[0] print("Python %d.%d or greater required, but you have Python %s" %(major,minor,v)) sys.exit(2)
python
def EnsurePythonVersion(self, major, minor): """Exit abnormally if the Python version is not late enough.""" if sys.version_info < (major, minor): v = sys.version.split()[0] print("Python %d.%d or greater required, but you have Python %s" %(major,minor,v)) sys.exit(2)
[ "def", "EnsurePythonVersion", "(", "self", ",", "major", ",", "minor", ")", ":", "if", "sys", ".", "version_info", "<", "(", "major", ",", "minor", ")", ":", "v", "=", "sys", ".", "version", ".", "split", "(", ")", "[", "0", "]", "print", "(", "\...
Exit abnormally if the Python version is not late enough.
[ "Exit", "abnormally", "if", "the", "Python", "version", "is", "not", "late", "enough", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConscript.py#L479-L484
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msvc.py
validate_vars
def validate_vars(env): """Validate the PCH and PCHSTOP construction variables.""" if 'PCH' in env and env['PCH']: if 'PCHSTOP' not in env: raise SCons.Errors.UserError("The PCHSTOP construction must be defined if PCH is defined.") if not SCons.Util.is_String(env['PCHSTOP']): ...
python
def validate_vars(env): """Validate the PCH and PCHSTOP construction variables.""" if 'PCH' in env and env['PCH']: if 'PCHSTOP' not in env: raise SCons.Errors.UserError("The PCHSTOP construction must be defined if PCH is defined.") if not SCons.Util.is_String(env['PCHSTOP']): ...
[ "def", "validate_vars", "(", "env", ")", ":", "if", "'PCH'", "in", "env", "and", "env", "[", "'PCH'", "]", ":", "if", "'PCHSTOP'", "not", "in", "env", ":", "raise", "SCons", ".", "Errors", ".", "UserError", "(", "\"The PCHSTOP construction must be defined if...
Validate the PCH and PCHSTOP construction variables.
[ "Validate", "the", "PCH", "and", "PCHSTOP", "construction", "variables", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msvc.py#L55-L61
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msvc.py
msvc_set_PCHPDBFLAGS
def msvc_set_PCHPDBFLAGS(env): """ Set appropriate PCHPDBFLAGS for the MSVC version being used. """ if env.get('MSVC_VERSION',False): maj, min = msvc_version_to_maj_min(env['MSVC_VERSION']) if maj < 8: env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}']) ...
python
def msvc_set_PCHPDBFLAGS(env): """ Set appropriate PCHPDBFLAGS for the MSVC version being used. """ if env.get('MSVC_VERSION',False): maj, min = msvc_version_to_maj_min(env['MSVC_VERSION']) if maj < 8: env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}']) ...
[ "def", "msvc_set_PCHPDBFLAGS", "(", "env", ")", ":", "if", "env", ".", "get", "(", "'MSVC_VERSION'", ",", "False", ")", ":", "maj", ",", "min", "=", "msvc_version_to_maj_min", "(", "env", "[", "'MSVC_VERSION'", "]", ")", "if", "maj", "<", "8", ":", "en...
Set appropriate PCHPDBFLAGS for the MSVC version being used.
[ "Set", "appropriate", "PCHPDBFLAGS", "for", "the", "MSVC", "version", "being", "used", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msvc.py#L63-L75
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msvc.py
pch_emitter
def pch_emitter(target, source, env): """Adds the object file target.""" validate_vars(env) pch = None obj = None for t in target: if SCons.Util.splitext(str(t))[1] == '.pch': pch = t if SCons.Util.splitext(str(t))[1] == '.obj': obj = t if not obj: ...
python
def pch_emitter(target, source, env): """Adds the object file target.""" validate_vars(env) pch = None obj = None for t in target: if SCons.Util.splitext(str(t))[1] == '.pch': pch = t if SCons.Util.splitext(str(t))[1] == '.obj': obj = t if not obj: ...
[ "def", "pch_emitter", "(", "target", ",", "source", ",", "env", ")", ":", "validate_vars", "(", "env", ")", "pch", "=", "None", "obj", "=", "None", "for", "t", "in", "target", ":", "if", "SCons", ".", "Util", ".", "splitext", "(", "str", "(", "t", ...
Adds the object file target.
[ "Adds", "the", "object", "file", "target", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msvc.py#L78-L97
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msvc.py
object_emitter
def object_emitter(target, source, env, parent_emitter): """Sets up the PCH dependencies for an object file.""" validate_vars(env) parent_emitter(target, source, env) # Add a dependency, but only if the target (e.g. 'Source1.obj') # doesn't correspond to the pre-compiled header ('Source1.pch'). ...
python
def object_emitter(target, source, env, parent_emitter): """Sets up the PCH dependencies for an object file.""" validate_vars(env) parent_emitter(target, source, env) # Add a dependency, but only if the target (e.g. 'Source1.obj') # doesn't correspond to the pre-compiled header ('Source1.pch'). ...
[ "def", "object_emitter", "(", "target", ",", "source", ",", "env", ",", "parent_emitter", ")", ":", "validate_vars", "(", "env", ")", "parent_emitter", "(", "target", ",", "source", ",", "env", ")", "if", "'PCH'", "in", "env", ":", "pch", "=", "env", "...
Sets up the PCH dependencies for an object file.
[ "Sets", "up", "the", "PCH", "dependencies", "for", "an", "object", "file", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msvc.py#L99-L121
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msvc.py
msvc_batch_key
def msvc_batch_key(action, env, target, source): """ Returns a key to identify unique batches of sources for compilation. If batching is enabled (via the $MSVC_BATCH setting), then all target+source pairs that use the same action, defined by the same environment, and have the same target and source...
python
def msvc_batch_key(action, env, target, source): """ Returns a key to identify unique batches of sources for compilation. If batching is enabled (via the $MSVC_BATCH setting), then all target+source pairs that use the same action, defined by the same environment, and have the same target and source...
[ "def", "msvc_batch_key", "(", "action", ",", "env", ",", "target", ",", "source", ")", ":", "if", "not", "'MSVC_BATCH'", "in", "env", "or", "env", ".", "subst", "(", "'$MSVC_BATCH'", ")", "in", "(", "'0'", ",", "'False'", ",", "''", ",", "None", ")",...
Returns a key to identify unique batches of sources for compilation. If batching is enabled (via the $MSVC_BATCH setting), then all target+source pairs that use the same action, defined by the same environment, and have the same target and source directories, will be batched. Returning None specif...
[ "Returns", "a", "key", "to", "identify", "unique", "batches", "of", "sources", "for", "compilation", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msvc.py#L146-L173
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msvc.py
generate
def generate(env): """Add Builders and construction variables for MSVC++ to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) # TODO(batch): shouldn't reach in to cmdgen this way; necessary # for now to bypass the checks in Builder.DictCmdGenerator.__call__() # and allo...
python
def generate(env): """Add Builders and construction variables for MSVC++ to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) # TODO(batch): shouldn't reach in to cmdgen this way; necessary # for now to bypass the checks in Builder.DictCmdGenerator.__call__() # and allo...
[ "def", "generate", "(", "env", ")", ":", "static_obj", ",", "shared_obj", "=", "SCons", ".", "Tool", ".", "createObjBuilders", "(", "env", ")", "static_obj", ".", "cmdgen", ".", "source_ext_match", "=", "False", "shared_obj", ".", "cmdgen", ".", "source_ext_...
Add Builders and construction variables for MSVC++ to an Environment.
[ "Add", "Builders", "and", "construction", "variables", "for", "MSVC", "++", "to", "an", "Environment", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msvc.py#L213-L286
train
iotile/coretools
iotileship/iotile/ship/resources/hardware_manager.py
HardwareManagerResource.open
def open(self): """Open and potentially connect to a device.""" self.hwman = HardwareManager(port=self._port) self.opened = True if self._connection_string is not None: try: self.hwman.connect_direct(self._connection_string) except HardwareError:...
python
def open(self): """Open and potentially connect to a device.""" self.hwman = HardwareManager(port=self._port) self.opened = True if self._connection_string is not None: try: self.hwman.connect_direct(self._connection_string) except HardwareError:...
[ "def", "open", "(", "self", ")", ":", "self", ".", "hwman", "=", "HardwareManager", "(", "port", "=", "self", ".", "_port", ")", "self", ".", "opened", "=", "True", "if", "self", ".", "_connection_string", "is", "not", "None", ":", "try", ":", "self"...
Open and potentially connect to a device.
[ "Open", "and", "potentially", "connect", "to", "a", "device", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileship/iotile/ship/resources/hardware_manager.py#L46-L64
train
iotile/coretools
iotileship/iotile/ship/resources/hardware_manager.py
HardwareManagerResource.close
def close(self): """Close and potentially disconnect from a device.""" if self.hwman.stream.connected: self.hwman.disconnect() self.hwman.close() self.opened = False
python
def close(self): """Close and potentially disconnect from a device.""" if self.hwman.stream.connected: self.hwman.disconnect() self.hwman.close() self.opened = False
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "hwman", ".", "stream", ".", "connected", ":", "self", ".", "hwman", ".", "disconnect", "(", ")", "self", ".", "hwman", ".", "close", "(", ")", "self", ".", "opened", "=", "False" ]
Close and potentially disconnect from a device.
[ "Close", "and", "potentially", "disconnect", "from", "a", "device", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileship/iotile/ship/resources/hardware_manager.py#L67-L74
train
iotile/coretools
iotilebuild/iotile/build/config/site_scons/pythondist.py
get_support_package
def get_support_package(tile): """Returns the support_package product.""" packages = tile.find_products('support_package') if len(packages) == 0: return None elif len(packages) == 1: return packages[0] raise BuildError("Tile declared multiple support packages, only one is supported...
python
def get_support_package(tile): """Returns the support_package product.""" packages = tile.find_products('support_package') if len(packages) == 0: return None elif len(packages) == 1: return packages[0] raise BuildError("Tile declared multiple support packages, only one is supported...
[ "def", "get_support_package", "(", "tile", ")", ":", "packages", "=", "tile", ".", "find_products", "(", "'support_package'", ")", "if", "len", "(", "packages", ")", "==", "0", ":", "return", "None", "elif", "len", "(", "packages", ")", "==", "1", ":", ...
Returns the support_package product.
[ "Returns", "the", "support_package", "product", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/site_scons/pythondist.py#L30-L39
train
iotile/coretools
iotilebuild/iotile/build/config/site_scons/pythondist.py
iter_support_files
def iter_support_files(tile): """Iterate over all files that go in the support wheel. This method has two possible behaviors. If there is a 'support_package' product defined, then this recursively enumerates all .py files inside that folder and adds them all in the same hierarchy to the support wheel....
python
def iter_support_files(tile): """Iterate over all files that go in the support wheel. This method has two possible behaviors. If there is a 'support_package' product defined, then this recursively enumerates all .py files inside that folder and adds them all in the same hierarchy to the support wheel....
[ "def", "iter_support_files", "(", "tile", ")", ":", "support_package", "=", "get_support_package", "(", "tile", ")", "if", "support_package", "is", "None", ":", "for", "module", ",", "_", ",", "_", "in", "iter_python_modules", "(", "tile", ")", ":", "yield",...
Iterate over all files that go in the support wheel. This method has two possible behaviors. If there is a 'support_package' product defined, then this recursively enumerates all .py files inside that folder and adds them all in the same hierarchy to the support wheel. If there is no support_package ...
[ "Iterate", "over", "all", "files", "that", "go", "in", "the", "support", "wheel", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/site_scons/pythondist.py#L42-L73
train
iotile/coretools
iotilebuild/iotile/build/config/site_scons/pythondist.py
iter_python_modules
def iter_python_modules(tile): """Iterate over all python products in the given tile. This will yield tuples where the first entry is the path to the module containing the product the second entry is the appropriate import string to include in an entry point, and the third entry is the entry point ...
python
def iter_python_modules(tile): """Iterate over all python products in the given tile. This will yield tuples where the first entry is the path to the module containing the product the second entry is the appropriate import string to include in an entry point, and the third entry is the entry point ...
[ "def", "iter_python_modules", "(", "tile", ")", ":", "for", "product_type", "in", "tile", ".", "PYTHON_PRODUCTS", ":", "for", "product", "in", "tile", ".", "find_products", "(", "product_type", ")", ":", "entry_point", "=", "ENTRY_POINT_MAP", ".", "get", "(", ...
Iterate over all python products in the given tile. This will yield tuples where the first entry is the path to the module containing the product the second entry is the appropriate import string to include in an entry point, and the third entry is the entry point name.
[ "Iterate", "over", "all", "python", "products", "in", "the", "given", "tile", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/site_scons/pythondist.py#L76-L110
train
iotile/coretools
iotilebuild/iotile/build/config/site_scons/pythondist.py
generate_setup_py
def generate_setup_py(target, source, env): """Generate the setup.py file for this distribution.""" tile = env['TILE'] data = {} entry_points = {} for _mod, import_string, entry_point in iter_python_modules(tile): if entry_point not in entry_points: entry_points[entry_point] =...
python
def generate_setup_py(target, source, env): """Generate the setup.py file for this distribution.""" tile = env['TILE'] data = {} entry_points = {} for _mod, import_string, entry_point in iter_python_modules(tile): if entry_point not in entry_points: entry_points[entry_point] =...
[ "def", "generate_setup_py", "(", "target", ",", "source", ",", "env", ")", ":", "tile", "=", "env", "[", "'TILE'", "]", "data", "=", "{", "}", "entry_points", "=", "{", "}", "for", "_mod", ",", "import_string", ",", "entry_point", "in", "iter_python_modu...
Generate the setup.py file for this distribution.
[ "Generate", "the", "setup", ".", "py", "file", "for", "this", "distribution", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/site_scons/pythondist.py#L197-L237
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/rpmutils.py
defaultMachine
def defaultMachine(use_rpm_default=True): """ Return the canonicalized machine name. """ if use_rpm_default: try: # This should be the most reliable way to get the default arch rmachine = subprocess.check_output(['rpm', '--eval=%_target_cpu'], shell=False).rstrip() r...
python
def defaultMachine(use_rpm_default=True): """ Return the canonicalized machine name. """ if use_rpm_default: try: # This should be the most reliable way to get the default arch rmachine = subprocess.check_output(['rpm', '--eval=%_target_cpu'], shell=False).rstrip() r...
[ "def", "defaultMachine", "(", "use_rpm_default", "=", "True", ")", ":", "if", "use_rpm_default", ":", "try", ":", "rmachine", "=", "subprocess", ".", "check_output", "(", "[", "'rpm'", ",", "'--eval=%_target_cpu'", "]", ",", "shell", "=", "False", ")", ".", ...
Return the canonicalized machine name.
[ "Return", "the", "canonicalized", "machine", "name", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/rpmutils.py#L441-L459
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/rpmutils.py
defaultSystem
def defaultSystem(): """ Return the canonicalized system name. """ rsystem = platform.system() # Try to lookup the string in the canon tables if rsystem in os_canon: rsystem = os_canon[rsystem][0] return rsystem
python
def defaultSystem(): """ Return the canonicalized system name. """ rsystem = platform.system() # Try to lookup the string in the canon tables if rsystem in os_canon: rsystem = os_canon[rsystem][0] return rsystem
[ "def", "defaultSystem", "(", ")", ":", "rsystem", "=", "platform", ".", "system", "(", ")", "if", "rsystem", "in", "os_canon", ":", "rsystem", "=", "os_canon", "[", "rsystem", "]", "[", "0", "]", "return", "rsystem" ]
Return the canonicalized system name.
[ "Return", "the", "canonicalized", "system", "name", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/rpmutils.py#L461-L469
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py
Task.prepare
def prepare(self): """ Called just before the task is executed. This is mainly intended to give the target Nodes a chance to unlink underlying files and make all necessary directories before the Action is actually called to build the targets. """ global print_pre...
python
def prepare(self): """ Called just before the task is executed. This is mainly intended to give the target Nodes a chance to unlink underlying files and make all necessary directories before the Action is actually called to build the targets. """ global print_pre...
[ "def", "prepare", "(", "self", ")", ":", "global", "print_prepare", "T", "=", "self", ".", "tm", ".", "trace", "if", "T", ":", "T", ".", "write", "(", "self", ".", "trace_message", "(", "u'Task.prepare()'", ",", "self", ".", "node", ")", ")", "self",...
Called just before the task is executed. This is mainly intended to give the target Nodes a chance to unlink underlying files and make all necessary directories before the Action is actually called to build the targets.
[ "Called", "just", "before", "the", "task", "is", "executed", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py#L163-L207
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py
Task.execute
def execute(self): """ Called to execute the task. This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in prepare(), executed() or failed(). """ T = self.tm.trace if T: T.write(self.t...
python
def execute(self): """ Called to execute the task. This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in prepare(), executed() or failed(). """ T = self.tm.trace if T: T.write(self.t...
[ "def", "execute", "(", "self", ")", ":", "T", "=", "self", ".", "tm", ".", "trace", "if", "T", ":", "T", ".", "write", "(", "self", ".", "trace_message", "(", "u'Task.execute()'", ",", "self", ".", "node", ")", ")", "try", ":", "cached_targets", "=...
Called to execute the task. This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in prepare(), executed() or failed().
[ "Called", "to", "execute", "the", "task", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py#L226-L269
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py
Task.executed_without_callbacks
def executed_without_callbacks(self): """ Called when the task has been successfully executed and the Taskmaster instance doesn't want to call the Node's callback methods. """ T = self.tm.trace if T: T.write(self.trace_message('Task.executed_without_callbacks()', ...
python
def executed_without_callbacks(self): """ Called when the task has been successfully executed and the Taskmaster instance doesn't want to call the Node's callback methods. """ T = self.tm.trace if T: T.write(self.trace_message('Task.executed_without_callbacks()', ...
[ "def", "executed_without_callbacks", "(", "self", ")", ":", "T", "=", "self", ".", "tm", ".", "trace", "if", "T", ":", "T", ".", "write", "(", "self", ".", "trace_message", "(", "'Task.executed_without_callbacks()'", ",", "self", ".", "node", ")", ")", "...
Called when the task has been successfully executed and the Taskmaster instance doesn't want to call the Node's callback methods.
[ "Called", "when", "the", "task", "has", "been", "successfully", "executed", "and", "the", "Taskmaster", "instance", "doesn", "t", "want", "to", "call", "the", "Node", "s", "callback", "methods", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py#L271-L285
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py
Task.executed_with_callbacks
def executed_with_callbacks(self): """ Called when the task has been successfully executed and the Taskmaster instance wants to call the Node's callback methods. This may have been a do-nothing operation (to preserve build order), so we must check the node's state before...
python
def executed_with_callbacks(self): """ Called when the task has been successfully executed and the Taskmaster instance wants to call the Node's callback methods. This may have been a do-nothing operation (to preserve build order), so we must check the node's state before...
[ "def", "executed_with_callbacks", "(", "self", ")", ":", "global", "print_prepare", "T", "=", "self", ".", "tm", ".", "trace", "if", "T", ":", "T", ".", "write", "(", "self", ".", "trace_message", "(", "'Task.executed_with_callbacks()'", ",", "self", ".", ...
Called when the task has been successfully executed and the Taskmaster instance wants to call the Node's callback methods. This may have been a do-nothing operation (to preserve build order), so we must check the node's state before deciding whether it was "built", in which case...
[ "Called", "when", "the", "task", "has", "been", "successfully", "executed", "and", "the", "Taskmaster", "instance", "wants", "to", "call", "the", "Node", "s", "callback", "methods", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py#L287-L318
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py
Task.fail_stop
def fail_stop(self): """ Explicit stop-the-build failure. This sets failure status on the target nodes and all of their dependent parent nodes. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date ...
python
def fail_stop(self): """ Explicit stop-the-build failure. This sets failure status on the target nodes and all of their dependent parent nodes. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date ...
[ "def", "fail_stop", "(", "self", ")", ":", "T", "=", "self", ".", "tm", ".", "trace", "if", "T", ":", "T", ".", "write", "(", "self", ".", "trace_message", "(", "'Task.failed_stop()'", ",", "self", ".", "node", ")", ")", "self", ".", "tm", ".", "...
Explicit stop-the-build failure. This sets failure status on the target nodes and all of their dependent parent nodes. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure().
[ "Explicit", "stop", "-", "the", "-", "build", "failure", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py#L332-L357
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py
Task.fail_continue
def fail_continue(self): """ Explicit continue-the-build failure. This sets failure status on the target nodes and all of their dependent parent nodes. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-da...
python
def fail_continue(self): """ Explicit continue-the-build failure. This sets failure status on the target nodes and all of their dependent parent nodes. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-da...
[ "def", "fail_continue", "(", "self", ")", ":", "T", "=", "self", ".", "tm", ".", "trace", "if", "T", ":", "T", ".", "write", "(", "self", ".", "trace_message", "(", "'Task.failed_continue()'", ",", "self", ".", "node", ")", ")", "self", ".", "tm", ...
Explicit continue-the-build failure. This sets failure status on the target nodes and all of their dependent parent nodes. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure().
[ "Explicit", "continue", "-", "the", "-", "build", "failure", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py#L359-L373
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py
Task.make_ready_all
def make_ready_all(self): """ Marks all targets in a task ready for execution. This is used when the interface needs every target Node to be visited--the canonical example being the "scons -c" option. """ T = self.tm.trace if T: T.write(self.trace_message('Task.m...
python
def make_ready_all(self): """ Marks all targets in a task ready for execution. This is used when the interface needs every target Node to be visited--the canonical example being the "scons -c" option. """ T = self.tm.trace if T: T.write(self.trace_message('Task.m...
[ "def", "make_ready_all", "(", "self", ")", ":", "T", "=", "self", ".", "tm", ".", "trace", "if", "T", ":", "T", ".", "write", "(", "self", ".", "trace_message", "(", "'Task.make_ready_all()'", ",", "self", ".", "node", ")", ")", "self", ".", "out_of_...
Marks all targets in a task ready for execution. This is used when the interface needs every target Node to be visited--the canonical example being the "scons -c" option.
[ "Marks", "all", "targets", "in", "a", "task", "ready", "for", "execution", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py#L375-L390
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py
Task.make_ready_current
def make_ready_current(self): """ Marks all targets in a task ready for execution if any target is not current. This is the default behavior for building only what's necessary. """ global print_prepare T = self.tm.trace if T: T.write(self.trace_message(u'...
python
def make_ready_current(self): """ Marks all targets in a task ready for execution if any target is not current. This is the default behavior for building only what's necessary. """ global print_prepare T = self.tm.trace if T: T.write(self.trace_message(u'...
[ "def", "make_ready_current", "(", "self", ")", ":", "global", "print_prepare", "T", "=", "self", ".", "tm", ".", "trace", "if", "T", ":", "T", ".", "write", "(", "self", ".", "trace_message", "(", "u'Task.make_ready_current()'", ",", "self", ".", "node", ...
Marks all targets in a task ready for execution if any target is not current. This is the default behavior for building only what's necessary.
[ "Marks", "all", "targets", "in", "a", "task", "ready", "for", "execution", "if", "any", "target", "is", "not", "current", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py#L392-L434
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py
Task.postprocess
def postprocess(self): """ Post-processes a task after it's been executed. This examines all the targets just built (or not, we don't care if the build was successful, or even if there was no build because everything was up-to-date) to see if they have any waiting parent...
python
def postprocess(self): """ Post-processes a task after it's been executed. This examines all the targets just built (or not, we don't care if the build was successful, or even if there was no build because everything was up-to-date) to see if they have any waiting parent...
[ "def", "postprocess", "(", "self", ")", ":", "T", "=", "self", ".", "tm", ".", "trace", "if", "T", ":", "T", ".", "write", "(", "self", ".", "trace_message", "(", "u'Task.postprocess()'", ",", "self", ".", "node", ")", ")", "targets", "=", "set", "...
Post-processes a task after it's been executed. This examines all the targets just built (or not, we don't care if the build was successful, or even if there was no build because everything was up-to-date) to see if they have any waiting parent Nodes, or Nodes waiting on a common side e...
[ "Post", "-", "processes", "a", "task", "after", "it", "s", "been", "executed", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py#L438-L493
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py
Task.exception_set
def exception_set(self, exception=None): """ Records an exception to be raised at the appropriate time. This also changes the "exception_raise" attribute to point to the method that will, in fact """ if not exception: exception = sys.exc_info() self.e...
python
def exception_set(self, exception=None): """ Records an exception to be raised at the appropriate time. This also changes the "exception_raise" attribute to point to the method that will, in fact """ if not exception: exception = sys.exc_info() self.e...
[ "def", "exception_set", "(", "self", ",", "exception", "=", "None", ")", ":", "if", "not", "exception", ":", "exception", "=", "sys", ".", "exc_info", "(", ")", "self", ".", "exception", "=", "exception", "self", ".", "exception_raise", "=", "self", ".",...
Records an exception to be raised at the appropriate time. This also changes the "exception_raise" attribute to point to the method that will, in fact
[ "Records", "an", "exception", "to", "be", "raised", "at", "the", "appropriate", "time", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Taskmaster.py#L520-L530
train