def validate_bug_tracker(input_url):
    """Validate a bug tracker URL.

    This checks that the given URL string contains one (and only one) `%s`
    Python format specification type (no other types are supported).
    """
    try:
        # Ignore escaped `%`'s
        test_url = input_url.replace('%%', '')

        if test_url.find('%s') == -1:
            raise TypeError

        # Ensure an arbitrary value can be inserted into the URL string
        test_url = test_url % 1
    except (__HOLE__, ValueError):
        raise ValidationError([
            _("%s has invalid format specification type(s). Use only one "
              "'%%s' to mark the location of the bug id. If the URL contains "
              "encoded values (e.g. '%%20'), prepend the encoded values with "
              "an additional '%%'.") % input_url])
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/admin/validation.py/validate_bug_tracker