class_docstr: Class used to compile steps. Should be instantiated once per compilation.
class_docstr_tok: ["Class","used","to","compile","steps",".","Should","be","instantiated","once","per","compilation","."]
docstr: Set the serialize_output_to_json to true in container arguments
  
  if the function step is data referenced by other steps
docstr_tok: ["Set","the","serialize_output_to_json","to","true","in","container","arguments","if","the","function","step","is","data","referenced","by","other","steps"]
code: def _set_serialize_output_to_json_flag(
      self, compiled_steps: List[CompiledStep]
  ):
      """Set the serialize_output_to_json to true in container arguments
  
      if the function step is data referenced by other steps
      """
      for step in compiled_steps:
          if isinstance(step, ConditionStep):
              self._set_serialize_output_to_json_flag(step.if_steps)
              self._set_serialize_output_to_json_flag(step.else_steps)
          elif step.name in self._steps_need_json_serialization:
              step_container_args = step._request_dict["Arguments"][
                  "AlgorithmSpecification"
              ]["ContainerArguments"]
              step_container_args.extend(
                  ["--serialize_output_to_json", "true"]
              )
  
imports: from __future__ import absolute_import
  import logging
  import secrets
  from typing import Sequence, Union, List
  from sagemaker.workflow.entities import RequestType
  from sagemaker.workflow.function_step import _FunctionStep
  from sagemaker.workflow.steps import Step, StepTypeEnum, PropertyFile
  from sagemaker.workflow.condition_step import ConditionStep
  from sagemaker.workflow.step_collections import StepCollection
  from sagemaker.workflow.step_outputs import get_step
  from sagemaker.workflow.pipeline_definition_config import PipelineDefinitionConfig
  from sagemaker.workflow.step_outputs import StepOutput
  from sagemaker.workflow.utilities import step_compilation_context_manager, get_config_hash, get_code_hash
  from sagemaker.utils import sagemaker_timestamp
label_desc: Use image node_id 8 for calling the StepsCompiler obj's underlying member method code with example usage: obj._set_serialize_output_to_json_flag(compiled_steps) without return types