code: def test_plots_deprecated_collect_all(name, plot):
      ht = hl.balding_nichols_model(
          1, n_variants=100, n_samples=1
      ).rows()
      ht = ht.add_index("idx")
  
      with pytest.raises(ValueError):
          plot(ht.idx, collect_all=True)
  
      with pytest.raises(ValueError):
          plot(ht.idx, n_divisions=0)
  
      with patch("warnings.warn") as mock:
          plot(ht.idx, n_divisions=None)
          mock.assert_not_called()
  
      with patch("warnings.warn") as mock:
          plot(ht.idx, n_divisions=None, collect_all=True)
          mock.assert_called()
          assert name in mock.call_args_list[0][0][0]
  
file_path: hail/hail/python/test/hail/plot/test_plot.py
imports: import pytest
  from unittest.mock import patch
  import hail
label_desc: Use image node_id 12 for calling a global function with example usage: test_plots_deprecated_collect_all(name, plot) without return types