def _DropCommonSuffixes(filename):
 for suffix in ('test.cc', 'regtest.cc', 'unittest.cc', 'inl.h', 'impl.h', 'internal.h'):
  if (filename.endswith(suffix) and (len(filename) > len(suffix)) and (filename[((- len(suffix)) - 1)] in ('-', '_'))):
   return filename[:((- len(suffix)) - 1)]
 return os.path.splitext(filename)[0]

def _DropCommonSuffixes ( filename ) : for suffix in ( 'test.cc' , 'regtest.cc' , 'unittest.cc' , 'inl.h' , 'impl.h' , 'internal.h' ) : if ( filename . endswith ( suffix ) and ( len ( filename ) > len ( suffix ) ) and ( filename [ ( ( - len ( suffix ) ) - 1 ) ] in ( '-' , '_' ) ) ) : return filename [ : ( ( - len ( suffix ) ) - 1 ) ] return os . path . splitext ( filename ) [ 0 ]
drops common suffixes like _test .