code: def _validate_test_and_control_groups(
      test_data: pd.DataFrame,
      group_column: str,
      control_group_name: str,
  ) -> str:
      """
      Checks whether `test_data` has data on exactly two different experiment groups: test and control. Also returns the
      name of the test group.
  
      Parameters
      ----------
      test_data : DataFrame
          A Pandas' DataFrame with `group_column` as a column.
  
      group_column : str
          The name of the column that tells whether rows belong to the test or control group.
  
      control_group_name : str
          The name of the control group.
  
      Returns
      ----------
      test_group_name: str
          The name of the test group.
      """
      unique_values = test_data[group_column].unique()
  
      if control_group_name not in unique_values:
          raise ValueError(
              "control group '{}' not found".format(control_group_name)
          )
  
      n_groups = len(unique_values)
      if n_groups != 2:
          raise RuntimeError(
              "Exactly 2 groups are required for delta evaluations. found {}".format(
                  n_groups
              )
          )
      return (
          unique_values[0]
          if control_group_name == unique_values[1]
          else unique_values[1]
      )
  
imports: import pandas
  from toolz import curry
  from fklearn.types import EvalReturnType, UncurriedEvalFnType
  from fklearn.validation.evaluators import r2_evaluator
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_test_and_control_groups(test_data, group_column, control_group_name) and returns: unknown