

def check_process_name(name, p):
    if (p.name == name):
        return True
    if ((len(p.cmdline) > 0) and (os.path.basename(p.cmdline[0]) == name)):
        return True
    if ((len(p.cmdline) > 1) and (os.path.basename(p.cmdline[1]) == name)):
        return True
    return False

dataset/ETHPy150Open openstack/monitoring-for-openstack/oschecks/utils.py check_process_name/original