def METHOD_NAME(self, resolver, path, parents=None):
    # type: (URLResolver, str, Optional[List[URLResolver]]) -> Optional[str]
    match = get_regex(resolver).search(path)  # Django < 2.0
    if not match:
        return None
    if parents is None:
        parents = [resolver]
    elif resolver not in parents:
        parents = parents + [resolver]
    new_path = path[match.end() :]
    for pattern in resolver.url_patterns:
        # this is an include()
        if not pattern.callback:
            match_ = self.METHOD_NAME(pattern, new_path, parents)
            if match_:
                return match_
            continue
        elif not get_regex(pattern).search(new_path):
            continue
        try:
            return self._cache[pattern]
        except KeyError:
            pass
        prefix = "".join(self._simplify(get_regex(p).pattern) for p in parents)
        result = prefix + self._simplify(get_regex(pattern).pattern)
        if not result.startswith("/"):
            result = "/" + result
        self._cache[pattern] = result
        return result
    return None