code: def split_dataset(dataset, n, seed=0):
      """
      Return a pair of datasets corresponding to a random split of the given
      dataset, with n datapoints in the first dataset and the rest in the last,
      using the given random seed
      """
      assert n <= len(dataset)
      keys = list(range(len(dataset)))
      np.random.RandomState(seed).shuffle(keys)
      keys_1 = keys[:n]
      keys_2 = keys[n:]
      return _SplitDataset(dataset, keys_1), _SplitDataset(
          dataset, keys_2
      )
  
file_path: dowhy/dowhy/causal_prediction/dataloaders/misc.py
imports: import hashlib
  from collections import Counter
  import numpy
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: split_dataset(dataset, n, seed) and returns: _SplitDataset,  _SplitDataset