def _get_node(nodes, node_id, fuzzy=True):
    """
    Returns a dispatcher node that match the given node id.

    :param nodes:
        Dispatcher nodes.
    :type nodes: dict

    :param node_id:
        Node id.
    :type node_id: str

    :return:
         The dispatcher node and its id.
    :rtype: (str, dict)
    """

    try:
        return node_id, nodes[node_id]  # Return dispatcher node and its id.
    except KeyError as ex:
        if fuzzy:
            it = sorted(nodes.items())
            n = next(((k, v) for k, v in it if node_id in k), EMPTY)
            if n is not EMPTY:
                return n
        raise ex
def _get_node ( nodes , node_id , fuzzy = True ) : try : return node_id , nodes [ node_id ] except KeyError as ex : if fuzzy : it = sorted ( nodes . items ( ) ) n = next ( ( ( k , v ) for k , v in it if node_id in k ) , EMPTY ) if n is not EMPTY : return n raise ex
Returns a dispatcher node that match the given node id.

    :param nodes:
        Dispatcher nodes.
    :type nodes: dict

    :param node_id:
        Node id.
    :type node_id: str

    :return:
         The dispatcher node and its id.
    :rtype: (str, dict)