def bytes2str(bs):
 if (isinstance(bs, type('')) and (PY_MAJOR_VERSION > 2)):
  return bs.decode('latin1')
 else:
  return bs

def bytes2str ( bs ) : if ( isinstance ( bs , type ( '' ) ) and ( PY_MAJOR_VERSION > 2 ) ) : return bs . decode ( 'latin1' ) else : return bs
for cross compatibility between python 2 and python 3 strings .