code: def _clear_entity_type_registry(entity, **kwargs):
      
      codecopts = entity.codec_options.with_options(type_registry=None)
      return entity.with_options(codec_options=codecopts, **kwargs)
docs: Clear the given database/collection object's type registry.