def METHOD_NAME(obj):
    """default function for packing objects in JSON."""
    if isinstance(obj, datetime):
        obj = _ensure_tzinfo(obj)
        return obj.isoformat().replace('+00:00', 'Z')
    if isinstance(obj, bytes):
        return b2a_base64(obj, newline=False).decode('ascii')
    if isinstance(obj, Iterable):
        return list(obj)
    if isinstance(obj, numbers.Integral):
        return int(obj)
    if isinstance(obj, numbers.Real):
        return float(obj)
    raise TypeError("%r is not JSON serializable" % obj)