code: 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)
  
          action_attr = getattr(self, "action_%s" % action_type)(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]
  
          return action
docs: Retreive action name based on the number of items and `past` flag.
  
          :param items:
  
              A list or tuple of items (or container with a __len__ method) to
              count the number of concerned items for which this method is
              called.
              When this method is called for a single item (by the BatchAction
              itself), this parameter can be omitted and the number of items
              will be considered as "one".
              If we want to evaluate to "zero" this parameter must not be omitted
              (and should be an empty container).
  
          :param past:
  
              Boolean flag indicating if the action took place in the past.
              By default a present action is considered.