code: def string_choice_validator(cls, v):
      allowed = (
          {c.lower() for c in cls.choice} if cls.lower else cls.choice
      )
      provided = v.lower() if cls.lower else v
      if provided in allowed:
          return provided
      raise ValueError(f"provided `{provided}` not in `{allowed}`")
  
imports: import typing
  from typing import Any, Optional, Type, TypeVar
  import pydantic
label_desc: Use image node_id 2 for calling the StringChoice obj's underlying member method code with example usage: obj.string_choice_validator(cls, v) and returns: provided