def pymodule_info(module_name, pymodule):
    fields = INSIGHTS.get(module_name)
    fields = (fields.split() if fields else ['__version__', 'version', 'VERSION'])
    for f in fields:
        v = pymodule_version_info(f, getattr(pymodule, f, None), pymodule)
        if v:
            return v
    if hasattr(pymodule, '__file__'):
        return dict(path=pymodule.__file__)
    if hasattr(pymodule, '__spec__'):
        v = getattr(pymodule.__spec__, 'origin')
        if (v == 'built-in'):
            return dict(version=v)
    return dict(note=str(dir(pymodule)))
def pymodule_info(module_name, pymodule):
    fields = INSIGHTS.get(module_name)
    fields = (fields.split() if fields else ['__version__', 'version', 'VERSION'])
    for f in fields:
        v = pymodule_version_info(f, getattr(pymodule, f, None), pymodule)
        if v:
            return v
    if hasattr(pymodule, '__file__'):
        return dict(path=pymodule.__file__)
    if hasattr(pymodule, '__spec__'):
        v = getattr(pymodule.__spec__, 'origin')
        if (v == 'built-in'):
            return dict(version=v)
    return dict(note=str(dir(pymodule)))