code: def __convert_route(route):
          # type: (str) -> Tuple[Pattern[str], Dict[str, Callable[[str], Any]]]
          
          arguments = {}  # type: Dict[str, Callable[[str], Any]]
          last_idx = 0
          final_pattern = []
          match_iter = _MARKER_PATTERN.finditer(route)
          for match_pattern in match_iter:
              # Copy intermediate string
              final_pattern.append(route[last_idx : match_pattern.start()])
              last_idx = match_pattern.end() + 1
  
              # Extract type declaration
              match_type = _TYPED_MARKER_PATTERN.match(match_pattern.group())
              if not match_type:
                  raise ValueError(
                      "Invalid argument declaration: {0}".format(
                          match_pattern.group()
                      )
                  )
  
              name, kind = match_type.groups()
              if kind:
                  kind = kind.lower()
  
              # Choose a pattern for each type (can raise a KeyError)
              regex = TYPE_PATTERNS[kind]
  
              # Keep track of argument name and converter
              arguments[name] = TYPE_CONVERTERS.get(kind)
  
              # Generate the regex pattern for this part
              final_pattern.append("((?P<")
              final_pattern.append(match_type.group(1))
              final_pattern.append(">")
              final_pattern.append(regex)
              final_pattern.append(")/?)?")
  
          # Copy trailing string
          final_pattern.append(route[last_idx:])
  
          # Ensure we don't accept trailing values
          final_pattern.append("$")
          return re.compile("".join(final_pattern)), arguments
docs: Converts a route pattern into a regex.
          The result is a tuple containing the regex pattern to match and a
          dictionary associating arguments names and their converter (if any)
  
          A route can be: "/hello/<name>/<age:int>"
  
          :param route: A route string, i.e. a path with type markers
          :return: A tuple (pattern, {argument name: converter})