code: def __init__(
      self, expt_dir, variables=None, grid_size=None, grid_seed=1
  ):
      self.expt_dir = expt_dir
      self.jobs_pkl = os.path.join(expt_dir, EXPERIMENT_GRID_FILE)
      self.locker = Locker()
  
      # Only one process at a time is allowed to have access to the grid.
      self.locker.lock_wait(self.jobs_pkl)
  
      # Set up the grid for the first time if it doesn't exist.
      if variables is not None and not os.path.exists(self.jobs_pkl):
          self.seed = grid_seed
          self.vmap = GridMap(variables, grid_size)
          self.grid = self._hypercube_grid(self.vmap.card(), grid_size)
          self.status = np.zeros(grid_size, dtype=int) + CANDIDATE_STATE
          self.values = np.zeros(grid_size) + np.nan
          self.durs = np.zeros(grid_size) + np.nan
          self.proc_ids = np.zeros(grid_size, dtype=int)
          self._save_jobs()
  
      # Or load in the grid from the pickled file.
      else:
          self._load_jobs()
  
imports: import os
  import sys
  import tempfile
  import pickle
  import numpy
  import numpy.random
  from .spearmint_pb2 import *
  from .Locker import *
  from .sobol_lib import *
  from .helpers import *
  import logging
label_desc: Use image node_id 4 to create a new ExperimentGrid object  with example: obj = ExperimentGrid(expt_dir, variables, grid_size, grid_seed)