def get_used_images(images):
 config_file_path = pathlib2.Path(CONFIG_FILE_PATH)
 with config_file_path.open(mode='r') as file:
  try:
   config = yaml.load(file)
  except yaml.YAMLError as exc:
   LOGGER.error(('error in configuration file: %s' % str(exc)))
   sys.exit(1)
 weights = config.get('weights')
 weights_list = [x.items() for x in weights]
 weights_list = list(itertools.chain.from_iterable(weights_list))
 return [x for x in weights_list if (x[0] in images)]

def get_used_images ( images ) : config_file_path = pathlib2 . Path ( CONFIG_FILE_PATH ) with config_file_path . open ( mode = 'r' ) as file : try : config = yaml . load ( file ) except yaml . YAMLError as exc : LOGGER . error ( ( 'error in configuration file: %s' % str ( exc ) ) ) sys . exit ( 1 ) weights = config . get ( 'weights' ) weights_list = [ x . items ( ) for x in weights ] weights_list = list ( itertools . chain . from_iterable ( weights_list ) ) return [ x for x in weights_list if ( x [ 0 ] in images ) ]
returns the images and their ranks that are scheduled to be built and that exist in the configuration file .