class_docstr: The ModelGraph represents the network that is being processed by hls4ml.
  
  Args:
      config (dict):  The configuration dictionary
      layer_list (list(dict)):  The list contains a dictionary for each input layer
      inputs (list, optional):  The inputs to the model. If None, determined from layer_list
      outputs (list, optional):  The outputs to the model. If None, determined from layer_list
docstr: Applies a flow (a collection of optimizers).
  
  Args:
      flow (str): The name of the flow to apply
      reapply (str, optional): Determines the action to take if the flow and its requirements have already been
          applied. Possible values are:
          - 'all': Apply the flow and all its requirements.
          - 'single': Apply only the given flow, but skip the already applied requirements.
          - 'none': Skip applying the flow.
          Defaults to 'single'.
docstr_tok: ["Applies","a","flow","(","a","collection","of","optimizers",")",".","Args",":","flow","(","str",")",":","The","name","of","the","flow","to","apply","reapply","(","str",",","optional",")",":","Determines","the","action","to","take","if","the","flow","and","its","requirements","have","already","been","applied",".","Possible","values","are",":","-","'all","'",":","Apply","the","flow","and","all","its","requirements",".","-","'single","'",":","Apply","only","the","given","flow",",","but","skip","the","already","applied","requirements",".","-","'none","'",":","Skip","applying","the","flow",".","Defaults","to","'single","'","."]
code: def apply_flow(self, flow, reapply="single"):
      """Applies a flow (a collection of optimizers).
  
      Args:
          flow (str): The name of the flow to apply
          reapply (str, optional): Determines the action to take if the flow and its requirements have already been
              applied. Possible values are:
              - 'all': Apply the flow and all its requirements.
              - 'single': Apply only the given flow, but skip the already applied requirements.
              - 'none': Skip applying the flow.
              Defaults to 'single'.
      """
  
      def all_applied_flows():
          applied_flows = {}
  
          for flow_group in self._applied_flows:
              applied_flows.update(
                  {flow: set() for flow in flow_group.keys()}
              )
  
          return applied_flows
  
      assert reapply in ["all", "single", "none"]
  
      if reapply == "all":
          applied_flows = {}
      elif reapply == "single":
          applied_flows = all_applied_flows()
          applied_flows.pop(flow, None)
      else:  # reapply == 'none'
          applied_flows = all_applied_flows()
          if flow in applied_flows:
              return
  
      self._applied_flows.append(applied_flows)
      self._apply_sub_flow(flow, applied_flows)
  
imports: import ctypes
  import os
  import platform
  from collections import OrderedDict
  import numpy
  import numpy.ctypeslib
  from hls4ml.backends import get_backend
  from hls4ml.model.flow import get_flow
  from hls4ml.model.layers import layer_map
  from hls4ml.model.optimizer import get_available_passes, optimize_model
label_desc: Use image node_id 4 for calling the ModelGraph obj's underlying member method code with example usage: obj.apply_flow(flow, reapply) and returns: applied_flows