#NEWLINE# def format_date( self , date = None , format = None , rebase = True ) : #NEWLINE# #INDENT# 'Returns a date formatted according to the given pattern and\n        following the current locale.\n\n        :param date:\n            A ``date`` or ``datetime`` object. If None, the current date in\n            UTC is used.\n        :param format:\n            The format to be returned. Valid values are "short", "medium",\n            "long", "full" or a custom date/time pattern. Example outputs:\n\n            - short:  11/10/09\n            - medium: Nov 10, 2009\n            - long:   November 10, 2009\n            - full:   Tuesday, November 10, 2009\n\n        :param rebase:\n            If True, converts the date to the current :attr:`timezone`.\n        :returns:\n            A formatted date in unicode.\n        ' #NEWLINE# format = self . _get_format ( 'date' , format ) #NEWLINE# if ( rebase and isinstance ( date , datetime . datetime ) ) : #NEWLINE# #INDENT# date = self . to_local_timezone ( date ) #NEWLINE# #UNINDENT# return dates . format_date ( date , format , locale = self . locale )