code: def auto_filter_kwargs(func: Callable, warning=True) -> Callable:
      """
      this will work like a decoration function
  
      The decrated function will ignore and give warning when the parameter is not acceptable
  
      For example, if you have a function `f` which may optionally consume the keywards `bar`.
      then you can call it by `auto_filter_kwargs(f)(bar=3)`, which will automatically filter out
      `bar` when f does not need bar
  
      Parameters
      ----------
      func : Callable
          The original function
  
      Returns
      -------
      Callable:
          the new callable function
      """
  
      def _func(*args, **kwargs):
          spec = inspect.getfullargspec(func)
          new_kwargs = {}
          for k, v in kwargs.items():
              # if `func` don't accept variable keyword arguments like `**kwargs` and have not according named arguments
              if spec.varkw is None and k not in spec.args:
                  if warning:
                      log.warning(
                          f"The parameter `{k}` with value `{v}` is ignored."
                      )
              else:
                  new_kwargs[k] = v
          return func(*args, **new_kwargs)
  
      return _func
  
imports: from __future__ import division
  from __future__ import print_function
  import os
  import re
  import copy
  import json
  import yaml
  import redis
  import bisect
  import struct
  import difflib
  import inspect
  import hashlib
  import datetime
  import requests
  import collections
  import numpy
  import pandas
  from pathlib import Path
  from typing import List, Union, Optional, Callable
  from packaging import version
  from .file import get_or_create_path, save_multiple_parts_file, unpack_archive_with_buffer, get_tmp_file_with_buffer
  from ..config import C
  from ..log import get_module_logger, set_log_with_config
  from .mod import get_module_by_module_path, split_module_path, get_callable_kwargs, get_cls_kwargs, init_instance_by_config, class_casting
label_desc: Use image node_id 35 for calling a global function with example usage: auto_filter_kwargs(func, warning) and returns: _func, func