import logging


def _check_transformer_type(obj, logger):
    """ Check if a given object is :class:`Transformer`

    :param obj: the instance
    :return: True if it is :class:`Transformer` False otherwise
    """
    if not (hasattr(obj, 'fit') and callable(obj.fit)):
        logger('{} seems not be a Transformer'.format(type(obj)), level=logging.WARNING)
        return False
    if not (hasattr(obj, 'transform') and callable(obj.transform)):
        logger('{} seems not be a Transformer'.format(type(obj)), level=logging.WARNING)
        return False
    if not (hasattr(obj, 'fit_transform') and callable(obj.fit_transform)):
        logger('{} seems not be a Transformer'.format(type(obj)), level=logging.WARNING)
        return False
    if not (hasattr(obj, 'inverse_transform') and callable(obj.inverse_transform)):
        logger('{} seems not be a Transformer'.format(type(obj)), level=logging.WARNING)
        return False
    return True