Converts various size tuples or slices representing data ranges returns a
    new slice with all non-negative (or None) values.

def get_true_slice(dims, data_len):
    '''
    Converts various size tuples or slices representing data ranges returns a
    new slice with all non-negative (or None) values.
    '''
    rangeLen = non_str_len_no_throw(dims)

    # Get the range qualifier for length
    if isinstance(dims, slice):
        start = get_restricted_index(int(dims.start), data_len) if dims.start != None else dims.start
        stop = get_restricted_index(int(dims.stop), data_len) if dims.stop != None else dims.stop
        step = get_restricted_index(int(dims.step), data_len) if dims.step != None else dims.step
    elif rangeLen > 3:
        raise AttributeError(str(dims)+' length is > 3')
    elif rangeLen == 3:
        start = get_restricted_index(int(dims[0]), data_len) if dims[0] != None else dims[0]
        stop = get_restricted_index(int(dims[1]), data_len) if dims[1] != None else dims[1]
        step = get_restricted_index(int(dims[2]), data_len) if dims[2] != None else dims[2]
    elif rangeLen == 2:
        start = get_restricted_index(int(dims[0]), data_len) if dims[0] != None else dims[0]
        stop = get_restricted_index(int(dims[1]), data_len) if dims[1] != None else dims[1]
        step = None
    elif rangeLen == 1:
        start = get_restricted_index(int(dims[0]), data_len) if dims[0] != None else dims[0]
        stop = get_restricted_index(int(dims[0]), data_len)+1 if dims[0] != None else dims[0]
        step = None
    elif dims != None:
        start = get_restricted_index(int(dims), data_len) if dims != None else dims
        stop = get_restricted_index(int(dims), data_len)+1 if dims != None else dims
        step = None
    else:
        start = None
        stop = None
        step = None

    return slice(start, stop, step)