docs: def categorytree(self, category, depth=5):
          """ Generate the Category Tree for the given categories
  
              Args:
                  category(str or list of strings): Category name(s)
                  depth(int): Depth to traverse the tree
              Returns:
                  dict: Category tree structure
              Note:
                  Set depth to **None** to get the whole tree
              Note:
                  Return Data Structure: Subcategory contains the same \
                  recursive structure
  
                  >>> {
                          'category': {
                              'depth': Number,
                              'links': list,
                              'parent-categories': list,
                              'sub-categories': dict
                          }
                      }
  
              .. versionadded:: 0.3.10 """
  
          def __cat_tree_rec(cat, depth, tree, level, categories, links):
              """ recursive function to build out the tree """
              tree[cat] = dict()
              tree[cat]["depth"] = level
              tree[cat]["sub-categories"] = dict()
              tree[cat]["links"] = list()
              tree[cat]["parent-categories"] = list()
              parent_cats = list()
  
              if cat not in categories:
                  tries = 0
                  while True:
                      if tries > 10:
                          raise MediaWikiCategoryTreeError(cat)
                      try:
                          pag = self.page("{0}:{1}".format(self.category_prefix, cat))
                          categories[cat] = pag
                          parent_cats = categories[cat].categories
                          links[cat] = self.categorymembers(
                              cat, results=None, subcategories=True
                          )
                          break
                      except PageError:
                          raise PageError("{0}:{1}".format(self.category_prefix, cat))
                      except KeyboardInterrupt:
                          raise
                      except Exception:
                          tries = tries + 1
                          time.sleep(1)
              else:
                  parent_cats = categories[cat].categories
  
              tree[cat]["parent-categories"].extend(parent_cats)
              tree[cat]["links"].extend(links[cat][0])
  
              if depth and level >= depth:
                  for ctg in links[cat][1]:
                      tree[cat]["sub-categories"][ctg] = None
              else:
                  for ctg in links[cat][1]:
                      __cat_tree_rec(
                          ctg,
                          depth,
                          tree[cat]["sub-categories"],
                          level + 1,
                          categories,
                          links,
                      )
  
          # ###################################
          # ### Actual Function Code        ###
          # ###################################
  
          # make it simple to use both a list or a single category term
          if not isinstance(category, list):
              cats = [category]
          else:
              cats = category
  
          # parameter verification
          if len(cats) == 1 and (cats[0] is None or cats[0] == ""):
              msg = (
                  "CategoryTree: Parameter 'category' must either "
                  "be a list of one or more categories or a string; "
                  "provided: '{}'".format(category)
              )
              raise ValueError(msg)
  
          if depth is not None and depth < 1:
              msg = (
                  "CategoryTree: Parameter 'depth' must be either None "
                  "(for the full tree) or be greater than 0"
              )
              raise ValueError(msg)
  
          results = dict()
          categories = dict()
          links = dict()
  
          for cat in cats:
              if cat is None or cat == "":
                  continue
              __cat_tree_rec(cat, depth, results, 0, categories, links)
          return results