Edward J. Schwartz commited on
Commit ·
12b7aae
1
Parent(s): 5b87f77
Try again to fix new splits
Browse files132 unmodified lines1331341351361371381391 unmodified line141142143144145146147148149150151152153154155156132 unmodified lines# A function (name) is a library function if it appears in more than one Exename# this is (('func', 'oo.exe'): 123)testcount = set(zip(ds['Name'], list(zip(ds['Binary'], ds['Exename']))))# sorted pairs by function nametestcount = sorted(testcount, key=lambda x: x[0])1 unmodified line# group by function namegrouped = itertools.groupby(testcount, lambda t: t[0])grouped = {k: [b for _,b in g] for k, g in grouped}library_func_names = {f for f, exes in grouped.items() if len(exes) > 1}# Exename# vlibrary_func_names_dedup = {(f, exes[0][1]) for f, exes in grouped.items() if len(exes) > 1}# Binary# vlibrary_func_names_dedup_all = {(f, exes[0][0]) for f, exes in grouped.items() if len(exes) > 1}nonlibrary_func_names = {f for f, exes in grouped.items() if len(exes) == 1}train_filter_fun = Noneif self.config.name == "bylibrary":132 unmodified lines1331341351361371381391 unmodified line141142143144145146147148149150151152153154155156157158159160161162132 unmodified lines# A function (name) is a library function if it appears in more than one Exename# this is (('func', 'oo.exe'): 123)testcount = set(zip(ds['Name'], zip(ds['Binary'], ds['Exename'])))# sorted pairs by function nametestcount = sorted(testcount, key=lambda x: x[0])1 unmodified line# group by function namegrouped = itertools.groupby(testcount, lambda t: t[0])# Move the function name to the keygrouped = {k: [b for _,b in g] for k, g in grouped}print("WHAT")#print(grouped)def appears_in_single_exe(tuples):return len({x[1] for x in tuples}) == 1library_func_names = {f for f, exes in grouped.items() if not appears_in_single_exe(exes)}# Exename# vlibrary_func_names_dedup = {(f, exes[0][1]) for f, exes in grouped.items() if not appears_in_single_exe(exes)}# Binary# vlibrary_func_names_dedup_all = {(f, exes[0][0]) for f, exes in grouped.items() if not appears_in_single_exe(exes)}nonlibrary_func_names = {f for f, exes in grouped.items() if appears_in_single_exe(exes)}train_filter_fun = Noneif self.config.name == "bylibrary":
oo-method-test-split.py+11-5