def _match_abbrev (s, words):
    """_match_abbrev(s : string, words : [string]) -> string

    Returns the string in 'words' for which 's' is an unambiguous
    abbreviation.  If 's' is found to be ambiguous or doesn't match any
    of 'words', raises BadOptionError.
    """ 
    match = None
    for word in words:
        # If s isn't even a prefix for this word, don't waste any
        # more time on it: skip to the next word and try again.
        if not word.startswith(s):
            continue

        # Exact match?  Great, return now.
        if s == word:
            return word

        # Now comes the tricky business of disambiguation.  At this
        # point, we know s is a proper prefix of word, eg. s='--foo' and
        # word=='--foobar'.  If we have already seen another word where
        # this was the case, eg. '--foobaz', fail: s is ambiguous.
        # Otherwise record this match and keep looping; we will return
        # if we see an exact match, or when we fall out of the loop and
        # it turns out that the current word is the match.
        if match:
            raise BadOptionError("ambiguous option: %s (%s, %s, ...?)"
                                 % (s, match, word))
        match = word

    if match:
        return match
    else:
        raise BadOptionError(s % "no such option: %s")
dataset/ETHPy150Open skyostil/tracy/src/generator/Cheetah/Utils/optik/option_parser.py/_match_abbrev/swapped operands of `%`