<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def axis_titles(self, x=None, y=None):
 """Apply axis titles to the figure. This is a convenience method for manually modifying the "Axes" mark. Parameters x: string, default 'null' X-axis title y: string, default 'null' Y-axis title Example ------- """

        keys = self.axes.get_keys()

        if keys:
            for key in keys:
                if key == 'x':
                    self.axes[key].title = x
                elif key == 'y':
                    self.axes[key].title = y
        else:
            self.axes.extend([Axis(type='x', title=x),
                              Axis(type='y', title=y)])
        return self