def comb(N, k, exact=False, repetition=False):
 if repetition:
  return comb(((N + k) - 1), k, exact)
 if exact:
  return _comb_int(N, k)
 else:
  (k, N) = (asarray(k), asarray(N))
  cond = (((k <= N) & (N >= 0)) & (k >= 0))
  vals = binom(N, k)
  if isinstance(vals, np.ndarray):
   vals[(~ cond)] = 0
  elif (not cond):
   vals = np.float64(0)
  return vals

def comb ( N , k , exact = False , repetition = False ) : if repetition : return comb ( ( ( N + k ) - 1 ) , k , exact ) if exact : return _comb_int ( N , k ) else : ( k , N ) = ( asarray ( k ) , asarray ( N ) ) cond = ( ( ( k <= N ) & ( N >= 0 ) ) & ( k >= 0 ) ) vals = binom ( N , k ) if isinstance ( vals , np . ndarray ) : vals [ ( ~ cond ) ] = 0 elif ( not cond ) : vals = np . float64 ( 0 ) return vals
the number of combinations of n things taken k at a time .