parameters: (args)
docstring: Governs multiple runs in CTU mode or runs once in normal mode.
docstring_summary: Governs multiple runs in CTU mode or runs once in normal mode.
docstring_tokens: Governs multiple runs in CTU mode or runs once in normal mode .
function: def govern_analyzer_runs(args):
      """ Governs multiple runs in CTU mode or runs once in normal mode. """
  
      ctu_config = get_ctu_config_from_args(args)
      # If we do a CTU collect (1st phase) we remove all previous collection
      # data first.
      if ctu_config.collect:
          shutil.rmtree(ctu_config.dir, ignore_errors=True)
  
      # If the user asked for a collect (1st) and analyze (2nd) phase, we do an
      # all-in-one run where we deliberately remove collection data before and
      # also after the run. If the user asks only for a single phase data is
      # left so multiple analyze runs can use the same data gathered by a single
      # collection run.
      if ctu_config.collect and ctu_config.analyze:
          # CTU strings are coming from args.ctu_dir and extdef_map_cmd,
          # so we can leave it empty
          args.ctu_phases = CtuConfig(collect=True, analyze=False,
                                      dir='', extdef_map_cmd='')
          run_analyzer_parallel(args)
          merge_ctu_extdef_maps(ctu_config.dir)
          args.ctu_phases = CtuConfig(collect=False, analyze=True,
                                      dir='', extdef_map_cmd='')
          run_analyzer_parallel(args)
          shutil.rmtree(ctu_config.dir, ignore_errors=True)
      else:
          # Single runs (collect or analyze) are launched from here.
          run_analyzer_parallel(args)
          if ctu_config.collect:
              merge_ctu_extdef_maps(ctu_config.dir)
function_tokens: def govern_analyzer_runs ( args ) : ctu_config = get_ctu_config_from_args ( args ) # If we do a CTU collect (1st phase) we remove all previous collection # data first. if ctu_config . collect : shutil . rmtree ( ctu_config . dir , ignore_errors = True ) # If the user asked for a collect (1st) and analyze (2nd) phase, we do an # all-in-one run where we deliberately remove collection data before and # also after the run. If the user asks only for a single phase data is # left so multiple analyze runs can use the same data gathered by a single # collection run. if ctu_config . collect and ctu_config . analyze : # CTU strings are coming from args.ctu_dir and extdef_map_cmd, # so we can leave it empty args . ctu_phases = CtuConfig ( collect = True , analyze = False , dir = '' , extdef_map_cmd = '' ) run_analyzer_parallel ( args ) merge_ctu_extdef_maps ( ctu_config . dir ) args . ctu_phases = CtuConfig ( collect = False , analyze = True , dir = '' , extdef_map_cmd = '' ) run_analyzer_parallel ( args ) shutil . rmtree ( ctu_config . dir , ignore_errors = True ) else : # Single runs (collect or analyze) are launched from here. run_analyzer_parallel ( args ) if ctu_config . collect : merge_ctu_extdef_maps ( ctu_config . dir )