def inspect_object(obj, refresh=True):
    """
    inspect provided object (container, image) and return raw dict with the metadata

    :param obj: instance of Container or an Image
    :param refresh: bool, refresh the metadata or return cached?
    :return: dict
    """
    if hasattr(obj, 'inspect'):
        return obj.inspect(refresh=refresh)
    return obj.get_metadata(refresh=refresh)
