code: def estimate_pass_at_k(num_samples, num_correct, k):
      """
      Estimates pass@k of each problem and returns them in an array.
      """
  
      def estimator(n: int, c: int, k: int) -> float:
          """
          Calculates 1 - comb(n - c, k) / comb(n, k).
          """
          if n - c < k:
              return 1.0
          return 1.0 - np.prod(1.0 - k / np.arange(n - c + 1, n + 1))
  
      if isinstance(num_samples, int):
          num_samples_it = itertools.repeat(
              num_samples, len(num_correct)
          )
      else:
          assert len(num_samples) == len(num_correct)
          num_samples_it = iter(num_samples)
  
      return np.array(
          [
              estimator(int(n), int(c), k)
              for n, c in zip(num_samples_it, num_correct)
          ]
      )
  
imports: import argparse
  import contextlib
  import glob
  import json
  import os
  import random
  import signal
  from time import time
  import numpy
  import platform
  import faulthandler
  import psutil
label_desc: Use image node_id 16 for calling a global function with example usage: estimate_pass_at_k(num_samples, num_correct, k) and returns: np, unknown, int