def _ensure_tuple_or_list(arg_name, tuple_or_list):
    if not isinstance(tuple_or_list, (tuple, list)):
        raise TypeError('Expected %s to be a tuple or list. '
                        'Received %r' % (arg_name, tuple_or_list))
    return list(tuple_or_list)
Ensures an input is a tuple or list.
dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/_helpers.py/_ensure_tuple_or_list