code: def test_matrix_types():
      mattypes = (
          sp.coo_matrix,
          sp.lil_matrix,
          sp.csr_matrix,
          sp.csc_matrix,
      )
  
      dtypes = (np.int32, np.int64, np.float32, np.float64)
  
      no_users, no_items = (10, 100)
      no_features = 20
  
      for mattype in mattypes:
          for dtype in dtypes:
              train = mattype((no_users, no_items), dtype=dtype)
              weights = train.tocoo()
  
              user_features = mattype(
                  (no_users, no_features), dtype=dtype
              )
              item_features = mattype(
                  (no_items, no_features), dtype=dtype
              )
  
              model = LightFM()
              model.fit_partial(
                  train,
                  sample_weight=weights,
                  user_features=user_features,
                  item_features=item_features,
              )
  
              model.predict(
                  np.random.randint(0, no_users, 10).astype(np.int32),
                  np.random.randint(0, no_items, 10).astype(np.int32),
                  user_features=user_features,
                  item_features=item_features,
              )
  
              model.predict_rank(
                  train,
                  user_features=user_features,
                  item_features=item_features,
              )
  
imports: import numpy
  import pytest
  import scipy.sparse
  from lightfm.lightfm import LightFM
label_desc: Use image node_id 2 for calling a global function with example usage: test_matrix_types() without return types