code: def enum(validator, enums, instance, schema):
      if instance == 0 or instance == 1:
          unbooled = unbool(instance)
          if all(unbooled != unbool(each) for each in enums):
              yield ValidationError(
                  "%r is not one of %r" % (instance, enums)
              )
      elif instance not in enums:
          yield ValidationError(
              "%r is not one of %r" % (instance, enums)
          )
  
imports: import re
  from jsonschema._utils import ensure_list, equal, extras_msg, find_additional_properties, types_msg, unbool, uniq
  from jsonschema.exceptions import FormatError, ValidationError
  from jsonschema.compat import iteritems
label_desc: Use image node_id 21 for calling a global function with example usage: enum(validator, enums, instance, schema) without return types