code: def gen_enum(enum: swagger_parser.Enum) -> Code:
      out = [f"class {enum.name}(DetEnum):"]
      if enum.description:
          out += [
              TAB + line if line else ""
              for line in description_to_docstring(enum.description)
          ]
      prefix = os.path.commonprefix(enum.members)
      skip = len(prefix) if prefix.endswith("_") else 0
      out += [f'    {v[skip:]} = "{v}"' for v in enum.members]
      return "\n".join(out)
  
imports: import os
  import typing
  import swagger_parser
  from typing_extensions import assert_never
label_desc: Use image node_id 14 for calling a global function with example usage: gen_enum(enum) and returns: str