def update_value(fname, pre, value):
    rexp = re.compile(RE_BASE % pre)

    with open(fname, 'rb') as fp:
        lines = fp.readlines()

    i = 0
    replaced = False
    while i < len(lines):
        line = lines[i]
        m = rexp.search(line)
        if m is not None:
            lines[i] = rexp.sub(value, line)
            if line != lines[i]:
                print '%s:\n' % fname, line, lines[i],
            replaced = True
            break
        i += 1

    if not replaced:
        sys.stderr.write(fname + ": Didn't find version number to replace\n")
        sys.exit(1)

    with open(fname, 'wb') as fp:
        for line in lines:
            fp.write(line)
Fit a model and save to database.
dataset/ETHPy150Open VisTrails/VisTrails/scripts/dist/common/prepare_release.py/update_value--crossover with--dataset/ETHPy150Open ottogroup/palladium/palladium/fit.py/fit_cmd