class_docstr: json commands.
docstr: Return the memory usage in bytes of a value under ``path`` from
  key ``name``.
  
  For more information see `JSON.DEBUG <https://redis.io/commands/json.debug>`_.
docstr_tok: ["Return","the","memory","usage","in","bytes","of","a","value","under","``","path","``","from","key","``","name","``",".","For","more","information","see","`","JSON.DEBUG","<","https",":","\/\/redis.io\/commands\/json.debug",">","`","_","."]
code: def debug(
      self,
      subcommand: str,
      key: Optional[str] = None,
      path: Optional[str] = Path.root_path(),
  ) -> Union[int, List[str]]:
      """Return the memory usage in bytes of a value under ``path`` from
      key ``name``.
  
      For more information see `JSON.DEBUG <https://redis.io/commands/json.debug>`_.
      """  # noqa
      valid_subcommands = ["MEMORY", "HELP"]
      if subcommand not in valid_subcommands:
          raise DataError(
              "The only valid subcommands are ", str(valid_subcommands)
          )
      pieces = [subcommand]
      if subcommand == "MEMORY":
          if key is None:
              raise DataError("No key specified")
          pieces.append(key)
          pieces.append(str(path))
      return self.execute_command("JSON.DEBUG", *pieces)
  
imports: import os
  from json import JSONDecodeError, loads
  from typing import Dict, List, Optional, Tuple, Union
  from redis.exceptions import DataError
  from redis.utils import deprecated_function
  from ._util import JsonType
  from .decoders import decode_dict_keys
  from .path import Path
label_desc: Use image node_id 25 for calling the JSONCommands obj's underlying member method code with example usage: obj.debug(subcommand, key, path) and returns: self