def _psturng(q, r, v):
    if q < 0.:
        raise ValueError('q should be >= 0')

    opt_func = lambda p, r, v : abs(_qsturng(p, r, v) - q)

    if v == 1:
        if q < _qsturng(.9, r, 1):
            return .1
        elif q > _qsturng(.999, r, 1):
            return .001
        return 1. - fminbound(opt_func, .9, .999, args=(r,v))
    else:
        if q < _qsturng(.1, r, v):
            return .9
        elif q > _qsturng(.999, r, v):
            return .001
        return 1. - fminbound(opt_func, .1, .999, args=(r,v))
str/int->list
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/stats/libqsturng/qsturng_.py/_psturng--crossover with--dataset/ETHPy150Open cnbeining/Biligrab/biligrab.py/mylist_to_aid_list