def appendPadding(str, blocksize=AES_blocksize, mode='CMS'):
  ''' Pad (append padding to) string for use with symmetric encryption algorithm
    Input: (string) str - String to be padded
           (int)    blocksize - block size of the encryption algorithm
           (string) mode - padding scheme one in (CMS, Bit, ZeroLen, Null, Space, Random)
    Return:(string) Padded string according to chosen padding mode
  '''
  if mode not in (0,'CMS'):     
    for k in MODES.keys():
        if k in mode:
            return globals()['append'+k[1]+'Padding'](str, blocksize) 
        else:
            return appendCMSPadding(str, blocksize)
  else:
      return appendCMSPadding(str, blocksize)
dataset/ETHPy150Open keenlabs/KeenClient-Python/keen/Padding.py/appendPadding/swapped operands of `in`