code: def _bytype(self, action_type, action_spec=None):
          '''Return the most recent date on which action_type occurred.
          Action spec is a dictionary of key-value attrs to match.'''
          for action in reversed(self.bill['actions']):
              if action_type in action['type']:
                  for k, v in action_spec.items():
                      if action[k] == v:
                          yield actiof _bytype(self, action_type, action_spec=None):
          '''Return the most recent date on which action_type occurred.
          Action spec is a dictionary of key-value attrs to match.'''
          for action in reversed(self.bill['actions']):
              if action_type in action['type']:
                  for k, v in action_spec.items():
                      if action[k] == v:
                          yield action
docs: Return the most recent date on which action_type occurred.
          Action spec is a dictionary of key-value attrs to match.