code: def dict_take_pop(dict_, keys, *d):
      
      if len(d) == 0:
          return [dict_.pop(key) for key in keys]
      elif len(d) == 1:
          default = d[0]
          return [dict_.pop(key, default) for key in keys]
      else:
          raise ValueError('len(d) must be 1 or 0')
docs: like dict_take but pops values off
  
      CommandLine:
          python -m utool.util_dict --test-dict_take_pop
  
      Example1:
          >>> # ENABLE_DOCTEST
          >>> from utool.util_dict import *  # NOQA
          >>> import utool as ut
          >>> dict_ = {1: 'a', 'other': None, 'another': 'foo', 2: 'b', 3: 'c'}
          >>> keys = [1, 2, 3, 4, 5]
          >>> print('before: ' + ut.repr4(dict_))
          >>> result = list(dict_take_pop(dict_, keys, None))
          >>> result = ut.repr4(result, nl=False)
          >>> print('after: ' + ut.repr4(dict_))
          >>> assert len(dict_) == 2
          >>> print(result)
          ['a', 'b', 'c', None, None]
  
      Example2:
          >>> # ENABLE_DOCTEST
          >>> from utool.util_dict import *  # NOQA
          >>> import utool as ut
          >>> dict_ = {1: 'a', 2: 'b', 3: 'c'}
          >>> keys = [1, 2, 3, 4, 5]
          >>> print('before: ' + ut.repr4(dict_))
          >>> try:
          >>>     print(list(dict_take_pop(dict_, keys)))
          >>>     result = 'did not get key error'
          >>> except KeyError:
          >>>     result = 'correctly got key error'
          >>> assert len(dict_) == 0
          >>> print('after: ' + ut.repr4(dict_))
          >>> print(result)
          correctly got key error