def dict_subset(d, keys):
 n = dict()
 for key in keys:
  if (key in d):
   n[key] = d[key]
 return n

def dict_subset ( d , keys ) : n = dict ( ) for key in keys : if ( key in d ) : n [ key ] = d [ key ] return n
return a new dictionary that is built from copying select keys from d .