def module_name(item):
    """Returns the full module name where the given object is declared.

    Examples::

       >>> module_name(module_name)
       'xotl.tools.names'

       >>> from xotl.tools.symbols import Unset
       >>> module_name(Unset)
       'xotl.tools.symbols'

    """
    from xotl.tools.future.inspect import get_attr_value
    if item is None:
        res = ''
    elif isinstance(item, str):
        res = item
    else:
        res = get_attr_value(item, '__module__', None)
        if res is None:
            res = get_attr_value(type(item), '__module__', '')
    if res.startswith('__') or res in ('builtins', 'exceptions', '<module>'):
        res = ''
    return str(res)
