def convert_str(text):
 if six.PY2:
  return encodeutils.to_utf8(text)
 elif isinstance(text, bytes):
  return text.decode('utf-8')
 else:
  return text

def convert_str ( text ) : if six . PY2 : return encodeutils . to_utf8 ( text ) elif isinstance ( text , bytes ) : return text . decode ( 'utf-8' ) else : return text
convert to native string .