input: Write a python function to create a grid with specified dimensions, width, height, and margin, and initialize a specific cell. Use Pygame to draw the grid and handle an event that changes the cell's value when the space key is pressed.
  assert create_grid(10, 10, 20, 20, 5)[1][5] == 1
  assert create_grid(5, 5, 10, 10, 2)[2][2] == 0
  assert create_grid(3, 3, 15, 15, 3)[0][0] == 0
output: import pygame
  
  def create_grid(width, height, cell_width, cell_height, margin):
      pygame.init()
      screen = pygame.display.set_mode((width * cell_width + margin * (width - 1), 
                                        height * cell_height + margin * (height - 1)))
      grid = [[0 for x in range(width)] for y in range(height)]
      grid[1][5] = 1  # Initialize a specific cell
      running = True
      clock = pygame.time.Clock()
      
      while running:
          for event in pygame.event.get():
              if event.type == pygame.QUIT:
                  running = False
              elif event.type == pygame.KEYDOWN:
                  if event.key == pygame.K_SPACE:
                      for y in range(height):
                          for x in range(width):
                              grid[y][x] = 1 - grid[y][x]  # Toggle cell value when space key is pressed
  
          screen.fill((0, 0, 0))
          
          for row in range(height):
              for column in range(width):
                  color = (255, 255, 255) if grid[row][column] == 1 else (0, 0, 255)
                  pygame.draw.rect(screen, color,
                                   [(margin + cell_width) * column + margin,
                                    (margin + cell_height) * row + margin,
                                    cell_width,
                                    cell_height])
          
          pygame.display.flip()
          clock.tick(60)
      
      pygame.quit()
      return grid