<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_connection_state(self, conn_or_int_id):
 """Get a connection's state by either conn_id or internal_id This routine must only be called from the internal worker thread. Args: conn_or_int_id (int, string):
 The external integer connection id or and internal string connection id """


        key = conn_or_int_id
        if isinstance(key, str):
            table = self._int_connections
        elif isinstance(key, int):
            table = self._connections
        else:
            raise ArgumentError("You must supply either an int connection id or a string internal id to _get_connection_state", id=key)

        if key not in table:
            return self.Disconnected

        data = table[key]
        return data['state']