docstr: Split reference and test data into two splits -- one of which to learn test locations
  and parameters and one to use for tests.
  
  Parameters
  ----------
  x_ref
      Data used as reference distribution.
  x
      Batch of instances.
  
  Returns
  -------
  Tuple containing split train data and tuple containing split test data.
docstr_tok: ["Split","reference","and","test","data","into","two","splits","--","one","of","which","to","learn","test","locations","and","parameters","and","one","to","use","for","tests",".","Parameters","--","--","--","--","--","x_ref","Data","used","as","reference","distribution",".","x","Batch","of","instances",".","Returns","--","--","--","-","Tuple","containing","split","train","data","and","tuple","containing","split","test","data","."]
code: def get_splits(
      self, x_ref: Union[np.ndarray, list], x: Union[np.ndarray, list]
  ) -> Tuple[
      Tuple[Union[np.ndarray, list], Union[np.ndarray, list]],
      Tuple[Union[np.ndarray, list], Union[np.ndarray, list]],
  ]:
      """
      Split reference and test data into two splits -- one of which to learn test locations
      and parameters and one to use for tests.
  
      Parameters
      ----------
      x_ref
          Data used as reference distribution.
      x
          Batch of instances.
  
      Returns
      -------
      Tuple containing split train data and tuple containing split test data.
      """
      n_ref, n_cur = len(x_ref), len(x)
      perm_ref, perm_cur = np.random.permutation(
          n_ref
      ), np.random.permutation(n_cur)
      idx_ref_tr, idx_ref_te = (
          perm_ref[: int(n_ref * self.train_size)],
          perm_ref[int(n_ref * self.train_size) :],
      )
      idx_cur_tr, idx_cur_te = (
          perm_cur[: int(n_cur * self.train_size)],
          perm_cur[int(n_cur * self.train_size) :],
      )
  
      if isinstance(x_ref, np.ndarray):
          x_ref_tr, x_ref_te = x_ref[idx_ref_tr], x_ref[idx_ref_te]
          x_cur_tr, x_cur_te = x[idx_cur_tr], x[idx_cur_te]
      elif isinstance(x, list):
          x_ref_tr, x_ref_te = [x_ref[_] for _ in idx_ref_tr], [
              x_ref[_] for _ in idx_ref_te
          ]
          x_cur_tr, x_cur_te = [x[_] for _ in idx_cur_tr], [
              x[_] for _ in idx_cur_te
          ]
      else:
          raise TypeError(
              f"x needs to be of type np.ndarray or list and not {type(x)}."
          )
  
      return (x_ref_tr, x_cur_tr), (x_ref_te, x_cur_te)
  
imports: import logging
  from abc import abstractmethod
  from typing import Callable, Dict, List, Optional, Tuple, Union, Any
  import numpy
  from alibi_detect.base import BaseDetector, concept_drift_dict, DriftConfigMixin
  from alibi_detect.cd.utils import get_input_shape, update_reference
  from alibi_detect.utils.frameworks import has_pytorch, has_tensorflow
  from alibi_detect.utils.statstest import fdr
  from scipy.stats import binom_test, ks_2samp
  from sklearn.model_selection import StratifiedKFold
label_desc: Use image node_id 3 for calling the BaseLearnedKernelDrift obj's underlying member method code with example usage: obj.get_splits(x_ref, x) and returns: x_ref_tr,  x_cur_tr,  x_ref_te,  x_cur_te