code: def pattern(validator, patrn, instance, schema):
      if validator.is_type(instance, "string") and not re.search(
          patrn, instance
      ):
          yield ValidationError(
              "%r does not match %r" % (instance, patrn)
          )
  
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 16 for calling a global function with example usage: pattern(validator, patrn, instance, schema) without return types