@classmethod<EOL><INDENT>def from_session(cls, session):<DEDENT>
session.error_wrapper = lambda e: NvimError(e[<NUM_LIT:1>])<EOL>channel_id, metadata = session.request(b'<STR_LIT>')<EOL>if IS_PYTHON3:<EOL><INDENT>metadata = walk(decode_if_bytes, metadata)<EOL><DEDENT>types = {<EOL>metadata['<STR_LIT>']['<STR_LIT>']['<STR_LIT:id>']: Buffer,<EOL>metadata['<STR_LIT>']['<STR_LIT>']['<STR_LIT:id>']: Window,<EOL>metadata['<STR_LIT>']['<STR_LIT>']['<STR_LIT:id>']: Tabpage,<EOL>}<EOL>return cls(session, channel_id, metadata, types)<EOL>
Create a new Nvim instance for a Session instance.

        This method must be called to create the first Nvim instance, since it
        queries Nvim metadata for type information and sets a SessionHook for
        creating specialized objects from Nvim remote handles.