CodeGraph: Enhancing Graph Reasoning of LLMs with Code