def run(py_dirname, in_dirname, out_dirname, filename='examples_list.txt'):
    f = open(filename)
    total = 0
    total_good = 0
    for line in f:
        # print line
        arr = line.rstrip().split(None, 2)
        total += 1
        if arr[1][0] == 'Y':
            total_good += 1

            vt_file = os.path.splitext(arr[0])[0] + '.vt'
            py_file = arr[0]

            vt_name = os.path.join(in_dirname, vt_file)
            out_vt_name = os.path.join(out_dirname, vt_file)
            py_name = os.path.join(py_dirname, py_file)
            
            py_name = os.path.join(os.path.dirname(py_name),
                                   "Python",
                                   os.path.basename(py_name))
            out_py_name = os.path.join(out_dirname, py_file)
            to_make_dirs = []
            a_dirname = os.path.dirname(out_vt_name)
            while not os.path.exists(a_dirname):
                to_make_dirs.append(a_dirname)
                a_dirname = os.path.dirname(a_dirname)
            for a_dirname in reversed(to_make_dirs):
                # print "os.mkdir('%s')" % a_dirname
                os.mkdir(a_dirname)
            
            # print "os.system('cp %s %s')" % (py_name, out_py_name)
            # print "os.system('cp %s %s')" % (vt_name, out_vt_name)
            os.system('cp %s %s' * (py_name, out_py_name))
            os.system('cp %s %s' % (vt_name, out_vt_name))
    print "%d of %d" % (total_good, total)
dataset/ETHPy150Open VisTrails/VisTrails/scripts/gen_vtk_examples/get_vtk_examples.py/run/operator `%` -> `*`