code: def recv(stream):
      
      header = stream.read(4)
      if len(header) != 4:
          return None # EOF
      (length,) = struct.unpack('!I', header)
      payload = stream.read(length)
      if len(payload) != length:
          return None
      term = erlang.binary_to_term(payload)
      return term
docs: Read an Erlang term from an input stream.