def check_bounds(bounds, virtual_dset):

    if type(bounds) != tuple and type(bounds) != slice:
        raise BadRequest('The provided parameter, bounds, is not a tuple as expected.')
    if type(bounds) == tuple and len(bounds) > len(virtual_dset.shape):
        raise BadRequest('The provided parameter, bounds, is trying to restrict more dimensions '
                         'than the how many are actually present in the data.')
Return the cursor associated with an object in an array.
dataset/ETHPy150Open ooici/pyon/prototype/hdf/hdf_array_iterator.py/check_bounds--crossover with--dataset/ETHPy150Open graphql-python/graphql-relay-py/graphql_relay/connection/arrayconnection.py/cursor_for_object_in_connection