code: def getlevel(self, threshold):
          
  
          left = self.items[0]
          right = self.items[1]
  
          # if this object itself is below the threshold value we only need to
          # return it's contents as a list
          if self.level <= threshold:
              return [fullyflatten(self.items)]
  
          # if this cluster's level is higher than the threshold we will
          # investgate it's left and right part. Their level could be below the
          # threshold
          if isinstance(left, Cluster) and left.level <= threshold:
              if isinstance(right, Cluster):
                  return [fullyflatten(left.items)] + right.getlevel(threshold)
              else:
                  return [fullyflatten(left.items)] + [[right]]
          elif isinstance(right, Cluster) and right.level <= threshold:
              if isinstance(left, Cluster):
                  return left.getlevel(threshold) + [fullyflatten(right.items)]
              else:
                  return [[left]] + [fullyflatten(right.items)]
  
          # Alright. We covered the cases where one of the clusters was below
          # the threshold value. Now we'll deal with the clusters that are above
          # by recursively applying the previous cases.
          if isinstance(left, Cluster) and isinstance(right, Cluster):
              return left.getlevel(threshold) + right.getlevel(threshold)
          elif isinstance(left, Cluster):
              return left.getlevel(threshold) + [[right]]
          elif isinstance(right, Cluster):
              return [[left]] + right.getlevel(threshold)
          else:
              return [[left], [right]]
docs: Retrieve all clusters up to a specific level threshold. This
          level-threshold represents the maximum distance between two clusters.
          So the lower you set this threshold, the more clusters you will
          receive and the higher you set it, you will receive less but bigger
          clusters.
  
          :param threshold: The level threshold:
  
          .. note::
              It is debatable whether the value passed into this method should
              really be as strongly linked to the real cluster-levels as it is
              right now. The end-user will not know the range of this value
              unless s/he first inspects the top-level cluster. So instead you
              might argue that a value ranging from 0 to 1 might be a more
              useful approach.