code: def data_arg_check(
      train_data=None,
      val_data=None,
      train_required=False,
      val_required=False,
      ndarray_only=False,
  ):
      if train_required and train_data is None:
          raise ValueError("train_data is required")
      if val_required and val_data is None:
          raise ValueError("val_data is required")
      if train_data is not None and not is_iter(
          train_data, ndarray_only
      ):
          if bad_data_tuple(train_data):
              err_msg = "data must be tuple of numpy.ndarrays"
              if not ndarray_only:
                  err_msg += " or an instance of ktrain.Dataset"
              raise ValueError(err_msg)
      if val_data is not None and not is_iter(val_data, ndarray_only):
          if bad_data_tuple(val_data):
              err_msg = "data must be tuple of numpy.ndarrays or BERT-style tuple"
              if not ndarray_only:
                  err_msg += " or an instance of Iterator"
              raise ValueError(err_msg)
      return
  
imports: from .imports import *
  from subprocess import Popen
label_desc: Use image node_id 24 for calling a global function with example usage: data_arg_check(train_data, val_data, train_required, val_required, ndarray_only) without return types