def data_in(self, session, text="", **kwargs):
        """
        Called by portal sessions for relaying data coming
        in from the protocol to the server.

        Args:
            session (PortalSession): Session receiving data.

        Kwargs:
            text (str): Text from protocol.
            kwargs (any): Other data from protocol.

        Notes:
            Data is serialized before passed on.

        """
        #from evennia.server.profiling.timetrace import timetrace
        #text = timetrace(text, "portalsessionhandler.data_in")

        if session:
            now = time()
            if self.command_counter > _MAX_COMMAND_RATE:
                # data throttle (anti DoS measure)
                dT = now - self.command_counter_reset
                self.command_counter = 0
                self.command_counter_reset = now
                self.command_overflow = dT < 1.0
                if self.command_overflow:
                    reactor.callLater(1.0, self.data_in, None)
            if self.command_overflow:
                self.data_out(session, text=_ERROR_COMMAND_OVERFLOW)
                return
            # relay data to Server
            self.command_counter += 1
            session.cmd_last = now
            self.portal.amp_protocol.send_MsgPortal2Server(session,
                                                       text=text,
                                                       **kwargs)
        else:
           # called by the callLater callback
            if self.command_overflow:
                self.command_overflow = False
                reactor.callLater(1.0, self.data_in, None)
dataset/ETHPy150Open evennia/evennia/evennia/server/portal/portalsessionhandler.py/PortalSessionHandler.data_in/original