Get a sub-set of a Python dictionary,dict([i for i in iter(d.items()) if i[0] in validkeys])