docstr: Generates a random grid of size length x length with start = (0, 0) and
  goal = (length-1, length-1)
docstr_tok: ["Generates","a","random","grid","of","size","length","x","length","with","start","=","(","0",",","0",")","and","goal","=","(","length-1",",","length-1",")"]
code: def random_grid(
      cls,
      length: int,
      max_horizon: int = -1,
      wall_prob: float = 0.1,
      use_taxicab_reward: bool = False,
  ):
      """
      Generates a random grid of size length x length with start = (0, 0) and
      goal = (length-1, length-1)
      """
      size = (length, length)
      start = (0, 0)
      goal = (length - 1, length - 1)
      walls = []
      for r in range(length):
          for c in range(length):
              if (r, c) == start or (r, c) == goal:
                  continue
              else:
                  if random.uniform(0, 1) < wall_prob:
                      walls.append((r, c))
      return cls(
          size, start, goal, max_horizon, walls, use_taxicab_reward
      )
  
imports: import logging
  import random
  from typing import Iterable, Optional, Sequence, Tuple
  import numpy
  import torch
  from reagent.ope.estimators.sequential_estimators import DMEstimator, DoublyRobustEstimator, EpsilonGreedyRLPolicy, IPSEstimator, MAGICEstimator, NeuralDualDICE, RewardProbability, RLEstimatorInput, State, StateDistribution, StateReward, ValueFunction
  from reagent.ope.estimators.types import Action, ActionSpace
  from reagent.ope.test.envs import Environment, PolicyLogGenerator
  from reagent.ope.trainers.rl_tabular_trainers import DPTrainer, DPValueFunction, EstimatedStateValueFunction, TabularPolicy
label_desc: Use image node_id 3 for calling the GridWorld obj's underlying member method code with example usage: obj.random_grid(cls, length, max_horizon, wall_prob, use_taxicab_reward) and returns: cls