input: Write a python function to split data into train and test sets.
  assert len(split_data([(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e')], test_size=0.2)[0]) == 4
  assert len(split_data([(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e')], test_size=0.2)[2]) == 1
  assert len(split_data([(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'), (6, 'f')], test_size=0.5)[0]) == 3
  assert len(split_data([(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'), (6, 'f')], test_size=0.5)[2]) == 3
output: import random
  
  def split_data(data, test_size):
      data_copy = data[:]
      random.shuffle(data_copy)
      
      test_len = int(len(data_copy) * test_size)
      test_set = data_copy[:test_len]
      train_set = data_copy[test_len:]
      
      return train_set, test_set, test_set