def fill_settings(sections, acquire_settings, log_printer):
 local_bears = {}
 global_bears = {}
 for (section_name, section) in sections.items():
  bear_dirs = section.bear_dirs()
  bears = list(section.get('bears', ''))
  (section_local_bears, section_global_bears) = collect_bears(bear_dirs, bears, [BEAR_KIND.LOCAL, BEAR_KIND.GLOBAL], log_printer)
  section_local_bears = Dependencies.resolve(section_local_bears)
  section_global_bears = Dependencies.resolve(section_global_bears)
  all_bears = copy.deepcopy(section_local_bears)
  all_bears.extend(section_global_bears)
  fill_section(section, acquire_settings, log_printer, all_bears)
  local_bears[section_name] = section_local_bears
  global_bears[section_name] = section_global_bears
 return (local_bears, global_bears)

def fill_settings ( sections , acquire_settings , log_printer ) : local_bears = { } global_bears = { } for ( section_name , section ) in sections . items ( ) : bear_dirs = section . bear_dirs ( ) bears = list ( section . get ( 'bears' , '' ) ) ( section_local_bears , section_global_bears ) = collect_bears ( bear_dirs , bears , [ BEAR_KIND . LOCAL , BEAR_KIND . GLOBAL ] , log_printer ) section_local_bears = Dependencies . resolve ( section_local_bears ) section_global_bears = Dependencies . resolve ( section_global_bears ) all_bears = copy . deepcopy ( section_local_bears ) all_bears . extend ( section_global_bears ) fill_section ( section , acquire_settings , log_printer , all_bears ) local_bears [ section_name ] = section_local_bears global_bears [ section_name ] = section_global_bears return ( local_bears , global_bears )
retrieves all bears and requests missing settings via the given acquire_settings method .