class_docstr: NNCF is an neural network enhanced matrix factorization model which also captures neighborhood information.
  We implement the NNCF model with three ways to process neighborhood information.
docstr: Get neighborhood information using louvain algorithm.
  First, change the id of node,
  for example, the id of user node "1" will be set to "u_1" in order to use louvain algorithm.
  Second, use louvain algorithm to seperate nodes into different communities.
  Finally, find the community neighbors of each node with the same type and reset the id of the nodes.
  
  Returns:
      torch.IntTensor: The neighborhood nodes of a batch of user or item, shape: [batch_size, neigh_num]
docstr_tok: ["Get","neighborhood","information","using","louvain","algorithm",".","First",",","change","the","id","of","node",",","for","example",",","the","id","of","user","node","``","1","''","will","be","set","to","``","u_1","''","in","order","to","use","louvain","algorithm",".","Second",",","use","louvain","algorithm","to","seperate","nodes","into","different","communities",".","Finally",",","find","the","community","neighbors","of","each","node","with","the","same","type","and","reset","the","id","of","the","nodes",".","Returns",":","torch.IntTensor",":","The","neighborhood","nodes","of","a","batch","of","user","or","item",",","shape",":","[","batch_size",",","neigh_num","]"]
code: def get_neigh_louvain(self):
      r"""Get neighborhood information using louvain algorithm.
      First, change the id of node,
      for example, the id of user node "1" will be set to "u_1" in order to use louvain algorithm.
      Second, use louvain algorithm to seperate nodes into different communities.
      Finally, find the community neighbors of each node with the same type and reset the id of the nodes.
  
      Returns:
          torch.IntTensor: The neighborhood nodes of a batch of user or item, shape: [batch_size, neigh_num]
      """
      inter_M = self.interaction_matrix
      pairs = list(zip(inter_M.row, inter_M.col))
  
      tmp_relation = []
      for i in range(len(pairs)):
          tmp_relation.append(
              ["user_" + str(pairs[i][0]), "item_" + str(pairs[i][1])]
          )
  
      import networkx as nx
  
      G = nx.Graph()
      G.add_edges_from(tmp_relation)
      resolution = self.resolution
      import community
  
      partition = community.best_partition(G, resolution=resolution)
  
      community_dict = {}
      community_dict.setdefault(0, [])
      for i in range(len(partition.values())):
          community_dict[i] = []
      for node, part in partition.items():
          community_dict[part] = community_dict[part] + [node]
  
      tmp_user2item, tmp_item2user = self.prepare_vector_element(
          partition, tmp_relation, community_dict
      )
      u_neigh = self.Max_ner(tmp_user2item, self.neigh_num)
      i_neigh = self.Max_ner(tmp_item2user, self.neigh_num)
  
      u_neigh = torch.tensor(u_neigh, device=self.device)
      i_neigh = torch.tensor(i_neigh, device=self.device)
      return u_neigh, i_neigh
  
imports: import torch
  import torch.nn
  from torch.nn.init import normal_
  from recbole.model.abstract_recommender import GeneralRecommender
  from recbole.model.layers import MLPLayers
  from recbole.utils import InputType
  from recbole.model.general_recommender.itemknn import ComputeSimilarity
  import numpy
label_desc: Use image node_id 6 for calling the NNCF obj's underlying member method code with example usage: obj.get_neigh_louvain() and returns: u_neigh,  i_neigh