code: def test_many_notifies(self):
      self.autocommit(self.conn)
      for name in ["foo", "bar", "baz"]:
          self.listen(name)
  
      pids = {}
      for name in ["foo", "bar", "baz", "qux"]:
          pids[name] = int(self.notify(name).communicate()[0])
  
      self.assertEqual(0, len(self.conn.notifies))
      for i in range(10):
          self.assertEqual(extensions.POLL_OK, self.conn.poll())
      self.assertEqual(3, len(self.conn.notifies))
  
      names = dict.fromkeys(["foo", "bar", "baz"])
      for pid, name in self.conn.notifies:
          self.assertEqual(pids[name], pid)
          names.pop(name)
  
imports: import unittest
  from collections import deque
  import psycopg2
  from psycopg2 import extensions
  from psycopg2.extensions import Notify
  from .testutils import ConnectingTestCase, skip_if_crdb, slow
  from .testconfig import dsn
  import sys
  import time
  import select
  from subprocess import Popen, PIPE
label_desc: Use image node_id 5 for calling the NotifiesTests obj's underlying member method code with example usage: obj.test_many_notifies() without return types