code: def test_danmf():
      """
      Test the DANMF procedure.
      """
      graph = nx.newman_watts_strogatz_graph(100, 5, 0.3)
  
      model = DANMF()
  
      model.fit(graph)
      memberships = model.get_memberships()
  
      indices = [k for k, v in memberships.items()].sort()
      nodes = [node for node in graph.nodes()].sort()
  
      assert graph.number_of_nodes() == len(memberships)
      assert indices == nodes
      assert type(memberships) == dict
  
      embedding = model.get_embedding()
  
      assert embedding.shape[0] == graph.number_of_nodes()
      assert embedding.shape[1] == 2 * model.layers[-1]
      assert type(embedding) == np.ndarray
  
      graph = nx.newman_watts_strogatz_graph(200, 5, 0.3)
  
      model = DANMF()
  
      model.fit(graph)
      memberships = model.get_memberships()
  
      indices = [k for k, v in memberships.items()].sort()
      nodes = [node for node in graph.nodes()].sort()
  
      assert graph.number_of_nodes() == len(memberships)
      assert indices == nodes
      assert type(memberships) == dict
  
      embedding = model.get_embedding()
  
      assert embedding.shape[0] == graph.number_of_nodes()
      assert embedding.shape[1] == 2 * model.layers[-1]
      assert type(embedding) == np.ndarray
  
file_path: karateclub/test/community_detection_overlapping_test.py
imports: import numpy
  import networkx
  from karateclub.community_detection.overlapping import EgoNetSplitter, NNSED, DANMF, MNMF, BigClam, SymmNMF
label_desc: Use image node_id 3 for calling a global function with example usage: test_danmf() without return types