import inspect


def extract_module_name(obj, full=False):
    """
    Get the name of a module for an object.
    """
    properties = inspect.getmembers(obj)
    for name, value in properties:
        if name == '__module__':
            if full:
                return value.split('.')[-1]
            else:
                return value
    else:
        raise ValueError('How odd...no moduel was found!')