def setUp(self): self.test_gml_dir = os.path.join(test_s3shared_path, 'test_dataset', 'repositories') self.augmented_asts = [] for file in os.listdir(self.test_gml_dir): if file[-4:] == '.gml': gml = os.path.abspath(os.path.join(self.test_gml_dir, file)) self.augmented_asts.append(AugmentedAST.from_gml(gml, parent_types_of_variable_nodes))
def from_gml_files(cls, gml_files: List[str]): task = cls() task.origin_files = gml_files logger.info('Creating {} from gml files'.format(cls.__name__)) for gml_file in tqdm(gml_files): ast = AugmentedAST.from_gml(gml_file, task.parent_types_of_variable_nodes) task.add_AugmentedAST(ast) return task