def _ChunkFactory(chunk_type, stream_rdr, offset):
 chunk_cls_map = {PNG_CHUNK_TYPE.IHDR: _IHDRChunk, PNG_CHUNK_TYPE.pHYs: _pHYsChunk}
 chunk_cls = chunk_cls_map.get(chunk_type, _Chunk)
 return chunk_cls.from_offset(chunk_type, stream_rdr, offset)

def _ChunkFactory ( chunk_type , stream_rdr , offset ) : chunk_cls_map = { PNG_CHUNK_TYPE . IHDR : _IHDRChunk , PNG_CHUNK_TYPE . pHYs : _pHYsChunk } chunk_cls = chunk_cls_map . get ( chunk_type , _Chunk ) return chunk_cls . from_offset ( chunk_type , stream_rdr , offset )
return a |_chunk| subclass instance appropriate to *chunk_type* parsed from *stream_rdr* at *offset* .