def METHOD_NAME(modname):
    """
    Get version information of a Python module.
    """
    try:
        if modname in sys.modules:
            module = sys.modules[modname]
        else:
            module = importlib.import_module(modname)
        try:
            return module.__version__
        except AttributeError:
            return module.version
    except ImportError:
        return None