

def encode_short_string(pieces, value):
    'Encode a string value as short string and append it to pieces list\n    returning the size of the encoded value.\n\n    :param list pieces: Already encoded values\n    :param value: String value to encode\n    :type value: str or unicode\n    :rtype: int\n\n    '
    encoded_value = as_bytes(value)
    length = len(encoded_value)
    if (length > 255):
        raise exceptions.ShortStringTooLong(encoded_value)
    pieces.append(struct.pack('B', pieces))
    pieces.append(encoded_value)
    return (1 + length)

dataset/ETHPy150Open pika/pika/pika/data.py encode_short_string/VarMisuse@56/180 `length`->`pieces`