<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def readfmt(stream, fmt):
 """Read and unpack an object from stream, using a struct format string."""

    size = struct.calcsize(fmt)
    blob = stream.read(size)
    return struct.unpack(fmt, blob)