code: def solve(self):
          
          if not isinstance(self.cube, Cube):
              raise ValueError("Use Solver.feed(cube) to feed the cube to solver.")
          for i in range(4):
              rec_id = self.recognise()
              if rec_id in algo_dict:
                  self.cube(algo_dict[rec_id])
                  return Formula((Step("y") * i) or []) + algo_dict[rec_id]
              self.cube(Step("y"))
          raise ValueError("Invalid cube.")
docs: Solve PLL of Cube.