code: def test_cg_nan(use_native):
      # test issue with CG code that was causing NaN values in output:
      # https://github.com/benfred/implicit/issues/19#issuecomment-283164905
      raw = [
          [
              0.0,
              2.0,
              1.5,
              1.33333333,
              1.25,
              1.2,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
          ],
          [
              0.0,
              0.0,
              2.0,
              1.5,
              1.33333333,
              1.25,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
          ],
          [
              0.0,
              0.0,
              0.0,
              2.0,
              1.5,
              1.33333333,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
          ],
          [0.0, 0.0, 0.0, 0.0, 2.0, 1.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
          [0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
          [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
          [
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              2.0,
              1.5,
              1.33333333,
              1.25,
              1.2,
          ],
          [
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              2.0,
              1.5,
              1.33333333,
              1.25,
          ],
          [
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              0.0,
              2.0,
              1.5,
              1.33333333,
          ],
          [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 1.5],
          [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0],
          [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
      ]
      counts = csr_matrix(raw, dtype=np.float64)
      model = AlternatingLeastSquares(
          factors=3,
          regularization=0.01,
          dtype=np.float64,
          use_native=use_native,
          use_cg=True,
          use_gpu=False,
          random_state=23,
      )
      model.fit(counts, show_progress=False)
      rows, cols = model.item_factors, model.user_factors
  
      assert not np.isnan(np.sum(cols))
      assert not np.isnan(np.sum(rows))
  
imports: import pickle
  import unittest
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from recommender_base_test import RecommenderBaseTestMixin, get_checker_board
  from scipy.sparse import coo_matrix, csr_matrix, random
  import implicit
  from implicit.als import AlternatingLeastSquares
  from implicit.gpu import HAS_CUDA
label_desc: Use image node_id 4 for calling a global function with example usage: test_cg_nan(use_native) without return types