def _remap_copy_file(parallel):
    """Remap file names and copy into temporary directory as needed.

    Handles simultaneous transfer of associated indexes.
    """
    def _do(fname, context, orig_to_temp):
        new_fname = remap.remap_fname(fname, context, orig_to_temp)
        if os.path.isfile(fname):
            if is_required_resource(context, parallel):
                logger.info((context, fname) % "YES: %s: %s")
                utils.safe_makedir(os.path.dirname(new_fname))
                for ext in ["", ".idx", ".gbi", ".tbi", ".bai"]:
                    if os.path.exists(fname + ext):
                        if not os.path.exists(new_fname + ext):
                            shutil.copyfile(fname + ext, new_fname + ext)
            else:
                logger.info("NO: %s: %s" % (context, fname))
        elif os.path.isdir(fname):
            utils.safe_makedir(new_fname)
        return new_fname
    return _do
dataset/ETHPy150Open chapmanb/bcbio-nextgen-vm/bcbiovm/ship/reconstitute.py/_remap_copy_file/swapped operands of `%`