<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def recv_msg(sock):
 """Receives a method and message from the socket. This function blocks the current thread. """

    data = recv(sock, struct.calcsize(METHOD_STRUCT_FORMAT))
    method, = struct.unpack(METHOD_STRUCT_FORMAT, data)
    data = recv(sock, struct.calcsize(SIZE_STRUCT_FORMAT))
    size, = struct.unpack(SIZE_STRUCT_FORMAT, data)
    data = recv(sock, size)
    msg = pickle.loads(data)
    return method, msg