def nativeString(s):
 if (not isinstance(s, (bytes, unicode))):
  raise TypeError(('%r is neither bytes nor unicode' % s))
 if _PY3:
  if isinstance(s, bytes):
   return s.decode('ascii')
  else:
   s.encode('ascii')
 elif isinstance(s, unicode):
  return s.encode('ascii')
 else:
  s.decode('ascii')
 return s

def nativeString ( s ) : if ( not isinstance ( s , ( bytes , unicode ) ) ) : raise TypeError ( ( '%r is neither bytes nor unicode' % s ) ) if _PY3 : if isinstance ( s , bytes ) : return s . decode ( 'ascii' ) else : s . encode ( 'ascii' ) elif isinstance ( s , unicode ) : return s . encode ( 'ascii' ) else : s . decode ( 'ascii' ) return s
convert c{bytes} or c{unicode} to the native c{str} type .