code: def extract(dictionary, keys):
      
      return dict((k, dictionary[k]) for k in keys if k in dictionary)
docs: Extract only the specified keys from a dict
  
      :param dictionary: source dictionary
      :param keys: list of keys to extract
      :return dict: extracted dictionary