import numpy in function definition