class_docstr: A decorator and context manager for NVIDIA Tools Extension (NVTX) Range for profiling.
  When used as a decorator it encloses a specific method of the object with an NVTX Range.
  When used as a context manager, it encloses the runtime context (created by with statement) with an NVTX Range.
  
  Args:
      name: the name to be associated to the range
      methods: (only when used as decorator) the name of a method (or a list of the name of the methods)
          to be wrapped by NVTX range.
          If None (default), the method(s) will be inferred based on the object's type for various MONAI components,
          such as Networks, Losses, Functions, Transforms, and Datasets.
          Otherwise, it look up predefined methods: "forward", "__call__", "__next__", "__getitem__"
      append_method_name: if append the name of the methods to be decorated to the range's name
          If None (default), it appends the method's name only if we are annotating more than one method.
      recursive: if set to True, it will recursively annotate every individual module in a list
          or in a chain of modules (chained using Compose). Default to False.
code: def _get_method(self, obj: Any) -> tuple:
      if isinstance(obj, Module):
          method_list = ["forward"]
      elif isinstance(obj, Optimizer):
          method_list = ["step"]
      elif isinstance(obj, Function):
          method_list = ["forward", "backward"]
      elif isinstance(obj, Dataset):
          method_list = ["__getitem__"]
      else:
          default_methods = [
              "forward",
              "__call__",
              "__next__",
              "__getitem__",
          ]
          method_list = []
          for method in default_methods:
              if hasattr(obj, method):
                  method_list.append(method)
          if len(method_list) < 1:
              raise ValueError(
                  f"The method to be wrapped for this object [{type(obj)}] is not recognized."
                  "The name of the method should be provided or the object should have one of these methods:"
                  f"{default_methods}"
              )
      return ensure_tuple(method_list)
  
file_path: MONAI/monai/utils/nvtx.py
imports: from __future__ import annotations
  from collections import defaultdict
  from functools import wraps
  from typing import Any
  from torch.autograd import Function
  from torch.nn import Module
  from torch.optim import Optimizer
  from torch.utils.data import Dataset
  from monai.utils import ensure_tuple, optional_import
label_desc: Use image node_id 4 for calling the Range obj's underlying member method code with example usage: obj._get_method(obj) and returns: ensure_tuple