Implement the function which can get local variables.