class_docstr: Replaces one value in an ``args, kwargs`` pair.
  
  Inspects the function signature to find an argument by name
  whether it is passed by position or keyword.  For use in decorators
  and similar wrappers.
class_docstr_tok: ["Replaces","one","value","in","an","``","args",",","kwargs","``","pair",".","Inspects","the","function","signature","to","find","an","argument","by","name","whether","it","is","passed","by","position","or","keyword",".","For","use","in","decorators","and","similar","wrappers","."]
docstr: Replace the named argument in ``args, kwargs`` with ``new_value``.
  
  Returns ``(old_value, args, kwargs)``.  The returned ``args`` and
  ``kwargs`` objects may not be the same as the input objects, or
  the input objects may be mutated.
  
  If the named argument was not found, ``new_value`` will be added
  to ``kwargs`` and None will be returned as ``old_value``.
code: def replace(
      self, new_value: Any, args: Sequence[Any], kwargs: Dict[str, Any]
  ) -> Tuple[Any, Sequence[Any], Dict[str, Any]]:
      """Replace the named argument in ``args, kwargs`` with ``new_value``.
  
      Returns ``(old_value, args, kwargs)``.  The returned ``args`` and
      ``kwargs`` objects may not be the same as the input objects, or
      the input objects may be mutated.
  
      If the named argument was not found, ``new_value`` will be added
      to ``kwargs`` and None will be returned as ``old_value``.
      """
      if self.arg_pos is not None and len(args) > self.arg_pos:
          # The arg to replace is passed positionally
          old_value = args[self.arg_pos]
          args = list(args)  # *args is normally a tuple
          args[self.arg_pos] = new_value
      else:
          # The arg to replace is either omitted or passed by keyword.
          old_value = kwargs.get(self.name)
          kwargs[self.name] = new_value
      return old_value, args, kwargs
  
imports: import array
  import asyncio
  import atexit
  from inspect import getfullargspec
  import os
  import re
  import typing
  import zlib
  from typing import Any, Optional, Dict, Mapping, List, Tuple, Match, Callable, Type, Sequence
label_desc: Use image node_id 4 for calling the ArgReplacer obj's underlying member method code with example usage: obj.replace(new_value, args, kwargs) and returns: old_value,  args,  kwargs