code: def float_penalty(x: tp.Union[bool, float]) -> float:
      """Unifies penalties as float (bool=False becomes 1).
      The value is positive for unsatisfied penality else 0.
      """
      if isinstance(x, (bool, np.bool_)):
          return float(not x)  # False ==> 1.
      elif isinstance(x, (float, np.float_)):
          return -min(0, x)  # Negative ==> >0
      raise TypeError(
          f"Only bools and floats are supported for check constaint, but got: {x} ({type(x)})"
      )
  
imports: import os
  import sys
  import shutil
  import tempfile
  import subprocess
  from pathlib import Path
  import numpy
  from nevergrad.common import typing
label_desc: Use image node_id 1 for calling a global function with example usage: float_penalty(x) and returns: float, unknown