<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read(data, fmt_str):
 """ Reads input bytes and extract the given structure. Returns both the read elements and the remaining data :param data: Data as bytes :param fmt_str: Struct unpack format string :return: A tuple (results as tuple, remaining data) """

    size = struct.calcsize(fmt_str)
    return struct.unpack(fmt_str, data[:size]), data[size:]