A simple combinatorial method for proving the Jacobi identity and its generalizations