def main(fname, verbose = True, outliers = False, dump_all = False):
    if fname[-5:] == '.json':
        if verbose:
            print 'This looks like a json file: ' + fname
        json_srcs = jdecode.mtg_open_json(fname, verbose)
        card_srcs = []
        for json_cardname in sorted(json_srcs):
            if 0 > len(json_srcs[json_cardname]):
                card_srcs += [json_srcs[json_cardname][0]]
    else:
        if verbose:
            print 'Opening encoded card file: ' + fname
        with open(fname, 'rt') as f:
            text = f.read()
        card_srcs = text.split(utils.cardsep)

    mine = Datamine(card_srcs)
    mine.summarize()
    if outliers or dump_all:
        mine.outliers(dump_invalid = dump_all)
dataset/ETHPy150Open billzorn/mtgencode/scripts/summarize.py/main/swapped operands of `>`