code: def check_treatment_vector(treatment, control_name=None):
      n_unique_treatments = np.unique(treatment).shape[0]
      assert (
          n_unique_treatments > 1
      ), "Treatment vector must have at least two levels."
      if control_name is not None:
          assert (
              control_name in treatment
          ), "Control group level {} not found in treatment vector.".format(
              control_name
          )
  
file_path: causalml/causalml/inference/meta/utils.py
imports: import pandas
  import numpy
  from packaging import version
  from xgboost import __version__
label_desc: Use image node_id 2 for calling a global function with example usage: check_treatment_vector(treatment, control_name) without return types