code: def test_can_run():
      import numpy as np
      from brainiak.factoranalysis.htfa import HTFA
      from mpi4py import MPI
  
      comm = MPI.COMM_WORLD
      rank = comm.Get_rank()
      size = comm.Get_size()
  
      n_voxel = 100
      n_tr = 20
      K = 5
      max_global_iter = 3
      max_local_iter = 3
      max_voxel = n_voxel
      max_tr = n_tr
      R = []
      n_subj = 2
      for s in np.arange(n_subj):
          R.append(np.random.randint(2, high=102, size=(n_voxel, 3)))
      my_R = []
      for idx in np.arange(n_subj):
          if idx % size == rank:
              my_R.append(R[idx])
  
      htfa = HTFA(
          K,
          n_subj=n_subj,
          max_global_iter=max_global_iter,
          max_local_iter=max_local_iter,
          max_voxel=max_voxel,
          max_tr=max_tr,
          verbose=True,
      )
      assert htfa, "Invalid HTFA instance!"
  
      X = []
      for s in np.arange(n_subj):
          X.append(np.random.rand(n_voxel, n_tr))
      my_data = []
      for idx in np.arange(n_subj):
          if idx % size == rank:
              my_data.append(X[idx])
  
      if rank == 0:
          htfa.fit(my_data, R=my_R)
          assert True, "Root successfully running HTFA"
          assert (
              htfa.global_prior_.shape[0] == htfa.prior_bcast_size
          ), "Invalid result of HTFA! (wrong # element in global_prior)"
          assert (
              htfa.global_posterior_.shape[0] == htfa.prior_bcast_size
          ), "Invalid result of HTFA! (wrong # element in global_posterior)"
  
      else:
          htfa.fit(my_data, R=my_R)
          assert True, "worker successfully running HTFA"
          print(htfa.local_weights_.shape)
          assert (
              htfa.local_weights_.shape[0] == n_tr * K
          ), "Invalid result of HTFA! (wrong # element in local_weights)"
          assert (
              htfa.local_posterior_.shape[0] == htfa.prior_size
          ), "Invalid result of HTFA! (wrong # element in local_posterior)"
  
imports: import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_can_run() without return types