def parse_node_descriptor(desc, model):
    """Parse a string node descriptor.

    The function creates an SGNode object without connecting its inputs and outputs
    and returns a 3-tuple:

    SGNode, [(input X, trigger X)], <processing function name>

    Args:
        desc (str): A description of the node to be created.
        model (str): A device model for the node to be created that sets any
            device specific limits on how the node is set up.
    """

    try:
        data = graph_node.parseString(desc)
    except ParseException:
        raise  # TODO: Fix this to properly encapsulate the parse error

    stream_desc = u' '.join(data['node'])

    stream = DataStream.FromString(stream_desc)
    node = SGNode(stream, model)

    inputs = []

    if 'input_a' in data:
        input_a = data['input_a']
        stream_a = DataStreamSelector.FromString(u' '.join(input_a['input_stream']))

        trigger_a = None
        if 'type' in input_a:
            trigger_a = InputTrigger(input_a['type'], input_a['op'], int(input_a['reference'], 0))

        inputs.append((stream_a, trigger_a))

    if 'input_b' in data:
        input_a = data['input_b']
        stream_a = DataStreamSelector.FromString(u' '.join(input_a['input_stream']))

        trigger_a = None
        if 'type' in input_a:
            trigger_a = InputTrigger(input_a['type'], input_a['op'], int(input_a['reference'], 0))

        inputs.append((stream_a, trigger_a))

    if 'combiner' in data and str(data['combiner']) == u'||':
        node.trigger_combiner = SGNode.OrTriggerCombiner
    else:
        node.trigger_combiner = SGNode.AndTriggerCombiner

    processing = data['processor']
    return node, inputs, processing
Parse a string node descriptor.

    The function creates an SGNode object without connecting its inputs and outputs
    and returns a 3-tuple:

    SGNode, [(input X, trigger X)], <processing function name>

    Args:
        desc (str): A description of the node to be created.
        model (str): A device model for the node to be created that sets any
            device specific limits on how the node is set up.