code: def get_and_pop_keys(dct: Dict, keys: List) -> Dict:
      """Get and pop keys from a dictionary
  
      Examples
      --------
      >>> get_and_pop_keys({'a': 1, 'b': 2}, ['a'])
      {'a': 1}
  
      Parameters
      ----------
      dct: dict
          Dictionary to pop from
      keys: list
          Keys to pop
  
      Returns
      -------
      dict
          Dictionary containing the popped keys
  
      """
      res = {}
      for k in keys:
          res[k] = dct.pop(k)
      return res
  
file_path: deepchem/deepchem/utils/differentiation_utils/misc.py
imports: import contextlib
  import copy
  from typing import Mapping, Callable, Union, Dict, List
label_desc: Use image node_id 2 for calling a global function with example usage: get_and_pop_keys(dct, keys) and returns: res