def _get_fit_dataset(self, is_complex: bool, x, validation_data, test_data, polar, process_dataset):
    if (not process_dataset):
        return (x, validation_data, test_data)
    if isinstance(x, tf.data.Dataset):
        if (not is_complex):
            x_fit = x.map((lambda imag, label: transform_to_real_map_function(imag, label, mode=polar)))
        else:
            x_fit = x
    elif ((is_complex and tf.dtypes.as_dtype(x.dtype).is_complex) or ((not is_complex) and tf.dtypes.as_dtype(x.dtype).is_floating)):
        x_fit = x
    elif (is_complex and (not tf.dtypes.as_dtype(x.dtype).is_complex)):
        raise NotImplementedError(f'Cast real dataset to complex not yet implemented, please provide the dataset in complex form.')
    else:
        x_fit = transform_to_real(x, mode=polar)
    val_data_fit = self._transform_dataset(is_complex, validation_data, polar)
    test_data_fit = self._transform_dataset(is_complex, test_data, polar)
    return (x_fit, val_data_fit, test_data_fit)
def _get_fit_dataset(self, is_complex: bool, x, validation_data, test_data, polar, process_dataset):
    if (not process_dataset):
        return (x, validation_data, test_data)
    if isinstance(x, tf.data.Dataset):
        if (not is_complex):
            x_fit = x.map((lambda imag, label: transform_to_real_map_function(imag, label, mode=polar)))
        else:
            x_fit = x
    elif ((is_complex and tf.dtypes.as_dtype(x.dtype).is_complex) or ((not is_complex) and tf.dtypes.as_dtype(x.dtype).is_floating)):
        x_fit = x
    elif (is_complex and (not tf.dtypes.as_dtype(x.dtype).is_complex)):
        raise NotImplementedError(f'Cast real dataset to complex not yet implemented, please provide the dataset in complex form.')
    else:
        x_fit = transform_to_real(x, mode=polar)
    val_data_fit = self._transform_dataset(is_complex, validation_data, polar)
    test_data_fit = self._transform_dataset(is_complex, test_data, polar)
    return (x_fit, val_data_fit, test_data_fit)