Get the location of the bokehjs source files. If dev is True,
    the files in bokehjs/build are preferred. Otherwise uses the files
    in bokeh/server/static.
325248
def bokehjsdir(dev=False):
    
    dir1 = join(ROOT_DIR, '..', 'bokehjs', 'build')
    dir2 = join(serverdir(), 'static')
    if dev and isdir(dir1):
        return dir1
    else:
        return dir2
774574
private List<SourceFile> getBuiltinExterns(CompilerOptions options) {
    try {
      return CommandLineRunner.getBuiltinExterns(options.getEnvironment());
    } catch (IOException e) {
      throw new BuildException(e);
    }
  }
867712
private boolean findJavaSourceFiles(String[] args) {
        String prev = "";
        for (String s : args) {
            if (s.endsWith(".java") && !prev.equals("-xf") && !prev.equals("-if")) {
                return true;
            }
            prev = s;
        }
        return false;
    }
894911
function _gpfLoadSources () { //jshint ignore:line
    var sourceListContent = _gpfSyncReadForBoot(gpfSourcesPath + "sources.json"),
        _gpfSources = _GpfFunc("return " + sourceListContent)(),
        allContent = [],
        idx = 0;
    for (; idx < _gpfSources.length; ++idx) {
        _gpfProcessSource(_gpfSources[idx], allContent);
    }
    return allContent.join("\n");
}
758980
def find_source_files(input_path, excludes):
    

    java_files = []

    input_path = os.path.normpath(os.path.abspath(input_path))

    for dirpath, dirnames, filenames in os.walk(input_path):
        if is_excluded(dirpath, excludes):
            del dirnames[:]
            continue

        for filename in filenames:
            if filename.endswith(".java"):
                java_files.append(os.path.join(dirpath, filename))

    return java_files
1125917
function lookForExternalDependencies( jsFiles ) {
  const
  javascriptSources = [],
  resources = {};

  for ( const jsFileName of Object.keys( jsFiles ) ) {
    const depFileName = `${jsFileName}.dep`;
    if ( Project.srcOrLibPath( depFileName ) ) {
      const depFile = new Source( Project, depFileName );
      try {
        const
        json = depFile.read(),
        dependencies = ToloframeworkPermissiveJson.parse( json );
        // Looking for Javascript dependencies.
        lookForExternalDependenciesJS( dependencies.js, javascriptSources );
        // Looking for other dependencies.
        lookForExternalDependenciesRES( dependencies.res, resources, depFile );
      } catch ( ex ) {
        Fatal.fire(
          `Unable to parse JSON file "${depFile.getAbsoluteFilePath()}"!\n${ex}`,
          Project.srcOrLibPath( jsFileName )
        );
      }
    }
  }

  return {
    js: javascriptSources,
    res: resources
  };
}
459706
def css_files(self):
        ''' 

        '''
        bokehjsdir = self.bokehjsdir()
        js_files = []
        for root, dirnames, files in os.walk(bokehjsdir):
            for fname in files:
                if fname.endswith(".css"):
                    js_files.append(join(root, fname))
        return js_files
798124
private File[] getSources(final List<File> sourceList) {
    final File[] sortedSources = new File[sourceList.size()];
    sourceList.toArray(sortedSources);
    Arrays.sort(sortedSources, new Comparator<File>() {
      @Override
      public int compare(final File o1, final File o2) {
        return o1.getName().compareTo(o2.getName());
      }
    });
    return sortedSources;
  }
644968
def show_help(bokehjs_action):
    ''' 

    '''
    print()
    if bokehjs_action in ['built', 'installed']:
        print("Bokeh-specific options available with 'install' or 'develop':")
        print()
        print("  --build-js          build and install a fresh BokehJS")
        print("  --install-js        install only last previously built BokehJS")
    else:
        print("Bokeh is using PACKAGED BokehJS, located in 'bokeh.server.static'")
        print()
        print("No extra Bokeh-specific options are available.")
    print()
1181202
private static File getCodeSourceArchive() {
        try {
            CodeSource codeSource = DocumentRootHelper.class.getProtectionDomain().getCodeSource();
            URL location = (codeSource == null ? null : codeSource.getLocation());
            if (location == null) {
                return null;
            }
            String path = location.getPath();
            URLConnection connection = location.openConnection();
            if (connection instanceof JarURLConnection) {
                path = ((JarURLConnection) connection).getJarFile().getName();
            }
            if (path.indexOf("!/") != -1) {
                path = path.substring(0, path.indexOf("!/"));
            }
            return new File(path);
        } catch (IOException ex) {
            return null;
        }
    }
427287
def _get_paths(options):
    
    opts = options

    docroot = path(opts.get('docroot', 'docs'))
    if not docroot.exists():
        raise BuildFailure("Sphinx documentation root (%s) does not exist."
                           % docroot)

    builddir = docroot / opts.get("builddir", ".build")

    srcdir = docroot / opts.get("sourcedir", "")
    if not srcdir.exists():
        raise BuildFailure("Sphinx source file dir (%s) does not exist"
                           % srcdir)

    # Where is the sphinx conf.py file?
    confdir = path(opts.get('confdir', srcdir))

    # Where should output files be generated?
    outdir = opts.get('outdir', '')
    if outdir:
        outdir = path(outdir)
    else:
        outdir = builddir / opts.get('builder', 'html')

    # Where are doctrees cached?
    doctrees = opts.get('doctrees', '')
    if not doctrees:
        doctrees = builddir / "doctrees"
    else:
        doctrees = path(doctrees)

    return Bunch(locals())
234380
def find_vext_files(self):
        
        packages = self.depends_on("vext")
        vext_files = []
        for location in [package.get("location") for package in packages]:
            if not location:
                continue
            vext_files.extend(glob(join(location, "*.vext")))
        return vext_files
405333
def find_pyd_file():
    

    if not os.path.isdir("./build"):
        raise NotADirectoryError

    for path, dirs, files in os.walk("./build"):
        for file_name in files:
            file_name_parts = os.path.splitext(file_name)
            if file_name_parts[1] == ".pyd":
                return path
    return None
813313
def source_index(self):
        
        return self.get(property_name='source_index',
                        default=os.path.join(self.data_directory, 'sources'))
1281953
def _get_src_file(self, val, default='Unknown'):
        '''
        
        '''
        path = default

        try:
            # http://stackoverflow.com/questions/6761337/inspect-getfile-vs-inspect-getsourcefile
            # first try and get the actual source file
            source_file = inspect.getsourcefile(val)
            if not source_file:
                # get the raw file since val doesn't have a source file (could be a .pyc or .so file)
                source_file = inspect.getfile(val)

            if source_file:
                path = os.path.realpath(source_file)

        except TypeError as e:
            path = default

        return path
1301947
def build_sourcemap(sources):
    
    sourcemap = {}
    for sfile in sources:
        inc = find_includes(sfile)
        sourcemap[sfile] = set(inc)
    return sourcemap
591802
def determine_path
      if source_line.file == SourceLine::DEFAULT_FILE
        return source_line.file
      end

      full_path = File.expand_path(source_line.file)
      pwd       = Dir.pwd

      if full_path.start_with?(pwd)
        from = Pathname.new(full_path)
        to   = Pathname.new(pwd)

        return from.relative_path_from(to).to_s
      else
        return full_path
      end
    end