def splits(
        cls,
        train_pct: float,
        operator: str,
        operand_length: Optional[int] = None,
        data_dir: str = DEFAULT_DATA_DIR,
    ):
        """
        Creates training and validation datasets

        :param train_pct: percentage of total equations used for training data
        :param operator: The arithmetic operator for this dataset e.g. '+', '-', '*', '/', 'sort'
        :param operand_length: for list based datasets the length of the lists
        :returns: (train_dataset, validation_dataset)
        """

        assert (0 < train_pct) and (train_pct < 100)

        ds_name = cls.get_dsname(operator, operand_length)
        eqs = cls.make_data(operator, operand_length)

        train_rows, _ = cls.calc_split_len(train_pct, len(eqs))

        train_ds = cls(ds_name, eqs[:train_rows], train=True, data_dir=data_dir)
        val_ds = cls(ds_name, eqs[train_rows:], train=False, data_dir=data_dir)

        return train_ds, val_ds

        Creates training and validation datasets

        :param train_pct: percentage of total equations used for training data
        :param operator: The arithmetic operator for this dataset e.g. '+', '-', '*', '/', 'sort'
        :param operand_length: for list based datasets the length of the lists
        :returns: (train_dataset, validation_dataset)
        
grok/data.py