class_docstr: Tests for basics.py
class_docstr_tok: ["Tests","for","basics.py"]
docstr: Test that the rank returned by bf.rank() is correct.
docstr_tok: ["Test","that","the","rank","returned","by","bf.rank","(",")","is","correct","."]
code: def test_bluefog_rank(self):
      """Test that the rank returned by bf.rank() is correct."""
      true_rank, _ = mpi_env_rank_and_size()
      bf.init()
      rank = bf.rank()
      # print("Rank: ", true_rank, rank)
      assert true_rank == rank
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import inspect
  import os
  import warnings
  import unittest
  import numpy
  import networkx
  import pytest
  import torch
  from common import mpi_env_rank_and_size
  import bluefog.torch
  from bluefog.torch import ExponentialGraph, RingGraph, StarGraph, MeshGrid2DGraph, FullyConnectedGraph
  from bluefog.torch import IsTopologyEquivalent, InferDestinationFromSourceRanks, InferSourceFromDestinationRanks
label_desc: Use image node_id 2 for calling the BasicsTests obj's underlying member method code with example usage: obj.test_bluefog_rank() without return types