def dict_islice(Dict, *keys):
  """Returns a shallow copy of the subset of a given dict (or an otherwise
  hashable object) with a given set of keys.
  The return object is a dict.
  This is similar to dict_slice, except that missing keys in
  Dict will be ignored.
  """
  # This is fancy but we require Dict to have keys() function:
  #return dict([ (k, Dict[k]) for k in (set(keys) & set(Dict.keys())) ])
  # use this one instead, which is milder requirement:
  return dict([ (k, Dict[k]) for k in keys if (k in Dict) ])