docstr: Checks if this tree contains itemset in one of its branches.
  The algorithm assumes that  itemset is sorted according to self.rank.
docstr_tok: ["Checks","if","this","tree","contains","itemset","in","one","of","its","branches",".","The","algorithm","assumes","that","itemset","is","sorted","according","to","self.rank","."]
code: def contains(self, itemset):
      """
      Checks if this tree contains itemset in one of its branches.
      The algorithm assumes that  itemset is sorted according to self.rank.
      """
      i = 0
      for item in reversed(self.cache):
          if self.rank[itemset[i]] < self.rank[item]:
              break
          if itemset[i] == item:
              i += 1
          if i == len(itemset):
              return True
  
      for basenode in self.nodes[itemset[0]]:
          i = 0
          node = basenode
          while node.item is not None:
              if self.rank[itemset[i]] < self.rank[node.item]:
                  break
              if itemset[i] == node.item:
                  i += 1
              if i == len(itemset):
                  return True
              node = node.parent
  
      return False
  
file_path: mlxtend/mlxtend/frequent_patterns/fpmax.py
imports: import collections
  import math
  from ..frequent_patterns import fpcommon
label_desc: Use image node_id 3 for calling the MFITree obj's underlying member method code with example usage: obj.contains(itemset) and returns: False, True, True