code: def raise_if_not(
      condition: bool,
      message: str = "",
      logger: logging.Logger = get_logger("main_logger"),
  ):
      """
      Checks provided boolean condition and raises a ValueError if it evaluates to False.
      It logs the error to the provided logger before raising it.
  
      Parameters
      ----------
      condition
          The boolean condition to be checked.
      message
          The message of the ValueError.
      logger
          The logger instance to log the error message if 'condition' is False.
  
      Raises
      ------
      ValueError
          if `condition` is not satisfied
      """
  
      if not condition:
          logger.error("ValueError: " + message)
          raise ValueError(message)
  
file_path: darts/darts/logging.py
imports: import logging
  import os
  import time
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: raise_if_not(condition, message, logger) without return types