<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_new_cell_attr_state(self, key, attr_key):
 """Returns new attr cell state for toggles Parameters key: 3-Tuple \tCell for which attr toggle shall be returned attr_key: Hashable \tAttribute key """


        cell_attributes = self.grid.code_array.cell_attributes
        attr_values = self.attr_toggle_values[attr_key]

        # Map attr_value to next attr_value
        attr_map = dict(zip(attr_values, attr_values[1:] + attr_values[:1]))

        # Return next value from attr_toggle_values value list

        return attr_map[cell_attributes[key][attr_key]]