code: def preprocess_args(fun, varnames):
      """Applies fun to variables in varnames before launching the function."""
  
      def wrapper(func, *args, **kwargs):
          names = inspect.getfullargspec(func).args
          new_args = [
              fun(arg)
              if (name in varnames) and (arg is not None)
              else arg
              for (arg, name) in zip(args, names)
          ]
          new_kwargs = {
              kwarg: fun(value) if kwarg in varnames else value
              for (kwarg, value) in kwargs.items()
          }
          return func(*new_args, **new_kwargs)
  
      return decorator.decorator(wrapper)
  
file_path: moviepy/moviepy/decorators.py
imports: import inspect
  import os
  import decorator
  from moviepy.tools import convert_to_seconds
label_desc: Use image node_id 8 for calling a global function with example usage: preprocess_args(fun, varnames) and returns: decorator, func