Painlevé analysis and reducibility to the canonical form for the generalized Kadomtsev–Petviashvili equation