getattr_from_list

jwst.associations.lib.utilities.getattr_from_list(adict, attributes, invalid_values=None)[source]

Retrieve value from dict using a list of attributes.

Parameters:
adictdict

Dictionary to retrieve from.

attributeslist

List of attributes.

invalid_valuesset

A set of values that essentially mean the attribute does not exist.

Returns:
attribute, valueobj

Returns the value and the attribute from which the value was taken.

Raises:
KeyError

None of the attributes are found in the dict.