code: def test_seed(self, lab, seed):
      num_classes = 10
      means = [
          np.array(
              [np.random.uniform(high=10), np.random.uniform(high=10)]
          )
          for _ in range(num_classes)
      ]
      sigmas = [np.random.uniform(high=1) for _ in range(num_classes)]
      class_stats = list(zip(means, sigmas))
      num_samples = 2000
  
      def generate_data_iid():
          # This should be IID, resulting in a larger p-value
          samples = []
          labels = []
  
          for _ in range(num_samples):
              label = np.random.choice(num_classes)
              mean, sigma = class_stats[label]
              sample = np.random.normal(mean, sigma)
              samples.append(sample)
              labels.append(label)
          samples = np.array(samples)
          labels = np.array(labels)
          dataset = {"features": samples, "labels": labels}
          return dataset
  
      dataset = generate_data_iid()
      embeddings = dataset["features"]
  
      # Create new issue manager, ignore the lab assigned for this test
      if seed == "default":
          issue_manager = NonIIDIssueManager(
              datalab=lab,
              metric="euclidean",
              k=10,
          )
      else:
          issue_manager = NonIIDIssueManager(
              datalab=lab,
              metric="euclidean",
              k=10,
              seed=seed,
          )
      issue_manager.find_issues(features=embeddings)
      p_value = issue_manager.info["p-value"]
  
      # Run again with the same seed
      issue_manager.find_issues(features=embeddings)
      p_value2 = issue_manager.info["p-value"]
  
      assert p_value > 0.0
      if seed is not None or seed == "default":
          assert p_value == p_value2
      else:
          assert p_value != p_value2
  
      # using pred_probs
      # normalizing pred_probs (0 to 1)
      pred_probs = embeddings / (
          np.max(embeddings) - np.min(embeddings)
      )
      if seed == "default":
          issue_manager = NonIIDIssueManager(
              datalab=lab,
              metric="euclidean",
              k=10,
          )
      else:
          issue_manager = NonIIDIssueManager(
              datalab=lab,
              metric="euclidean",
              k=10,
              seed=seed,
          )
      issue_manager.find_issues(pred_probs=pred_probs)
      p_value = issue_manager.info["p-value"]
  
      # Run again with the same seed
      issue_manager.find_issues(pred_probs=pred_probs)
      p_value2 = issue_manager.info["p-value"]
  
      assert p_value > 0.0
      if seed is not None or seed == "default":
          assert p_value == p_value2
      else:
          assert p_value != p_value2
  
file_path: cleanlab/tests/datalab/issue_manager/test_noniid.py
imports: import numpy
  import pytest
  from cleanlab.datalab.internal.issue_manager.noniid import NonIIDIssueManager, simplified_kolmogorov_smirnov_test
label_desc: Use image node_id 11 for calling the TestNonIIDIssueManager obj's underlying member method code with example usage: obj.test_seed(lab, seed) and returns: dataset