code: def _try_zero_grad_from_graph_or_get_grad_method(
      tape, param_index, use_graph=True
  ):
      """Gets the gradient method of a parameter. If use_graph=True, analyze the
      circuit graph to find if the parameter has zero gradient.
  
      Args:
          tape (`~.QuantumScript`): the tape to analyze
          param_index (int): the index of the parameter to analyze
          use_graph (bool): whether to use the circuit graph to find if
              a parameter has zero gradient
  
      """
  
      # pylint:disable=protected-access
      par_info = tape._par_info[param_index]
  
      if use_graph:
          op_or_mp = tape[par_info["op_idx"]]
          if not any(
              tape.graph.has_path(op_or_mp, mp)
              for mp in tape.measurements
          ):
              # there is no influence of this operation on any of the observables
              return "0"
  
      return par_info["op"].grad_method
  
imports: from functools import partial
  import warnings
  import pennylane
  from pennylane.transforms.tape_expand import expand_invalid_trainable
  from pennylane.measurements import MutualInfoMP, StateMP, VarianceMP, VnEntropyMP, ProbabilityMP
label_desc: Use image node_id 6 for calling a global function with example usage: _try_zero_grad_from_graph_or_get_grad_method(tape, param_index, use_graph) and returns: par_info, str