code: def clean_sample_data(samples):
      
      out = []
      for data in (utils.to_single_data(x) for x in samples):
          if "dirs" in data:
              data["dirs"] = {"work": data["dirs"]["work"], "galaxy": data["dirs"]["galaxy"],
                              "fastq": data["dirs"].get("fastq")}
          data["config"] = {"algorithm": data["config"]["algorithm"],
                            "resources": data["config"]["resources"]}
          for remove_attr in ["config_file", "algorithm"]:
              data.pop(remove_attr, None)
          out.append([data])
      return out
docs: Clean unnecessary information from sample data, reducing size for message passing.