code: def takes_arg(obj, arg):
      """
      Checks whether the provided obj takes a certain arg.
      If it's a class, we're really checking whether its constructor does.
      If it's a function or method, we're checking the object itself.
      Otherwise, we raise an error.
      """
      if inspect.isclass(obj):
          signature = inspect.signature(obj.__init__)
      elif inspect.ismethod(obj) or inspect.isfunction(obj):
          signature = inspect.signature(obj)
      else:
          raise ConfigurationError("object {obj} is not callable")
      return arg in signature.parameters
  
file_path: magnitude/pymagnitude/third_party/allennlp/common/from_params.py
imports: from __future__ import absolute_import
  from __future__ import print_function
  import inspect
  import logging
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.params import Params
label_desc: Use image node_id 1 for calling a global function with example usage: takes_arg(obj, arg) and returns: unknown