import click


def is_group(obj):
    """ Examine the object to determine if it is wrapping a click.Group

    :param obj: the object in question
    :returns: if the object is a click.Group in some fashion
    """
    # Using self of the bound method so this is safe across weirdly decorated groups.
    return hasattr(obj, 'command') and isinstance(obj.command.__self__, click.Group)