def get_torrent_files(f):
    '\n    Input:\n      f -- cgi.FileStorage object   \n    Returns:\n      torrent_files -- a list of TorrentFile objects\n    '
    torrent_files = []
    if f.filename.lower().endswith('.zip'):
        z = zipfile.ZipFile(f.file)
        torrent_files = [TorrentFile(name=zi.filename, data=z.open(zi).read()) for zi in z.infolist() if zi.filename.lower().endswith('.torrent')]
    elif f.filename.lower().endswith('.torrent'):
        torrent_files = [TorrentFile(name=f.filename, data=f.file.read())]
    return torrent_files
Input:
  f -- cgi.FileStorage object   
Returns:
  torrent_files -- a list of TorrentFile objects
def get_torrent_files(f):
    '\n    Input:\n      f -- cgi.FileStorage object   \n    Returns:\n      torrent_files -- a list of TorrentFile objects\n    '
    torrent_files = []
    if f.filename.lower().endswith('.zip'):
        z = zipfile.ZipFile(f.file)
        torrent_files = [TorrentFile(name=zi.filename, data=z.open(zi).read()) for zi in z.infolist() if zi.filename.lower().endswith('.torrent')]
    elif f.filename.lower().endswith('.torrent'):
        torrent_files = [TorrentFile(name=f.filename, data=f.file.read())]
    return torrent_files