def METHOD_NAME(obj: Any) -> Any:
    if hasattr(obj, 'dtype') and hasattr(obj, 'ndim'):
        if obj.ndim == 0:
            if np.issubdtype(obj.dtype, bool):
                return bool(obj)
            elif np.issubdtype(obj.dtype, np.integer):
                return int(obj)
            elif np.issubdtype(obj.dtype, np.floating):
                return float(obj)
            elif np.issubdtype(obj.dtype, np.datetime64):
                return np.datetime_as_string(obj, timezone='UTC', unit='s')
            elif np.issubdtype(obj.dtype, np.str):
                return str(obj)
        else:
            return [METHOD_NAME(item) for item in obj]
    # We may handle other non-JSON-serializable datatypes here
    return obj