code: def calc(cur_state, n_body):
      next_state = np.zeros((n_body, fea_num), dtype=float)
      f_mat = np.zeros((n_body, n_body, 2), dtype=float)
      f_sum = np.zeros((n_body, 2), dtype=float)
      acc = np.zeros((n_body, 2), dtype=float)
      for i in range(n_body):
          for j in range(i + 1, n_body):
              if j != i:
                  f = get_f(cur_state[i][:3], cur_state[j][:3])
                  f_mat[i, j] += f
                  f_mat[j, i] -= f
          f_sum[i] = np.sum(f_mat[i], axis=0)
          acc[i] = f_sum[i] / cur_state[i][0]
          next_state[i][0] = cur_state[i][0]
          next_state[i][3:5] = cur_state[i][3:5] + acc[i] * diff_t
          next_state[i][1:3] = (
              cur_state[i][1:3] + next_state[i][3:5] * diff_t
          )
      return next_state
  
file_path: dgl/examples/pytorch/graphsim/n_body_sim.py
imports: from __future__ import absolute_import, division, print_function
  import argparse
  import os
  from math import cos, pi, radians, sin
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: calc(cur_state, n_body) and returns: next_state