def decode_string(data, encoding='hex'):
    '''
    Decode string

    :param data: string to decode
    :param encoding: encoding to use (default: 'hex')
    :return: decoded string
    '''
    if six.PY2:
        return data.decode(encoding)
    else:
        return codecs.decode(data.encode('ascii'), encoding)
def decode_string ( data , encoding = 'hex' ) : if six . PY2 : return data . decode ( encoding ) else : return codecs . decode ( data . encode ( 'ascii' ) , encoding )
Decode string

    :param data: string to decode
    :param encoding: encoding to use (default: 'hex')
    :return: decoded string