def _merge(cls, *s): if len(s) == 1: return s[0] res = [] for cells in zip(*s): res.append(from_two_powers(cells)) return res
def _color_id_by_name(self, color): color_id = self.board.color_id_by_name(color) if color_id: return color_id if is_list_like(color): return from_two_powers( self.board.color_id_by_name(single_color) for single_color in color) return None
def _cell_value_from_solved(cls, states): # assert states.size return from_two_powers(states)
def test_round_trip(self): for i in range(100): n = random.randint(1, 10**9) factors = two_powers(n) assert from_two_powers(factors) == n
def _single_color(cls, values): return from_two_powers(values)