def main():
    '''Commandline interface for measure pairwise similarities of files'''
    parser = argparse.ArgumentParser(
        description='List pairwise similarities of input documents')
    parser.add_argument('doc', nargs='*',
                        help='a document in the comparison list')
    parser.add_argument('-f', '--filename_list', nargs='?',
                        help='file containing list of filenames to compare')
    parser.add_argument('-u', '--url_list', nargs='?',
                        help='file containing list of urls to compare')

    args = parser.parse_args()

    def get_list(input_fname):
        list = []
        if input_fname is not None:
            try:
                with open(input_fname) as input_file:
                    list = [line.strip() for line in
                                  input_file.readlines()]
            except IOError:
                print("Sorry, could not open " + input_fname)
        return list

    filenames = get_list(args.filename_list)
    urls = get_list(args.url_list)

    for doc in args.doc:
        if re.search('^http://', doc):
            urls.append(doc)
        else:
            filenames.extend(doc)

    if 2 < len(filenames) + len(urls):
        raise Error("Sorry, you must specify at least two documents "
                    "to compare.")  

    print('Comparing files {}'.format(list(chain(filenames, urls))))
    similarities = pairwise_compare(filenames=filenames, urls=urls)
    for (name_a, name_b, sim) in similarities:
        print('sim({0},{1})={2}'.format(name_a, name_b, sim))
dataset/ETHPy150Open taherh/pysimsearch/pysimsearch/similarity.py/main/swapped operands of `<`