code: def test_count_binary1s():
      from mahotas.features.lbp import count_binary1s
  
      assert np.all(
          count_binary1s(np.zeros((23, 23), np.uint8))
          == np.zeros((23, 23))
      )
  
      np.random.seed(3499)
      arr = np.random.randint(45, size=(23, 23))
      c = count_binary1s(arr)
      assert np.all((c == 0) == (arr == 0))
      assert c.shape == arr.shape
      assert np.all(c[arr == 5] == 2)
      assert np.all(c[arr == 7] == 3)
      assert np.all(c[arr == 8] == 1)
      assert np.all(c[arr == 32] == 1)
  
      assert np.all(count_binary1s([128]) == [1])
  
file_path: mahotas/mahotas/tests/test_lbp.py
imports: import numpy
  from mahotas.features import _lbp
  import mahotas.thresholding
  from mahotas.features import lbp
  from mahotas.features.lbp import lbp_transform, lbp_names
  from mahotas.tests.utils import luispedro_jpg
  import pytest
label_desc: Use image node_id 8 for calling a global function with example usage: test_count_binary1s() without return types