def _clean_pid(self, pid):
        """if pid is a number, don't do anything. If pid is a list with one
        entry, strip the list and return the number. If pid contains more than
        one entries, do nothing.
        """
        if isinstance(pid, (list, tuple)):
            if len(pid) == 1:
                return pid[0]
            else:
                return pid
        return pid
if pid is a number, don't do anything. If pid is a list with one
        entry, strip the list and return the number. If pid contains more than
        one entries, do nothing.