human
Complete the below
def _ImageHeaderFactory(stream):

    ''''Return a |BaseImageHeader| subclass instance that knows how to parse the
    headers of the image in *stream*.'
    '''
 ... Give me a the Python program you requested?
assistant
#Here is the Python program you requested.
    from docx.image import SIGNATURES
    def read_32(stream):
        stream.seek(0)
        return stream.read(32)
    header = read_32(stream)
    for (cls, offset, signature_bytes) in SIGNATURES:
        end = (offset + len(signature_bytes))
        found_bytes = header[offset:end]
        if (found_bytes == signature_bytes):
            return cls.from_stream(stream)
    raise UnrecognizedImageError