Python function names should use `snake_case`, i.e. in this case it should read `rebin_cube_hdu`.
And parameter names should also use snake case, i.e. it should be `image_hdu` instead of `image_HDU`.
(I know `HDU` is an abbreviation, but it should still be `hdu` here.)