nodes: 0, module; 1, function_definition; 2, function_name:subdict_by_keys; 3, parameters; 4, block; 5, identifier:dict_obj; 6, identifier:keys; 7, expression_statement; 8, return_statement; 9, comment:"""Returns a sub-dict composed solely of the given keys.
  
      Parameters
      ----------
      dict_obj : dict
          The dict to create a sub-dict from.
      keys : list of str
          The keys to keep in the sub-dict. Keys not present in the given dict
          will be ignored.
  
      Returns
      -------
      dict
          A sub-dict of the given dict composed solely of the given keys.
  
      Example:
      --------
      >>> dict_obj = {'a': 1, 'b': 2, 'c': 3, 'd': 4}
      >>> subdict = subdict_by_keys(dict_obj, ['b', 'd', 'e'])
      >>> print(sorted(subdict.items()))
      [('b', 2), ('d', 4)]
      """; 10, dictionary_comprehension; 11, pair; 12, for_in_clause; 13, identifier:k; 14, subscript; 15, identifier:k; 16, call; 17, identifier:dict_obj; 18, identifier:k; 19, attribute; 20, argument_list; 21, call; 22, identifier:intersection; 23, call; 24, identifier:set; 25, argument_list; 26, attribute; 27, argument_list; 28, identifier:keys; 29, identifier:dict_obj; 30, identifier:keys
code: def subdict_by_keys(dict_obj, keys):
      """Returns a sub-dict composed solely of the given keys.
  
      Parameters
      ----------
      dict_obj : dict
          The dict to create a sub-dict from.
      keys : list of str
          The keys to keep in the sub-dict. Keys not present in the given dict
          will be ignored.
  
      Returns
      -------
      dict
          A sub-dict of the given dict composed solely of the given keys.
  
      Example:
      --------
      >>> dict_obj = {'a': 1, 'b': 2, 'c': 3, 'd': 4}
      >>> subdict = subdict_by_keys(dict_obj, ['b', 'd', 'e'])
      >>> print(sorted(subdict.items()))
      [('b', 2), ('d', 4)]
      """
      return {k: dict_obj[k] for k in set(keys).intersection(dict_obj.keys())}