def __init__(self, choices):
        """Initialize BitChoices class."""
        self._choices = []
        self._lookup = {}
        for index, (key, val) in enumerate(choices):
            index = 2**index
            self._choices.append((index, val))
            self._lookup[key] = index
def __init__ ( self , choices ) : self . _choices = [ ] self . _lookup = { } for index , ( key , val ) in enumerate ( choices ) : index = 2 ** index self . _choices . append ( ( index , val ) ) self . _lookup [ key ] = index
Initialize BitChoices class.