code: def expandRecs(G, RecCollect, nodeType, weighted):
      for Rec in RecCollect:
          fullCiteList = [makeID(c, nodeType) for c in Rec.createCitation(multiCite = True)]
          if len(fullCiteList) > 1:
              for i, citeID1 in enumerate(fullCiteList):
                  if citeID1 in G:
                      for citeID2 in fullCiteList[i + 1:]:
                          if citeID2 not in G:
                              G.add_node(citeID2, **G.node[citeID1])
                              if weighted:
                                  G.add_edge(citeID1, citeID2, weight = 1)
                              else:
                                  G.add_edge(citeID1, citeID2)
                          elif weighted:
                              try:
                                  G.edges[citeID1, citeID2]['weight'] += 1
                              except KeyError:
                                  G.add_edge(citeID1, citeID2, weight = 1)
                          for e1, e2, data in G.edges(citeID1, data = True):
                              G.add_edge(citeID2, e2, **data)