Include the scripts used by solutions.
779270
def _generate_validation_scripts(self):
        

        id_script_list_validation_fields = (
            AccessibleFormImplementation.ID_SCRIPT_LIST_VALIDATION_FIELDS
        )
        local = self.parser.find('head,body').first_result()
        if local is not None:
            if (
                self.parser.find(
                    '#'
                    + AccessibleEventImplementation.ID_SCRIPT_COMMON_FUNCTIONS
                ).first_result() is None
            ):
                common_functions_file = open(
                    os.path.join(
                        os.path.dirname(os.path.dirname(os.path.dirname(
                            os.path.realpath(__file__)
                        ))),
                        'js',
                        'common.js'
                    ),
                    'r'
                )
                common_functions_content = common_functions_file.read()
                common_functions_file.close()

                common_functions_script = self.parser.create_element('script')
                common_functions_script.set_attribute(
                    'id',
                    AccessibleEventImplementation.ID_SCRIPT_COMMON_FUNCTIONS
                )
                common_functions_script.set_attribute(
                    'type',
                    'text/javascript'
                )
                common_functions_script.append_text(common_functions_content)
                local.prepend_element(common_functions_script)

            self.script_list_fields_with_validation = self.parser.find(
                '#'
                + id_script_list_validation_fields
            ).first_result()
            if self.script_list_fields_with_validation is None:
                script_list_file = open(
                    os.path.join(
                        os.path.dirname(os.path.dirname(os.path.dirname(
                            os.path.realpath(__file__)
                        ))),
                        'js',
                        'scriptlist_validation_fields.js'
                    ),
                    'r'
                )
                script_list_content = script_list_file.read()
                script_list_file.close()

                self.script_list_fields_with_validation = (
                    self.parser.create_element('script')
                )
                self.script_list_fields_with_validation.set_attribute(
                    'id',
                    id_script_list_validation_fields
                )
                self.script_list_fields_with_validation.set_attribute(
                    'type',
                    'text/javascript'
                )
                self.script_list_fields_with_validation.append_text(
                    script_list_content
                )
                local.append_element(self.script_list_fields_with_validation)
            if (
                self.parser.find(
                    '#'
                    + AccessibleFormImplementation.ID_SCRIPT_EXECUTE_VALIDATION
                ).first_result() is None
            ):
                script_function_file = open(
                    os.path.join(
                        os.path.dirname(os.path.dirname(os.path.dirname(
                            os.path.realpath(__file__)
                        ))),
                        'js',
                        'validation.js'
                    ),
                    'r'
                )
                script_function_content = script_function_file.read()
                script_function_file.close()

                script_function = self.parser.create_element('script')
                script_function.set_attribute(
                    'id',
                    AccessibleFormImplementation.ID_SCRIPT_EXECUTE_VALIDATION
                )
                script_function.set_attribute('type', 'text/javascript')
                script_function.append_text(script_function_content)
                self.parser.find('body').first_result().append_element(
                    script_function
                )
        self.scripts_added = True
1148256
public function includePackagesViewsFunctions()
    {
        $_assets_package = Package::createFromAssetsLoader($this->assets_loader);
        foreach ($this->assets_loader->getAssetsDb() as $package=>$config) {
            if (!empty($config['views_functions'])) {
                $assets_package = clone $_assets_package;
                $assets_package->loadFromArray($config);
                foreach ($assets_package->getViewsFunctionsPaths() as $fcts) {
                    $fct_file = $assets_package->getFullPath($fcts);
                    if (@file_exists($fct_file)) {
                        @include_once $fct_file;
                    }
                }
            }
        }
    }
1261348
public function renderPaymentScripts()
    {
        $this->environment->display($this->scriptsTemplate, array(
            'public_key'    =>  $this->publicKey,
            'currency'      =>  $this->paymentBridgeInterface->getCurrency(),
        ));
    }
685552
public function addTooltipScripts() {
		if ( ! is_admin() ) {
			$assets = new Assets( 'pressbooks', 'plugin' );
			wp_enqueue_script( 'glossary-tooltip', $assets->getPath( 'scripts/glossary-tooltip.js' ), false, null, true );
			wp_enqueue_style( 'glossary-tooltip', $assets->getPath( 'styles/glossary-tooltip.css' ), false, null );
		}
	}
1013831
protected function ensureScripts() {
    $scripts = $this->package->getScripts();
    $scripts[Handler::PLUGIN_KEY][] = "NuvoleWeb\\DrupalComponentScaffold\\Plugin::scaffold";
    $scripts[DrupalScaffold::POST_DRUPAL_SCAFFOLD_CMD][] = "NuvoleWeb\\DrupalComponentScaffold\\Plugin::scaffold";
    $this->package->setScripts($scripts);
  }
525345
def finalize(self):
        """"""
        if self.total_duplicate > 0:
            print('{} duplicate scripts found'.format(self.total_duplicate))
            for duplicate in self.list_duplicate:
                print(duplicate)
582877
public function addScripts(array $scripts, $opType = null): self
    {
        foreach ($scripts as $document) {
            $this->addScript($document, $opType);
        }

        return $this;
    }
1235906
def search_script(self, script):
        
        if self.import_statement.search(script):
            for installed in self.libraries_installed:
                for found in set(self.import_statement.findall(script)):
                    if found == installed.key:
                        self.libraries_installed.remove(installed)
                        self.libraries_found.append(installed)
1043795
function(module) {
        for (var i = 0; i < module.include.length; i++) {
          var curInclude = module.include[i];
          if (curInclude.substr(0, 2) == '^!') {
            module.include[i] = curInclude.substr(2);
            attachBuildIds.push(curInclude.substr(2));
          }
        }
      }
846689
private function resolveHelpers()
    {

        if (count($helpers = Arr::get($this->getGeneral(), 'helpers', []))) {

            foreach ($helpers as $helper) {
                if (file_exists($helper)) {
                    include $helper;
                }
            }

        }

    }
762775
def add_scripts(self):
        """"""
        common_script = self.node(self.defs, 'script', type='text/javascript')

        def get_js_dict():
            return dict(
                (k, getattr(self.graph.state, k))
                for k in dir(self.graph.config)
                if not k.startswith('_') and hasattr(self.graph.state, k)
                and not hasattr(getattr(self.graph.state, k), '__call__')
            )

        def json_default(o):
            if isinstance(o, (datetime, date)):
                return o.isoformat()
            if hasattr(o, 'to_dict'):
                return o.to_dict()
            return json.JSONEncoder().default(o)

        dct = get_js_dict()
        # Config adds
        dct['legends'] = [
            l.get('title') if isinstance(l, dict) else l
            for l in self.graph._legends + self.graph._secondary_legends
        ]

        common_js = 'window.pygal = window.pygal || {};'
        common_js += 'window.pygal.config = window.pygal.config || {};'
        if self.graph.no_prefix:
            common_js += 'window.pygal.config = '
        else:
            common_js += 'window.pygal.config[%r] = ' % self.graph.uuid

        common_script.text = common_js + json.dumps(dct, default=json_default)

        for js in self.graph.js:
            if js.startswith('file://'):
                script = self.node(self.defs, 'script', type='text/javascript')
                with io.open(js[len('file://'):], encoding='utf-8') as f:
                    script.text = f.read()
            else:
                if js.startswith('//') and self.graph.force_uri_protocol:
                    js = '%s:%s' % (self.graph.force_uri_protocol, js)
                self.node(self.defs, 'script', type='text/javascript', href=js)
597996
def make_script(self):
        """"""
        self.script_path.write(self.script)
        self.script_path.permissions.make_executable()
        return self.script_path
6963
def install_egg_scripts(self, dist):
        """"""
        if not self.exclude_scripts and dist.metadata_isdir('scripts'):
            for script_name in dist.metadata_listdir('scripts'):
                if dist.metadata_isdir('scripts/' + script_name):
                    # The "script" is a directory, likely a Python 3
                    # __pycache__ directory, so skip it.
                    continue
                self.install_script(
                    dist, script_name,
                    dist.get_metadata('scripts/' + script_name)
                )
        self.install_wrapper_scripts(dist)
885261
def _add_cli_scripts(self):
        ''''''

        pattern = r"cli script\s+" \
                  r"(\/[\w\.\-]+\/)?" \
                  r"(?P<name>[\w\.\-]+)\s*\{"
        sections = re.finditer(pattern, self.template_str)

        for section in sections:
            if 'scripts' not in self.templ_dict:
                self.templ_dict['scripts'] = []

            try:
                sec_start = self._get_section_start_index(
                    section.group('name')
                )
            except NonextantSectionException:
                continue

            sec_end = self._get_section_end_index(
                section.group('name'), sec_start
            )
            section_value = self.template_str[sec_start+1:sec_end].strip()

            self.templ_dict['scripts'].append(dict(
                name=section.group('name'),
                script=section_value
            ))

            self.template_str = self.template_str[:sec_start+1] + \
                self.template_str[sec_end:]
445170
protected function setUpScripts()
    {
        Admin::script($this->script());

        foreach ($this->actions as $action) {
            $action->setGrid($this->grid);

            Admin::script($action->script());
        }
    }
79530
protected function combineFiles()
    {
        if (Director::isDev() && $this->owner->config()->combine_files) {
            
            // Obtain Tools:
            
            $tools = ViewTools::singleton();
            
            // Combine Files:
            
            $tools->combineFiles($this->owner->config()->combined_js,  $this->owner->getRequiredJSFiles());
            $tools->combineFiles($this->owner->config()->combined_css, $this->owner->getRequiredCSSFiles());
            
        }
    }
8488
function loadScripts(scripts, loadedCallback) {
    var srcs = [], property, count, i, src,
        countDown = function () {
          count -= 1;
          if (!count) {
            loadedCallback();
          }
        };

    for (property in scripts) {
      if (!(property in window)) {
        srcs.push(scripts[property]);
      }
    }

    count = srcs.length;
    if (!count) {
      loadedCallback();
    }

    for (i = 0; i < srcs.length; i += 1) {
      src = srcs[i];
      loadScript(src, countDown);
    }
  }