code: def generate_seed(seed):
      
      if seed is None:
          random.seed()
          seed = random.randint(0, sys.maxsize)
      random.seed(a=seed)
  
      return seed
docs: Generate seed for random number generator