code: def test_value_error_missing_num_examples_with_joint(
      use_num_examples, use_labels, func
  ):
      dataset_name = "imdb"
      (
          pred_probs,
          labels,
      ) = _get_pred_probs_labels_from_labelerrors_datasets(dataset_name)
      joint = estimate_joint(labels=labels, pred_probs=pred_probs)
      if (
          use_num_examples is False and use_labels is False
      ):  # can't infer num_examples. Throw error!
          with pytest.raises(ValueError) as e:
              df = func(
                  labels=labels if use_labels else None,
                  joint=joint,
                  num_examples=len(labels)
                  if use_num_examples
                  else None,
              )
      else:  # at least one of use_num_examples and use_labels must be True. Can infer num_examples.
          # If this runs without error, the test passes.
          df = func(
              labels=labels if use_labels else None,
              joint=joint,
              num_examples=len(labels) if use_num_examples else None,
          )
  
file_path: cleanlab/tests/test_dataset.py
imports: import requests
  import pytest
  import hypothesis.extra.numpy
  import hypothesis.strategies
  import io
  import numpy
  from hypothesis import given, settings
  from cleanlab.dataset import health_summary, find_overlapping_classes, rank_classes_by_label_quality, overall_label_health_score
  from cleanlab.count import estimate_joint, num_label_issues, compute_confident_joint
label_desc: Use image node_id 5 for calling a global function with example usage: test_value_error_missing_num_examples_with_joint(use_num_examples, use_labels, func) without return types