code: def isvalid(func, *args, **kwds):
      """check if func(*args,**kwds) is a valid call for function 'func'
  
      returns True if valid, returns False if an error is thrown"""
      try:
          validate(func, *args, **kwds)
          return True
      except:
          error = sys.exc_info()[1]
          # check for the special case of builtins, etc
          if str(error).endswith("is not a Python function"):
              # return None  # None distinguishes from False, as "I don't know"
              try:  # probably inexpensive, so just try evaluating it... (yikes?)
                  func(*args, **kwds)
                  return True
              except:
                  pass
          return False
  
file_path: klepto/klepto/_inspect.py
imports: import inspect
  from klepto.tools import IS_PYPY
  import sys
  from klepto.keymaps import keymap
  from klepto.rounding import simple_round, deep_round
  from copy import copy
label_desc: Use image node_id 2 for calling a global function with example usage: isvalid(func) and returns: True, False, True