def array_1d(array):
    """
    Check if the given array has only one dimension. Following formats will
    return True:
        (x,), (x,1) and (1,x)
    """
    if not len(array.shape) == 1:
        if len(array.shape) == 2:
            if array.shape[0] == 1 or array.shape[1] == 1:
                return True
            else:
                raise ValueError('only 1D arrays are accepted')
    else:
        return True
    return True
