def METHOD_NAME(dataset, batch_size, kwargs, val_ratio=0.4, rand_split=True):
    dataset_size = len(dataset)
    indices = list(range(dataset_size))
    if rand_split: np.random.shuffle(indices)
    len_val = int(np.floor(val_ratio * dataset_size))
    train_indices, val_indices = indices[len_val:], indices[:len_val]
    train_sampler = SubsetRandomSampler(train_indices)
    valid_sampler = SubsetRandomSampler(val_indices)
    __ = kwargs.pop('shuffle', None)
    __ = kwargs.pop('drop_last', None)
    train_loader = torch.utils.data.DataLoader(dataset, batch_size=batch_size,
                                               sampler=train_sampler, **kwargs, drop_last=True)
    validation_loader = torch.utils.data.DataLoader(dataset, batch_size=batch_size,
                                                    sampler=valid_sampler, **kwargs, drop_last=True)
    return train_loader, validation_loader