def checkforkernelmodule(name):
    with open('/proc/modules', 'r') as f:
        for line in f:
            if line.startswith(name + ' '):
                return line.rstrip()
    return None
Return a string if a Linux kernel module is loaded, None otherwise.
dataset/ETHPy150Open coreemu/core/daemon/core/misc/utils.py/checkforkernelmodule