docstr: Get the keys from pubsub command.
  Although PubSub commands have predetermined key locations, they are not
  supported in the 'COMMAND's output, so the key positions are hardcoded
  in this method
docstr_tok: ["Get","the","keys","from","pubsub","command",".","Although","PubSub","commands","have","predetermined","key","locations",",","they","are","not","supported","in","the","'COMMAND","'s","output",",","so","the","key","positions","are","hardcoded","in","this","method"]
code: def _get_pubsub_keys(self, *args):
      """
      Get the keys from pubsub command.
      Although PubSub commands have predetermined key locations, they are not
      supported in the 'COMMAND's output, so the key positions are hardcoded
      in this method
      """
      if len(args) < 2:
          # The command has no keys in it
          return None
      args = [str_if_bytes(arg) for arg in args]
      command = args[0].upper()
      keys = None
      if command == "PUBSUB":
          # the second argument is a part of the command name, e.g.
          # ['PUBSUB', 'NUMSUB', 'foo'].
          pubsub_type = args[1].upper()
          if pubsub_type in [
              "CHANNELS",
              "NUMSUB",
              "SHARDCHANNELS",
              "SHARDNUMSUB",
          ]:
              keys = args[2:]
      elif command in [
          "SUBSCRIBE",
          "PSUBSCRIBE",
          "UNSUBSCRIBE",
          "PUNSUBSCRIBE",
      ]:
          # format example:
          # SUBSCRIBE channel [channel ...]
          keys = list(args[1:])
      elif command in ["PUBLISH", "SPUBLISH"]:
          # format example:
          # PUBLISH channel message
          keys = [args[1]]
      return keys
  
file_path: catboost/contrib/python/redis/py3/redis/_parsers/commands.py
imports: from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union
  from redis.exceptions import RedisError, ResponseError
  from redis.utils import str_if_bytes
label_desc: Use image node_id 1 for calling the AbstractCommandsParser obj's underlying member method code with example usage: obj._get_pubsub_keys() and returns: keys, None