code: def build_patterns(fnames):
      
      patterns = []
      for fn in fnames:
          et = ET.parse(fn)
          res = et.findall('CC') + et.findall('EVENT')
          for event in res:
              G = networkx.DiGraph()
              build_event_graph(G, et, event)
              add_graph(patterns, G)
      patterns = sorted(patterns, key=lambda x: len(x[0]), reverse=True)
      return patterns
docs: Return a list of CC/EVENT graph patterns from a list of EKB files