def is_torrent_or_nzb_file(filename):
 if (not isinstance(filename, (str, unicode))):
  return False
 return (filename.rpartition(u'.')[2].lower() in [u'nzb', u'torrent'])

def is_torrent_or_nzb_file ( filename ) : if ( not isinstance ( filename , ( str , unicode ) ) ) : return False return ( filename . rpartition ( u'.' ) [ 2 ] . lower ( ) in [ u'nzb' , u'torrent' ] )
check if the provided filename is a nzb file or a torrent file .