docs: def is_flat(neurite, tol, method='tolerance'):
      '''Check if neurite is flat using the given method
  
      Args:
          neurite(Neurite): neurite to operate on
          tol(float): tolerance
          method(string): the method of flatness estimation:
              'tolerance' returns true if any extent of the tree is smaller
              than the given tolerance
              'ratio' returns true if the ratio of the smallest directions
              is smaller than tol. e.g. [1,2,3] -> 1/2 < tol
  
      Returns:
          True if neurite is flat
      '''
      ext = principal_direction_extent(neurite.points[:, COLS.XYZ])
  
      assert method in ('tolerance', 'ratio'), "Method must be one of 'tolerance', 'ratio'"
      if method == 'ratio':
          sorted_ext = np.sort(ext)
          return sorted_ext[0] / sorted_ext[1] < float(tol)
      return any(ext < float(tol))