Added a function to check if the execution context is local or remote.