code: def test_n_train_examples():
      cnn = CNN(
          epochs=4,
          log_interval=1000,
          loader="train",
          seed=1,
          dataset="sklearn-digits",
      )
      cnn.fit(
          train_idx=X_train_idx,
          train_labels=y_train,
          loader="train",
      )
      cnn.loader = "test"
      pred = cnn.predict(X_test_idx)
      print(accuracy_score(true_labels_test, pred))
      assert accuracy_score(true_labels_test, pred) > 0.1
  
      # Check that exception is raised when invalid name is given.
      cnn.loader = "INVALID"
      with pytest.raises(ValueError) as e:
          pred = cnn.predict(X_test_idx)
  
      # Check that pred_proba runs on all examples when None is passed in
      cnn.loader = "test"
      proba = cnn.predict_proba(idx=None, loader="test")
      assert proba is not None
      assert len(pred) == SKLEARN_DIGITS_TEST_SIZE
  
file_path: cleanlab/tests/test_model_pytorch_cnn.py
imports: from cleanlab.experimental.mnist_pytorch import CNN, SKLEARN_DIGITS_TEST_SIZE, SKLEARN_DIGITS_TRAIN_SIZE
  import cleanlab
  import numpy
  from sklearn.metrics import accuracy_score
  from sklearn.datasets import load_digits
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_n_train_examples() without return types