def add_node(self, binary_descriptor):
        """Add a node to the sensor_graph using a binary node descriptor.

        Args:
            binary_descriptor (bytes): An encoded binary node descriptor.

        Returns:
            int: A packed error code.
        """

        try:
            node_string = parse_binary_descriptor(binary_descriptor)
        except:
            self._logger.exception("Error parsing binary node descriptor: %s", binary_descriptor)
            return _pack_sgerror(SensorGraphError.INVALID_NODE_STREAM)  # FIXME: Actually provide the correct error codes here

        try:
            self.graph.add_node(node_string)
        except NodeConnectionError:
            return _pack_sgerror(SensorGraphError.STREAM_NOT_IN_USE)
        except ProcessingFunctionError:
            return _pack_sgerror(SensorGraphError.INVALID_PROCESSING_FUNCTION)
        except ResourceUsageError:
            return _pack_sgerror(SensorGraphError.NO_NODE_SPACE_AVAILABLE)

        return Error.NO_ERROR
def add_node ( self , binary_descriptor ) : try : node_string = parse_binary_descriptor ( binary_descriptor ) except : self . _logger . exception ( "Error parsing binary node descriptor: %s" , binary_descriptor ) return _pack_sgerror ( SensorGraphError . INVALID_NODE_STREAM ) try : self . graph . add_node ( node_string ) except NodeConnectionError : return _pack_sgerror ( SensorGraphError . STREAM_NOT_IN_USE ) except ProcessingFunctionError : return _pack_sgerror ( SensorGraphError . INVALID_PROCESSING_FUNCTION ) except ResourceUsageError : return _pack_sgerror ( SensorGraphError . NO_NODE_SPACE_AVAILABLE ) return Error . NO_ERROR
Add a node to the sensor_graph using a binary node descriptor.

        Args:
            binary_descriptor (bytes): An encoded binary node descriptor.

        Returns:
            int: A packed error code.