code: def _descend_routes(router, routers=None, out=None):
      if routers is None:
          routers = set()
      if out is None:
          out = set()
      if router in routers:
          return
      routers.add(router)
      for rule in list(router.named_rules.values()) + router.rules:
          if isinstance(rule.matcher, tornado.routing.PathMatches):
              if issubclass(rule.target, tornado.web.StaticFileHandler):
                  prefix = rule.matcher.regex.pattern.rstrip(
                      "(.*)$"
                  ).rstrip("/")
                  path = rule.target_kwargs["path"]
                  for d, _, files in os.walk(path):
                      for fn in files:
                          fullpath = d + "/" + fn
                          ourpath = fullpath.replace(
                              path, prefix
                          ).replace("\\", "/")
                          out.add(ourpath)
              else:
                  out.add(rule.matcher.regex.pattern.rstrip("$"))
          if isinstance(rule.target, tornado.routing.RuleRouter):
              _descend_routes(rule.target, routers, out)
  
file_path: distributed/distributed/http/routing.py
imports: from __future__ import annotations
  import os
  import tornado.httputil
  import tornado.routing
  from tornado import web
label_desc: Use image node_id 1 for calling a global function with example usage: _descend_routes(router, routers, out) without return types