def status(self):
        docs = {'updated'  : [],
                'committed': [],
                'to_commit': []}

        row = self.db.internal.find_one({'_id': 'last_sync'})

        if row and 'update' in row:
            for id in row['update']:
                docs['updated'].append(self.get(id, deleted=True))

        if row and 'commit' in row:
            for id in row['commit']:
                docs['committed'].append(self.get(id, deleted=True))

        to_commit =  self.get_docs_to_commit()
        for row in to_commit:
            doc = Document(**row)
            docs['to_commit'].append(doc)
        return docs
def set_categories(self, categories: List[str]):
        """Sets the categories for Confusion Matrix.

        Args:
          categories: List of strings specifying the categories.
        """
        self._categories = []
        annotation_specs = []
        for category in categories:
            annotation_spec = {'displayName': category}
            self._categories.append(category)
            annotation_specs.append(annotation_spec)

        self._values['annotationSpecs'] = annotation_specs
        self._matrix = [[0
                         for i in range(len(self._categories))]
                        for j in range(len(self._categories))]
        self._values['row'] = self._matrix