Ensure the provided edge direction is either "in" or "out".

def validate_edge_direction(edge_direction):
    """Ensure the provided edge direction is either "in" or "out"."""
    if not isinstance(edge_direction, six.string_types):
        raise TypeError(u'Expected string edge_direction, got: {} {}'.format(
                        type(edge_direction), edge_direction))

    if edge_direction not in ALLOWED_EDGE_DIRECTIONS:
        raise ValueError(u'Unrecognized edge direction: {}'.format(edge_direction))