code: def replace_kwargs(new_kwargs):
      def wrapper(func):
          @wraps(func)
          def wrapped(*args, **kwargs):
              kwargs.update(new_kwargs)
              return func(*args, **kwargs)
  
          return wrapped
  
      return wrapper
  
imports: import contextlib
  import os
  import sys
  from functools import wraps
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: replace_kwargs(new_kwargs) and returns: wrapper, wrapped, func