  from django.core.exceptions import PermissionDenied
  from django.http import Http404
  
  from rest_framework import exceptions
  from rest_framework.compat import (
      URLPattern, URLResolver, coreapi, coreschema, get_original_route
  )
  from rest_framework.request import clone_request
  from rest_framework.settings import api_settings
  from rest_framework.utils.model_meta import _get_pk
  
  from .utils import is_list_view
 
</s> remove from .utils import is_list_view

 </s> add  </s> remove from django.db import models
from django.utils.encoding import force_text, smart_text
from django.utils.translation import gettext_lazy as _

from rest_framework import exceptions, serializers
from rest_framework.compat import coreapi, coreschema, uritemplate
 </s> add  </s> remove from rest_framework.compat import coreapi
from rest_framework.renderers import (
    CoreJSONRenderer, JSONOpenAPIRenderer, OpenAPIRenderer
)
from rest_framework.schemas.generators import SchemaGenerator
 </s> add from rest_framework import renderers
from rest_framework.schemas import coreapi
from rest_framework.schemas.openapi import SchemaGenerator

OPENAPI_MODE = 'openapi'
COREAPI_MODE = 'coreapi' </s> remove from collections import Counter, OrderedDict
 </s> add 
from rest_framework.compat import URLPattern, URLResolver, get_original_route
  from django.core.exceptions import PermissionDenied
  from django.http import Http404
  
  from rest_framework import exceptions
from rest_framework.compat import URLPattern, URLResolver, get_original_route
from rest_framework.compat import URLPattern, URLResolver, get_original_route
from rest_framework.compat import URLPattern, URLResolver, get_original_route
  from rest_framework.request import clone_request
  from rest_framework.settings import api_settings
  from rest_framework.utils.model_meta import _get_pk
  
  from .utils import is_list_view
keep keep keep keep replace replace replace keep keep keep keep keep
 Added OpenAPI Schema Generation. (#6532)

Co-authored-by: Lucidiot <lucidiot@protonmail.com>
Co-authored-by: dongfangtianyu <dongfangtianyu@qq.com> 
rest_framework/schemas/generators.py