import random


def train_test_split(data,ratio=0.20,random_seed=None):
    """
    Arguments--
    data: list of sequence
    ration: train-test ratio. Default is 0.20
    Returns:
    train: tarining data
    test: test data
    """
    if random_seed:
        random.seed(random_seed)
    
    k = int(ratio*len(data))
    test = random.choices(data,k=k)
    train = [x for x in data if x not in test]
    
    return train,test