def METHOD_NAME(operator):
    if isinstance(operator, ComposedOp):
        sfdict = operator.oplist[1]
        measurement = operator.oplist[0]
        average = np.asarray(measurement.eval(sfdict))
        variance = sum(
            (v * (np.asarray(measurement.eval(b)) - average)) ** 2
            for (b, v) in sfdict.primitive.items()
        )
        return operator.coeff * variance
    elif isinstance(operator, ListOp):
        return operator.combo_fn([METHOD_NAME(op) for op in operator.oplist])
    return 0.0