def maybe_decode()

in rocketmq/client.py [0:0]


def maybe_decode(val):
    if isinstance(val, binary_type):
        return val.decode('utf-8')
    elif isinstance(val, text_type):
        return val
    raise TypeError('Expects string types, but got %s', type(val))