Code-Style In-Context Learning for Knowledge-Based Question Answering