code: def _raise_error_if_not_sarray(dataset, variable_name="SArray"):
      
      err_msg = "Input %s is not an SArray."
      if not isinstance(dataset, _SArray):
        raise ToolkitError(err_msg % variable_name)
docs: Check if the input is an SArray. Provide a proper error
      message otherwise.