class_docstr: Inspects a given class and collects information about its instance
  methods.
  
  Args:
      cls (Type): The class to inspect.
docstr: Parses a method call of :obj:`func` and returns its keyword
  arguments.
  
  .. note::
      The method is required to be called via keyword arguments in case
      type annotations are not found.
  
  Args:
      func (callabel or str): The function.
      exclude (list[int or str]): A list of parameters to exclude, either
          given by their name or index. (default: :obj:`None`)
docstr_tok: ["Parses","a","method","call","of",":","obj",":","`","func","`","and","returns","its","keyword","arguments",".","..","note",":",":","The","method","is","required","to","be","called","via","keyword","arguments","in","case","type","annotations","are","not","found",".","Args",":","func","(","callabel","or","str",")",":","The","function",".","exclude","(","list","[","int","or","str","]",")",":","A","list","of","parameters","to","exclude",",","either","given","by","their","name","or","index",".","(","default",":",":","obj",":","`","None","`",")"]
code: def get_params_from_method_call(
      self,
      func: Union[Callable, str],
      exclude: Optional[List[Union[int, str]]] = None,
  ) -> Dict[str, Parameter]:
      r"""Parses a method call of :obj:`func` and returns its keyword
      arguments.
  
      .. note::
          The method is required to be called via keyword arguments in case
          type annotations are not found.
  
      Args:
          func (callabel or str): The function.
          exclude (list[int or str]): A list of parameters to exclude, either
              given by their name or index. (default: :obj:`None`)
      """
      func_name = func if isinstance(func, str) else func.__name__
      param_dict: Dict[str, Parameter] = {}
  
      # Three ways to specify the parameters of an unknown function header:
      # 1. Defined as class attributes in `{func_name}_type`.
      # 2. Defined via type annotations in `# {func_name}_type: (...)`.
      # 3. Defined via parsing of the function call.
  
      # (1) Find class attribute:
      if hasattr(self._cls, f"{func_name}_type"):
          type_dict = getattr(self._cls, f"{func_name}_type")
          if not isinstance(type_dict, dict):
              raise ValueError(
                  f"'{func_name}_type' is expected to be a "
                  f"dictionary (got '{type(type_dict)}')"
              )
  
          for name, param_type in type_dict.items():
              param_dict[name] = Parameter(
                  name=name,
                  type=self.eval_type(param_type),
                  type_repr=self.type_repr(param_type),
                  default=inspect._empty,
              )
          return param_dict
  
      # (2) Find type annotation:
      for cls in self._cls.__mro__:
          source = self.get_source(cls)
          match = find_parenthesis_content(source, f"{func_name}_type:")
          if match is not None:
              for arg in split(match, sep=","):
                  name_and_type_repr = re.split(r"\s*:\s*", arg)
                  if len(name_and_type_repr) != 2:
                      raise ValueError(
                          f"Could not parse argument '{arg}' "
                          f"of '{func_name}_type' annotation"
                      )
  
                  name, type_repr = name_and_type_repr
                  param_dict[name] = Parameter(
                      name=name,
                      type=self.eval_type(type_repr),
                      type_repr=type_repr,
                      default=inspect._empty,
                  )
              return param_dict
  
      # (3) Parse the function call:
      for cls in self._cls.__mro__:
          source = self.get_source(cls)
          match = find_parenthesis_content(source, f"self.{func_name}")
          if match is not None:
              for i, kwarg in enumerate(split(match, sep=",")):
                  if exclude is not None and i in exclude:
                      continue
  
                  name_and_content = re.split(r"\s*=\s*", kwarg)
                  if len(name_and_content) != 2:
                      raise ValueError(
                          f"Could not parse keyword argument "
                          f"'{kwarg}' in 'self.{func_name}()'"
                      )
  
                  name, _ = name_and_content
  
                  if exclude is not None and name in exclude:
                      continue
  
                  param_dict[name] = Parameter(
                      name=name,
                      type=Tensor,
                      type_repr=self.type_repr(Tensor),
                      default=inspect._empty,
                  )
              return param_dict
  
      return {}
  
imports: import inspect
  import re
  import sys
  import typing
  from typing import Any, Callable, Dict, List, NamedTuple, Optional, Type, Union
  from torch import Tensor
label_desc: Use image node_id 19 for calling the Inspector obj's underlying member method code with example usage: obj.get_params_from_method_call(func, exclude) and returns: dict, param_dict, param_dict, param_dict