def extract_key_values(key, d):
 if (key in d):
  (yield d[key])
 for k in d:
  if isinstance(d[k], dict):
   for j in extract_key_values(key, d[k]):
    (yield j)

def extract_key_values ( key , d ) : if ( key in d ) : ( yield d [ key ] ) for k in d : if isinstance ( d [ k ] , dict ) : for j in extract_key_values ( key , d [ k ] ) : ( yield j )
extracts all values that match a key .