def selectCharacterSet(self, charSet, which):
        # XXX Rewrite these as dict lookups
        if which == G0:
            which = '('
        elif which == G1:
            which = ')'
        else:
            raise ValueError("`which' argument to selectCharacterSet must be G0 or G1")
        if charSet == CS_UK:
            charSet = 'A'
        elif charSet == CS_US:
            charSet = 'B'
        elif charSet == CS_DRAWING:
            charSet = '0'
        elif charSet == CS_ALTERNATE:
            charSet = '1'
        elif charSet == CS_ALTERNATE_SPECIAL:
            charSet = '2'
        else:
            raise ValueError("Invalid `charSet' argument to selectCharacterSet")
        self.write('\x1b' + which + charSet)
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/conch/insults/insults.py/ServerProtocol.selectCharacterSet/original