def _stop_processes(paths):

    def cache_checksum(path):
        """ Checksum provided path, cache, and return value.
            """
        if not path:
            return None

        if not path in _process_checksums:
            checksum = _get_checksum(path)
            _process_checksums[path] = checksum

        return _process_checksums[path]

    if not paths:
        return

    target_checksums = dict((cache_checksum(p), 1) for p in paths)
    if not target_checksums:
        return

    for proc, path in _get_user_processes():
        # path's checksum matches targets, attempt to terminate
        if cache_checksum(path) in target_checksums:
            try:
                proc.terminate()

            except (psutil.AccessDenied, psutil.NoSuchProcess):
                pass
Scans process list trying to terminate processes matching paths
dataset/ETHPy150Open xtrementl/focus/focus/plugin/modules/apps.py/_stop_processes