<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def solve(self, angles0, target):
 """Calculate joint angles and returns it."""

        return self.optimizer.optimize(np.array(angles0), target)