code: def _finalize_cwl_in(data, work_dir, passed_keys, output_cwl_keys, runtime):
      
      data["dirs"] = {"work": work_dir}
      if not tz.get_in(["config", "algorithm"], data):
          if "config" not in data:
              data["config"] = {}
          data["config"]["algorithm"] = {}
      if "rgnames" not in data and "description" in data:
          data["rgnames"] = {"sample": data["description"]}
      data["cwl_keys"] = passed_keys
      data["output_cwl_keys"] = output_cwl_keys
      data = _add_resources(data, runtime)
      data = cwlutils.normalize_missing(data)
      data = run_info.normalize_world(data)
      return data
docs: Finalize data object with inputs from CWL.