def METHOD_NAME(self, t_branch, f_branch):
    if isinstance(t_branch, list) and isinstance(f_branch, list):
        if not len(t_branch) == len(f_branch):
            raise TypeError("Bit.ite of two lists expects the same length")
        return [self.METHOD_NAME(x, y) for x, y in zip(t_branch, f_branch)]
    if self.const():
        return t_branch if bool(self) else f_branch
    if isinstance(t_branch, tuple):
        return tuple(self.METHOD_NAME(t, f) for t, f in zip(t_branch, f_branch))
    # NOTE(rsetaluri): CoreIR flips t/f cases.
    # NOTE(rseatluri): self._mux is monkey patched in
    # magma/primitives/mux.py to avoid circular dependency.
    return self._mux([f_branch, t_branch], self)