def execute_section(section, global_bear_list, local_bear_list, print_results, cache, log_printer, console_printer):
 try:
  running_processes = int(section['jobs'])
 except ValueError:
  log_printer.warn("Unable to convert setting 'jobs' into a number. Falling back to CPU count.")
  running_processes = get_cpu_count()
 except IndexError:
  running_processes = get_cpu_count()
 (processes, arg_dict) = instantiate_processes(section, local_bear_list, global_bear_list, running_processes, cache, log_printer, console_printer=console_printer)
 logger_thread = LogPrinterThread(arg_dict['message_queue'], log_printer)
 processes.append(logger_thread)
 for runner in processes:
  runner.start()
 try:
  return (process_queues(processes, arg_dict['control_queue'], arg_dict['local_result_dict'], arg_dict['global_result_dict'], arg_dict['file_dict'], print_results, section, cache, log_printer, console_printer=console_printer), arg_dict['local_result_dict'], arg_dict['global_result_dict'], arg_dict['file_dict'])
 finally:
  logger_thread.running = False
  for runner in processes:
   runner.join()

def execute_section ( section , global_bear_list , local_bear_list , print_results , cache , log_printer , console_printer ) : try : running_processes = int ( section [ 'jobs' ] ) except ValueError : log_printer . warn ( "Unable to convert setting 'jobs' into a number. Falling back to CPU count." ) running_processes = get_cpu_count ( ) except IndexError : running_processes = get_cpu_count ( ) ( processes , arg_dict ) = instantiate_processes ( section , local_bear_list , global_bear_list , running_processes , cache , log_printer , console_printer = console_printer ) logger_thread = LogPrinterThread ( arg_dict [ 'message_queue' ] , log_printer ) processes . append ( logger_thread ) for runner in processes : runner . start ( ) try : return ( process_queues ( processes , arg_dict [ 'control_queue' ] , arg_dict [ 'local_result_dict' ] , arg_dict [ 'global_result_dict' ] , arg_dict [ 'file_dict' ] , print_results , section , cache , log_printer , console_printer = console_printer ) , arg_dict [ 'local_result_dict' ] , arg_dict [ 'global_result_dict' ] , arg_dict [ 'file_dict' ] ) finally : logger_thread . running = False for runner in processes : runner . join ( )
executes the section with the given bears .