Iterate a ``script`` element.
975809
def iter_links_script_element(self, element):
        ''''''
        if self.javascript_scraper and element.text:
            link_iter = self.javascript_scraper.scrape_links(element.text,
                                                             context=True)

            for link, context in link_iter:
                inline = is_likely_inline(link)

                if context is True:
                    link_type = None
                else:
                    link_type = context

                yield LinkInfo(
                    element=element, tag=element.tag, attrib=None,
                    link=link,
                    inline=inline, linked=not inline,
                    base_link=None,
                    value_type='script',
                    link_type=link_type
                )

        for link in self.iter_links_plain_element(element):
            yield link
743584
def script(self):
        """"""
        self.shebang_header = self.shebang_headers[self.language]
        self.slurm_header   = [self.slurm_headers[k]['tag'] % v for k,v in self.slurm_params.items()]
        self.script_header  = self.script_headers[self.language]
        self.script_footer  = self.script_footers[self.language]
        return '\n'.join(flatter([self.shebang_header,
                                  self.slurm_header,
                                  self.script_header,
                                  self.command,
                                  self.script_footer]))
322724
def _process_script_node(node, name):
    '''
    '''
    if isinstance(node, basestring):
        # The script is just the text itself
        return [node]


    if isinstance(node, dict):
        # There must be a "script" key, which must be a list of strings
        script = node.get('script')
        if not script:
            raise ConfigError("{}: must have a 'script' subkey".format(name))

        if isinstance(script, list):
            return script

        if isinstance(script, basestring):
            return [script]

        raise ConfigError("{}.script: must be a string or list".format(name))

    raise ConfigError("{}: must be string or dict".format(name))
302726
def _RunScript(self, script):
    
    process = subprocess.Popen(
        script, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
    while True:
      for line in iter(process.stdout.readline, b''):
        self.logger.info(line.decode('utf-8').rstrip('\n'))
      if process.poll() is not None:
        break
504672
function script($script, $scriptId = null) {
        if (!isset($scriptId) || !isset($this->_scriptIds[$scriptId])) {
            $this->_scripts[] = $script;
            if (isset($scriptId)) $this->_scriptIds[$scriptId] = true;
        }
    }
1142665
def run_script(self, requires, script_name):
        """"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
472559
def script_load(self, script):
        """"""
        sha_digest = sha1(script.encode("utf-8")).hexdigest()
        self.shas[sha_digest] = script
        return sha_digest
644388
function(url, callback, doc) {
		doc = doc || document;
		
		return _.element.create({
			tag: 'script',
			properties: {
				src: url,
				async: true,
				onload: callback
			},
			inside: doc.documentElement
		});
	}
403230
def _iter_vars(mod):
    """"""
    vars = sorted(var for var in dir(mod) if _is_public(var))
    for var in vars:
        yield getattr(mod, var)
314970
def get_scripts():
    """"""
    proc = Popen(['npm', 'run-script'], stdout=PIPE)
    should_yeild = False
    for line in proc.stdout.readlines():
        line = line.decode()
        if 'available via `npm run-script`:' in line:
            should_yeild = True
            continue

        if should_yeild and re.match(r'^  [^ ]+', line):
            yield line.strip().split(' ')[0]
862228
def get_script_property(value, is_bytes=False):
    """"""

    obj = unidata.ascii_scripts if is_bytes else unidata.unicode_scripts

    if value.startswith('^'):
        negated = value[1:]
        value = '^' + unidata.unicode_alias['script'].get(negated, negated)
    else:
        value = unidata.unicode_alias['script'].get(value, value)

    return obj[value]
555204
def _script_reload(script, input, output):
    """"""
    input = [Path(entry).expand().abspath() for entry in input]
    output = Path(output).expand().abspath()
    cmd = 'python3 {0} {1} {2}'.format(script, ' '.join(input), output)
    event_handler = RunScriptChangeHandler(cmd)
    event_handler.run()  # run always once
    observer = Observer()
    path = script.dirname().expand().abspath()
    click.secho('watch: {0}'.format(path), fg='blue')
    observer.schedule(event_handler, path, recursive=True)
    for entry in input:
        entry = entry.dirname().expand().abspath()
        click.secho('watch: {0}'.format(entry), fg='blue')
        observer.schedule(event_handler, entry, recursive=True)
    path = Path(__file__).parent / 'qface'
    click.secho('watch: {0}'.format(path), fg='blue')
    observer.schedule(event_handler, path, recursive=True)
    observer.start()

    try:
        while True:
            time.sleep(1)
    except KeyboardInterrupt:
        observer.stop()
    observer.join()
1349526
def is_script(self, container):
        """"""
        try:
            style = self._style(container)
            return style.get_value('position',
                                   container) != TextPosition.NORMAL
        except StyleException:
            return False
577006
private Object getScriptResult(String script, ScriptEngine engine) throws ScriptException {
        String scriptToExecute = script.substring(script.indexOf(":") + 1);
        return engine.eval(scriptToExecute);
    }
1056580
public Object eval(String script) {
//        // use Java's ScriptEngine at the moment
//        ScriptEngineManager manager = new ScriptEngineManager();
//        ScriptEngine jsEngine = manager.getEngineByName("JavaScript");
//        try {
//            return jsEngine.eval(script);
//        } catch (ScriptException e) {
//            throw new RuntimeException(e);
//        }
        return eval(script, Collections.<String, Object>emptyMap());
    }
1111170
def run_script(self, filename=None, silent=False, set_focus=False,
                   args=None):
        """"""
        if filename is None:
            self.shell.interpreter.restore_stds()
            filename, _selfilter = getopenfilename(
                    self, _("Run Python script"), getcwd_or_home(),
                    _("Python scripts")+" (*.py ; *.pyw ; *.ipy)")
            self.shell.interpreter.redirect_stds()
            if filename:
                os.chdir( osp.dirname(filename) )
                filename = osp.basename(filename)
            else:
                return
        logger.debug("Running script with %s", args)
        filename = osp.abspath(filename)
        rbs = remove_backslashes
        command = "runfile('%s', args='%s')" % (rbs(filename), rbs(args))
        if set_focus:
            self.shell.setFocus()
        if self.dockwidget and not self.ismaximized:
            self.dockwidget.setVisible(True)
            self.dockwidget.raise_()
        self.shell.write(command+'\n')
        self.shell.run_command(command)
644493
protected Object evaluate(String script, String scriptName) {
        try {
            Context curCtx = Context.getCurrentContext();
            curCtx.setLanguageVersion(Context.VERSION_1_8);
            return curCtx.evaluateString(programScope, script, scriptName, 1, null);
        } catch (EcmaError rerr) {
            throw new BPjsCodeEvaluationException(rerr);

        } catch (WrappedException wrapped) {
            try {
                throw wrapped.getCause();
            } catch (BPjsException be ) {
                throw be;
            } catch ( IllegalStateException ise ) {
                String msg = ise.getMessage();
                if ( msg.contains("Cannot capture continuation") && msg.contains("executeScriptWithContinuations or callFunctionWithContinuations") ){
                    throw new BPjsCodeEvaluationException("bp.sync called outside of a b-thread");
                } else {
                    throw ise;
                }
            } catch ( Throwable generalException ) {
                throw new BPjsRuntimeException("(Wrapped) Exception evaluating BProgram code: " + generalException.getMessage(), generalException);
            }

        } catch (EvaluatorException evalExp) {
            throw new BPjsCodeEvaluationException(evalExp);
            
        } catch ( Exception exp ) {
            throw new BPjsRuntimeException("Error evaluating BProgram code: " + exp.getMessage(), exp);
        }
    }