import logging


def base_func(aggregate_function):
    """Deals with the possibility of functools.partial being applied to a given
    function. Allows access to the decorated 'return' attribute whether or not
    it is also a partial function

    Args:
        aggregate_function (callable) Either a raw function or a functools.partial object

    Returns: callable
    """
    logging.info('Checking base func for %s', aggregate_function)
    if hasattr(aggregate_function, 'func'):
        return aggregate_function.func
    else:
        return aggregate_function