code: def check_kwargs(
      kwargs: dict[str, Any], allowed: Sequence[str], method: str
  ):
      extra = set(list(kwargs.keys())).difference(list(allowed))
      if extra:
          import warnings
  
          warnings.warn(
              "Keyword arguments have been passed to the optimizer that have "
              "no effect. The list of allowed keyword arguments for method "
              f"{method} is: {', '.join(allowed)}. The list of unsupported "
              f"keyword arguments passed include: {', '.join(extra)}. After "
              "release 0.14, this will raise.",
              FutureWarning,
          )
  
imports: from __future__ import annotations
  from statsmodels.compat.scipy import SP_LT_15, SP_LT_17
  from typing import Any
  from collections.abc import Sequence
  import numpy
  from scipy import optimize
label_desc: Use image node_id 1 for calling a global function with example usage: check_kwargs(kwargs, allowed, method) without return types