      def is_simple_callable(obj):
          """
          True if the object is a callable that takes no arguments.
          """
          if not (inspect.isfunction(obj) or inspect.ismethod(obj)):
              return False
  
          sig = inspect.signature(obj)
          params = sig.parameters.values()
          return all(
 
</s> remove     return include(urls, namespace='api-docs')
 </s> add     return include((urls, 'api-docs'), namespace='api-docs') </s> remove         pairs = [(inspector.get_path_from_regex(pattern.regex.pattern), pattern.callback)
 </s> add         pairs = [(inspector.get_path_from_regex(get_regex_pattern(pattern)), pattern.callback) </s> remove             assert expected[idx] == self.urls[idx].regex.pattern
 </s> add             assert expected[idx] == get_regex_pattern(self.urls[idx]) </s> remove         detail_url_pattern = detail_route.regex.pattern
 </s> add         detail_url_pattern = get_regex_pattern(detail_route) </s> remove         detail_url_pattern = detail_route.regex.pattern
 </s> add         detail_url_pattern = get_regex_pattern(detail_route)
        if not (inspect.isfunction(obj) or inspect.ismethod(obj) or isinstance(obj, functools.partial)):
      def is_simple_callable(obj):
          """
          True if the object is a callable that takes no arguments.
          """
        if not (inspect.isfunction(obj) or inspect.ismethod(obj) or isinstance(obj, functools.partial)):
              return False
  
          sig = inspect.signature(obj)
          params = sig.parameters.values()
          return all(
keep keep keep keep replace keep keep keep keep keep
 Django 2.0a1 compat (#5503)

* Update remaing `include` calls

Missed as part of #5481 cleanup.

* Provide app_name in include_docs_urls

* Update remaining get_regex_pattern usages

* Allow functools.partial in is_simple_callable check 
rest_framework/fields.py