def validation_split(val_feed_dicts, feed_dicts):
    """ validation_split.

    Handles validation split; build validation data based on a
    percentage of training data. It checks all val_feed_dicts keys
    values for a float, if found, it retrieves the exact same key in feed_dict
    and split its data according to `float` value and move it to val_feed_dict.

    Args:
        val_feed_dicts: `dict` of arrays or float. validation dictionary.
        feed_dicts: `dict` of arrays. training data dictionary.

    """
    if val_feed_dicts:
        for i, val_dict in enumerate(val_feed_dicts):
            for key, val in val_dict.items():
                if isinstance(val, float):
                    split = val
                    if type(feed_dicts[i][key]) in [list, np.ndarray]:
                        split_at = int(len(feed_dicts[i][key]) * (1 - split))
                        feed_dicts[i][key], val_feed_dicts[i][key] = \
                            (slice_array(feed_dicts[i][key], 0, split_at),
                             slice_array(feed_dicts[i][key], split_at))
                    else:
                        # If parameter is not an array, we duplicate value
                        val_feed_dicts[i][key] = feed_dicts[i][key]
dataset/ETHPy150Open tflearn/tflearn/tflearn/helpers/trainer.py/validation_split/original