Call external script.

        :param includes: testcase's includes
        :param variables: variables
        :return: script's output
962384
def action(self, includes: dict, variables: dict) -> tuple:
        
        json_args = fill_template_str(json.dumps(self.data), variables)
        p = subprocess.Popen([self.module, json_args], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        if p.wait() == 0:
            out = p.stdout.read().decode()
            debug(out)
            return variables, json.loads(out)
        else:
            out = p.stdout.read().decode()
            warning(out)
            raise Exception('Execution failed.')
310647
def handle_includes(defns):
    '''
    '''
    newdefns = []
    for d in defns:
        if isinstance(d,list):
            newdefns.extend(handle_includes(d))
        else:
            newdefns.append(d)

    return newdefns
364167
def execfile(fname, variables):
    
    with open(fname) as f:
        code = compile(f.read(), fname, 'exec')
        exec(code, variables)
869140
function (variables, bundleHandler) {
		// handle if bundleHandler specified in first argument
		if (!bundleHandler && typeof (variables) === 'function') {
			bundleHandler = variables;
			variables = null;
		}

		return through2.obj(function (file, enc, cb) {
			if (!checkFile(file, cb))
				return;

			var ext = path.extname(file.path).toLowerCase();
			var resultFileName = path.basename(file.path, ext);

			var bundleFiles = processBundleFile(file, ext, variables, bundleHandler, cb);
			if (file.sourceMap)
				bundleFiles = bundleFiles.pipe(sourcemaps.init());
			bundleFiles
				.pipe(concat(resultFileName))
				.pipe(pushTo(this))
				.on('end', cb);
		});
	}
868448
def check_external_aliases(subname, params, comment, test=nil)
      @@external_aliases.each{ |alias_item|
        if subname == alias_item["old_name"] ||
                    subname.upcase == alias_item["old_name"].upcase &&
                            @options.ignore_case

          new_meth = initialize_external_method(alias_item["new_name"], 
                                                subname, params, @file_name, 
                                                comment)
          new_meth.visibility = alias_item["visibility"]

          progress "e"
          @stats.num_methods += 1
          alias_item["file_or_module"].add_method(new_meth)

          if !alias_item["file_or_module"].include_requires?(@file_name, @options.ignore_case)
            alias_item["file_or_module"].add_require(Require.new(@file_name, ""))
          end
        end
      }
    end
933612
def collect_output(self):
        
        if self.embed:
            if self.concat:
                concat_scripts = [self.compiled_scripts[path]
                                  for path in self.build_order]

                return [self.embed_template_string % '\n'.join(concat_scripts)]
            else:
                return [self.embed_template_string %
                        self.compiled_scripts[path]
                        for path in self.build_order]
        else:
            return [self.external_template_string %
                    os.path.join(
                        self.relative_directory,
                        os.path.relpath(
                            self.out_path_of(path),
                            self.output_directory))

                    for path in self.build_order
                    if self.compiled_scripts[path] != ""]
590337
def use(parser, token):
    '''
    
    '''

    args, kwargs = parser.parse_args(token)
    assert isinstance(args[0], ast.Str), \
        'First argument to "include" tag must be a string'
    name = args[0].s

    action = ast.YieldFrom(
        value=_a.Call(_a.Attribute(_a.Name('self'), name), [
            _a.Name('context'),
        ])
    )

    if kwargs:
        kwargs = _wrap_kwargs(kwargs)
        return _create_with_scope([ast.Expr(value=action)], kwargs)

    return action
73326
def get_include_path():
    
    f1 = os.path.basename(sys.argv[0]).lower()  # script filename
    f2 = os.path.basename(sys.executable).lower()  # Executable filename

    # If executable filename and script name are the same, we are
    if f1 == f2 or f2 == f1 + '.exe':  # under a "compiled" python binary
        result = os.path.dirname(os.path.realpath(sys.executable))
    else:
        result = os.path.dirname(os.path.realpath(__file__))

    return result
505350
def render_source(self, source, variables=None):
        
        if variables is None:
            variables = {}
        template = self._engine.from_string(source)
        return template.render(**variables)
103627
def _load_includes(self, tag, ssh=False):
        
        import re
        includes = []
        for child in tag:
            if child.tag == "include" and "path" in child.attrib:
                incl = { "path": child.attrib["path"] }
                if "modules" in child.attrib:
                    incl["modules"] = re.split(",\s*", child.attrib["modules"].lower())
                includes.append(incl)

        if ssh == False:
            self._vardict["includes"] = includes
        else:
            self._vardict["ssh.includes"] = includes
1335368
def add_output_variable(self, var):
        """"""
        assert(isinstance(var, Variable))
        self.output_variable_list.append(var)
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
988991
def include_notify_js_variables(context):
    
    ctx = {
        'user': context['request'].user,
        'update_notification': reverse('notifications:update'),
        'mark_notification': reverse('notifications:mark'),
        'mark_all_notification': reverse('notifications:mark_all'),
        'delete_notification': reverse('notifications:delete'),

        'nf_list_class_selector': notify_settings.NF_LIST_CLASS_SELECTOR,
        'nf_class_selector': notify_settings.SINGLE_NF_CLASS_SELECTOR,
        'nf_box_list_class_selector': notify_settings.NF_BOX_CLASS_SELECTOR,
        'nf_box_class_selector': notify_settings.SINGLE_NF_BOX_CLASS_SELECTOR,

        'nf_mark_selector': notify_settings.MARK_NF_CLASS_SELECTOR,
        'nf_mark_all_selector': notify_settings.MARK_ALL_NF_CLASS_SELECTOR,
        'nf_delete_selector': notify_settings.DELETE_NF_CLASS_SELECTOR,

        'nf_read_class': notify_settings.READ_NF_CLASS,
        'nf_unread_class': notify_settings.UNREAD_NF_CLASS,

        'nf_update_time_interval': notify_settings.UPDATE_TIME_INTERVAL,
    }
    return ctx
200884
function includeJsFiles() {
        if (cog.getOption('include_only_external')) {
            return extLibFiles().concat(generatedJsFiles());
        }
        if (cog.getOption('compile_typescript')) {
            return extLibFiles().concat(generatedJsFiles());
        }
        return extLibFiles().concat(srcFiles()).concat(generatedJsFiles());
    }
748881
private void includeExternal(ServletRequest req, ServletResponse res) throws ServletException, IOException {

        // This is an external include, probably to a JSP page, dispatch with system dispatcher
        if (LOG.isInfoEnabled()) {
            LOG.info(
                Messages.get().getBundle().key(
                    Messages.LOG_FLEXREQUESTDISPATCHER_INCLUDING_EXTERNAL_TARGET_1,
                    m_extTarget));
        }
        m_rd.include(req, res);
    }
1228688
def add_variables(
        self, variables: Union[List["Variable"], "Variable"], index: int = None
    ) -> None:
        
        if isinstance(variables, Variable):
            addvars = copy.deepcopy([variables])
        else:
            addvars = copy.deepcopy(variables)

        if index is None:
            self.variables.extend(addvars)
        else:
            self.variables[index:index] = addvars
748966
def render(self, hosts, vars={}):
        
        if self.tpl_file.endswith(".tpl"):
            return self._render_mako(hosts, vars)
        elif self.tpl_file.endswith(".py"):
            return self._render_py(hosts, vars)
        else:
            raise ValueError("Don't know how to handle '{0}'".format(self.tpl_file))