Modify validate num and realnum to accept not only string but also int/float inputs.

Using numbers module
Merge pull request #5205 from yuyiguo/RESTV2

Modify validate num and realnum to accept ints or floats too