code: def _creation_function(self, idx, seed, preset):
          
          return lambda: self.env.instantiate(seed=seed, serial_id=idx, preset=preset)
docs: Helper function to create a proper closure around supplied values