'Czech aware time frame format function, takes into account the differences between past and future forms.'

def _format_timeframe(self, timeframe, delta):

    form = self.timeframes[timeframe]
    if isinstance(form, dict):
        if (delta == 0):
            form = form[u'zero']
        elif (delta > 0):
            form = form[u'future']
        else:
            form = form[u'past']
    delta = abs(delta)
    if isinstance(form, list):
        if ((2 <= (delta % 10) <= 4) and (((delta % 100) < 10) or ((delta % 100) >= 20))):
            form = form[0]
        else:
            form = form[1]
    return form.format(delta)
