(self, user, pids)
return filtered_pids
Filter pids by it's username.
        :param user: string with name of system user
        :param pids: set of pids to filter
        :return: set of filtered pids
Filter pids by it's username.
        :param user: string with name of system user
        :param pids: set of pids to filter
        :return: set of filtered pids
Filter pids by it s username . : param user : string with name of system user : param pids : set of pids to filter : return : set of filtered pids
def _filter_by_user(self, user, pids):
        """
        Filter pids by it's username.
        :param user: string with name of system user
        :param pids: set of pids to filter
        :return: set of filtered pids
        """
        filtered_pids = set()
        for pid in pids:
            try:
                proc = psutil.Process(pid)
                if proc.username() == user:
                    self.log.debug("Collecting pid %s belonging to %s", pid, user)
                    filtered_pids.add(pid)
                else:
                    self.log.debug("Discarding pid %s not belonging to %s", pid, user)
            except psutil.NoSuchProcess:
                self.log.debug("Unable to filter pids by username, process %s does not exist", pid)
                pass

        return filtered_pids
def _filter_by_user ( self , user , pids ) : filtered_pids = set ( ) for pid in pids : try : proc = psutil . Process ( pid ) if proc . username ( ) == user : self . log . debug ( "Collecting pid %s belonging to %s" , pid , user ) filtered_pids . add ( pid ) else : self . log . debug ( "Discarding pid %s not belonging to %s" , pid , user ) except psutil . NoSuchProcess : self . log . debug ( "Unable to filter pids by username, process %s does not exist" , pid ) pass return filtered_pids