Converts the specified value to a list if it is a :class:`numpy.ndarray`;
    otherwise it is just returned as is.

def _array_convert(a):
    """Converts the specified value to a list if it is a :class:`numpy.ndarray`;
    otherwise it is just returned as is.
    """
    from numpy import ndarray
    if isinstance(a, ndarray):
        larr = a.tolist()
        if len(larr) == 1:
            return larr[0]
        else:
            return larr
    else:
        return a