def dict_lookup(dict_, keys, default=None):
    'Looks up :attr:`keys` in the dict, returns the corresponding values.\n\n    The :attr:`default` is used for keys not present in the dict.\n\n    Args:\n        dict_ (dict): A dictionary for lookup.\n        keys: A numpy array or a (possibly nested) list of keys.\n        default (optional): Value to be returned when a key is not in\n            :attr:`dict_`. Error is raised if :attr:`default` is not given and\n            key is not in the dict.\n\n    Returns:\n        A numpy array of values with the same structure as :attr:`keys`.\n\n    Raises:\n        TypeError: If key is not in :attr:`dict_` and :attr:`default` is `None`.\n    '
    return np.vectorize((lambda x: dict_.get(x, default)))(keys)
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`.
def dict_lookup(dict_, keys, default=None):
    'Looks up :attr:`keys` in the dict, returns the corresponding values.\n\n    The :attr:`default` is used for keys not present in the dict.\n\n    Args:\n        dict_ (dict): A dictionary for lookup.\n        keys: A numpy array or a (possibly nested) list of keys.\n        default (optional): Value to be returned when a key is not in\n            :attr:`dict_`. Error is raised if :attr:`default` is not given and\n            key is not in the dict.\n\n    Returns:\n        A numpy array of values with the same structure as :attr:`keys`.\n\n    Raises:\n        TypeError: If key is not in :attr:`dict_` and :attr:`default` is `None`.\n    '
    return np.vectorize((lambda x: dict_.get(x, default)))(keys)