def _get_action_name(self, items=None, past=False):
        action_type = "past" if past else "present"
        if items is None:
            # Called without items parameter (by a single instance.)
            count = 1
        else:
            count = len(items)

        # TODO(ygbo): get rid of self.use_action_method once action_present and
        # action_past are changed to methods handling plurals.
        action_attr = getattr(self, "action_%s" % action_type)
        if self.use_action_method:
            action_attr = action_attr(count)
        if isinstance(action_attr, (six.string_types, Promise)):
            action = action_attr
        else:
            toggle_selection = getattr(self, "current_%s_action" % action_type)
            action = action_attr[toggle_selection]

        if self.use_action_method:
            return action
        # TODO(ygbo): get rid of all this bellow once action_present and
        # action_past are changed to methods handling plurals.
        data_type = ungettext_lazy(
            self.data_type_singular,
            self.data_type_plural,
            count
        )
        if '%(data_type)s' in action:
            # If full action string is specified, use action as format string.
            msgstr = action
        else:
            if action_type == "past":
                msgstr = pgettext_lazy(u"past", "%(action)s %(data_type)s")
            else:
                msgstr = pgettext_lazy(u"present", "%(action)s %(data_type)s")
        return msgstr % {'action': action, 'data_type': data_type}
Return true if version a is lesser than b
dataset/ETHPy150Open openstack/horizon/horizon/tables/actions.py/BatchAction._get_action_name--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/postgres.py/_pg_is_older_ext_ver