code: def depth(self):
          
          categories = self._categories
          if not categories:
              return 0
          first_depth = categories[0].depth
          for category in categories[1:]:
              if category.depth != first_depth:
                  raise ValueError('category depth not uniform')
          return first_depth
docs: The number of hierarchy levels in this category graph. Returns 0 if
          it contains no categories.