def _get_hdr_values(extns, key):
    """
    Helper function to get the all header values from a list of extensions.
    The return value is a dict keyed on the EXPID value.

    Parameters
    ----------
    extns : iterable of :any:`astrodata.Astrodata`
        AstroData extensions to be examined
    key : str
        The FITS header key to find in the list of extensions
    """

    return {x.hdr.get('EXPID'): x.hdr.get(key) for x in extns}