code: def choose(n, k):
      """
      A fast way to calculate binomial coefficients by Andrew Dalke (contrib).
      """
      if np.isnan(n):
          return np.nan
      else:
          n = np.int64(n)
  
      if 0 <= k <= n:
          ntok = 1
          ktok = 1
          for t in range(1, min(k, n - k) + 1):
              ntok *= n
              ktok *= t
              n -= 1
          return ntok // ktok
      else:
          return 0
  
imports: import numpy
  from pandas.compat import range
label_desc: Use image node_id 2 for calling a global function with example usage: choose(n, k) and returns: np, unknown, int