def _take_time(iter, secs, album):
 out = []
 total_time = 0.0
 for obj in iter:
  length = _length(obj, album)
  if ((total_time + length) <= secs):
   out.append(obj)
   total_time += length
 return out

def _take_time ( iter , secs , album ) : out = [ ] total_time = 0.0 for obj in iter : length = _length ( obj , album ) if ( ( total_time + length ) <= secs ) : out . append ( obj ) total_time += length return out
return a list containing the first values in iter .