def close(self, control_flow, simulation_cfg, skip_mcs_cfg=False):
    # First, insert a WaitTime, in case there was a controller crash
    self.log_input_event(WaitTime(1.0, time=self.last_time))
    # Flush the json input log
    self.output.close()

    # Write the config files
    path_templates = [(self.replay_cfg_path, replay_config_template),
                      (self.interactive_replay_cfg_path, interactive_replay_config_template),
                      (self.openflow_replay_cfg_path, openflow_replay_config_template)]
    if not skip_mcs_cfg:
      path_templates.append((self.mcs_cfg_path, mcs_config_template))

    wait_on_deterministic_values = False
    if hasattr(control_flow.sync_callback, "record_deterministic_values"):
      wait_on_deterministic_values = control_flow.sync_callback.record_deterministic_values

    delay_flow_mods = False
    if hasattr(control_flow, "delay_flow_mods"):
      delay_flow_mods = control_flow.delay_flow_mods

    bug_signature = ""
    if hasattr(control_flow, "bug_signature"):
      bug_signature = control_flow.bug_signature

    for path, template in path_templates:
      with open(path, 'w') as cfg_out:
        config_string = template % (str(simulation_cfg),
                                    self.output_path,
                                    str(wait_on_deterministic_values),
                                    str(delay_flow_mods),
                                    "'%s'" % str(control_flow.invariant_check_name),
                                    '"%s"' % str(bug_signature))
        cfg_out.write(config_string)
dataset/ETHPy150Open ucb-sts/sts/sts/input_traces/input_logger.py/InputLogger.close/original