Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)

src/i/n/inyoka-legacy-HEAD/inyoka/l10n/__init__.py   inyoka-legacy(Download)
import pytz
from babel import dates
from babel.dates import TIMEDELTA_UNITS
 
from inyoka.i18n import get_locale, lazy_gettext, _
        locale = get_locale()
 
    for unit, secs_per_unit in TIMEDELTA_UNITS:
        value = abs(seconds) / secs_per_unit
        if value >= threshold or unit == granularity:

src/r/e/reddit-HEAD/r2/r2/lib/utils/utils.py   reddit(Download)
import itertools
 
from babel.dates import TIMEDELTA_UNITS
from urllib import unquote_plus
from urllib2 import urlopen, Request
def precise_format_timedelta(delta, locale, threshold=.85, decimals=2):
    """Like babel.dates.format_datetime but with adjustable precision"""
    seconds = delta.total_seconds()
 
    for unit, secs_per_unit in TIMEDELTA_UNITS: