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
transport_plugins/jlink/iotile_transport_jlink/jlink.py
JLinkAdapter.probe_async
def probe_async(self, callback): """Send advertisements for all connected devices. Args: callback (callable): A callback for when the probe operation has completed. callback should have signature callback(adapter_id, success, failure_reason) where: succes...
python
def probe_async(self, callback): """Send advertisements for all connected devices. Args: callback (callable): A callback for when the probe operation has completed. callback should have signature callback(adapter_id, success, failure_reason) where: succes...
[ "def", "probe_async", "(", "self", ",", "callback", ")", ":", "def", "_on_finished", "(", "_name", ",", "control_info", ",", "exception", ")", ":", "if", "exception", "is", "not", "None", ":", "callback", "(", "self", ".", "id", ",", "False", ",", "str...
Send advertisements for all connected devices. Args: callback (callable): A callback for when the probe operation has completed. callback should have signature callback(adapter_id, success, failure_reason) where: success: bool failure_reason: ...
[ "Send", "advertisements", "for", "all", "connected", "devices", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/jlink/iotile_transport_jlink/jlink.py#L179-L207
train
iotile/coretools
transport_plugins/jlink/iotile_transport_jlink/jlink.py
JLinkAdapter._open_debug_interface
def _open_debug_interface(self, conn_id, callback, connection_string=None): """Enable debug interface for this IOTile device Args: conn_id (int): the unique identifier for the connection callback (callback): Callback to be called when this command finishes callba...
python
def _open_debug_interface(self, conn_id, callback, connection_string=None): """Enable debug interface for this IOTile device Args: conn_id (int): the unique identifier for the connection callback (callback): Callback to be called when this command finishes callba...
[ "def", "_open_debug_interface", "(", "self", ",", "conn_id", ",", "callback", ",", "connection_string", "=", "None", ")", ":", "self", ".", "_try_connect", "(", "connection_string", ")", "callback", "(", "conn_id", ",", "self", ".", "id", ",", "True", ",", ...
Enable debug interface for this IOTile device Args: conn_id (int): the unique identifier for the connection callback (callback): Callback to be called when this command finishes callback(conn_id, adapter_id, success, failure_reason)
[ "Enable", "debug", "interface", "for", "this", "IOTile", "device" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/jlink/iotile_transport_jlink/jlink.py#L305-L314
train
iotile/coretools
iotileemulate/iotile/emulate/virtual/peripheral_tile.py
EmulatedPeripheralTile._reset_vector
async def _reset_vector(self): """Main background task for the tile executive. The tile executive is in charge registering the tile with the controller and then handing control over to the tile's application firmware after proper configuration values have been received. """ ...
python
async def _reset_vector(self): """Main background task for the tile executive. The tile executive is in charge registering the tile with the controller and then handing control over to the tile's application firmware after proper configuration values have been received. """ ...
[ "async", "def", "_reset_vector", "(", "self", ")", ":", "self", ".", "_logger", ".", "info", "(", "\"Tile %s at address %d is starting from reset\"", ",", "self", ".", "name", ",", "self", ".", "address", ")", "try", ":", "address", ",", "run_level", ",", "d...
Main background task for the tile executive. The tile executive is in charge registering the tile with the controller and then handing control over to the tile's application firmware after proper configuration values have been received.
[ "Main", "background", "task", "for", "the", "tile", "executive", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/virtual/peripheral_tile.py#L55-L87
train
iotile/coretools
iotileemulate/iotile/emulate/virtual/peripheral_tile.py
EmulatedPeripheralTile._handle_reset
def _handle_reset(self): """Reset this tile. This process needs to trigger the peripheral tile to reregister itself with the controller and get new configuration variables. It also needs to clear app_running. """ self._registered.clear() self._start_received.cl...
python
def _handle_reset(self): """Reset this tile. This process needs to trigger the peripheral tile to reregister itself with the controller and get new configuration variables. It also needs to clear app_running. """ self._registered.clear() self._start_received.cl...
[ "def", "_handle_reset", "(", "self", ")", ":", "self", ".", "_registered", ".", "clear", "(", ")", "self", ".", "_start_received", ".", "clear", "(", ")", "self", ".", "_hosted_app_running", ".", "clear", "(", ")", "super", "(", "EmulatedPeripheralTile", "...
Reset this tile. This process needs to trigger the peripheral tile to reregister itself with the controller and get new configuration variables. It also needs to clear app_running.
[ "Reset", "this", "tile", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/virtual/peripheral_tile.py#L95-L107
train
iotile/coretools
iotilegateway/iotilegateway/gateway.py
IOTileGateway.start
async def start(self): """Start the gateway.""" self._logger.info("Starting all device adapters") await self.device_manager.start() self._logger.info("Starting all servers") for server in self.servers: await server.start()
python
async def start(self): """Start the gateway.""" self._logger.info("Starting all device adapters") await self.device_manager.start() self._logger.info("Starting all servers") for server in self.servers: await server.start()
[ "async", "def", "start", "(", "self", ")", ":", "self", ".", "_logger", ".", "info", "(", "\"Starting all device adapters\"", ")", "await", "self", ".", "device_manager", ".", "start", "(", ")", "self", ".", "_logger", ".", "info", "(", "\"Starting all serve...
Start the gateway.
[ "Start", "the", "gateway", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilegateway/iotilegateway/gateway.py#L49-L57
train
iotile/coretools
iotilegateway/iotilegateway/gateway.py
IOTileGateway.stop
async def stop(self): """Stop the gateway manager and synchronously wait for it to stop.""" self._logger.info("Stopping all servers") for server in self.servers: await server.stop() self._logger.info("Stopping all device adapters") await self.device_manager.stop()
python
async def stop(self): """Stop the gateway manager and synchronously wait for it to stop.""" self._logger.info("Stopping all servers") for server in self.servers: await server.stop() self._logger.info("Stopping all device adapters") await self.device_manager.stop()
[ "async", "def", "stop", "(", "self", ")", ":", "self", ".", "_logger", ".", "info", "(", "\"Stopping all servers\"", ")", "for", "server", "in", "self", ".", "servers", ":", "await", "server", ".", "stop", "(", ")", "self", ".", "_logger", ".", "info",...
Stop the gateway manager and synchronously wait for it to stop.
[ "Stop", "the", "gateway", "manager", "and", "synchronously", "wait", "for", "it", "to", "stop", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilegateway/iotilegateway/gateway.py#L59-L67
train
iotile/coretools
iotileship/iotile/ship/scripts/iotile_ship.py
main
def main(argv=None): """Main entry point for iotile-ship recipe runner. This is the iotile-ship command line program. Args: argv (list of str): An optional set of command line parameters. If not passed, these are taken from sys.argv. """ if argv is None: a...
python
def main(argv=None): """Main entry point for iotile-ship recipe runner. This is the iotile-ship command line program. Args: argv (list of str): An optional set of command line parameters. If not passed, these are taken from sys.argv. """ if argv is None: a...
[ "def", "main", "(", "argv", "=", "None", ")", ":", "if", "argv", "is", "None", ":", "argv", "=", "sys", ".", "argv", "[", "1", ":", "]", "parser", "=", "build_args", "(", ")", "args", "=", "parser", ".", "parse_args", "(", "args", "=", "argv", ...
Main entry point for iotile-ship recipe runner. This is the iotile-ship command line program. Args: argv (list of str): An optional set of command line parameters. If not passed, these are taken from sys.argv.
[ "Main", "entry", "point", "for", "iotile", "-", "ship", "recipe", "runner", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileship/iotile/ship/scripts/iotile_ship.py#L59-L129
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Subst.py
subst_dict
def subst_dict(target, source): """Create a dictionary for substitution of special construction variables. This translates the following special arguments: target - the target (object or array of objects), used to generate the TARGET and TARGETS construction variables so...
python
def subst_dict(target, source): """Create a dictionary for substitution of special construction variables. This translates the following special arguments: target - the target (object or array of objects), used to generate the TARGET and TARGETS construction variables so...
[ "def", "subst_dict", "(", "target", ",", "source", ")", ":", "dict", "=", "{", "}", "if", "target", ":", "def", "get_tgt_subst_proxy", "(", "thing", ")", ":", "try", ":", "subst_proxy", "=", "thing", ".", "get_subst_proxy", "(", ")", "except", "Attribute...
Create a dictionary for substitution of special construction variables. This translates the following special arguments: target - the target (object or array of objects), used to generate the TARGET and TARGETS construction variables source - the source (object or array of o...
[ "Create", "a", "dictionary", "for", "substitution", "of", "special", "construction", "variables", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Subst.py#L266-L329
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Subst.py
CmdStringHolder.escape
def escape(self, escape_func, quote_func=quote_spaces): """Escape the string with the supplied function. The function is expected to take an arbitrary string, then return it with all special characters escaped and ready for passing to the command interpreter. After calling this...
python
def escape(self, escape_func, quote_func=quote_spaces): """Escape the string with the supplied function. The function is expected to take an arbitrary string, then return it with all special characters escaped and ready for passing to the command interpreter. After calling this...
[ "def", "escape", "(", "self", ",", "escape_func", ",", "quote_func", "=", "quote_spaces", ")", ":", "if", "self", ".", "is_literal", "(", ")", ":", "return", "escape_func", "(", "self", ".", "data", ")", "elif", "' '", "in", "self", ".", "data", "or", ...
Escape the string with the supplied function. The function is expected to take an arbitrary string, then return it with all special characters escaped and ready for passing to the command interpreter. After calling this function, the next call to str() will return the escaped s...
[ "Escape", "the", "string", "with", "the", "supplied", "function", ".", "The", "function", "is", "expected", "to", "take", "an", "arbitrary", "string", "then", "return", "it", "with", "all", "special", "characters", "escaped", "and", "ready", "for", "passing", ...
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Subst.py#L142-L157
train
iotile/coretools
iotilecore/iotile/core/utilities/formatting.py
indent_list
def indent_list(inlist, level): """Join a list of strings, one per line with 'level' spaces before each one""" indent = ' '*level joinstr = '\n' + indent retval = joinstr.join(inlist) return indent + retval
python
def indent_list(inlist, level): """Join a list of strings, one per line with 'level' spaces before each one""" indent = ' '*level joinstr = '\n' + indent retval = joinstr.join(inlist) return indent + retval
[ "def", "indent_list", "(", "inlist", ",", "level", ")", ":", "indent", "=", "' '", "*", "level", "joinstr", "=", "'\\n'", "+", "indent", "retval", "=", "joinstr", ".", "join", "(", "inlist", ")", "return", "indent", "+", "retval" ]
Join a list of strings, one per line with 'level' spaces before each one
[ "Join", "a", "list", "of", "strings", "one", "per", "line", "with", "level", "spaces", "before", "each", "one" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/utilities/formatting.py#L20-L27
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/gfortran.py
generate
def generate(env): """Add Builders and construction variables for gfortran to an Environment.""" fortran.generate(env) for dialect in ['F77', 'F90', 'FORTRAN', 'F95', 'F03', 'F08']: env['%s' % dialect] = 'gfortran' env['SH%s' % dialect] = '$%s' % dialect if env['PLATFORM'] in ['...
python
def generate(env): """Add Builders and construction variables for gfortran to an Environment.""" fortran.generate(env) for dialect in ['F77', 'F90', 'FORTRAN', 'F95', 'F03', 'F08']: env['%s' % dialect] = 'gfortran' env['SH%s' % dialect] = '$%s' % dialect if env['PLATFORM'] in ['...
[ "def", "generate", "(", "env", ")", ":", "fortran", ".", "generate", "(", "env", ")", "for", "dialect", "in", "[", "'F77'", ",", "'F90'", ",", "'FORTRAN'", ",", "'F95'", ",", "'F03'", ",", "'F08'", "]", ":", "env", "[", "'%s'", "%", "dialect", "]",...
Add Builders and construction variables for gfortran to an Environment.
[ "Add", "Builders", "and", "construction", "variables", "for", "gfortran", "to", "an", "Environment", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/gfortran.py#L41-L55
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._extract_device_uuid
def _extract_device_uuid(cls, slug): """Turn a string slug into a UUID """ if len(slug) != 22: raise ArgumentError("Invalid device slug", slug=slug) hexdigits = slug[3:] hexdigits = hexdigits.replace('-', '') try: rawbytes = binascii.unhexlify(h...
python
def _extract_device_uuid(cls, slug): """Turn a string slug into a UUID """ if len(slug) != 22: raise ArgumentError("Invalid device slug", slug=slug) hexdigits = slug[3:] hexdigits = hexdigits.replace('-', '') try: rawbytes = binascii.unhexlify(h...
[ "def", "_extract_device_uuid", "(", "cls", ",", "slug", ")", ":", "if", "len", "(", "slug", ")", "!=", "22", ":", "raise", "ArgumentError", "(", "\"Invalid device slug\"", ",", "slug", "=", "slug", ")", "hexdigits", "=", "slug", "[", "3", ":", "]", "he...
Turn a string slug into a UUID
[ "Turn", "a", "string", "slug", "into", "a", "UUID" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L69-L84
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent.start
def start(self): """Start this gateway agent.""" self._prepare() self._disconnector = tornado.ioloop.PeriodicCallback(self._disconnect_hanging_devices, 1000, self._loop) self._disconnector.start()
python
def start(self): """Start this gateway agent.""" self._prepare() self._disconnector = tornado.ioloop.PeriodicCallback(self._disconnect_hanging_devices, 1000, self._loop) self._disconnector.start()
[ "def", "start", "(", "self", ")", ":", "self", ".", "_prepare", "(", ")", "self", ".", "_disconnector", "=", "tornado", ".", "ioloop", ".", "PeriodicCallback", "(", "self", ".", "_disconnect_hanging_devices", ",", "1000", ",", "self", ".", "_loop", ")", ...
Start this gateway agent.
[ "Start", "this", "gateway", "agent", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L86-L92
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent.stop
def stop(self): """Stop this gateway agent.""" if self._disconnector: self._disconnector.stop() self.client.disconnect()
python
def stop(self): """Stop this gateway agent.""" if self._disconnector: self._disconnector.stop() self.client.disconnect()
[ "def", "stop", "(", "self", ")", ":", "if", "self", ".", "_disconnector", ":", "self", ".", "_disconnector", ".", "stop", "(", ")", "self", ".", "client", ".", "disconnect", "(", ")" ]
Stop this gateway agent.
[ "Stop", "this", "gateway", "agent", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L94-L100
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._validate_connection
def _validate_connection(self, action, uuid, key): """Validate that a message received for a device has the right key If this action is valid the corresponding internal connection id to be used with the DeviceManager is returned, otherwise None is returned and an invalid message status ...
python
def _validate_connection(self, action, uuid, key): """Validate that a message received for a device has the right key If this action is valid the corresponding internal connection id to be used with the DeviceManager is returned, otherwise None is returned and an invalid message status ...
[ "def", "_validate_connection", "(", "self", ",", "action", ",", "uuid", ",", "key", ")", ":", "if", "uuid", "not", "in", "self", ".", "_connections", ":", "self", ".", "_logger", ".", "warn", "(", "\"Received message for device with no connection 0x%X\"", ",", ...
Validate that a message received for a device has the right key If this action is valid the corresponding internal connection id to be used with the DeviceManager is returned, otherwise None is returned and an invalid message status is published. Args: slug (string): The sl...
[ "Validate", "that", "a", "message", "received", "for", "a", "device", "has", "the", "right", "key" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L118-L144
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._publish_status
def _publish_status(self, slug, data): """Publish a status message for a device Args: slug (string): The device slug that we are publishing on behalf of data (dict): The status message data to be sent back to the caller """ status_topic = self.topics.prefix + 'd...
python
def _publish_status(self, slug, data): """Publish a status message for a device Args: slug (string): The device slug that we are publishing on behalf of data (dict): The status message data to be sent back to the caller """ status_topic = self.topics.prefix + 'd...
[ "def", "_publish_status", "(", "self", ",", "slug", ",", "data", ")", ":", "status_topic", "=", "self", ".", "topics", ".", "prefix", "+", "'devices/{}/data/status'", ".", "format", "(", "slug", ")", "self", ".", "_logger", ".", "debug", "(", "\"Publishing...
Publish a status message for a device Args: slug (string): The device slug that we are publishing on behalf of data (dict): The status message data to be sent back to the caller
[ "Publish", "a", "status", "message", "for", "a", "device" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L146-L157
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._publish_response
def _publish_response(self, slug, message): """Publish a response message for a device Args: slug (string): The device slug that we are publishing on behalf of message (dict): A set of key value pairs that are used to create the message that is sent. """ ...
python
def _publish_response(self, slug, message): """Publish a response message for a device Args: slug (string): The device slug that we are publishing on behalf of message (dict): A set of key value pairs that are used to create the message that is sent. """ ...
[ "def", "_publish_response", "(", "self", ",", "slug", ",", "message", ")", ":", "resp_topic", "=", "self", ".", "topics", ".", "gateway_topic", "(", "slug", ",", "'data/response'", ")", "self", ".", "_logger", ".", "debug", "(", "\"Publishing response message:...
Publish a response message for a device Args: slug (string): The device slug that we are publishing on behalf of message (dict): A set of key value pairs that are used to create the message that is sent.
[ "Publish", "a", "response", "message", "for", "a", "device" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L159-L170
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._on_action
def _on_action(self, sequence, topic, message): """Process a command action that we received on behalf of a device. Args: sequence (int): The sequence number of the packet received topic (string): The topic this message was received on message (dict): The message its...
python
def _on_action(self, sequence, topic, message): """Process a command action that we received on behalf of a device. Args: sequence (int): The sequence number of the packet received topic (string): The topic this message was received on message (dict): The message its...
[ "def", "_on_action", "(", "self", ",", "sequence", ",", "topic", ",", "message", ")", ":", "try", ":", "slug", "=", "None", "parts", "=", "topic", ".", "split", "(", "'/'", ")", "slug", "=", "parts", "[", "-", "3", "]", "uuid", "=", "self", ".", ...
Process a command action that we received on behalf of a device. Args: sequence (int): The sequence number of the packet received topic (string): The topic this message was received on message (dict): The message itself
[ "Process", "a", "command", "action", "that", "we", "received", "on", "behalf", "of", "a", "device", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L172-L225
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._on_connect
def _on_connect(self, sequence, topic, message): """Process a request to connect to an IOTile device A connection message triggers an attempt to connect to a device, any error checking is done by the DeviceManager that is actually managing the devices. A disconnection message i...
python
def _on_connect(self, sequence, topic, message): """Process a request to connect to an IOTile device A connection message triggers an attempt to connect to a device, any error checking is done by the DeviceManager that is actually managing the devices. A disconnection message i...
[ "def", "_on_connect", "(", "self", ",", "sequence", ",", "topic", ",", "message", ")", ":", "try", ":", "slug", "=", "None", "parts", "=", "topic", ".", "split", "(", "'/'", ")", "slug", "=", "parts", "[", "-", "3", "]", "uuid", "=", "self", ".",...
Process a request to connect to an IOTile device A connection message triggers an attempt to connect to a device, any error checking is done by the DeviceManager that is actually managing the devices. A disconnection message is checked to make sure its key matches what we excep...
[ "Process", "a", "request", "to", "connect", "to", "an", "IOTile", "device" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L227-L259
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._send_rpc
def _send_rpc(self, client, uuid, address, rpc, payload, timeout, key): """Send an RPC to a connected device Args: client (string): The client that sent the rpc request uuid (int): The id of the device we're opening the interface on address (int): The address of the ...
python
def _send_rpc(self, client, uuid, address, rpc, payload, timeout, key): """Send an RPC to a connected device Args: client (string): The client that sent the rpc request uuid (int): The id of the device we're opening the interface on address (int): The address of the ...
[ "def", "_send_rpc", "(", "self", ",", "client", ",", "uuid", ",", "address", ",", "rpc", ",", "payload", ",", "timeout", ",", "key", ")", ":", "conn_id", "=", "self", ".", "_validate_connection", "(", "'send_rpc'", ",", "uuid", ",", "key", ")", "if", ...
Send an RPC to a connected device Args: client (string): The client that sent the rpc request uuid (int): The id of the device we're opening the interface on address (int): The address of the tile that we want to send the RPC to rpc (int): The id of the rpc that ...
[ "Send", "an", "RPC", "to", "a", "connected", "device" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L262-L299
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._send_script
def _send_script(self, client, uuid, chunk, key, chunk_status): """Send a script to the connected device. Args: client (string): The client that sent the rpc request uuid (int): The id of the device we're opening the interface on chunk (bytes): The binary script to s...
python
def _send_script(self, client, uuid, chunk, key, chunk_status): """Send a script to the connected device. Args: client (string): The client that sent the rpc request uuid (int): The id of the device we're opening the interface on chunk (bytes): The binary script to s...
[ "def", "_send_script", "(", "self", ",", "client", ",", "uuid", ",", "chunk", ",", "key", ",", "chunk_status", ")", ":", "conn_id", "=", "self", ".", "_validate_connection", "(", "'send_script'", ",", "uuid", ",", "key", ")", "if", "conn_id", "is", "None...
Send a script to the connected device. Args: client (string): The client that sent the rpc request uuid (int): The id of the device we're opening the interface on chunk (bytes): The binary script to send to the device key (string): The key to authenticate the cal...
[ "Send", "a", "script", "to", "the", "connected", "device", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L302-L351
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._open_interface
def _open_interface(self, client, uuid, iface, key): """Open an interface on a connected device. Args: client (string): The client id who is requesting this operation uuid (int): The id of the device we're opening the interface on iface (string): The name of the inte...
python
def _open_interface(self, client, uuid, iface, key): """Open an interface on a connected device. Args: client (string): The client id who is requesting this operation uuid (int): The id of the device we're opening the interface on iface (string): The name of the inte...
[ "def", "_open_interface", "(", "self", ",", "client", ",", "uuid", ",", "iface", ",", "key", ")", ":", "conn_id", "=", "self", ".", "_validate_connection", "(", "'open_interface'", ",", "uuid", ",", "key", ")", "if", "conn_id", "is", "None", ":", "return...
Open an interface on a connected device. Args: client (string): The client id who is requesting this operation uuid (int): The id of the device we're opening the interface on iface (string): The name of the interface that we're opening key (string): The key to au...
[ "Open", "an", "interface", "on", "a", "connected", "device", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L409-L440
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._disconnect_hanging_devices
def _disconnect_hanging_devices(self): """Periodic callback that checks for devices that haven't been used and disconnects them.""" now = monotonic() for uuid, data in self._connections.items(): if (now - data['last_touch']) > self.client_timeout: self._logger.info("...
python
def _disconnect_hanging_devices(self): """Periodic callback that checks for devices that haven't been used and disconnects them.""" now = monotonic() for uuid, data in self._connections.items(): if (now - data['last_touch']) > self.client_timeout: self._logger.info("...
[ "def", "_disconnect_hanging_devices", "(", "self", ")", ":", "now", "=", "monotonic", "(", ")", "for", "uuid", ",", "data", "in", "self", ".", "_connections", ".", "items", "(", ")", ":", "if", "(", "now", "-", "data", "[", "'last_touch'", "]", ")", ...
Periodic callback that checks for devices that haven't been used and disconnects them.
[ "Periodic", "callback", "that", "checks", "for", "devices", "that", "haven", "t", "been", "used", "and", "disconnects", "them", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L476-L483
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._disconnect_from_device
def _disconnect_from_device(self, uuid, key, client, unsolicited=False): """Disconnect from a device that we have previously connected to. Args: uuid (int): The unique id of the device key (string): A 64 byte string used to secure this connection client (string): The...
python
def _disconnect_from_device(self, uuid, key, client, unsolicited=False): """Disconnect from a device that we have previously connected to. Args: uuid (int): The unique id of the device key (string): A 64 byte string used to secure this connection client (string): The...
[ "def", "_disconnect_from_device", "(", "self", ",", "uuid", ",", "key", ",", "client", ",", "unsolicited", "=", "False", ")", ":", "conn_id", "=", "self", ".", "_validate_connection", "(", "'disconnect'", ",", "uuid", ",", "key", ")", "if", "conn_id", "is"...
Disconnect from a device that we have previously connected to. Args: uuid (int): The unique id of the device key (string): A 64 byte string used to secure this connection client (string): The client id for who is trying to connect to the device. u...
[ "Disconnect", "from", "a", "device", "that", "we", "have", "previously", "connected", "to", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L486-L536
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._notify_report
def _notify_report(self, device_uuid, event_name, report): """Notify that a report has been received from a device. This routine is called synchronously in the event loop by the DeviceManager """ if device_uuid not in self._connections: self._logger.debug("Dropping report f...
python
def _notify_report(self, device_uuid, event_name, report): """Notify that a report has been received from a device. This routine is called synchronously in the event loop by the DeviceManager """ if device_uuid not in self._connections: self._logger.debug("Dropping report f...
[ "def", "_notify_report", "(", "self", ",", "device_uuid", ",", "event_name", ",", "report", ")", ":", "if", "device_uuid", "not", "in", "self", ".", "_connections", ":", "self", ".", "_logger", ".", "debug", "(", "\"Dropping report for device without an active con...
Notify that a report has been received from a device. This routine is called synchronously in the event loop by the DeviceManager
[ "Notify", "that", "a", "report", "has", "been", "received", "from", "a", "device", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L580-L603
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._notify_trace
def _notify_trace(self, device_uuid, event_name, trace): """Notify that we have received tracing data from a device. This routine is called synchronously in the event loop by the DeviceManager """ if device_uuid not in self._connections: self._logger.debug("Dropping trace d...
python
def _notify_trace(self, device_uuid, event_name, trace): """Notify that we have received tracing data from a device. This routine is called synchronously in the event loop by the DeviceManager """ if device_uuid not in self._connections: self._logger.debug("Dropping trace d...
[ "def", "_notify_trace", "(", "self", ",", "device_uuid", ",", "event_name", ",", "trace", ")", ":", "if", "device_uuid", "not", "in", "self", ".", "_connections", ":", "self", ".", "_logger", ".", "debug", "(", "\"Dropping trace data for device without an active c...
Notify that we have received tracing data from a device. This routine is called synchronously in the event loop by the DeviceManager
[ "Notify", "that", "we", "have", "received", "tracing", "data", "from", "a", "device", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L605-L629
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._send_accum_trace
def _send_accum_trace(self, device_uuid): """Send whatever accumulated tracing data we have for the device.""" if device_uuid not in self._connections: self._logger.debug("Dropping trace data for device without an active connection, uuid=0x%X", device_uuid) return conn_...
python
def _send_accum_trace(self, device_uuid): """Send whatever accumulated tracing data we have for the device.""" if device_uuid not in self._connections: self._logger.debug("Dropping trace data for device without an active connection, uuid=0x%X", device_uuid) return conn_...
[ "def", "_send_accum_trace", "(", "self", ",", "device_uuid", ")", ":", "if", "device_uuid", "not", "in", "self", ".", "_connections", ":", "self", ".", "_logger", ".", "debug", "(", "\"Dropping trace data for device without an active connection, uuid=0x%X\"", ",", "de...
Send whatever accumulated tracing data we have for the device.
[ "Send", "whatever", "accumulated", "tracing", "data", "we", "have", "for", "the", "device", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L631-L655
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._on_scan_request
def _on_scan_request(self, sequence, topic, message): """Process a request for scanning information Args: sequence (int:) The sequence number of the packet received topic (string): The topic this message was received on message_type (string): The type of the packet r...
python
def _on_scan_request(self, sequence, topic, message): """Process a request for scanning information Args: sequence (int:) The sequence number of the packet received topic (string): The topic this message was received on message_type (string): The type of the packet r...
[ "def", "_on_scan_request", "(", "self", ",", "sequence", ",", "topic", ",", "message", ")", ":", "if", "messages", ".", "ProbeCommand", ".", "matches", "(", "message", ")", ":", "self", ".", "_logger", ".", "debug", "(", "\"Received probe message on topic %s, ...
Process a request for scanning information Args: sequence (int:) The sequence number of the packet received topic (string): The topic this message was received on message_type (string): The type of the packet received message (dict): The message itself
[ "Process", "a", "request", "for", "scanning", "information" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L657-L671
train
iotile/coretools
transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py
AWSIOTGatewayAgent._publish_scan_response
def _publish_scan_response(self, client): """Publish a scan response message The message contains all of the devices that are currently known to this agent. Connection strings for direct connections are translated to what is appropriate for this agent. Args: client...
python
def _publish_scan_response(self, client): """Publish a scan response message The message contains all of the devices that are currently known to this agent. Connection strings for direct connections are translated to what is appropriate for this agent. Args: client...
[ "def", "_publish_scan_response", "(", "self", ",", "client", ")", ":", "devices", "=", "self", ".", "_manager", ".", "scanned_devices", "converted_devs", "=", "[", "]", "for", "uuid", ",", "info", "in", "devices", ".", "items", "(", ")", ":", "slug", "="...
Publish a scan response message The message contains all of the devices that are currently known to this agent. Connection strings for direct connections are translated to what is appropriate for this agent. Args: client (string): A unique id for the client that made this ...
[ "Publish", "a", "scan", "response", "message" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/awsiot/iotile_transport_awsiot/gateway_agent.py#L673-L714
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/link.py
_versioned_lib_suffix
def _versioned_lib_suffix(env, suffix, version): """For suffix='.so' and version='0.1.2' it returns '.so.0.1.2'""" Verbose = False if Verbose: print("_versioned_lib_suffix: suffix={:r}".format(suffix)) print("_versioned_lib_suffix: version={:r}".format(version)) if not suffix.endswith(ve...
python
def _versioned_lib_suffix(env, suffix, version): """For suffix='.so' and version='0.1.2' it returns '.so.0.1.2'""" Verbose = False if Verbose: print("_versioned_lib_suffix: suffix={:r}".format(suffix)) print("_versioned_lib_suffix: version={:r}".format(version)) if not suffix.endswith(ve...
[ "def", "_versioned_lib_suffix", "(", "env", ",", "suffix", ",", "version", ")", ":", "Verbose", "=", "False", "if", "Verbose", ":", "print", "(", "\"_versioned_lib_suffix: suffix={:r}\"", ".", "format", "(", "suffix", ")", ")", "print", "(", "\"_versioned_lib_su...
For suffix='.so' and version='0.1.2' it returns '.so.0.1.2
[ "For", "suffix", "=", ".", "so", "and", "version", "=", "0", ".", "1", ".", "2", "it", "returns", ".", "so", ".", "0", ".", "1", ".", "2" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/link.py#L148-L158
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/link.py
_setup_versioned_lib_variables
def _setup_versioned_lib_variables(env, **kw): """ Setup all variables required by the versioning machinery """ tool = None try: tool = kw['tool'] except KeyError: pass use_soname = False try: use_soname = kw['use_soname'] except KeyError: pass # The $_SHLIBVERSIONFLAGS define...
python
def _setup_versioned_lib_variables(env, **kw): """ Setup all variables required by the versioning machinery """ tool = None try: tool = kw['tool'] except KeyError: pass use_soname = False try: use_soname = kw['use_soname'] except KeyError: pass # The $_SHLIBVERSIONFLAGS define...
[ "def", "_setup_versioned_lib_variables", "(", "env", ",", "**", "kw", ")", ":", "tool", "=", "None", "try", ":", "tool", "=", "kw", "[", "'tool'", "]", "except", "KeyError", ":", "pass", "use_soname", "=", "False", "try", ":", "use_soname", "=", "kw", ...
Setup all variables required by the versioning machinery
[ "Setup", "all", "variables", "required", "by", "the", "versioning", "machinery" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/link.py#L245-L278
train
iotile/coretools
iotilegateway/iotilegateway/main.py
main
def main(argv=None, loop=SharedLoop, max_time=None): """Main entry point for iotile-gateway.""" should_raise = argv is not None if argv is None: argv = sys.argv[1:] parser = build_parser() cmd_args = parser.parse_args(argv) configure_logging(cmd_args.verbose) logger = logging.getL...
python
def main(argv=None, loop=SharedLoop, max_time=None): """Main entry point for iotile-gateway.""" should_raise = argv is not None if argv is None: argv = sys.argv[1:] parser = build_parser() cmd_args = parser.parse_args(argv) configure_logging(cmd_args.verbose) logger = logging.getL...
[ "def", "main", "(", "argv", "=", "None", ",", "loop", "=", "SharedLoop", ",", "max_time", "=", "None", ")", ":", "should_raise", "=", "argv", "is", "not", "None", "if", "argv", "is", "None", ":", "argv", "=", "sys", ".", "argv", "[", "1", ":", "]...
Main entry point for iotile-gateway.
[ "Main", "entry", "point", "for", "iotile", "-", "gateway", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilegateway/iotilegateway/main.py#L54-L107
train
iotile/coretools
iotilecore/iotile/core/hw/reports/utc_assigner.py
_TimeAnchor.copy
def copy(self): """Return a copy of this _TimeAnchor.""" return _TimeAnchor(self.reading_id, self.uptime, self.utc, self.is_break, self.exact)
python
def copy(self): """Return a copy of this _TimeAnchor.""" return _TimeAnchor(self.reading_id, self.uptime, self.utc, self.is_break, self.exact)
[ "def", "copy", "(", "self", ")", ":", "return", "_TimeAnchor", "(", "self", ".", "reading_id", ",", "self", ".", "uptime", ",", "self", ".", "utc", ",", "self", ".", "is_break", ",", "self", ".", "exact", ")" ]
Return a copy of this _TimeAnchor.
[ "Return", "a", "copy", "of", "this", "_TimeAnchor", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/reports/utc_assigner.py#L43-L45
train
iotile/coretools
iotilecore/iotile/core/hw/reports/utc_assigner.py
UTCAssigner.anchor_stream
def anchor_stream(self, stream_id, converter="rtc"): """Mark a stream as containing anchor points.""" if isinstance(converter, str): converter = self._known_converters.get(converter) if converter is None: raise ArgumentError("Unknown anchor converter string: %s"...
python
def anchor_stream(self, stream_id, converter="rtc"): """Mark a stream as containing anchor points.""" if isinstance(converter, str): converter = self._known_converters.get(converter) if converter is None: raise ArgumentError("Unknown anchor converter string: %s"...
[ "def", "anchor_stream", "(", "self", ",", "stream_id", ",", "converter", "=", "\"rtc\"", ")", ":", "if", "isinstance", "(", "converter", ",", "str", ")", ":", "converter", "=", "self", ".", "_known_converters", ".", "get", "(", "converter", ")", "if", "c...
Mark a stream as containing anchor points.
[ "Mark", "a", "stream", "as", "containing", "anchor", "points", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/reports/utc_assigner.py#L125-L135
train
iotile/coretools
iotilecore/iotile/core/hw/reports/utc_assigner.py
UTCAssigner.id_range
def id_range(self): """Get the range of archor reading_ids. Returns: (int, int): The lowest and highest reading ids. If no reading ids have been loaded, (0, 0) is returned. """ if len(self._anchor_points) == 0: return (0, 0) return (self._a...
python
def id_range(self): """Get the range of archor reading_ids. Returns: (int, int): The lowest and highest reading ids. If no reading ids have been loaded, (0, 0) is returned. """ if len(self._anchor_points) == 0: return (0, 0) return (self._a...
[ "def", "id_range", "(", "self", ")", ":", "if", "len", "(", "self", ".", "_anchor_points", ")", "==", "0", ":", "return", "(", "0", ",", "0", ")", "return", "(", "self", ".", "_anchor_points", "[", "0", "]", ".", "reading_id", ",", "self", ".", "...
Get the range of archor reading_ids. Returns: (int, int): The lowest and highest reading ids. If no reading ids have been loaded, (0, 0) is returned.
[ "Get", "the", "range", "of", "archor", "reading_ids", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/reports/utc_assigner.py#L137-L149
train
iotile/coretools
iotilecore/iotile/core/hw/reports/utc_assigner.py
UTCAssigner._convert_epoch_anchor
def _convert_epoch_anchor(cls, reading): """Convert a reading containing an epoch timestamp to datetime.""" delta = datetime.timedelta(seconds=reading.value) return cls._EpochReference + delta
python
def _convert_epoch_anchor(cls, reading): """Convert a reading containing an epoch timestamp to datetime.""" delta = datetime.timedelta(seconds=reading.value) return cls._EpochReference + delta
[ "def", "_convert_epoch_anchor", "(", "cls", ",", "reading", ")", ":", "delta", "=", "datetime", ".", "timedelta", "(", "seconds", "=", "reading", ".", "value", ")", "return", "cls", ".", "_EpochReference", "+", "delta" ]
Convert a reading containing an epoch timestamp to datetime.
[ "Convert", "a", "reading", "containing", "an", "epoch", "timestamp", "to", "datetime", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/reports/utc_assigner.py#L168-L172
train
iotile/coretools
iotilecore/iotile/core/hw/reports/utc_assigner.py
UTCAssigner.add_point
def add_point(self, reading_id, uptime=None, utc=None, is_break=False): """Add a time point that could be used as a UTC reference.""" if reading_id == 0: return if uptime is None and utc is None: return if uptime is not None and uptime & (1 << 31): ...
python
def add_point(self, reading_id, uptime=None, utc=None, is_break=False): """Add a time point that could be used as a UTC reference.""" if reading_id == 0: return if uptime is None and utc is None: return if uptime is not None and uptime & (1 << 31): ...
[ "def", "add_point", "(", "self", ",", "reading_id", ",", "uptime", "=", "None", ",", "utc", "=", "None", ",", "is_break", "=", "False", ")", ":", "if", "reading_id", "==", "0", ":", "return", "if", "uptime", "is", "None", "and", "utc", "is", "None", ...
Add a time point that could be used as a UTC reference.
[ "Add", "a", "time", "point", "that", "could", "be", "used", "as", "a", "UTC", "reference", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/reports/utc_assigner.py#L174-L198
train
iotile/coretools
iotilecore/iotile/core/hw/reports/utc_assigner.py
UTCAssigner.add_reading
def add_reading(self, reading): """Add an IOTileReading.""" is_break = False utc = None if reading.stream in self._break_streams: is_break = True if reading.stream in self._anchor_streams: utc = self._anchor_streams[reading.stream](reading) sel...
python
def add_reading(self, reading): """Add an IOTileReading.""" is_break = False utc = None if reading.stream in self._break_streams: is_break = True if reading.stream in self._anchor_streams: utc = self._anchor_streams[reading.stream](reading) sel...
[ "def", "add_reading", "(", "self", ",", "reading", ")", ":", "is_break", "=", "False", "utc", "=", "None", "if", "reading", ".", "stream", "in", "self", ".", "_break_streams", ":", "is_break", "=", "True", "if", "reading", ".", "stream", "in", "self", ...
Add an IOTileReading.
[ "Add", "an", "IOTileReading", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/reports/utc_assigner.py#L200-L212
train
iotile/coretools
iotilecore/iotile/core/hw/reports/utc_assigner.py
UTCAssigner.add_report
def add_report(self, report, ignore_errors=False): """Add all anchors from a report.""" if not isinstance(report, SignedListReport): if ignore_errors: return raise ArgumentError("You can only add SignedListReports to a UTCAssigner", report=report) for r...
python
def add_report(self, report, ignore_errors=False): """Add all anchors from a report.""" if not isinstance(report, SignedListReport): if ignore_errors: return raise ArgumentError("You can only add SignedListReports to a UTCAssigner", report=report) for r...
[ "def", "add_report", "(", "self", ",", "report", ",", "ignore_errors", "=", "False", ")", ":", "if", "not", "isinstance", "(", "report", ",", "SignedListReport", ")", ":", "if", "ignore_errors", ":", "return", "raise", "ArgumentError", "(", "\"You can only add...
Add all anchors from a report.
[ "Add", "all", "anchors", "from", "a", "report", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/reports/utc_assigner.py#L214-L226
train
iotile/coretools
iotilecore/iotile/core/hw/reports/utc_assigner.py
UTCAssigner.assign_utc
def assign_utc(self, reading_id, uptime=None, prefer="before"): """Assign a utc datetime to a reading id. This method will return an object with assignment information or None if a utc value cannot be assigned. The assignment object returned contains a utc property that has the asssign...
python
def assign_utc(self, reading_id, uptime=None, prefer="before"): """Assign a utc datetime to a reading id. This method will return an object with assignment information or None if a utc value cannot be assigned. The assignment object returned contains a utc property that has the asssign...
[ "def", "assign_utc", "(", "self", ",", "reading_id", ",", "uptime", "=", "None", ",", "prefer", "=", "\"before\"", ")", ":", "if", "prefer", "not", "in", "(", "\"before\"", ",", "\"after\"", ")", ":", "raise", "ArgumentError", "(", "\"Invalid prefer paramete...
Assign a utc datetime to a reading id. This method will return an object with assignment information or None if a utc value cannot be assigned. The assignment object returned contains a utc property that has the asssigned UTC as well as other properties describing how reliable the assi...
[ "Assign", "a", "utc", "datetime", "to", "a", "reading", "id", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/reports/utc_assigner.py#L228-L286
train
iotile/coretools
iotilecore/iotile/core/hw/reports/utc_assigner.py
UTCAssigner.ensure_prepared
def ensure_prepared(self): """Calculate and cache UTC values for all exactly known anchor points.""" if self._prepared: return exact_count = 0 fixed_count = 0 inexact_count = 0 self._logger.debug("Preparing UTCAssigner (%d total anchors)", len(self._anchor_...
python
def ensure_prepared(self): """Calculate and cache UTC values for all exactly known anchor points.""" if self._prepared: return exact_count = 0 fixed_count = 0 inexact_count = 0 self._logger.debug("Preparing UTCAssigner (%d total anchors)", len(self._anchor_...
[ "def", "ensure_prepared", "(", "self", ")", ":", "if", "self", ".", "_prepared", ":", "return", "exact_count", "=", "0", "fixed_count", "=", "0", "inexact_count", "=", "0", "self", ".", "_logger", ".", "debug", "(", "\"Preparing UTCAssigner (%d total anchors)\""...
Calculate and cache UTC values for all exactly known anchor points.
[ "Calculate", "and", "cache", "UTC", "values", "for", "all", "exactly", "known", "anchor", "points", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/reports/utc_assigner.py#L288-L316
train
iotile/coretools
iotilecore/iotile/core/hw/reports/utc_assigner.py
UTCAssigner.fix_report
def fix_report(self, report, errors="drop", prefer="before"): """Perform utc assignment on all readings in a report. The returned report will have all reading timestamps in UTC. This only works on SignedListReport objects. Note that the report should typically have previously been adde...
python
def fix_report(self, report, errors="drop", prefer="before"): """Perform utc assignment on all readings in a report. The returned report will have all reading timestamps in UTC. This only works on SignedListReport objects. Note that the report should typically have previously been adde...
[ "def", "fix_report", "(", "self", ",", "report", ",", "errors", "=", "\"drop\"", ",", "prefer", "=", "\"before\"", ")", ":", "if", "not", "isinstance", "(", "report", ",", "SignedListReport", ")", ":", "raise", "ArgumentError", "(", "\"Report must be a SignedL...
Perform utc assignment on all readings in a report. The returned report will have all reading timestamps in UTC. This only works on SignedListReport objects. Note that the report should typically have previously been added to the UTC assigner using add_report or no reference points fro...
[ "Perform", "utc", "assignment", "on", "all", "readings", "in", "a", "report", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/reports/utc_assigner.py#L318-L371
train
iotile/coretools
iotilecore/iotile/core/hw/reports/utc_assigner.py
UTCAssigner._fix_left
def _fix_left(self, reading_id, last, start, found_id): """Fix a reading by looking for the nearest anchor point before it.""" accum_delta = 0 exact = True crossed_break = False if start == 0: return None for curr in self._anchor_points.islice(None, start -...
python
def _fix_left(self, reading_id, last, start, found_id): """Fix a reading by looking for the nearest anchor point before it.""" accum_delta = 0 exact = True crossed_break = False if start == 0: return None for curr in self._anchor_points.islice(None, start -...
[ "def", "_fix_left", "(", "self", ",", "reading_id", ",", "last", ",", "start", ",", "found_id", ")", ":", "accum_delta", "=", "0", "exact", "=", "True", "crossed_break", "=", "False", "if", "start", "==", "0", ":", "return", "None", "for", "curr", "in"...
Fix a reading by looking for the nearest anchor point before it.
[ "Fix", "a", "reading", "by", "looking", "for", "the", "nearest", "anchor", "point", "before", "it", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/reports/utc_assigner.py#L427-L452
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
sconsign_dir
def sconsign_dir(node): """Return the .sconsign file info for this directory, creating it first if necessary.""" if not node._sconsign: import SCons.SConsign node._sconsign = SCons.SConsign.ForDirectory(node) return node._sconsign
python
def sconsign_dir(node): """Return the .sconsign file info for this directory, creating it first if necessary.""" if not node._sconsign: import SCons.SConsign node._sconsign = SCons.SConsign.ForDirectory(node) return node._sconsign
[ "def", "sconsign_dir", "(", "node", ")", ":", "if", "not", "node", ".", "_sconsign", ":", "import", "SCons", ".", "SConsign", "node", ".", "_sconsign", "=", "SCons", ".", "SConsign", ".", "ForDirectory", "(", "node", ")", "return", "node", ".", "_sconsig...
Return the .sconsign file info for this directory, creating it first if necessary.
[ "Return", "the", ".", "sconsign", "file", "info", "for", "this", "directory", "creating", "it", "first", "if", "necessary", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L65-L71
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
EntryProxy.__get_base_path
def __get_base_path(self): """Return the file's directory and file name, with the suffix stripped.""" entry = self.get() return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(entry.get_path())[0], entry.name + "_base")
python
def __get_base_path(self): """Return the file's directory and file name, with the suffix stripped.""" entry = self.get() return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(entry.get_path())[0], entry.name + "_base")
[ "def", "__get_base_path", "(", "self", ")", ":", "entry", "=", "self", ".", "get", "(", ")", "return", "SCons", ".", "Subst", ".", "SpecialAttrWrapper", "(", "SCons", ".", "Util", ".", "splitext", "(", "entry", ".", "get_path", "(", ")", ")", "[", "0...
Return the file's directory and file name, with the suffix stripped.
[ "Return", "the", "file", "s", "directory", "and", "file", "name", "with", "the", "suffix", "stripped", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L447-L452
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
EntryProxy.__get_windows_path
def __get_windows_path(self): """Return the path with \ as the path separator, regardless of platform.""" if OS_SEP == '\\': return self else: entry = self.get() r = entry.get_path().replace(OS_SEP, '\\') return SCons.Subst.SpecialAttrWrapp...
python
def __get_windows_path(self): """Return the path with \ as the path separator, regardless of platform.""" if OS_SEP == '\\': return self else: entry = self.get() r = entry.get_path().replace(OS_SEP, '\\') return SCons.Subst.SpecialAttrWrapp...
[ "def", "__get_windows_path", "(", "self", ")", ":", "if", "OS_SEP", "==", "'\\\\'", ":", "return", "self", "else", ":", "entry", "=", "self", ".", "get", "(", ")", "r", "=", "entry", ".", "get_path", "(", ")", ".", "replace", "(", "OS_SEP", ",", "'...
Return the path with \ as the path separator, regardless of platform.
[ "Return", "the", "path", "with", "\\", "as", "the", "path", "separator", "regardless", "of", "platform", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L464-L472
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Base.must_be_same
def must_be_same(self, klass): """ This node, which already existed, is being looked up as the specified klass. Raise an exception if it isn't. """ if isinstance(self, klass) or klass is Entry: return raise TypeError("Tried to lookup %s '%s' as a %s." %\ ...
python
def must_be_same(self, klass): """ This node, which already existed, is being looked up as the specified klass. Raise an exception if it isn't. """ if isinstance(self, klass) or klass is Entry: return raise TypeError("Tried to lookup %s '%s' as a %s." %\ ...
[ "def", "must_be_same", "(", "self", ",", "klass", ")", ":", "if", "isinstance", "(", "self", ",", "klass", ")", "or", "klass", "is", "Entry", ":", "return", "raise", "TypeError", "(", "\"Tried to lookup %s '%s' as a %s.\"", "%", "(", "self", ".", "__class__"...
This node, which already existed, is being looked up as the specified klass. Raise an exception if it isn't.
[ "This", "node", "which", "already", "existed", "is", "being", "looked", "up", "as", "the", "specified", "klass", ".", "Raise", "an", "exception", "if", "it", "isn", "t", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L593-L601
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Base.srcnode
def srcnode(self): """If this node is in a build path, return the node corresponding to its source file. Otherwise, return ourself. """ srcdir_list = self.dir.srcdir_list() if srcdir_list: srcnode = srcdir_list[0].Entry(self.name) srcnode.must_be_...
python
def srcnode(self): """If this node is in a build path, return the node corresponding to its source file. Otherwise, return ourself. """ srcdir_list = self.dir.srcdir_list() if srcdir_list: srcnode = srcdir_list[0].Entry(self.name) srcnode.must_be_...
[ "def", "srcnode", "(", "self", ")", ":", "srcdir_list", "=", "self", ".", "dir", ".", "srcdir_list", "(", ")", "if", "srcdir_list", ":", "srcnode", "=", "srcdir_list", "[", "0", "]", ".", "Entry", "(", "self", ".", "name", ")", "srcnode", ".", "must_...
If this node is in a build path, return the node corresponding to its source file. Otherwise, return ourself.
[ "If", "this", "node", "is", "in", "a", "build", "path", "return", "the", "node", "corresponding", "to", "its", "source", "file", ".", "Otherwise", "return", "ourself", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L733-L743
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Base.get_path
def get_path(self, dir=None): """Return path relative to the current working directory of the Node.FS.Base object that owns us.""" if not dir: dir = self.fs.getcwd() if self == dir: return '.' path_elems = self.get_path_elements() pathname = '' ...
python
def get_path(self, dir=None): """Return path relative to the current working directory of the Node.FS.Base object that owns us.""" if not dir: dir = self.fs.getcwd() if self == dir: return '.' path_elems = self.get_path_elements() pathname = '' ...
[ "def", "get_path", "(", "self", ",", "dir", "=", "None", ")", ":", "if", "not", "dir", ":", "dir", "=", "self", ".", "fs", ".", "getcwd", "(", ")", "if", "self", "==", "dir", ":", "return", "'.'", "path_elems", "=", "self", ".", "get_path_elements"...
Return path relative to the current working directory of the Node.FS.Base object that owns us.
[ "Return", "path", "relative", "to", "the", "current", "working", "directory", "of", "the", "Node", ".", "FS", ".", "Base", "object", "that", "owns", "us", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L745-L761
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Base.set_src_builder
def set_src_builder(self, builder): """Set the source code builder for this node.""" self.sbuilder = builder if not self.has_builder(): self.builder_set(builder)
python
def set_src_builder(self, builder): """Set the source code builder for this node.""" self.sbuilder = builder if not self.has_builder(): self.builder_set(builder)
[ "def", "set_src_builder", "(", "self", ",", "builder", ")", ":", "self", ".", "sbuilder", "=", "builder", "if", "not", "self", ".", "has_builder", "(", ")", ":", "self", ".", "builder_set", "(", "builder", ")" ]
Set the source code builder for this node.
[ "Set", "the", "source", "code", "builder", "for", "this", "node", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L763-L767
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Base.src_builder
def src_builder(self): """Fetch the source code builder for this node. If there isn't one, we cache the source code builder specified for the directory (which in turn will cache the value from its parent directory, and so on up to the file system root). """ try: ...
python
def src_builder(self): """Fetch the source code builder for this node. If there isn't one, we cache the source code builder specified for the directory (which in turn will cache the value from its parent directory, and so on up to the file system root). """ try: ...
[ "def", "src_builder", "(", "self", ")", ":", "try", ":", "scb", "=", "self", ".", "sbuilder", "except", "AttributeError", ":", "scb", "=", "self", ".", "dir", ".", "src_builder", "(", ")", "self", ".", "sbuilder", "=", "scb", "return", "scb" ]
Fetch the source code builder for this node. If there isn't one, we cache the source code builder specified for the directory (which in turn will cache the value from its parent directory, and so on up to the file system root).
[ "Fetch", "the", "source", "code", "builder", "for", "this", "node", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L769-L781
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Base.Rfindalldirs
def Rfindalldirs(self, pathlist): """ Return all of the directories for a given path list, including corresponding "backing" directories in any repositories. The Node lookups are relative to this Node (typically a directory), so memoizing result saves cycles from looking ...
python
def Rfindalldirs(self, pathlist): """ Return all of the directories for a given path list, including corresponding "backing" directories in any repositories. The Node lookups are relative to this Node (typically a directory), so memoizing result saves cycles from looking ...
[ "def", "Rfindalldirs", "(", "self", ",", "pathlist", ")", ":", "try", ":", "memo_dict", "=", "self", ".", "_memo", "[", "'Rfindalldirs'", "]", "except", "KeyError", ":", "memo_dict", "=", "{", "}", "self", ".", "_memo", "[", "'Rfindalldirs'", "]", "=", ...
Return all of the directories for a given path list, including corresponding "backing" directories in any repositories. The Node lookups are relative to this Node (typically a directory), so memoizing result saves cycles from looking up the same path for each target in a given directory...
[ "Return", "all", "of", "the", "directories", "for", "a", "given", "path", "list", "including", "corresponding", "backing", "directories", "in", "any", "repositories", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L836-L867
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Base.RDirs
def RDirs(self, pathlist): """Search for a list of directories in the Repository list.""" cwd = self.cwd or self.fs._cwd return cwd.Rfindalldirs(pathlist)
python
def RDirs(self, pathlist): """Search for a list of directories in the Repository list.""" cwd = self.cwd or self.fs._cwd return cwd.Rfindalldirs(pathlist)
[ "def", "RDirs", "(", "self", ",", "pathlist", ")", ":", "cwd", "=", "self", ".", "cwd", "or", "self", ".", "fs", ".", "_cwd", "return", "cwd", ".", "Rfindalldirs", "(", "pathlist", ")" ]
Search for a list of directories in the Repository list.
[ "Search", "for", "a", "list", "of", "directories", "in", "the", "Repository", "list", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L869-L872
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Entry.rfile
def rfile(self): """We're a generic Entry, but the caller is actually looking for a File at this point, so morph into one.""" self.__class__ = File self._morph() self.clear() return File.rfile(self)
python
def rfile(self): """We're a generic Entry, but the caller is actually looking for a File at this point, so morph into one.""" self.__class__ = File self._morph() self.clear() return File.rfile(self)
[ "def", "rfile", "(", "self", ")", ":", "self", ".", "__class__", "=", "File", "self", ".", "_morph", "(", ")", "self", ".", "clear", "(", ")", "return", "File", ".", "rfile", "(", "self", ")" ]
We're a generic Entry, but the caller is actually looking for a File at this point, so morph into one.
[ "We", "re", "a", "generic", "Entry", "but", "the", "caller", "is", "actually", "looking", "for", "a", "File", "at", "this", "point", "so", "morph", "into", "one", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L973-L979
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Entry.get_text_contents
def get_text_contents(self): """Fetch the decoded text contents of a Unicode encoded Entry. Since this should return the text contents from the file system, we check to see into what sort of subclass we should morph this Entry.""" try: self = self.disambiguate(must_e...
python
def get_text_contents(self): """Fetch the decoded text contents of a Unicode encoded Entry. Since this should return the text contents from the file system, we check to see into what sort of subclass we should morph this Entry.""" try: self = self.disambiguate(must_e...
[ "def", "get_text_contents", "(", "self", ")", ":", "try", ":", "self", "=", "self", ".", "disambiguate", "(", "must_exist", "=", "1", ")", "except", "SCons", ".", "Errors", ".", "UserError", ":", "return", "''", "else", ":", "return", "self", ".", "get...
Fetch the decoded text contents of a Unicode encoded Entry. Since this should return the text contents from the file system, we check to see into what sort of subclass we should morph this Entry.
[ "Fetch", "the", "decoded", "text", "contents", "of", "a", "Unicode", "encoded", "Entry", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L989-L1005
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Entry.must_be_same
def must_be_same(self, klass): """Called to make sure a Node is a Dir. Since we're an Entry, we can morph into one.""" if self.__class__ is not klass: self.__class__ = klass self._morph() self.clear()
python
def must_be_same(self, klass): """Called to make sure a Node is a Dir. Since we're an Entry, we can morph into one.""" if self.__class__ is not klass: self.__class__ = klass self._morph() self.clear()
[ "def", "must_be_same", "(", "self", ",", "klass", ")", ":", "if", "self", ".", "__class__", "is", "not", "klass", ":", "self", ".", "__class__", "=", "klass", "self", ".", "_morph", "(", ")", "self", ".", "clear", "(", ")" ]
Called to make sure a Node is a Dir. Since we're an Entry, we can morph into one.
[ "Called", "to", "make", "sure", "a", "Node", "is", "a", "Dir", ".", "Since", "we", "re", "an", "Entry", "we", "can", "morph", "into", "one", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1007-L1013
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
FS.chdir
def chdir(self, dir, change_os_dir=0): """Change the current working directory for lookups. If change_os_dir is true, we will also change the "real" cwd to match. """ curr=self._cwd try: if dir is not None: self._cwd = dir if ch...
python
def chdir(self, dir, change_os_dir=0): """Change the current working directory for lookups. If change_os_dir is true, we will also change the "real" cwd to match. """ curr=self._cwd try: if dir is not None: self._cwd = dir if ch...
[ "def", "chdir", "(", "self", ",", "dir", ",", "change_os_dir", "=", "0", ")", ":", "curr", "=", "self", ".", "_cwd", "try", ":", "if", "dir", "is", "not", "None", ":", "self", ".", "_cwd", "=", "dir", "if", "change_os_dir", ":", "os", ".", "chdir...
Change the current working directory for lookups. If change_os_dir is true, we will also change the "real" cwd to match.
[ "Change", "the", "current", "working", "directory", "for", "lookups", ".", "If", "change_os_dir", "is", "true", "we", "will", "also", "change", "the", "real", "cwd", "to", "match", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1168-L1181
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
FS.get_root
def get_root(self, drive): """ Returns the root directory for the specified drive, creating it if necessary. """ drive = _my_normcase(drive) try: return self.Root[drive] except KeyError: root = RootDir(drive, self) self.Root[dri...
python
def get_root(self, drive): """ Returns the root directory for the specified drive, creating it if necessary. """ drive = _my_normcase(drive) try: return self.Root[drive] except KeyError: root = RootDir(drive, self) self.Root[dri...
[ "def", "get_root", "(", "self", ",", "drive", ")", ":", "drive", "=", "_my_normcase", "(", "drive", ")", "try", ":", "return", "self", ".", "Root", "[", "drive", "]", "except", "KeyError", ":", "root", "=", "RootDir", "(", "drive", ",", "self", ")", ...
Returns the root directory for the specified drive, creating it if necessary.
[ "Returns", "the", "root", "directory", "for", "the", "specified", "drive", "creating", "it", "if", "necessary", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1183-L1198
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
FS._lookup
def _lookup(self, p, directory, fsclass, create=1): """ The generic entry point for Node lookup with user-supplied data. This translates arbitrary input into a canonical Node.FS object of the specified fsclass. The general approach for strings is to turn it into a fully normali...
python
def _lookup(self, p, directory, fsclass, create=1): """ The generic entry point for Node lookup with user-supplied data. This translates arbitrary input into a canonical Node.FS object of the specified fsclass. The general approach for strings is to turn it into a fully normali...
[ "def", "_lookup", "(", "self", ",", "p", ",", "directory", ",", "fsclass", ",", "create", "=", "1", ")", ":", "if", "isinstance", "(", "p", ",", "Base", ")", ":", "p", ".", "must_be_same", "(", "fsclass", ")", "return", "p", "p", "=", "str", "(",...
The generic entry point for Node lookup with user-supplied data. This translates arbitrary input into a canonical Node.FS object of the specified fsclass. The general approach for strings is to turn it into a fully normalized absolute path and then call the root directory's lookup_abs(...
[ "The", "generic", "entry", "point", "for", "Node", "lookup", "with", "user", "-", "supplied", "data", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1200-L1334
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
FS.VariantDir
def VariantDir(self, variant_dir, src_dir, duplicate=1): """Link the supplied variant directory to the source directory for purposes of building files.""" if not isinstance(src_dir, SCons.Node.Node): src_dir = self.Dir(src_dir) if not isinstance(variant_dir, SCons.Node.Node)...
python
def VariantDir(self, variant_dir, src_dir, duplicate=1): """Link the supplied variant directory to the source directory for purposes of building files.""" if not isinstance(src_dir, SCons.Node.Node): src_dir = self.Dir(src_dir) if not isinstance(variant_dir, SCons.Node.Node)...
[ "def", "VariantDir", "(", "self", ",", "variant_dir", ",", "src_dir", ",", "duplicate", "=", "1", ")", ":", "if", "not", "isinstance", "(", "src_dir", ",", "SCons", ".", "Node", ".", "Node", ")", ":", "src_dir", "=", "self", ".", "Dir", "(", "src_dir...
Link the supplied variant directory to the source directory for purposes of building files.
[ "Link", "the", "supplied", "variant", "directory", "to", "the", "source", "directory", "for", "purposes", "of", "building", "files", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1369-L1383
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
FS.Repository
def Repository(self, *dirs): """Specify Repository directories to search.""" for d in dirs: if not isinstance(d, SCons.Node.Node): d = self.Dir(d) self.Top.addRepository(d)
python
def Repository(self, *dirs): """Specify Repository directories to search.""" for d in dirs: if not isinstance(d, SCons.Node.Node): d = self.Dir(d) self.Top.addRepository(d)
[ "def", "Repository", "(", "self", ",", "*", "dirs", ")", ":", "for", "d", "in", "dirs", ":", "if", "not", "isinstance", "(", "d", ",", "SCons", ".", "Node", ".", "Node", ")", ":", "d", "=", "self", ".", "Dir", "(", "d", ")", "self", ".", "Top...
Specify Repository directories to search.
[ "Specify", "Repository", "directories", "to", "search", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1385-L1390
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
FS.variant_dir_target_climb
def variant_dir_target_climb(self, orig, dir, tail): """Create targets in corresponding variant directories Climb the directory tree, and look up path names relative to any linked variant directories we find. Even though this loops and walks up the tree, we don't memoize the re...
python
def variant_dir_target_climb(self, orig, dir, tail): """Create targets in corresponding variant directories Climb the directory tree, and look up path names relative to any linked variant directories we find. Even though this loops and walks up the tree, we don't memoize the re...
[ "def", "variant_dir_target_climb", "(", "self", ",", "orig", ",", "dir", ",", "tail", ")", ":", "targets", "=", "[", "]", "message", "=", "None", "fmt", "=", "\"building associated VariantDir targets: %s\"", "start_dir", "=", "dir", "while", "dir", ":", "for",...
Create targets in corresponding variant directories Climb the directory tree, and look up path names relative to any linked variant directories we find. Even though this loops and walks up the tree, we don't memoize the return value because this is really only used to process t...
[ "Create", "targets", "in", "corresponding", "variant", "directories" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1421-L1446
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Dir.Dir
def Dir(self, name, create=True): """ Looks up or creates a directory node named 'name' relative to this directory. """ return self.fs.Dir(name, self, create)
python
def Dir(self, name, create=True): """ Looks up or creates a directory node named 'name' relative to this directory. """ return self.fs.Dir(name, self, create)
[ "def", "Dir", "(", "self", ",", "name", ",", "create", "=", "True", ")", ":", "return", "self", ".", "fs", ".", "Dir", "(", "name", ",", "self", ",", "create", ")" ]
Looks up or creates a directory node named 'name' relative to this directory.
[ "Looks", "up", "or", "creates", "a", "directory", "node", "named", "name", "relative", "to", "this", "directory", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1611-L1616
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Dir.link
def link(self, srcdir, duplicate): """Set this directory as the variant directory for the supplied source directory.""" self.srcdir = srcdir self.duplicate = duplicate self.__clearRepositoryCache(duplicate) srcdir.variant_dirs.append(self)
python
def link(self, srcdir, duplicate): """Set this directory as the variant directory for the supplied source directory.""" self.srcdir = srcdir self.duplicate = duplicate self.__clearRepositoryCache(duplicate) srcdir.variant_dirs.append(self)
[ "def", "link", "(", "self", ",", "srcdir", ",", "duplicate", ")", ":", "self", ".", "srcdir", "=", "srcdir", "self", ".", "duplicate", "=", "duplicate", "self", ".", "__clearRepositoryCache", "(", "duplicate", ")", "srcdir", ".", "variant_dirs", ".", "appe...
Set this directory as the variant directory for the supplied source directory.
[ "Set", "this", "directory", "as", "the", "variant", "directory", "for", "the", "supplied", "source", "directory", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1625-L1631
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Dir.getRepositories
def getRepositories(self): """Returns a list of repositories for this directory. """ if self.srcdir and not self.duplicate: return self.srcdir.get_all_rdirs() + self.repositories return self.repositories
python
def getRepositories(self): """Returns a list of repositories for this directory. """ if self.srcdir and not self.duplicate: return self.srcdir.get_all_rdirs() + self.repositories return self.repositories
[ "def", "getRepositories", "(", "self", ")", ":", "if", "self", ".", "srcdir", "and", "not", "self", ".", "duplicate", ":", "return", "self", ".", "srcdir", ".", "get_all_rdirs", "(", ")", "+", "self", ".", "repositories", "return", "self", ".", "reposito...
Returns a list of repositories for this directory.
[ "Returns", "a", "list", "of", "repositories", "for", "this", "directory", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1633-L1638
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Dir.rel_path
def rel_path(self, other): """Return a path to "other" relative to this directory. """ # This complicated and expensive method, which constructs relative # paths between arbitrary Node.FS objects, is no longer used # by SCons itself. It was introduced to store dependency paths ...
python
def rel_path(self, other): """Return a path to "other" relative to this directory. """ # This complicated and expensive method, which constructs relative # paths between arbitrary Node.FS objects, is no longer used # by SCons itself. It was introduced to store dependency paths ...
[ "def", "rel_path", "(", "self", ",", "other", ")", ":", "try", ":", "memo_dict", "=", "self", ".", "_memo", "[", "'rel_path'", "]", "except", "KeyError", ":", "memo_dict", "=", "{", "}", "self", ".", "_memo", "[", "'rel_path'", "]", "=", "memo_dict", ...
Return a path to "other" relative to this directory.
[ "Return", "a", "path", "to", "other", "relative", "to", "this", "directory", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1676-L1728
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Dir.get_found_includes
def get_found_includes(self, env, scanner, path): """Return this directory's implicit dependencies. We don't bother caching the results because the scan typically shouldn't be requested more than once (as opposed to scanning .h file contents, which can be requested as many times as the ...
python
def get_found_includes(self, env, scanner, path): """Return this directory's implicit dependencies. We don't bother caching the results because the scan typically shouldn't be requested more than once (as opposed to scanning .h file contents, which can be requested as many times as the ...
[ "def", "get_found_includes", "(", "self", ",", "env", ",", "scanner", ",", "path", ")", ":", "if", "not", "scanner", ":", "return", "[", "]", "self", ".", "clear", "(", ")", "return", "scanner", "(", "self", ",", "env", ",", "path", ")" ]
Return this directory's implicit dependencies. We don't bother caching the results because the scan typically shouldn't be requested more than once (as opposed to scanning .h file contents, which can be requested as many times as the files is #included by other files).
[ "Return", "this", "directory", "s", "implicit", "dependencies", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1738-L1757
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Dir.build
def build(self, **kw): """A null "builder" for directories.""" global MkdirBuilder if self.builder is not MkdirBuilder: SCons.Node.Node.build(self, **kw)
python
def build(self, **kw): """A null "builder" for directories.""" global MkdirBuilder if self.builder is not MkdirBuilder: SCons.Node.Node.build(self, **kw)
[ "def", "build", "(", "self", ",", "**", "kw", ")", ":", "global", "MkdirBuilder", "if", "self", ".", "builder", "is", "not", "MkdirBuilder", ":", "SCons", ".", "Node", ".", "Node", ".", "build", "(", "self", ",", "**", "kw", ")" ]
A null "builder" for directories.
[ "A", "null", "builder", "for", "directories", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1766-L1770
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Dir._create
def _create(self): """Create this directory, silently and without worrying about whether the builder is the default or not.""" listDirs = [] parent = self while parent: if parent.exists(): break listDirs.append(parent) p = paren...
python
def _create(self): """Create this directory, silently and without worrying about whether the builder is the default or not.""" listDirs = [] parent = self while parent: if parent.exists(): break listDirs.append(parent) p = paren...
[ "def", "_create", "(", "self", ")", ":", "listDirs", "=", "[", "]", "parent", "=", "self", "while", "parent", ":", "if", "parent", ".", "exists", "(", ")", ":", "break", "listDirs", ".", "append", "(", "parent", ")", "p", "=", "parent", ".", "up", ...
Create this directory, silently and without worrying about whether the builder is the default or not.
[ "Create", "this", "directory", "silently", "and", "without", "worrying", "about", "whether", "the", "builder", "is", "the", "default", "or", "not", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1776-L1806
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Dir.is_up_to_date
def is_up_to_date(self): """If any child is not up-to-date, then this directory isn't, either.""" if self.builder is not MkdirBuilder and not self.exists(): return 0 up_to_date = SCons.Node.up_to_date for kid in self.children(): if kid.get_state() > up_to_...
python
def is_up_to_date(self): """If any child is not up-to-date, then this directory isn't, either.""" if self.builder is not MkdirBuilder and not self.exists(): return 0 up_to_date = SCons.Node.up_to_date for kid in self.children(): if kid.get_state() > up_to_...
[ "def", "is_up_to_date", "(", "self", ")", ":", "if", "self", ".", "builder", "is", "not", "MkdirBuilder", "and", "not", "self", ".", "exists", "(", ")", ":", "return", "0", "up_to_date", "=", "SCons", ".", "Node", ".", "up_to_date", "for", "kid", "in",...
If any child is not up-to-date, then this directory isn't, either.
[ "If", "any", "child", "is", "not", "up", "-", "to", "-", "date", "then", "this", "directory", "isn", "t", "either", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1843-L1852
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Dir.get_timestamp
def get_timestamp(self): """Return the latest timestamp from among our children""" stamp = 0 for kid in self.children(): if kid.get_timestamp() > stamp: stamp = kid.get_timestamp() return stamp
python
def get_timestamp(self): """Return the latest timestamp from among our children""" stamp = 0 for kid in self.children(): if kid.get_timestamp() > stamp: stamp = kid.get_timestamp() return stamp
[ "def", "get_timestamp", "(", "self", ")", ":", "stamp", "=", "0", "for", "kid", "in", "self", ".", "children", "(", ")", ":", "if", "kid", ".", "get_timestamp", "(", ")", ">", "stamp", ":", "stamp", "=", "kid", ".", "get_timestamp", "(", ")", "retu...
Return the latest timestamp from among our children
[ "Return", "the", "latest", "timestamp", "from", "among", "our", "children" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L1876-L1882
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Dir.walk
def walk(self, func, arg): """ Walk this directory tree by calling the specified function for each directory in the tree. This behaves like the os.path.walk() function, but for in-memory Node.FS.Dir objects. The function takes the same arguments as the functions passed ...
python
def walk(self, func, arg): """ Walk this directory tree by calling the specified function for each directory in the tree. This behaves like the os.path.walk() function, but for in-memory Node.FS.Dir objects. The function takes the same arguments as the functions passed ...
[ "def", "walk", "(", "self", ",", "func", ",", "arg", ")", ":", "entries", "=", "self", ".", "entries", "names", "=", "list", "(", "entries", ".", "keys", "(", ")", ")", "names", ".", "remove", "(", "'.'", ")", "names", ".", "remove", "(", "'..'",...
Walk this directory tree by calling the specified function for each directory in the tree. This behaves like the os.path.walk() function, but for in-memory Node.FS.Dir objects. The function takes the same arguments as the functions passed to os.path.walk(): func(arg, d...
[ "Walk", "this", "directory", "tree", "by", "calling", "the", "specified", "function", "for", "each", "directory", "in", "the", "tree", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L2074-L2098
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
Dir._glob1
def _glob1(self, pattern, ondisk=True, source=False, strings=False): """ Globs for and returns a list of entry names matching a single pattern in this directory. This searches any repositories and source directories for corresponding entries and returns a Node (or string) relati...
python
def _glob1(self, pattern, ondisk=True, source=False, strings=False): """ Globs for and returns a list of entry names matching a single pattern in this directory. This searches any repositories and source directories for corresponding entries and returns a Node (or string) relati...
[ "def", "_glob1", "(", "self", ",", "pattern", ",", "ondisk", "=", "True", ",", "source", "=", "False", ",", "strings", "=", "False", ")", ":", "search_dir_list", "=", "self", ".", "get_all_rdirs", "(", ")", "for", "srcdir", "in", "self", ".", "srcdir_l...
Globs for and returns a list of entry names matching a single pattern in this directory. This searches any repositories and source directories for corresponding entries and returns a Node (or string) relative to the current directory if an entry is found anywhere. TODO: handle ...
[ "Globs", "for", "and", "returns", "a", "list", "of", "entry", "names", "matching", "a", "single", "pattern", "in", "this", "directory", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L2160-L2225
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
FileBuildInfo.convert_to_sconsign
def convert_to_sconsign(self): """ Converts this FileBuildInfo object for writing to a .sconsign file This replaces each Node in our various dependency lists with its usual string representation: relative to the top-level SConstruct directory, or an absolute path if it's outside...
python
def convert_to_sconsign(self): """ Converts this FileBuildInfo object for writing to a .sconsign file This replaces each Node in our various dependency lists with its usual string representation: relative to the top-level SConstruct directory, or an absolute path if it's outside...
[ "def", "convert_to_sconsign", "(", "self", ")", ":", "if", "os_sep_is_slash", ":", "node_to_str", "=", "str", "else", ":", "def", "node_to_str", "(", "n", ")", ":", "try", ":", "s", "=", "n", ".", "get_internal_path", "(", ")", "except", "AttributeError", ...
Converts this FileBuildInfo object for writing to a .sconsign file This replaces each Node in our various dependency lists with its usual string representation: relative to the top-level SConstruct directory, or an absolute path if it's outside.
[ "Converts", "this", "FileBuildInfo", "object", "for", "writing", "to", "a", ".", "sconsign", "file" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L2469-L2494
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
FileBuildInfo.prepare_dependencies
def prepare_dependencies(self): """ Prepares a FileBuildInfo object for explaining what changed The bsources, bdepends and bimplicit lists have all been stored on disk as paths relative to the top-level SConstruct directory. Convert the strings to actual Nodes (for use by the ...
python
def prepare_dependencies(self): """ Prepares a FileBuildInfo object for explaining what changed The bsources, bdepends and bimplicit lists have all been stored on disk as paths relative to the top-level SConstruct directory. Convert the strings to actual Nodes (for use by the ...
[ "def", "prepare_dependencies", "(", "self", ")", ":", "attrs", "=", "[", "(", "'bsources'", ",", "'bsourcesigs'", ")", ",", "(", "'bdepends'", ",", "'bdependsigs'", ")", ",", "(", "'bimplicit'", ",", "'bimplicitsigs'", ")", ",", "]", "for", "(", "nattr", ...
Prepares a FileBuildInfo object for explaining what changed The bsources, bdepends and bimplicit lists have all been stored on disk as paths relative to the top-level SConstruct directory. Convert the strings to actual Nodes (for use by the --debug=explain code and --implicit-cache).
[ "Prepares", "a", "FileBuildInfo", "object", "for", "explaining", "what", "changed" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L2505-L2532
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.Dir
def Dir(self, name, create=True): """Create a directory node named 'name' relative to the directory of this file.""" return self.dir.Dir(name, create=create)
python
def Dir(self, name, create=True): """Create a directory node named 'name' relative to the directory of this file.""" return self.dir.Dir(name, create=create)
[ "def", "Dir", "(", "self", ",", "name", ",", "create", "=", "True", ")", ":", "return", "self", ".", "dir", ".", "Dir", "(", "name", ",", "create", "=", "create", ")" ]
Create a directory node named 'name' relative to the directory of this file.
[ "Create", "a", "directory", "node", "named", "name", "relative", "to", "the", "directory", "of", "this", "file", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L2585-L2588
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File._morph
def _morph(self): """Turn a file system node into a File object.""" self.scanner_paths = {} if not hasattr(self, '_local'): self._local = 0 if not hasattr(self, 'released_target_info'): self.released_target_info = False self.store_info = 1 self._f...
python
def _morph(self): """Turn a file system node into a File object.""" self.scanner_paths = {} if not hasattr(self, '_local'): self._local = 0 if not hasattr(self, 'released_target_info'): self.released_target_info = False self.store_info = 1 self._f...
[ "def", "_morph", "(", "self", ")", ":", "self", ".", "scanner_paths", "=", "{", "}", "if", "not", "hasattr", "(", "self", ",", "'_local'", ")", ":", "self", ".", "_local", "=", "0", "if", "not", "hasattr", "(", "self", ",", "'released_target_info'", ...
Turn a file system node into a File object.
[ "Turn", "a", "file", "system", "node", "into", "a", "File", "object", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L2600-L2627
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.get_text_contents
def get_text_contents(self): """ This attempts to figure out what the encoding of the text is based upon the BOM bytes, and then decodes the contents so that it's a valid python string. """ contents = self.get_contents() # The behavior of various decode() methods ...
python
def get_text_contents(self): """ This attempts to figure out what the encoding of the text is based upon the BOM bytes, and then decodes the contents so that it's a valid python string. """ contents = self.get_contents() # The behavior of various decode() methods ...
[ "def", "get_text_contents", "(", "self", ")", ":", "contents", "=", "self", ".", "get_contents", "(", ")", "if", "contents", "[", ":", "len", "(", "codecs", ".", "BOM_UTF8", ")", "]", "==", "codecs", ".", "BOM_UTF8", ":", "return", "contents", "[", "le...
This attempts to figure out what the encoding of the text is based upon the BOM bytes, and then decodes the contents so that it's a valid python string.
[ "This", "attempts", "to", "figure", "out", "what", "the", "encoding", "of", "the", "text", "is", "based", "upon", "the", "BOM", "bytes", "and", "then", "decodes", "the", "contents", "so", "that", "it", "s", "a", "valid", "python", "string", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L2635-L2660
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.get_content_hash
def get_content_hash(self): """ Compute and return the MD5 hash for this file. """ if not self.rexists(): return SCons.Util.MD5signature('') fname = self.rfile().get_abspath() try: cs = SCons.Util.MD5filesignature(fname, chunksize=S...
python
def get_content_hash(self): """ Compute and return the MD5 hash for this file. """ if not self.rexists(): return SCons.Util.MD5signature('') fname = self.rfile().get_abspath() try: cs = SCons.Util.MD5filesignature(fname, chunksize=S...
[ "def", "get_content_hash", "(", "self", ")", ":", "if", "not", "self", ".", "rexists", "(", ")", ":", "return", "SCons", ".", "Util", ".", "MD5signature", "(", "''", ")", "fname", "=", "self", ".", "rfile", "(", ")", ".", "get_abspath", "(", ")", "...
Compute and return the MD5 hash for this file.
[ "Compute", "and", "return", "the", "MD5", "hash", "for", "this", "file", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L2663-L2677
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.get_found_includes
def get_found_includes(self, env, scanner, path): """Return the included implicit dependencies in this file. Cache results so we only scan the file once per path regardless of how many times this information is requested. """ memo_key = (id(env), id(scanner), path) try: ...
python
def get_found_includes(self, env, scanner, path): """Return the included implicit dependencies in this file. Cache results so we only scan the file once per path regardless of how many times this information is requested. """ memo_key = (id(env), id(scanner), path) try: ...
[ "def", "get_found_includes", "(", "self", ",", "env", ",", "scanner", ",", "path", ")", ":", "memo_key", "=", "(", "id", "(", "env", ")", ",", "id", "(", "scanner", ")", ",", "path", ")", "try", ":", "memo_dict", "=", "self", ".", "_memo", "[", "...
Return the included implicit dependencies in this file. Cache results so we only scan the file once per path regardless of how many times this information is requested.
[ "Return", "the", "included", "implicit", "dependencies", "in", "this", "file", ".", "Cache", "results", "so", "we", "only", "scan", "the", "file", "once", "per", "path", "regardless", "of", "how", "many", "times", "this", "information", "is", "requested", "....
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L2864-L2888
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.push_to_cache
def push_to_cache(self): """Try to push the node into a cache """ # This should get called before the Nodes' .built() method is # called, which would clear the build signature if the file has # a source scanner. # # We have to clear the local memoized values *befo...
python
def push_to_cache(self): """Try to push the node into a cache """ # This should get called before the Nodes' .built() method is # called, which would clear the build signature if the file has # a source scanner. # # We have to clear the local memoized values *befo...
[ "def", "push_to_cache", "(", "self", ")", ":", "if", "self", ".", "nocache", ":", "return", "self", ".", "clear_memoized_values", "(", ")", "if", "self", ".", "exists", "(", ")", ":", "self", ".", "get_build_env", "(", ")", ".", "get_CacheDir", "(", ")...
Try to push the node into a cache
[ "Try", "to", "push", "the", "node", "into", "a", "cache" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L2895-L2909
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.retrieve_from_cache
def retrieve_from_cache(self): """Try to retrieve the node's content from a cache This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in built(). Returns true if the node was successfully retrieved. ...
python
def retrieve_from_cache(self): """Try to retrieve the node's content from a cache This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in built(). Returns true if the node was successfully retrieved. ...
[ "def", "retrieve_from_cache", "(", "self", ")", ":", "if", "self", ".", "nocache", ":", "return", "None", "if", "not", "self", ".", "is_derived", "(", ")", ":", "return", "None", "return", "self", ".", "get_build_env", "(", ")", ".", "get_CacheDir", "(",...
Try to retrieve the node's content from a cache This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in built(). Returns true if the node was successfully retrieved.
[ "Try", "to", "retrieve", "the", "node", "s", "content", "from", "a", "cache" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L2911-L2924
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.release_target_info
def release_target_info(self): """Called just after this node has been marked up-to-date or was built completely. This is where we try to release as many target node infos as possible for clean builds and update runs, in order to minimize the overall memory consumption. ...
python
def release_target_info(self): """Called just after this node has been marked up-to-date or was built completely. This is where we try to release as many target node infos as possible for clean builds and update runs, in order to minimize the overall memory consumption. ...
[ "def", "release_target_info", "(", "self", ")", ":", "if", "(", "self", ".", "released_target_info", "or", "SCons", ".", "Node", ".", "interactive", ")", ":", "return", "if", "not", "hasattr", "(", "self", ".", "attributes", ",", "'keep_targetinfo'", ")", ...
Called just after this node has been marked up-to-date or was built completely. This is where we try to release as many target node infos as possible for clean builds and update runs, in order to minimize the overall memory consumption. We'd like to remove a lot more attri...
[ "Called", "just", "after", "this", "node", "has", "been", "marked", "up", "-", "to", "-", "date", "or", "was", "built", "completely", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L2949-L2999
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.has_src_builder
def has_src_builder(self): """Return whether this Node has a source builder or not. If this Node doesn't have an explicit source code builder, this is where we figure out, on the fly, if there's a transparent source code builder for it. Note that if we found a source builder, w...
python
def has_src_builder(self): """Return whether this Node has a source builder or not. If this Node doesn't have an explicit source code builder, this is where we figure out, on the fly, if there's a transparent source code builder for it. Note that if we found a source builder, w...
[ "def", "has_src_builder", "(", "self", ")", ":", "try", ":", "scb", "=", "self", ".", "sbuilder", "except", "AttributeError", ":", "scb", "=", "self", ".", "sbuilder", "=", "self", ".", "find_src_builder", "(", ")", "return", "scb", "is", "not", "None" ]
Return whether this Node has a source builder or not. If this Node doesn't have an explicit source code builder, this is where we figure out, on the fly, if there's a transparent source code builder for it. Note that if we found a source builder, we also set the self.builder at...
[ "Return", "whether", "this", "Node", "has", "a", "source", "builder", "or", "not", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L3016-L3031
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.alter_targets
def alter_targets(self): """Return any corresponding targets in a variant directory. """ if self.is_derived(): return [], None return self.fs.variant_dir_target_climb(self, self.dir, [self.name])
python
def alter_targets(self): """Return any corresponding targets in a variant directory. """ if self.is_derived(): return [], None return self.fs.variant_dir_target_climb(self, self.dir, [self.name])
[ "def", "alter_targets", "(", "self", ")", ":", "if", "self", ".", "is_derived", "(", ")", ":", "return", "[", "]", ",", "None", "return", "self", ".", "fs", ".", "variant_dir_target_climb", "(", "self", ",", "self", ".", "dir", ",", "[", "self", ".",...
Return any corresponding targets in a variant directory.
[ "Return", "any", "corresponding", "targets", "in", "a", "variant", "directory", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L3033-L3038
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.prepare
def prepare(self): """Prepare for this file to be created.""" SCons.Node.Node.prepare(self) if self.get_state() != SCons.Node.up_to_date: if self.exists(): if self.is_derived() and not self.precious: self._rmv_existing() else: ...
python
def prepare(self): """Prepare for this file to be created.""" SCons.Node.Node.prepare(self) if self.get_state() != SCons.Node.up_to_date: if self.exists(): if self.is_derived() and not self.precious: self._rmv_existing() else: ...
[ "def", "prepare", "(", "self", ")", ":", "SCons", ".", "Node", ".", "Node", ".", "prepare", "(", "self", ")", "if", "self", ".", "get_state", "(", ")", "!=", "SCons", ".", "Node", ".", "up_to_date", ":", "if", "self", ".", "exists", "(", ")", ":"...
Prepare for this file to be created.
[ "Prepare", "for", "this", "file", "to", "be", "created", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L3056-L3068
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.remove
def remove(self): """Remove this file.""" if self.exists() or self.islink(): self.fs.unlink(self.get_internal_path()) return 1 return None
python
def remove(self): """Remove this file.""" if self.exists() or self.islink(): self.fs.unlink(self.get_internal_path()) return 1 return None
[ "def", "remove", "(", "self", ")", ":", "if", "self", ".", "exists", "(", ")", "or", "self", ".", "islink", "(", ")", ":", "self", ".", "fs", ".", "unlink", "(", "self", ".", "get_internal_path", "(", ")", ")", "return", "1", "return", "None" ]
Remove this file.
[ "Remove", "this", "file", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L3074-L3079
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.get_max_drift_csig
def get_max_drift_csig(self): """ Returns the content signature currently stored for this node if it's been unmodified longer than the max_drift value, or the max_drift value is 0. Returns None otherwise. """ old = self.get_stored_info() mtime = self.get_timestam...
python
def get_max_drift_csig(self): """ Returns the content signature currently stored for this node if it's been unmodified longer than the max_drift value, or the max_drift value is 0. Returns None otherwise. """ old = self.get_stored_info() mtime = self.get_timestam...
[ "def", "get_max_drift_csig", "(", "self", ")", ":", "old", "=", "self", ".", "get_stored_info", "(", ")", "mtime", "=", "self", ".", "get_timestamp", "(", ")", "max_drift", "=", "self", ".", "fs", ".", "max_drift", "if", "max_drift", ">", "0", ":", "if...
Returns the content signature currently stored for this node if it's been unmodified longer than the max_drift value, or the max_drift value is 0. Returns None otherwise.
[ "Returns", "the", "content", "signature", "currently", "stored", "for", "this", "node", "if", "it", "s", "been", "unmodified", "longer", "than", "the", "max_drift", "value", "or", "the", "max_drift", "value", "is", "0", ".", "Returns", "None", "otherwise", "...
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L3110-L3134
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.built
def built(self): """Called just after this File node is successfully built. Just like for 'release_target_info' we try to release some more target node attributes in order to minimize the overall memory consumption. @see: release_target_info """ SCons.Node....
python
def built(self): """Called just after this File node is successfully built. Just like for 'release_target_info' we try to release some more target node attributes in order to minimize the overall memory consumption. @see: release_target_info """ SCons.Node....
[ "def", "built", "(", "self", ")", ":", "SCons", ".", "Node", ".", "Node", ".", "built", "(", "self", ")", "if", "(", "not", "SCons", ".", "Node", ".", "interactive", "and", "not", "hasattr", "(", "self", ".", "attributes", ",", "'keep_targetinfo'", "...
Called just after this File node is successfully built. Just like for 'release_target_info' we try to release some more target node attributes in order to minimize the overall memory consumption. @see: release_target_info
[ "Called", "just", "after", "this", "File", "node", "is", "successfully", "built", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L3181-L3203
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.changed
def changed(self, node=None, allowcache=False): """ Returns if the node is up-to-date with respect to the BuildInfo stored last time it was built. For File nodes this is basically a wrapper around Node.changed(), but we allow the return value to get cached after the reference ...
python
def changed(self, node=None, allowcache=False): """ Returns if the node is up-to-date with respect to the BuildInfo stored last time it was built. For File nodes this is basically a wrapper around Node.changed(), but we allow the return value to get cached after the reference ...
[ "def", "changed", "(", "self", ",", "node", "=", "None", ",", "allowcache", "=", "False", ")", ":", "if", "node", "is", "None", ":", "try", ":", "return", "self", ".", "_memo", "[", "'changed'", "]", "except", "KeyError", ":", "pass", "has_changed", ...
Returns if the node is up-to-date with respect to the BuildInfo stored last time it was built. For File nodes this is basically a wrapper around Node.changed(), but we allow the return value to get cached after the reference to the Executor got released in release_target_info(). ...
[ "Returns", "if", "the", "node", "is", "up", "-", "to", "-", "date", "with", "respect", "to", "the", "BuildInfo", "stored", "last", "time", "it", "was", "built", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L3205-L3225
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.get_cachedir_csig
def get_cachedir_csig(self): """ Fetch a Node's content signature for purposes of computing another Node's cachesig. This is a wrapper around the normal get_csig() method that handles the somewhat obscure case of using CacheDir with the -n option. Any files that don't ex...
python
def get_cachedir_csig(self): """ Fetch a Node's content signature for purposes of computing another Node's cachesig. This is a wrapper around the normal get_csig() method that handles the somewhat obscure case of using CacheDir with the -n option. Any files that don't ex...
[ "def", "get_cachedir_csig", "(", "self", ")", ":", "try", ":", "return", "self", ".", "cachedir_csig", "except", "AttributeError", ":", "pass", "cachedir", ",", "cachefile", "=", "self", ".", "get_build_env", "(", ")", ".", "get_CacheDir", "(", ")", ".", "...
Fetch a Node's content signature for purposes of computing another Node's cachesig. This is a wrapper around the normal get_csig() method that handles the somewhat obscure case of using CacheDir with the -n option. Any files that don't exist would normally be "built" by fetching ...
[ "Fetch", "a", "Node", "s", "content", "signature", "for", "purposes", "of", "computing", "another", "Node", "s", "cachesig", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L3322-L3347
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.get_contents_sig
def get_contents_sig(self): """ A helper method for get_cachedir_bsig. It computes and returns the signature for this node's contents. """ try: return self.contentsig except AttributeError: pass executor = self.get_executor() ...
python
def get_contents_sig(self): """ A helper method for get_cachedir_bsig. It computes and returns the signature for this node's contents. """ try: return self.contentsig except AttributeError: pass executor = self.get_executor() ...
[ "def", "get_contents_sig", "(", "self", ")", ":", "try", ":", "return", "self", ".", "contentsig", "except", "AttributeError", ":", "pass", "executor", "=", "self", ".", "get_executor", "(", ")", "result", "=", "self", ".", "contentsig", "=", "SCons", ".",...
A helper method for get_cachedir_bsig. It computes and returns the signature for this node's contents.
[ "A", "helper", "method", "for", "get_cachedir_bsig", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L3349-L3365
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
File.get_cachedir_bsig
def get_cachedir_bsig(self): """ Return the signature for a cached file, including its children. It adds the path of the cached file to the cache signature, because multiple targets built by the same action will all have the same build signature, and we have to different...
python
def get_cachedir_bsig(self): """ Return the signature for a cached file, including its children. It adds the path of the cached file to the cache signature, because multiple targets built by the same action will all have the same build signature, and we have to different...
[ "def", "get_cachedir_bsig", "(", "self", ")", ":", "try", ":", "return", "self", ".", "cachesig", "except", "AttributeError", ":", "pass", "children", "=", "self", ".", "children", "(", ")", "sigs", "=", "[", "n", ".", "get_cachedir_csig", "(", ")", "for...
Return the signature for a cached file, including its children. It adds the path of the cached file to the cache signature, because multiple targets built by the same action will all have the same build signature, and we have to differentiate them somehow.
[ "Return", "the", "signature", "for", "a", "cached", "file", "including", "its", "children", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L3367-L3391
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py
FileFinder.find_file
def find_file(self, filename, paths, verbose=None): """ Find a node corresponding to either a derived file or a file that exists already. Only the first file found is returned, and none is returned if no file is found. filename: A filename to find paths: A list of directory pat...
python
def find_file(self, filename, paths, verbose=None): """ Find a node corresponding to either a derived file or a file that exists already. Only the first file found is returned, and none is returned if no file is found. filename: A filename to find paths: A list of directory pat...
[ "def", "find_file", "(", "self", ",", "filename", ",", "paths", ",", "verbose", "=", "None", ")", ":", "memo_key", "=", "self", ".", "_find_file_key", "(", "filename", ",", "paths", ")", "try", ":", "memo_dict", "=", "self", ".", "_memo", "[", "'find_f...
Find a node corresponding to either a derived file or a file that exists already. Only the first file found is returned, and none is returned if no file is found. filename: A filename to find paths: A list of directory path *nodes* to search in. Can be represented as a list, a tuple, or a cal...
[ "Find", "a", "node", "corresponding", "to", "either", "a", "derived", "file", "or", "a", "file", "that", "exists", "already", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Node/FS.py#L3447-L3495
train
iotile/coretools
iotileship/iotile/ship/actions/send_ota_script_step.py
SendOTAScriptStep.run
def run(self, resources): """Actually send the trub script. Args: resources (dict): A dictionary containing the required resources that we needed access to in order to perform this step. """ hwman = resources['connection'] updater = hwman.hwman.app(...
python
def run(self, resources): """Actually send the trub script. Args: resources (dict): A dictionary containing the required resources that we needed access to in order to perform this step. """ hwman = resources['connection'] updater = hwman.hwman.app(...
[ "def", "run", "(", "self", ",", "resources", ")", ":", "hwman", "=", "resources", "[", "'connection'", "]", "updater", "=", "hwman", ".", "hwman", ".", "app", "(", "name", "=", "'device_updater'", ")", "updater", ".", "run_script", "(", "self", ".", "_...
Actually send the trub script. Args: resources (dict): A dictionary containing the required resources that we needed access to in order to perform this step.
[ "Actually", "send", "the", "trub", "script", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileship/iotile/ship/actions/send_ota_script_step.py#L38-L49
train
iotile/coretools
transport_plugins/bled112/iotile_transport_bled112/bgapi_structures.py
process_gatt_service
def process_gatt_service(services, event): """Process a BGAPI event containing a GATT service description and add it to a dictionary Args: services (dict): A dictionary of discovered services that is updated with this event event (BGAPIPacket): An event containing a GATT service """ l...
python
def process_gatt_service(services, event): """Process a BGAPI event containing a GATT service description and add it to a dictionary Args: services (dict): A dictionary of discovered services that is updated with this event event (BGAPIPacket): An event containing a GATT service """ l...
[ "def", "process_gatt_service", "(", "services", ",", "event", ")", ":", "length", "=", "len", "(", "event", ".", "payload", ")", "-", "5", "handle", ",", "start", ",", "end", ",", "uuid", "=", "unpack", "(", "'<BHH%ds'", "%", "length", ",", "event", ...
Process a BGAPI event containing a GATT service description and add it to a dictionary Args: services (dict): A dictionary of discovered services that is updated with this event event (BGAPIPacket): An event containing a GATT service
[ "Process", "a", "BGAPI", "event", "containing", "a", "GATT", "service", "description", "and", "add", "it", "to", "a", "dictionary" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/bled112/iotile_transport_bled112/bgapi_structures.py#L27-L41
train
iotile/coretools
transport_plugins/bled112/iotile_transport_bled112/bgapi_structures.py
handle_to_uuid
def handle_to_uuid(handle, services): """Find the corresponding UUID for an attribute handle""" for service in services.values(): for char_uuid, char_def in service['characteristics'].items(): if char_def['handle'] == handle: return char_uuid raise ValueError("Handle no...
python
def handle_to_uuid(handle, services): """Find the corresponding UUID for an attribute handle""" for service in services.values(): for char_uuid, char_def in service['characteristics'].items(): if char_def['handle'] == handle: return char_uuid raise ValueError("Handle no...
[ "def", "handle_to_uuid", "(", "handle", ",", "services", ")", ":", "for", "service", "in", "services", ".", "values", "(", ")", ":", "for", "char_uuid", ",", "char_def", "in", "service", "[", "'characteristics'", "]", ".", "items", "(", ")", ":", "if", ...
Find the corresponding UUID for an attribute handle
[ "Find", "the", "corresponding", "UUID", "for", "an", "attribute", "handle" ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/transport_plugins/bled112/iotile_transport_bled112/bgapi_structures.py#L87-L95
train
iotile/coretools
iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Variables/BoolVariable.py
_validator
def _validator(key, val, env): """ Validates the given value to be either '0' or '1'. This is usable as 'validator' for SCons' Variables. """ if not env[key] in (True, False): raise SCons.Errors.UserError( 'Invalid value for boolean option %s: %s' % (key, env[key]))
python
def _validator(key, val, env): """ Validates the given value to be either '0' or '1'. This is usable as 'validator' for SCons' Variables. """ if not env[key] in (True, False): raise SCons.Errors.UserError( 'Invalid value for boolean option %s: %s' % (key, env[key]))
[ "def", "_validator", "(", "key", ",", "val", ",", "env", ")", ":", "if", "not", "env", "[", "key", "]", "in", "(", "True", ",", "False", ")", ":", "raise", "SCons", ".", "Errors", ".", "UserError", "(", "'Invalid value for boolean option %s: %s'", "%", ...
Validates the given value to be either '0' or '1'. This is usable as 'validator' for SCons' Variables.
[ "Validates", "the", "given", "value", "to", "be", "either", "0", "or", "1", ".", "This", "is", "usable", "as", "validator", "for", "SCons", "Variables", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Variables/BoolVariable.py#L64-L72
train
iotile/coretools
iotilegateway/iotilegateway/supervisor/states.py
ServiceMessage.FromDictionary
def FromDictionary(cls, msg_dict): """Create from a dictionary with kv pairs. Args: msg_dict (dict): A dictionary with information as created by to_dict() Returns: ServiceMessage: the converted message """ level = msg_dict.get('level') msg = msg...
python
def FromDictionary(cls, msg_dict): """Create from a dictionary with kv pairs. Args: msg_dict (dict): A dictionary with information as created by to_dict() Returns: ServiceMessage: the converted message """ level = msg_dict.get('level') msg = msg...
[ "def", "FromDictionary", "(", "cls", ",", "msg_dict", ")", ":", "level", "=", "msg_dict", ".", "get", "(", "'level'", ")", "msg", "=", "msg_dict", ".", "get", "(", "'message'", ")", "now", "=", "msg_dict", ".", "get", "(", "'now_time'", ")", "created",...
Create from a dictionary with kv pairs. Args: msg_dict (dict): A dictionary with information as created by to_dict() Returns: ServiceMessage: the converted message
[ "Create", "from", "a", "dictionary", "with", "kv", "pairs", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilegateway/iotilegateway/supervisor/states.py#L65-L86
train
iotile/coretools
iotilegateway/iotilegateway/supervisor/states.py
ServiceMessage.to_dict
def to_dict(self): """Create a dictionary with the information in this message. Returns: dict: The dictionary with information """ msg_dict = {} msg_dict['level'] = self.level msg_dict['message'] = self.message msg_dict['now_time'] = monotonic() ...
python
def to_dict(self): """Create a dictionary with the information in this message. Returns: dict: The dictionary with information """ msg_dict = {} msg_dict['level'] = self.level msg_dict['message'] = self.message msg_dict['now_time'] = monotonic() ...
[ "def", "to_dict", "(", "self", ")", ":", "msg_dict", "=", "{", "}", "msg_dict", "[", "'level'", "]", "=", "self", ".", "level", "msg_dict", "[", "'message'", "]", "=", "self", ".", "message", "msg_dict", "[", "'now_time'", "]", "=", "monotonic", "(", ...
Create a dictionary with the information in this message. Returns: dict: The dictionary with information
[ "Create", "a", "dictionary", "with", "the", "information", "in", "this", "message", "." ]
2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec
https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilegateway/iotilegateway/supervisor/states.py#L88-L103
train