code: async def psubscribe(self, *args, **kwargs):
          
          if args:
              args = list_or_args(args[0], args[1:])
          new_patterns = {}
          new_patterns.update(dict.fromkeys(map(self.encode, args)))
          for pattern, handler in iteritems(kwargs):
              new_patterns[self.encode(pattern)] = handler
          ret_val = await self.execute_command('PSUBSCRIBE', *iterkeys(new_patterns))
          # update the patterns dict AFTER we send the command. we don't want to
          # subscribe twice to these patterns, once for the command and again
          # for the reconnection.
          self.patterns.update(new_patterns)
          return ret_val
docs: Subscribe to channel patterns. Patterns supplied as keyword arguments
          expect a pattern name as the key and a callable as the value. A
          pattern's callable will be invoked automatically when a message is
          received on that pattern rather than producing a message via
          ``listen()``.