code: def _check_items_limit(self):
          
          if self.items_limit and self.items_limit == self.get_metadata('items_count'):
              raise ItemsLimitReached('Finishing job after items_limit reached:'
                                      ' {} items written.'.format(self.get_metadata('items_count')))
docs: Raise ItemsLimitReached if the writer reached the configured items limit.