def prep_workdir(pack, parallel, args):
    """Unpack necessary files and directories into a temporary structure for processing
    """
    if pack["type"] == "shared":
        workdir, remap_dict, new_args = _create_workdir_shared(pack["workdir"], args, parallel, pack["tmpdir"])
        return workdir, new_args, _shared_finalizer(new_args, workdir, remap_dict, parallel)
    elif pack["type"] == "S3":
        workdir, new_args = _unpack_s3(pack["buckets"]["run"], args)
        datai, data = config_utils.get_dataarg(new_args)
        if "dirs" not in data:
            data["dirs"] = {}
        data["dirs"]["work"] = workdir
        new_args[datai] = data
        return workdir, new_args, ship_n_pack.send_run_integrated(pack)
    else:
        raise ValueError(pack % "Cannot handle work directory preparation type: %s")
dataset/ETHPy150Open chapmanb/bcbio-nextgen-vm/bcbiovm/ship/reconstitute.py/prep_workdir/swapped operands of `%`