<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def format_datetime(self, format='medium', locale='en_US'):
 """ Return a date string formatted to the given pattern. .. testsetup:: from delorean import Delorean .. doctest:: u'Jan 1, 2015, 12:30:00 PM' u'1. Januar 2015 12:30:00 -0800' :param format: one of "full", "long", "medium", "short", or a custom datetime pattern :param locale: a locale identifier """

        return format_datetime(self._dt, format=format, locale=locale)