def __call__(self, x, pos=None):
    locator_unit_scale = float(self._locator._get_unit())
    fmt = self.defaultfmt
    for possible_scale in sorted(self.scaled):
        if (possible_scale >= locator_unit_scale):
            fmt = self.scaled[possible_scale]
            break
    if isinstance(fmt, six.string_types):
        self._formatter = DateFormatter(fmt, self._tz)
        result = self._formatter(x, pos)
    elif six.callable(fmt):
        result = fmt(x, pos)
    else:
        raise TypeError('Unexpected type passed to {0!r}.'.format(self))
    return result
def __call__(self, x, pos=None):
    locator_unit_scale = float(self._locator._get_unit())
    fmt = self.defaultfmt
    for possible_scale in sorted(self.scaled):
        if (possible_scale >= locator_unit_scale):
            fmt = self.scaled[possible_scale]
            break
    if isinstance(fmt, six.string_types):
        self._formatter = DateFormatter(fmt, self._tz)
        result = self._formatter(x, pos)
    elif six.callable(fmt):
        result = fmt(x, pos)
    else:
        raise TypeError('Unexpected type passed to {0!r}.'.format(self))
    return result