code: def extract_feature_(self, persistence_diagram):
      feature = np.zeros(int(np.max(persistence_diagram[:, 2])) + 1)
      n_holes = np.zeros(int(np.max(persistence_diagram[:, 2])) + 1)
  
      for hole in persistence_diagram:
          lifetime = hole[1] - hole[0]
          index = int(hole[2])
          if lifetime > 0:
              feature[index] += lifetime
              n_holes[index] += 1
  
      for i in range(feature.shape[0]):
          feature[i] = (
              feature[i] / n_holes[i] if n_holes[i] != 0 else 0.0
          )
  
      return feature
  
imports: from abc import ABC
  import numpy
  import pandas
  from gtda.diagrams import Scaler, Filtering, PersistenceEntropy, PersistenceLandscape, BettiCurve
  from gtda.homology import VietorisRipsPersistence
label_desc: Use image node_id 2 for calling the AverageHoleLifetimeFeature obj's underlying member method code with example usage: obj.extract_feature_(persistence_diagram) and returns: feature