def extract_meta(response=None):
    """Extract meta object from response if possible."""
    if hasattr(response, 'meta') and response.meta:
        return response.meta
    if hasattr(response, 'request') and hasattr(response.request, 'meta'):
        return response.request.meta or {}
    return {}
