code: def test_self_unions(n):
      elements = get_elements(n)
      dis = DisjointSet(elements)
  
      for x in elements:
          assert dis.connected(x, x)
          assert not dis.merge(x, x)
          assert dis.connected(x, x)
      assert dis.n_subsets == len(elements)
  
      assert elements == list(dis)
      roots = [dis[x] for x in elements]
      assert elements == roots
  
file_path: catboost/contrib/python/scipy/py3/scipy/cluster/tests/test_disjoint_set.py
imports: import pytest
  from pytest import raises
  import numpy
  from scipy.cluster.hierarchy import DisjointSet
  import string
label_desc: Use image node_id 9 for calling a global function with example usage: test_self_unions(n) without return types