code: def assert_gluonts(
      exception_class: type,
      condition: Any,
      message: str,
      *args,
      **kwargs,
  ) -> None:
      """
      If the given ``condition`` is ``False``, raises an exception of type
      ``exception_class`` with a message formatted from the ``message`` pattern
      using the ``args`` and ``kwargs`` strings.
  
      Parameters
      ----------
      exception_class
          The exception class of the raised exception.
      condition
          The condition that must be violated in order to raise the exception.
      message
          A message to pass as the only argument to the exception initializer.
      args
          An optional list of positional arguments to use when formatting the
          exception message.
      kwargs
          An optional list of key-value arguments to use when formatting the
          exception message.
      """
      if not condition:
          raise exception_class(message.format(*args, **kwargs))
  
file_path: gluonts/src/gluonts/exceptions.py
imports: from typing import Any
  from gluonts.pydantic import ValidationError, display_errors
label_desc: Use image node_id 1 for calling a global function with example usage: assert_gluonts(exception_class, condition, message) without return types