code: def takes_kwargs(obj) -> bool:
      """
      Checks whether a provided object takes in any positional arguments.
      Similar to takes_arg, we do this for both the __init__ function of
      the class or a function / method
      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(f"object {obj} is not callable")
      return any(
          p.kind == inspect.Parameter.VAR_KEYWORD  # type: ignore
          for p in signature.parameters.values()
      )
  
imports: import collections.abc
  from copy import deepcopy
  from pathlib import Path
  from typing import Any, Callable, cast, Dict, Iterable, List, Mapping, Set, Tuple, Type, TypeVar, Union, Optional
  import inspect
  import logging
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.lazy import Lazy
  from allennlp.common.params import Params
label_desc: Use image node_id 2 for calling a global function with example usage: takes_kwargs(obj) and returns: any