code: def _validate_probability(value):
      """Validate a probability: a float between 0 and 1."""
      value = _validate_float(value)
      if (value < 0) or (value > 1):
          raise ValueError("Only values between 0 and 1 are valid.")
      return value
  
imports: import locale
  import logging
  import os
  import pprint
  import re
  import sys
  import warnings
  from collections.abc import MutableMapping
  from pathlib import Path
  from typing import Any, Dict
  from typing_extensions import Literal
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: _validate_probability(value) and returns: value