add additional js script source(s)
968374
def add_JSsource(self, new_src):
        """"""
        if isinstance(new_src, list):
            for h in new_src:
                self.JSsource.append(h)
        elif isinstance(new_src, basestring):
            self.JSsource.append(new_src)
        else:
            raise OptionTypeError("Option: %s Not Allowed For Series Type: %s" % type(new_src))
507674
function addFiles(sources, dest, options) {
      var opt = _.extend({}, defaultOptions, options || {});

      if(_.isString(sources)) {
        sources = [sources];
      }

      if(!inCwd(dest) || _.any(sources, function(src) {
        return !inCwd(src);
      })) {
        grunt.verbose.writeln('Ignore %s to %s: not in CWD.');
        return;
      }

      return addToQueueCopy(sources, dest, opt);
    }
1312767
def install_js():
    ''' 

    '''
    target_jsdir = join(SERVER, 'static', 'js')
    target_cssdir = join(SERVER, 'static', 'css')
    target_tslibdir = join(SERVER, 'static', 'lib')

    STATIC_ASSETS = [
        join(JS,  'bokeh.js'),
        join(JS,  'bokeh.min.js'),
        join(CSS, 'bokeh.css'),
        join(CSS, 'bokeh.min.css'),
    ]
    if not all(exists(a) for a in STATIC_ASSETS):
        print(BOKEHJS_INSTALL_FAIL)
        sys.exit(1)

    if exists(target_jsdir):
        shutil.rmtree(target_jsdir)
    shutil.copytree(JS, target_jsdir)

    if exists(target_cssdir):
        shutil.rmtree(target_cssdir)
    shutil.copytree(CSS, target_cssdir)

    if exists(target_tslibdir):
        shutil.rmtree(target_tslibdir)
    if exists(TSLIB):
        # keep in sync with bokehjs/src/compiler/compile.ts
        lib = {
            "lib.es5.d.ts",
            "lib.dom.d.ts",
            "lib.es2015.core.d.ts",
            "lib.es2015.promise.d.ts",
            "lib.es2015.symbol.d.ts",
            "lib.es2015.iterable.d.ts",
        }
        shutil.copytree(TSLIB, target_tslibdir, ignore=lambda _, files: [ f for f in files if f not in lib ])
1243876
function (out) {
            var tplParam = out.templateParam;
            if (tplParam.$hasScript) {
                out.scriptClasspath = tplParam.$classpath + "Script";
                out.scriptClassName = this._getClassName(out.scriptClasspath);
                out.addDependency(out.scriptClasspath);
            }
        }
938971
public void addScriptProperties(Content head) {
        HtmlTree javascript = HtmlTree.SCRIPT(pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath());
        head.addContent(javascript);
        if (configuration.createindex) {
            if (pathToRoot != null && script != null) {
                String ptrPath = pathToRoot.isEmpty() ? "." : pathToRoot.getPath();
                script.addContent(new RawHtml("var pathtoroot = \"" + ptrPath + "/\";loadScripts(document, \'script\');"));
            }
            addJQueryFile(head, DocPaths.JSZIP_MIN);
            addJQueryFile(head, DocPaths.JSZIPUTILS_MIN);
            head.addContent(new RawHtml("<!--[if IE]>"));
            addJQueryFile(head, DocPaths.JSZIPUTILS_IE_MIN);
            head.addContent(new RawHtml("<![endif]-->"));
            addJQueryFile(head, DocPaths.JQUERY_JS_1_10);
            addJQueryFile(head, DocPaths.JQUERY_JS);
        }
    }
1219712
function mergeScripts(crsScripts) {
  const scripts = {
    build: path.join(__dirname, 'scripts/build.js'),
    start: path.join(__dirname, 'scripts/start.js'),
    test: path.join(__dirname, 'scripts/test.js'),
  };
  crsScripts.forEach(scriptSet => {
    Object.assign(scripts, scriptSet || {});
  });
  return scripts;
}
1354959
def import_script(self, script_name):
        """"""
        filename = os.path.abspath(script_name)
        with open(filename, 'r') as script_file:
            self.toolbox_file.write(script_file.read())
179134
public function addAdditionalScript($additionalScript): void
    {
        if (!$additionalScript instanceof HtmlElementInterface) {
            $additionalScript = new HtmlString($additionalScript);
        }
        $this->webLibraries[] = new InlineWebLibrary(null, null, $additionalScript);
    }
1179537
private void addExternalResourceTags(StringBuffer sb, CmsContentDefinition definition) {

        Set<String> includedScripts = new HashSet<String>();
        Set<String> includedStyles = new HashSet<String>();
        for (CmsExternalWidgetConfiguration configuration : definition.getExternalWidgetConfigurations()) {
            for (String css : configuration.getCssResourceLinks()) {
                // avoid including the same resource twice
                if (!includedStyles.contains(css)) {
                    sb.append("<link type=\"text/css\" rel=\"stylesheet\" href=\"").append(css).append("\"></link>");
                    includedStyles.add(css);
                }
            }
            for (String script : configuration.getJavaScriptResourceLinks()) {
                // avoid including the same resource twice
                if (!includedScripts.contains(script)) {
                    sb.append("<script type=\"text/javascript\" src=\"").append(script).append("\"></script>");
                    includedScripts.add(script);
                }
            }
        }
    }
854161
public static function addScript($script)
	{
		if (!$script)
		{
			return;
		}

		if (substr($script, -3) != '.js')
		{
			$script .= '.js';
		}

		$root = self::base();

		if ($document = self::app('document'))
		{
			$document->addScript(rtrim(Request::base(true), '/') . $script . '?v=' . filemtime($root . $script));
		}
	}
316004
public function addScript($script = array())
	{
		foreach ($script as $file => $options)
		{
			$this->scripts = array_add($this->scripts, $file, $options);
		}
	}
657190
private function modifyScripts($scripts)
    {
        $updateScripts = (array) $scripts[ScriptEvents::POST_UPDATE_CMD];

        $index = array_search(ScriptHandler::class . '::installAssets', $updateScripts) ?: 0;
        array_splice($updateScripts, $index, 1, [ScriptHandler::class . '::updateProject', ScriptHandler::class . '::installAssets']);

        $scripts[ScriptEvents::POST_UPDATE_CMD] = $updateScripts;

        return $scripts;
    }
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:]
750217
public function addJs($js)
    {
        if (is_array($js)) {
            foreach ($js as $script) {
                $this->addJs($script);
            }

            return $this;
        }

        $this->js->push($js);

        return $this;
    }
1010682
protected void addJsFiles(JavaScriptObject files) {

        JsArray<CmsFileInfo> cmsFiles = files.cast();
        List<CmsFileInfo> fileObjects = new ArrayList<CmsFileInfo>();
        for (int i = 0; i < cmsFiles.length(); ++i) {
            fileObjects.add(cmsFiles.get(i));
        }
        addFiles(fileObjects);
    }
747691
function addCode(script, match, filePath) {
  var leftDeli = match[1], code = match[2];
  if(leftDeli==='<@' || leftDeli==='<!--@='){
    script.push('__p(escape(' + code + '));');
  }
  else if(leftDeli==='<@|' || leftDeli==='<!--@|'){//no escape
    script.push('__p(' + code + ');');
  }
  else{//<!--@ -->
    script.push(code);

    //possible single-line comment check
    var lastLine = code.split('\n').slice(-1)[0];
    if(lastLine.indexOf('//')>=0){
      /*eslint-disable no-console*/
      if(!filePath) console.warn('detect a possible single-line comment: %s', lastLine);
      else console.warn('detect a possible single-line comment in file %s: %s', filePath, lastLine);
      /*eslint-enable no-console*/
    }
    if(code.slice(-1)!==';') script.push(';');
  }
}
495906
protected void generateScriptSourceAppender() {
		final List<StringConcatenationClient> topElements = generateTopElements(false, true);
		final TypeReference appender = getCodeElementExtractor().getElementAppenderImpl("Script"); //$NON-NLS-1$
		final StringConcatenationClient content = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("/** Appender of " + getLanguageName() + " scripts."); //$NON-NLS-1$ //$NON-NLS-2$
				it.newLine();
				it.append(" *"); //$NON-NLS-1$
				it.newLine();
				it.append(" */"); //$NON-NLS-1$
				it.newLine();
				it.append("@SuppressWarnings(\"all\")"); //$NON-NLS-1$
				it.newLine();
				it.append("public class "); //$NON-NLS-1$
				it.append(getScriptAppender().getSimpleName());
				it.append(" extends "); //$NON-NLS-1$
				it.append(getCodeElementExtractor().getAbstractAppenderImpl());
				it.append(" implements "); //$NON-NLS-1$
				it.append(getScriptBuilderInterface());
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append(generateFieldsAndMethods(false, true));
				for (final StringConcatenationClient element : topElements) {
					it.append(element);
				}
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
			}

		};
		final JavaFileAccess javaFile = getFileAccessFactory().createJavaFile(appender, content);
		javaFile.writeTo(getSrcGen());
	}