code: def test_read_csv_head(gen_data1):
      pdf, tempdir = gen_data1
      file_path = os.path.join(tempdir, "test.csv")
      pdf.to_csv(file_path)
  
      df1 = md.read_csv(file_path)
      df2 = df1.head(5)
      graph = TileableGraph([df2.data])
      next(TileableGraphBuilder(graph).build())
      context = TileContext()
      chunk_graph_builder = ChunkGraphBuilder(
          graph, fuse_enabled=False, tile_context=context
      )
      chunk_graph = next(chunk_graph_builder.build())
      chunk1 = context[df1.data].chunks[0].data
      chunk2 = context[df2.data].chunks[0].data
      records = optimize(chunk_graph)
      assert records.get_optimization_result(chunk1) is None
      opt_chunk2 = records.get_optimization_result(chunk2)
      assert opt_chunk2.op.nrows == 5
      assert len(chunk_graph) == 1
      assert opt_chunk2 in chunk_graph.results
  
file_path: mars/mars/optimization/logical/chunk/tests/test_head.py
imports: import os
  import tempfile
  import pandas
  import pytest
  from .....None import dataframe
  from .....core import enter_mode, TileableGraph, TileableGraphBuilder, ChunkGraphBuilder, TileContext
  from ..None import optimize
label_desc: Use image node_id 2 for calling a global function with example usage: test_read_csv_head(gen_data1) without return types