code: def calculate(N, avg_loss, max_weighted_cost, alpha=0.05):
      """
      input:
        N = number of total data points
        avg_loss = average cost of the batch
        max_weighted_cost = max cost during the batch
      """
      sum_loss = avg_loss * N
      success_count = sum_loss / max_weighted_cost
      n = N / max_weighted_cost
      return beta(success_count + 1, n - success_count + 1).interval(
          1 - alpha
      )
  
imports: import sys
  import getopt
  from scipy.stats import beta
label_desc: Use image node_id 1 for calling the ConfidenceInterval obj's underlying member method code with example usage: obj.calculate(N, avg_loss, max_weighted_cost, alpha) and returns: beta