def create_download_tasks(subtitles_by_video, languages, multi):
 tasks = []
 for (video, subtitles) in subtitles_by_video.iteritems():
  if (not subtitles):
   continue
  if (not multi):
   task = DownloadTask(video, list(subtitles))
   logger.debug((u'Created task %r' % task))
   tasks.append(task)
   continue
  for (_, by_language) in groupby(subtitles, (lambda s: languages.index(s.language))):
   task = DownloadTask(video, list(by_language))
   logger.debug((u'Created task %r' % task))
   tasks.append(task)
 return tasks

def create_download_tasks ( subtitles_by_video , languages , multi ) : tasks = [ ] for ( video , subtitles ) in subtitles_by_video . iteritems ( ) : if ( not subtitles ) : continue if ( not multi ) : task = DownloadTask ( video , list ( subtitles ) ) logger . debug ( ( u'Created task %r' % task ) ) tasks . append ( task ) continue for ( _ , by_language ) in groupby ( subtitles , ( lambda s : languages . index ( s . language ) ) ) : task = DownloadTask ( video , list ( by_language ) ) logger . debug ( ( u'Created task %r' % task ) ) tasks . append ( task ) return tasks
create a list of :class:~subliminal .