def get_span_offsets(docgraph, node_id):
    """
    returns the character start and end position of the span of text that
    the given node spans or dominates.

    Returns
    -------
    offsets : tuple(int, int)
        character onset and offset of the span
    """
    try:
        span = get_span(docgraph, node_id)
        # workaround for issue #138
        # TODO: when #138 is fixed, just take the first onset / last offset
        onsets, offsets = zip(*[docgraph.get_offsets(tok_node)
                                for tok_node in span])
        return (min(onsets), max(offsets))
    except KeyError as _:
        raise KeyError("Node '{}' doesn't span any tokens.".format(node_id))