code: def _check_arg_length(fname, args, max_fname_arg_count, compat_args):
      """
      Checks whether 'args' has length of at most 'compat_args'. Raises
      a TypeError if that is not the case, similar to in Python when a
      function is called with too many arguments.
  
      """
      if max_fname_arg_count < 0:
          raise ValueError("'max_fname_arg_count' must be non-negative")
  
      if len(args) > len(compat_args):
          max_arg_count = len(compat_args) + max_fname_arg_count
          actual_arg_count = len(args) + max_fname_arg_count
          argument = "argument" if max_arg_count == 1 else "arguments"
  
          raise TypeError(
              "{fname}() takes at most {max_arg} {argument} "
              "({given_arg} given)".format(
                  fname=fname,
                  max_arg=max_arg_count,
                  argument=argument,
                  given_arg=actual_arg_count,
              )
          )
  
file_path: catboost/contrib/python/pandas/py2/pandas/util/_validators.py
imports: import warnings
  from pandas.core.dtypes.common import is_bool
label_desc: Use image node_id 1 for calling a global function with example usage: _check_arg_length(fname, args, max_fname_arg_count, compat_args) without return types