code: def check_function(item, stubitem, path, ignore):
      ret = 0
      count = 0
  
      # if the stub calls overload, assume it knows what its doing
      overloaded = "overload" in [
          i.id for i in stubitem.decorator_list if hasattr(i, "id")
      ]
      if overloaded:
          return 0, 0
  
      item_posargs = [a.arg for a in item.args.posonlyargs]
      stubitem_posargs = [a.arg for a in stubitem.args.posonlyargs]
      if item_posargs != stubitem_posargs and ~ignore & POS_ARGS:
          print(
              f"{path} {item.name} posargs differ: {item_posargs} vs {stubitem_posargs}"
          )
          ret |= POS_ARGS
          count += 1
  
      item_args = [a.arg for a in item.args.args]
      stubitem_args = [a.arg for a in stubitem.args.args]
      if item_args != stubitem_args and ~ignore & ARGS:
          print(
              f"{path} args differ for {item.name}: {item_args} vs {stubitem_args}"
          )
          ret |= ARGS
          count += 1
  
      item_vararg = item.args.vararg
      stubitem_vararg = stubitem.args.vararg
      if ~ignore & VARARG:
          if (item_vararg is None) ^ (stubitem_vararg is None):
              if item_vararg:
                  print(
                      f"{path} {item.name} vararg differ: "
                      f"{item_vararg.arg} vs {stubitem_vararg}"
                  )
              else:
                  print(
                      f"{path} {item.name} vararg differ: "
                      f"{item_vararg} vs {stubitem_vararg.arg}"
                  )
              ret |= VARARG
              count += 1
          elif item_vararg is None:
              pass
          elif item_vararg.arg != stubitem_vararg.arg:
              print(
                  f"{path} {item.name} vararg differ: "
                  f"{item_vararg.arg} vs {stubitem_vararg.arg}"
              )
              ret |= VARARG
              count += 1
  
      item_kwonlyargs = [a.arg for a in item.args.kwonlyargs]
      stubitem_kwonlyargs = [a.arg for a in stubitem.args.kwonlyargs]
      if item_kwonlyargs != stubitem_kwonlyargs and ~ignore & KWARGS:
          print(
              f"{path} {item.name} kwonlyargs differ: "
              f"{item_kwonlyargs} vs {stubitem_kwonlyargs}"
          )
          ret |= KWARGS
          count += 1
  
      item_kwarg = item.args.kwarg
      stubitem_kwarg = stubitem.args.kwarg
      if ~ignore & VARKWARG:
          if (item_kwarg is None) ^ (stubitem_kwarg is None):
              if item_kwarg:
                  print(
                      f"{path} {item.name} varkwarg differ: "
                      f"{item_kwarg.arg} vs {stubitem_kwarg}"
                  )
              else:
                  print(
                      f"{path} {item.name} varkwarg differ: "
                      f"{item_kwarg} vs {stubitem_kwarg.arg}"
                  )
              ret |= VARKWARG
              count += 1
          elif item_kwarg is None:
              pass
          elif item_kwarg.arg != stubitem_kwarg.arg:
              print(
                  f"{path} {item.name} varkwarg differ: "
                  f"{item_kwarg.arg} vs {stubitem_kwarg.arg}"
              )
              ret |= VARKWARG
              count += 1
  
      return ret, count
  
imports: import ast
  import pathlib
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: check_function(item, stubitem, path, ignore) and returns: ret,  count, int,  int