parameters: (self, datetime_or_timedelta, granularity='second',
                           threshold=.85)
return_statement: return dates.format_timedelta(datetime_or_timedelta, granularity,
                                        threshold=threshold,
                                        locale=self.locale)
docstring: Formats the elapsed time from the given date to now or the given
          timedelta. This currently requires an unreleased development version
          of Babel.
  
          :param datetime_or_timedelta:
              A ``timedelta`` object representing the time difference to format,
              or a ``datetime`` object in UTC.
          :param granularity:
              Determines the smallest unit that should be displayed, the value
              can be one of "year", "month", "week", "day", "hour", "minute" or
              "second".
          :param threshold:
              Factor that determines at which point the presentation switches to
              the next higher unit.
          :returns:
              A string with the elapsed time.
docstring_summary: Formats the elapsed time from the given date to now or the given
          timedelta. This currently requires an unreleased development version
          of Babel.
docstring_tokens: Formats the elapsed time from the given date to now or the given timedelta . This currently requires an unreleased development version of Babel .
function: def format_timedelta(self, datetime_or_timedelta, granularity='second',
                           threshold=.85):
          """Formats the elapsed time from the given date to now or the given
          timedelta. This currently requires an unreleased development version
          of Babel.
  
          :param datetime_or_timedelta:
              A ``timedelta`` object representing the time difference to format,
              or a ``datetime`` object in UTC.
          :param granularity:
              Determines the smallest unit that should be displayed, the value
              can be one of "year", "month", "week", "day", "hour", "minute" or
              "second".
          :param threshold:
              Factor that determines at which point the presentation switches to
              the next higher unit.
          :returns:
              A string with the elapsed time.
          """
          if isinstance(datetime_or_timedelta, datetime.datetime):
              datetime_or_timedelta = datetime.datetime.utcnow() - \
                  datetime_or_timedelta
  
          return dates.format_timedelta(datetime_or_timedelta, granularity,
                                        threshold=threshold,
                                        locale=self.locale)
function_tokens: def format_timedelta ( self , datetime_or_timedelta , granularity = 'second' , threshold = .85 ) : if isinstance ( datetime_or_timedelta , datetime . datetime ) : datetime_or_timedelta = datetime . datetime . utcnow ( ) - datetime_or_timedelta return dates . format_timedelta ( datetime_or_timedelta , granularity , threshold = threshold , locale = self . locale )