def is_policy(obj, check_updateable=False):
    """

    Check whether an object is an :term:`(updateable) policy <updateable
    policy>`.

    Parameters
    ----------
    obj

        Object to check.

    check_updateable : bool, optional

        If the obj is a policy, also check whether or not the policy is
        updateable.

    Returns
    -------
    bool

        Whether ``obj`` is a (updateable) policy.

    """
    from ..policies.base import BasePolicy
    from ..core.base import BaseUpdateablePolicy
    if check_updateable:
        return isinstance(obj, BaseUpdateablePolicy)
    return isinstance(obj, BasePolicy)
