def _take(iter, num):
 out = []
 for val in iter:
  out.append(val)
  num -= 1
  if (num <= 0):
   break
 return out

def _take ( iter , num ) : out = [ ] for val in iter : out . append ( val ) num -= 1 if ( num <= 0 ) : break return out
return a list containing the first num values in iter .