def stripascii(string):
 ord_ = (ord if (sys.version_info[0] < 3) else (lambda x: x))
 i = len(string)
 while i:
  i -= 1
  if (8 < ord_(string[i]) < 127):
   break
 else:
  i = (-1)
 return string[:(i + 1)]

def stripascii ( string ) : ord_ = ( ord if ( sys . version_info [ 0 ] < 3 ) else ( lambda x : x ) ) i = len ( string ) while i : i -= 1 if ( 8 < ord_ ( string [ i ] ) < 127 ) : break else : i = ( - 1 ) return string [ : ( i + 1 ) ]
return string truncated at last byte that is 7bit ascii .