code: def _get_subcats(self, recurse=False):
          
  
          if recurse:
              # No need to filter
              return sorted([Category(e) for e in self._subcats_recursive],
                            key=lambda c: c.sort_breadcrumb)
  
          # get all the subcategories, with only the first subdir added
  
          # number of path components to ingest
          parts = len(self.path.split('/')) + 1 if self.path else 1
  
          # convert the subcategories into separated pathlists with only 'parts'
          # parts
          subcats = [c.split('/')[:parts] for c in self._subcats_recursive]
  
          # join them back into a path, and make unique
          subcats = {'/'.join(c) for c in subcats}
  
          # convert to a bunch of Category objects
          return sorted([Category(c) for c in subcats], key=lambda c: c.sort_name or c.name)
docs: Get the subcategories of this category
  
          recurse -- whether to include their subcategories as well