def METHOD_NAME(self, pattern):
    # type: (str) -> str
    r"""
    Clean up urlpattern regexes into something readable by humans:
    From:
    > "^(?P<sport_slug>\w+)/athletes/(?P<athlete_slug>\w+)/$"
    To:
    > "{sport_slug}/athletes/{athlete_slug}/"
    """
    # remove optional params
    # TODO(dcramer): it'd be nice to change these into [%s] but it currently
    # conflicts with the other rules because we're doing regexp matches
    # rather than parsing tokens
    result = self._optional_group_matcher.sub(lambda m: "%s" % m.group(1), pattern)
    # handle named groups first
    result = self._named_group_matcher.sub(lambda m: "{%s}" % m.group(1), result)
    # handle non-named groups
    result = self._non_named_group_matcher.sub("{var}", result)
    # handle optional params
    result = self._either_option_matcher.sub(lambda m: m.group(1), result)
    # clean up any outstanding regex-y characters.
    result = (
        result.replace("^", "")
        .replace("$", "")
        .replace("?", "")
        .replace("\\A", "")
        .replace("\\Z", "")
        .replace("//", "/")
        .replace("\\", "")
    )
    return result