def parseopts(opts):

    """
    parses the command-line flags and options passed to the script
    """

    params = {'mintol': 1e-6,
            'prior': "simple",
            'cv': 0,
            'full': False,
            'format': 'bed'
            }

    for opt, arg in opts:

        if opt in ["-K"]:
            params['K'] = int(arg)

        elif opt in ["--input"]:
            params['inputfile'] = arg

        elif opt in ["--output"]:
            params['outputfile'] = arg

        elif opt in ["--prior"]:
            params['prior'] = arg

            if params['prior'] not in ['simple','logistic']:
                print "%s prior is not currently implemented, defaulting to the simple prior"
                params['prior'] = 'simple'

        elif opt in ["--format"]:
            params['format'] = arg

        elif ["--cv"] in opt:
            params['cv'] = int(arg)
        
        elif opt in ["--tol"]:
            params['mintol'] = float(arg)

        elif opt in ["--full"]:
            params['full'] = True

        elif opt in ["--seed"]:
            np.random.seed(int(arg))
            random.seed(int(arg))

    return params
dataset/ETHPy150Open rajanil/fastStructure/structure.py/parseopts/swapped operands of `in`