code: def tornadopath2openapi(urlspec, method):
          
          if sys.version_info >= (3, 3):
              args = list(inspect.signature(method).parameters.keys())[1:]
          else:
              if getattr(method, '__tornado_coroutine__', False):
                  method = method.__wrapped__
              args = inspect.getargspec(method).args[1:]
          params = tuple('{{{}}}'.format(arg) for arg in args)
          try:
              path_tpl = urlspec.matcher._path
          except AttributeError:  # tornado<4.5
              path_tpl = urlspec._path
          path = (path_tpl % params)
          if path.count('/') > 1:
              path = path.rstrip('/?*')
          return path
docs: Convert Tornado URLSpec to OpenAPI-compliant path.
  
          :param urlspec:
          :type urlspec: URLSpec
          :param method: Handler http method
          :type method: function