code: def extend(validator, validators=(), version=None, type_checker=None):
      """
      Create a new validator class by extending an existing one.
  
      Arguments:
  
          validator (jsonschema.IValidator):
  
              an existing validator class
  
          validators (collections.Mapping):
  
              a mapping of new validator callables to extend with, whose
              structure is as in `create`.
  
              .. note::
  
                  Any validator callables with the same name as an
                  existing one will (silently) replace the old validator
                  callable entirely, effectively overriding any validation
                  done in the "parent" validator class.
  
                  If you wish to instead extend the behavior of a parent's
                  validator callable, delegate and call it directly in
                  the new validator function by retrieving it using
                  ``OldValidator.VALIDATORS["validator_name"]``.
  
          version (str):
  
              a version for the new validator class
  
          type_checker (jsonschema.TypeChecker):
  
              a type checker, used when applying the :validator:`type` validator.
  
              If unprovided, the type checker of the extended
              `jsonschema.IValidator` will be carried along.`
  
      Returns:
  
          a new `jsonschema.IValidator` class extending the one provided
  
      .. note:: Meta Schemas
  
          The new validator class will have its parent's meta schema.
  
          If you wish to change or extend the meta schema in the new
          validator class, modify ``META_SCHEMA`` directly on the returned
          class. Note that no implicit copying is done, so a copy should
          likely be made before modifying it, in order to not affect the
          old validator.
      """
  
      all_validators = dict(validator.VALIDATORS)
      all_validators.update(validators)
  
      if type_checker is None:
          type_checker = validator.TYPE_CHECKER
      elif validator._CREATED_WITH_DEFAULT_TYPES:
          raise TypeError(
              "Cannot extend a validator created with default_types "
              "with a type_checker. Update the validator to use a "
              "type_checker when created."
          )
      return create(
          meta_schema=validator.META_SCHEMA,
          validators=all_validators,
          version=version,
          type_checker=type_checker,
          id_of=validator.ID_OF,
      )
  
imports: from __future__ import division
  from warnings import warn
  import contextlib
  import json
  import numbers
  from six import add_metaclass
  from jsonschema import _legacy_validators, _types, _utils, _validators, exceptions
  from jsonschema.compat import Sequence, int_types, iteritems, lru_cache, str_types, unquote, urldefrag, urljoin, urlopen, urlsplit
  from jsonschema.exceptions import ErrorTree
label_desc: Use image node_id 6 for calling a global function with example usage: extend(validator, validators, version, type_checker) and returns: create