def parse_iterator_result(result):
    """Gets features, labels from result."""
    if isinstance(result, (list, tuple)):
        if len(result) != 2:
            raise ValueError(
                'input_fn should return (features, labels) as a len 2 tuple.')
        return result[0], result[1]
    return result, None
