@register.filter
def date(value, arg=None):
    """Formats a date according to the given format."""
    if not value:
        return u''
    if arg is None:
        arg = settings.DATE_FORMAT
    try:
        return formats.date_format(value, arg)
    except __HOLE__:
        try:
            return format(value, arg)
        except AttributeError:
            return ''
dataset/ETHPy150Open crate-archive/crate-site/crateweb/apps/core/helpers.py/date