How to use python in Editor to build lighting and package project?

Thank you for your clue, I followed this method and find a function in c++ file.
in the header file “Editor/LevelEditor/Public/LevelEditorActions.h” FlevelEditorActionCallbacks::BuildLightingOnly_execute().

I tried to include the header file and call the function, but it doesn’t pass the compiling.