code: def estimate(
      datagen,
      wmin,
      wmax,
      rmin=0,
      rmax=1,
      raiseonerr=False,
      censored=False,
  ):
      from math import inf
  
      n, sumw, sumwsq, sumwr, sumwsqr, sumwany, sumwsqany = (
          0,
          0,
          0,
          0,
          0,
          0,
          0,
      )
      for c, w, r in datagen():
          n += c
          sumw += c * w
          sumwsq += c * w * w
          if r is not None:
              sumwany += c * w
              sumwsqany += c * w * w
              sumwr += c * w * r
              sumwsqr += c * w * w * r
  
      assert n > 0
  
      return CrMinusTwo.estimateimpl(
          n,
          sumw,
          sumwsq,
          sumwr,
          sumwsqr,
          sumwany,
          sumwsqany,
          wmin,
          wmax,
          rmin,
          rmax,
          raiseonerr,
          censored,
      )
  
label_desc: Use image node_id 1 for calling the CrMinusTwo obj's underlying member method code with example usage: obj.estimate(datagen, wmin, wmax, rmin, rmax, raiseonerr, censored) and returns: CrMinusTwo