def cell_in_raster(shape, cell):
    """Check if specified cell is within raster.

    Parameters
    ----------
    shape : pair of ints
        Shape of raster (num_rows, num_cols)
    cell : pair of ints
        Cell indices (row, col)

    Returns
    -------
    True if the specified cell is within the raster

    """
    if not 0 <= cell[0] < shape[0]:
        return False
    if not 0 <= cell[1] < shape[1]:
        return False
    return True
