old_contents: import networkx as nx
  from itertools import combinations
  from pygraphc.clustering.ClusterDistance import ClusterDistance
  
  
  class CreateGraph:
      def __init__(self, events_unique, cosine_threshold):
          self.events_unique = events_unique
          self.g = nx.MultiGraph()
          self.edges_dict = {}
          self.edges_weight = []
          self.cosine_threshold = cosine_threshold
  
      def get_edges_dict(self):
          return self.edges_dict
  
      def get_edges_weight(self):
          return self.edges_weight
  
      def do_create(self):
          self.__create_nodes()
          self.__create_edges()
  
      def get_graph(self):
          return self.g
  
      def get_nodes_id(self):
          total_nodes = len(self.events_unique)
          nodes = [i for i in xrange(total_nodes)]
          return nodes
  
      def __create_nodes(self):
          self.g.add_nodes_from(self.events_unique)
  
      def __create_edges(self):
          edges_combinations = [eu[0] for eu in self.events_unique]
          edge_index = 0
          for ec in combinations(edges_combinations, 2):
              # get cosine similarity between two nodes
              tfidf1, tfidf2 = self.g.node[ec[0]]['tf-idf'], self.g.node[ec[1]]['tf-idf']
              length1, length2 = self.g.node[ec[0]]['length'], self.g.node[ec[1]]['length']
              cosine_similarity = ClusterDistance.get_cosine_similarity(tfidf1, tfidf2, length1, length2)
  
              # create edge
              if cosine_similarity > self.cosine_threshold:
                  self.g.add_edge(ec[0], ec[1], weight=cosine_similarity)
                  self.edges_weight.append((ec[0], ec[1], cosine_similarity))
                  self.edges_dict[(ec[0], ec[1])] = edge_index
                  edge_index += 1
new_contents: import networkx as nx
  from itertools import combinations
  from pygraphc.clustering.ClusterDistance import ClusterDistance
  
  
  class CreateGraph:
      def __init__(self, events_unique, cosine_threshold):
          self.events_unique = events_unique
          self.g = nx.MultiGraph()
          self.edges_dict = {}
          self.edges_weight = []
          self.cosine_threshold = cosine_threshold
  
      def get_edges_dict(self):
          return self.edges_dict
  
      def get_edges_weight(self):
          return self.edges_weight
  
      def do_create(self):
          self.__create_nodes()
          self.__create_edges()
  
      def get_graph(self):
          return self.g
  
      def get_nodes_id(self):
          total_nodes = len(self.events_unique)
          nodes = [i for i in xrange(total_nodes)]
          return nodes
  
      def __create_nodes(self):
          self.g.add_nodes_from(self.events_unique)
  
      def __create_edges(self):
          edges_combinations = [eu[0] for eu in self.events_unique]
          edge_index = 0
          for ec in combinations(edges_combinations, 2):
              # get cosine similarity between two nodes
              tfidf1, tfidf2 = self.g.node[ec[0]]['tf-idf'], self.g.node[ec[1]]['tf-idf']
              length1, length2 = self.g.node[ec[0]]['length'], self.g.node[ec[1]]['length']
              cosine_similarity = ClusterDistance.get_cosine_similarity(tfidf1, tfidf2, length1, length2)
  
              # create edge
              if cosine_similarity > self.cosine_threshold:
                  self.g.add_edge(ec[0], ec[1], weight=cosine_similarity)
                  self.edges_weight.append((ec[0], ec[1], cosine_similarity))
                  self.edges_dict[(ec[0], ec[1])] = edge_index
                  edge_index += 1
  
subject: Add blank line to the end of file