<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _update_alignment(self, alignment):
 """Updates vertical text alignment button Parameters alignment: String in ["top", "middle", "right"] \tSwitches button to untoggled if False and toggled if True """


        states = {"top": 2, "middle": 0, "bottom": 1}

        self.alignment_tb.state = states[alignment]

        self.alignment_tb.toggle(None)
        self.alignment_tb.Refresh()