Evaluates the given script.
549885
public String eval(String expr) {
        String result = "undefined";
        if (expr == null) {
            return result;
        }
        ContextData contextData = currentContextData();
        if (contextData == null || frameIndex >= contextData.frameCount()) {
            return result;
        }
        StackFrame frame = contextData.getFrame(frameIndex);
        if (contextData.eventThreadFlag) {
            Context cx = Context.getCurrentContext();
            result = do_eval(cx, frame, expr);
        } else {
            synchronized (monitor) {
                if (insideInterruptLoop) {
                    evalRequest = expr;
                    evalFrame = frame;
                    monitor.notify();
                    do {
                        try {
                            monitor.wait();
                        } catch (InterruptedException exc) {
                            Thread.currentThread().interrupt();
                            break;
                        }
                    } while (evalRequest != null);
                    result = evalResult;
                }
            }
        }
        return result;
    }
1189943
def _eval_script(redis, script_id, *keys, **kwargs):
    
    args = kwargs.pop('args', ())
    if kwargs:
        raise TypeError("Unexpected keyword arguments %s" % kwargs.keys())
    try:
        return redis.evalsha(SCRIPTS[script_id], len(keys), *keys + args)
    except NoScriptError:
        logger.info("%s not cached.", SCRIPTS[script_id + 2])
        return redis.eval(SCRIPTS[script_id + 1], len(keys), *keys + args)
1277193
public Object evaluate(String scriptName, InputStream stream) {
		return evaluate(scriptName, new InputStreamReader(stream));
	}
447586
private void processScript() {

        ScriptReaderBase scr = null;

        try {
            if (database.isFilesInJar()
                    || fa.isStreamElement(scriptFileName)) {
                scr = ScriptReaderBase.newScriptReader(database,
                                                       scriptFileName,
                                                       scriptFormat);

                Session session =
                    database.sessionManager.getSysSessionForScript(database);

                scr.readAll(session);
                scr.close();
            }
        } catch (Throwable e) {
            if (scr != null) {
                scr.close();

                if (cache != null) {
                    cache.close(false);
                }

                closeAllTextCaches(false);
            }

            database.logger.appLog.logContext(e, null);

            if (e instanceof HsqlException) {
                throw (HsqlException) e;
            } else if (e instanceof IOException) {
                throw Error.error(ErrorCode.FILE_IO_ERROR, e.toString());
            } else if (e instanceof OutOfMemoryError) {
                throw Error.error(ErrorCode.OUT_OF_MEMORY);
            } else {
                throw Error.error(ErrorCode.GENERAL_ERROR, e.toString());
            }
        }
    }
883537
def safe_execute_script(self, script):
        
        try:
            self.execute_script(script)
        except Exception:
            # The likely reason this fails is because: "jQuery is not defined"
            self.activate_jquery()  # It's a good thing we can define it here
            self.execute_script(script)
415120
Object executeScript(String jsScript) {
    String jsScriptWithFunction = "(function (){" + jsScript + "})();";
    try {
      return jsScriptEngine.eval(jsScriptWithFunction);
    } catch (ScriptException e) {
      throw new org.molgenis.script.core.ScriptException(e);
    }
  }
553408
public void runScript() {
		if (script.trim().length() > 0) {
			BufferedReader reader = new BufferedReader(new StringReader(script));
			try {
				List results = runScript(reader);
				System.out.println(new LogEntry(Level.CRITICAL, "completed run of script in device '\" + this.deviceId + \"'\""));
			} catch (Throwable t) {
				throw new ConfigurationException("failed to complete run of script", t);
			}
		}
	}
498791
private Object js_eval(Context cx, Scriptable scope, Object[] args)
    {
        Scriptable global = ScriptableObject.getTopLevelScope(scope);
        return ScriptRuntime.evalSpecial(cx, global, global, args, "eval code", 1);
    }
225512
public Object evaluate(Reader in, String fileName) throws CompilationFailedException {
        Script script = null;
        try {
            script = parse(in, fileName);
            return script.run();
        } finally {
            if (script != null) {
                InvokerHelper.removeClass(script.getClass());
            }
        }
    }
102411
def eval(self, expression):
        
        expression_wrapped = wrap_script.format(expression)


        ### Evaluate the expression
        self._libeng.engEvalString(self._ep, expression_wrapped)

        ### Check for exceptions in MATLAB
        mxresult = self._libeng.engGetVariable(self._ep, 'ERRSTR__')

        error_string = self._libmx.mxArrayToString(mxresult)

        self._libmx.mxDestroyArray(mxresult)

        if error_string != "":
            raise RuntimeError("Error from MATLAB\n{0}".format(error_string))
721535
protected void runScript(File script) {
        if (!script.exists()) {
            JOptionPane.showMessageDialog(cliGuiCtx.getMainPanel(), script.getAbsolutePath() + " does not exist.",
                                          "Unable to run script.", JOptionPane.ERROR_MESSAGE);
            return;
        }

        int choice = JOptionPane.showConfirmDialog(cliGuiCtx.getMainPanel(), "Run CLI script " + script.getName() + "?",
                                                   "Confirm run script", JOptionPane.YES_NO_OPTION);
        if (choice != JOptionPane.YES_OPTION) return;

        menu.addScript(script);

        cliGuiCtx.getTabs().setSelectedIndex(1); // set to Output tab to view the output
        output.post("\n");

        SwingWorker scriptRunner = new ScriptRunner(script);
        scriptRunner.execute();
    }
309891
def evalsha(self, sha, numkeys, *keys_and_args):
        """"""
        if not self.script_exists(sha)[0]:
            raise RedisError("Sha not registered")
        script_callable = Script(self, self.shas[sha], self.load_lua_dependencies)
        numkeys = max(numkeys, 0)
        keys = keys_and_args[:numkeys]
        args = keys_and_args[numkeys:]
        return script_callable(keys, args)
1260947
private PyObject evalScript(InputStream inStream, String scriptName) {
		// Execute the script
		PythonInterpreter python = new PythonInterpreter();
		python.execfile(inStream, scriptName);
		// Get the result and cleanup
		PyObject scriptClass = python.get(SCRIPT_CLASS_NAME);
		python.cleanup();
		// Instantiate and return the result
		return scriptClass.__call__();
	}
249283
protected void executeScript(URL scriptUrl) {
        log.debug("Executing script '{}'", scriptUrl);
        final Jedis jedis = pool.getResource();
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(scriptUrl.openStream(), StandardCharsets.UTF_8))) {
            reader.lines()
                    .filter(line -> !Strings.isNullOrEmpty(line) && line.charAt(0) != '#' && !line.startsWith("//"))
                    .forEach(line -> {
                        try {
                            log.trace("execute: {}", line);
                            String[] args = line.split(" ", 3);
                            String command = null;
                            if (args.length == 1) {
                                command = String.format("return redis.call('%s')", args[0]);
                            } else if (args.length == 2) {
                                command = String.format("return redis.call('%s', '%s')", args[0], args[1]);
                            } else if (args.length == 3) {
                                command = String.format("return redis.call('%s', '%s', '%s')", args[0], args[1], unwrapQuotes(args[2]));
                            } else {
                                log.error("Unexpected number of script arguments {}", args.length);
                            }
                            log.trace("command: {}", command);
                            Object result = jedis.eval(command);
                        } catch (Exception e) {
                            log.error("Failed to execute '{}'", line, e);
                        }
                    });
        } catch (IOException e) {
            log.error("Failed to execute script '{}'", scriptUrl, e);
            pool.returnBrokenResource(jedis);
//            jedis = null;
        } finally {
            if (jedis != null) {
                pool.returnResource(jedis);
            }
        }
    }
1259170
function eval$if(params) {
  var script = params.$if
              ? params.$then
              : typeof params.$else == 'undefined' ? null : params.$else;
  return isScript(script)
          ? new this.js.Script(script)
          : script;
}
690314
def evaluate(self, m):
        """"""

        g = m.groupdict()
        if g["strings"]:
            self.line_num += g['strings'].count('\n')
        elif g["code"]:
            self.line_num += g["code"].count('\n')
        else:
            if g['block']:
                self.evaluate_block(g)
            elif self.stylesheets != CSS:
                if g['start'] is None:
                    self.evaluate_inline_tail(g)
                else:
                    self.evaluate_inline(g)
            self.line_num += g['comments'].count('\n')
12345
def eval_py(self, _globals, _locals):
        
        try:
            params = eval(self.script, _globals, _locals)
        except NameError as e:
            raise Exception(
                'Failed to evaluate parameters: {}'
                .format(str(e))
            )
        except ResolutionError as e:
            raise Exception('GetOutput: {}'.format(str(e)))

        return params