<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_grid_embedding(dim, m, n=None, t=4):
 """Find an embedding for a grid in a Chimera graph. Given a target :term:`Chimera` graph size, and grid dimensions, attempts to find an embedding. Args: dim (iterable[int]):
 Sizes of each grid dimension. Length can be between 1 and 3. m (int):
 Number of rows in the Chimera lattice. n (int, optional, default=m):
 Number of columns in the Chimera lattice. t (int, optional, default 4):
 Size of the shore within each Chimera tile. Returns: dict: An embedding mapping a grid to the Chimera lattice. Examples: This example finds an embedding for a 2x3 grid in a 12x12 lattice of Chimera unit cells. {(0, 0):
 [0, 4], (0, 1):
 [8, 12], (0, 2):
 [16, 20], (1, 0):
 [96, 100], (1, 1):
 [104, 108], (1, 2):
 [112, 116]} """


    m, n, t, target_edges = _chimera_input(m, n, t, None)
    indexer = dnx.generators.chimera.chimera_coordinates(m, n, t)

    dim = list(dim)
    num_dim = len(dim)
    if num_dim == 1:
        def _key(row, col, aisle): return row
        dim.extend([1, 1])
    elif num_dim == 2:
        def _key(row, col, aisle): return row, col
        dim.append(1)
    elif num_dim == 3:
        def _key(row, col, aisle): return row, col, aisle
    else:
        raise ValueError("find_grid_embedding supports between one and three dimensions")

    rows, cols, aisles = dim
    if rows > m or cols > n or aisles > t:
        msg = ("the largest grid that find_grid_embedding can fit in a ({}, {}, {}) Chimera-lattice "
               "is {}x{}x{}; given grid is {}x{}x{}").format(m, n, t, m, n, t, rows, cols, aisles)
        raise ValueError(msg)

    return {_key(row, col, aisle): [indexer.int((row, col, 0, aisle)), indexer.int((row, col, 1, aisle))]
            for row in range(dim[0]) for col in range(dim[1]) for aisle in range(dim[2])}