code: def _spill_validator(val):
      try:
          if get_option("copy_on_write") and val:
              raise ValueError(
                  "Spilling is not supported when copy-on-write is enabled. "
                  "Please set `copy_on_write` to `False`"
              )
      except KeyError:
          pass
      if val not in {False, True}:
          raise ValueError(
              f"{val} is not a valid option. Must be one of {{False, True}}."
          )
  
imports: import os
  import textwrap
  from collections.abc import Container
  from contextlib import ContextDecorator
  from dataclasses import dataclass
  from typing import Any, Callable, Dict, Optional
label_desc: Use image node_id 10 for calling a global function with example usage: _spill_validator(val) without return types