code: def dict_lookup(dict_, keys, default=None):
      """Looks up :attr:`keys` in the dict, returns the corresponding values.
  
      The :attr:`default` is used for keys not present in the dict.
  
      Args:
          dict_ (dict): A dictionary for lookup.
          keys: A numpy array or a (possibly nested) list of keys.
          default (optional): Value to be returned when a key is not in
              :attr:`dict_`. Error is raised if :attr:`default` is not given and
              key is not in the dict.
  
      Returns:
          A numpy array of values with the same structure as :attr:`keys`.
  
      Raises:
          TypeError: If key is not in :attr:`dict_` and :attr:`default` is `None`.
      """
      return np.vectorize(lambda x: dict_.get(x, default))(keys)
  
imports: from typing import List, Union
  import inspect
  import funcsigs
  from pydoc import locate
  import copy
  import collections
  import numpy
  import tensorflow
  from texar.tf.hyperparams import HParams
  from texar.tf.utils.dtypes import is_str, is_callable, compat_as_text, _maybe_list_to_array
label_desc: Use image node_id 15 for calling a global function with example usage: dict_lookup(dict_, keys, default) and returns: np