def entry_from_named_pair(register_pairs, key):
 results = register_pairs.get('results')
 if (results is None):
  raise RuntimeError("The dict argument does not have a 'results' entry. Must not have been created using 'register' in a loop")
 for result in results:
  item = result.get('item')
  if (item is not None):
   name = item.get('name')
   if (name == key):
    return result['content']
 raise RuntimeError('There was no entry found in the dict that had an item with a name that matched {}'.format(key))

def entry_from_named_pair ( register_pairs , key ) : results = register_pairs . get ( 'results' ) if ( results is None ) : raise RuntimeError ( "The dict argument does not have a 'results' entry. Must not have been created using 'register' in a loop" ) for result in results : item = result . get ( 'item' ) if ( item is not None ) : name = item . get ( 'name' ) if ( name == key ) : return result [ 'content' ] raise RuntimeError ( 'There was no entry found in the dict that had an item with a name that matched {}' . format ( key ) )
returns the entry in key given results provided by register_pairs .