code: def csi_wrap(self, value, capname, *args):
          
          if isinstance(value, str):
              value = value.encode('utf-8')
          return b''.join([
              self.csi(capname, *args),
              value,
              self.csi('sgr0'),
          ])
docs: Return a value wrapped in the selected CSI and does a reset.