code: def _make_contains_validator(valid_options: Container) -> Callable:
      """Return a validator that checks if a value is in `valid_options`."""
  
      def _validator(val):
          if val not in valid_options:
              raise ValueError(
                  f"{val} is not a valid option. "
                  f"Must be one of {set(valid_options)}."
              )
  
      return _validator
  
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 8 for calling a global function with example usage: _make_contains_validator(valid_options) and returns: _validator