def __get_matches(processes: List[Process], filters: ProcessParams, process_type: ProcessType) -> List[Process]:
        """
        Returns the processes that match a ProcessParams class
        """
        pid_to_process = {p.pid: p for p in processes}

        if filters.pid is None:
            return [
                p
                for p in pid_to_process.values()
                if process_type.value in p.exe and filters.process_substring in " ".join(p.cmdline)
            ]

        if filters.pid not in pid_to_process:
            return []

        return [pid_to_process[filters.pid]]

        Returns the processes that match a ProcessParams class
        
src/robusta/integrations/kubernetes/process_utils.py