code: def test_force_atlas2(
      graph_file, score, max_iter, barnes_hut_optimize
  ):
      cu_M = graph_file.get_edgelist(download=True)
      test_callback = TestCallback()
      cu_pos = cugraph_call(
          cu_M,
          max_iter=max_iter,
          pos_list=None,
          outbound_attraction_distribution=True,
          lin_log_mode=False,
          prevent_overlapping=False,
          edge_weight_influence=1.0,
          jitter_tolerance=1.0,
          barnes_hut_optimize=False,
          barnes_hut_theta=0.5,
          scaling_ratio=2.0,
          strong_gravity_mode=False,
          gravity=1.0,
          callback=test_callback,
      )
      """
          Trustworthiness score can be used for Force Atlas 2 as the algorithm
          optimizes modularity. The final layout will result in
          different communities being drawn out. We consider here the n x n
          adjacency matrix of the graph as an embedding of the nodes in high
          dimension. The results of force atlas 2 corresponds to the layout in
          a 2d space. Here we check that nodes belonging to the same community
          or neighbors are close to each other in the final embedding.
          Thresholds are based on the best score that is achived after 500
          iterations on a given graph.
      """
  
      if "string" in graph_file.metadata["col_types"]:
          df = renumbered_edgelist(
              graph_file.get_edgelist(download=True)
          )
          M = get_coo_array(df)
      else:
          M = get_coo_array(graph_file.get_edgelist(download=True))
      cu_trust = trustworthiness(M, cu_pos[["x", "y"]].to_pandas())
      print(cu_trust, score)
      assert cu_trust > score
      # verify `on_preprocess_end` was only called once
      assert test_callback.on_preprocess_end_called_count == 1
      # verify `on_epoch_end` was called on each iteration
      assert test_callback.on_epoch_end_called_count == max_iter
      # verify `on_train_end` was only called once
      assert test_callback.on_train_end_called_count == 1
  
file_path: cugraph/python/cugraph/cugraph/tests/layout/test_force_atlas2.py
imports: import time
  import pytest
  import cugraph
  from cugraph.structure import number_map
  from cugraph.internals import GraphBasedDimRedCallback
  from sklearn.manifold import trustworthiness
  import scipy.io
  from cugraph.datasets import karate, polbooks, dolphins, netscience, dining_prefs
label_desc: Use image node_id 4 for calling a global function with example usage: test_force_atlas2(graph_file, score, max_iter, barnes_hut_optimize) without return types