code: def _get_edge_sign(im, edge):
      
      edge_data = im[edge[0]][edge[1]]
      # Handle possible multiple edges between nodes
      signs = list(set([v['sign'] for v in edge_data.values()
                                    if v.get('sign')]))
      if len(signs) > 1:
          logger.warning("Edge %s has conflicting polarities; choosing "
                         "positive polarity by default" % str(edge))
          sign = 1
      else:
          sign = signs[0]
      if sign is None:
          raise Exception('No sign attribute for edge.')
      elif abs(sign) == 1:
          return sign
      else:
          raise Exception('Unexpected edge sign: %s' % edge.attr['sign'])
docs: Get the polarity of the influence by examining the edge sign.