code: def merge_nodes(self, n1: str, n2: str, same_polarity: bool = True):
          
  
          for p in self.predecessors(n1):
              for st in self[p][n1]["InfluenceStatements"]:
                  if not same_polarity:
                      st.obj_delta["polarity"] = -st.obj_delta["polarity"]
                  st.obj.db_refs["UN"][0] = (n2, st.obj.db_refs["UN"][0][1])
  
              if not self.has_edge(p, n2):
                  self.add_edge(p, n2)
                  self[p][n2]["InfluenceStatements"] = self[p][n1][
                      "InfluenceStatements"
                  ]
  
              else:
                  self[p][n2]["InfluenceStatements"] += self[p][n1][
                      "InfluenceStatements"
                  ]
  
          for s in self.successors(n1):
              for st in self.edges[n1, s]["InfluenceStatements"]:
                  if not same_polarity:
                      st.subj_delta["polarity"] = -st.subj_delta["polarity"]
                  st.subj.db_refs["UN"][0] = (n2, st.subj.db_refs["UN"][0][1])
  
              if not self.has_edge(n2, s):
                  self.add_edge(n2, s)
                  self[n2][s]["InfluenceStatements"] = self[n1][s][
                      "InfluenceStatements"
                  ]
              else:
                  self[n2][s]["InfluenceStatements"] += self[n1][s][
                      "InfluenceStatements"
                  ]
  
          self.remove_node(n1)
docs: Merge node n1 into node n2, with the option to specify relative
          polarity.
  
          Args:
              n1
              n2
              same_polarity