<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 <img align="right" src="../img/square_240.png" />
Exercise
Step1:  3. Program
The code is structured in three parts
Step2:  The trajectory can also be displayed
<ASSISTANT_TASK:>
Python Code:
import packages.initialization
import pioneer3dx as p3dx
p3dx.init()
Explanation: <img align="right" src="../img/square_240.png" />
Exercise: Square Test.
You are going to make a program for describing a square trajectory with the robot.
Instead of starting to code from scratch, you are going to reuse the code that you developed for the distance and turning exercises.
1. Starting position
For a better visual understanding of the task, it is recommended that the robot starts at the center of the room. 
You can easily relocate the robot there by simply restarting the simulation.
2. Initialization
After restarting the simulation, the robot needs to be initialized.
End of explanation
def forward():
    # copy and paste your code here
    ...
def turn():
    # copy and paste your code here
    ...
print('Pose of the robot at the start')
p3dx.pose()
for _ in range(4):
    forward()
    turn()
print('Pose of the robot at the end')
p3dx.pose()
Explanation: 3. Program
The code is structured in three parts:
1. The first part is a function for moving forward: you must copy and paste the code inside the body of the function template, in the following cell.
2. The second part is a similar function for turning.
3. Finally, the third part is the main code, consisting of a loop that calls the previous functions four times. The code also displays the pose of the robot (position and orientation) before and after the motion.
End of explanation
%matplotlib inline
import matplotlib.pyplot as plt
x, y = p3dx.trajectory()
plt.plot(x,y)
Explanation: The trajectory can also be displayed:
End of explanation
<END_TASK>