Create grid.py

add grid.py for cross validation, from libsvm