Scan for and add paths to the include path
963342
def load_include_path(paths):
    
    for path in paths:
        # Verify the path is valid
        if not os.path.isdir(path):
            continue
        # Add path to the system path, to avoid name clashes
        # with mysql-connector for example ...
        if path not in sys.path:
            sys.path.insert(1, path)
        # Load all the files in path
        for f in os.listdir(path):
            # Are we a directory? If so process down the tree
            fpath = os.path.join(path, f)
            if os.path.isdir(fpath):
                load_include_path([fpath])
1035367
def addPath(rel_path, prepend=False):
    
    path = lambda *paths: os.path.abspath(
        os.path.join(os.path.dirname(__file__), *paths)) + '/'
    if prepend:
      return sys.path.insert(0, path(rel_path))
    return sys.path.append(path(rel_path))
784763
function getIncludePath(path, options) {
  var includePath;
  var filePath;
  var views = options.views;

  // Abs path
  if (path.charAt(0) == '/') {
    includePath = exports.resolveInclude(path.replace(/^\/*/,''), options.root || '/', true);
  }
  // Relative paths
  else {
    // Look relative to a passed filename first
    if (options.filename) {
      filePath = exports.resolveInclude(path, options.filename);
      if (fs.existsSync(filePath)) {
        includePath = filePath;
      }
    }
    // Then look in any views directories
    if (!includePath) {
      if (Array.isArray(views) && views.some(function (v) {
        filePath = exports.resolveInclude(path, v, true);
        return fs.existsSync(filePath);
      })) {
        includePath = filePath;
      }
    }
    if (!includePath) {
      throw new Error('Could not find the include file "' +
          options.escapeFunction(path) + '"');
    }
  }
  return includePath;
}
1018970
def _include_file(context, uri, calling_uri, **kwargs):
    """"""

    template = _lookup_template(context, uri, calling_uri)
    (callable_, ctx) = _populate_self_namespace(
                                context._clean_inheritance_tokens(),
                                template)
    callable_(ctx, **_kwargs_for_include(callable_, context._data, **kwargs))
1175583
@Override
    public boolean include(ArchivePath path) {
        if (paths.contains(path.get())) {
            return false;
        }
        return true;
    }
769081
function include(filePath, extraVars) {
    if(!pathIsAbsolute(filePath)){
      filePath = path.resolve(path.dirname(this.file), filePath);
    }

    var vars = {};
    for(var ii in this.vars){
      vars[ii] = this.vars[ii];
    }
    if(extraVars){
      for(var jj in extraVars){
        vars[jj] = extraVars[jj];
      }
    }
    return render(readFile(filePath, {encoding: 'utf8'}), vars, filePath);
  }
582928
function include(path) {
	var path = publish.conf.templatesDir+path;
	return IO.readFile(path);
}
1290225
def scan_dir(self, path):
        

        """
        for fname in glob.glob(os.path.join(path, '*' + TABLE_EXT)):
            if os.path.isfile(fname):
                with open(fname, 'r') as fobj:
                    try:
                        self.add_colortable(fobj, os.path.splitext(os.path.basename(fname))[0])
                        log.debug('Added colortable from file: %s', fname)
                    except RuntimeError:
                        # If we get a file we can't handle, assume we weren't meant to.
                        log.info('Skipping unparsable file: %s', fname)
1263958
function include( path, isFromInclude, dot_path ) {
			if(!path){
				return;
			}
			all_paths.push(path)
			if(isNode){
				require(path);
				listenFileChange(path);
				if(isFromInclude){
					fileLoadeManager.iamready(dot_path);
				}
				return;
			}
			if (fm.isConcatinated) {
				fileLoadeManager.iamready(dot_path);
				return;
			}

			if (!docHead) {
				docHead = document.getElementsByTagName("head")[0];
			}

			// isNonfm && fm.holdReady(true);
			var e = document.createElement("script");
			// onerror is not supported by IE so this will throw exception only for
			// non IE browsers.

			if(me.version){
				path += "?v=" + me.version;
			}
			e.onerror = onFileLoadError;
			if(isFromInclude){
				e.onload = function(){
					fileLoadeManager.iamready(dot_path);
					$(document).trigger('jsfm-iamready-'+ path.split("/").pop().replace(".js", ""), [path]);
				};
			}

			e.src = path;
			e.type = "text/javascript";
			docHead.appendChild(e);
		}
561833
def scan(cls, path):
        
        result = []
        try:
            for _p in listdir(path):
                try:
                    result.append(Template(_p, op.join(path, _p)))
                except ValueError:
                    continue
        except OSError:
            pass

        return result
41347
def include_path(self):
        
        parts = [self.include_dir(root=self.url_root)]
        parts.append("index")
        return "/".join(parts)
164520
def add_find_links(self, urls):
        """"""
        for url in urls:
            if (
                self.to_scan is None  # if we have already "gone online"
                or not URL_SCHEME(url)  # or it's a local file/directory
                or url.startswith('file:')
                or list(distros_for_url(url))  # or a direct package link
            ):
                # then go ahead and process it now
                self.scan_url(url)
            else:
                # otherwise, defer retrieval till later
                self.to_scan.append(url)
176852
def _fix_paths(self, data):
        
        data['include_paths'] = [join('$PROJ_DIR$', path) for path in data['include_paths']]

        if data['linker_file']:
            data['linker_file'] = join('$PROJ_DIR$', data['linker_file'])

        data['groups'] = {}
        for attribute in SOURCE_KEYS:
            for k, v in data[attribute].items():
                if k not in data['groups']:
                    data['groups'][k] = []
                data['groups'][k].extend([join('$PROJ_DIR$', file) for file in v])
        for k,v in data['include_files'].items():
            if k not in data['groups']:
                data['groups'][k] = []
            data['groups'][k].extend([join('$PROJ_DIR$', file) for file in v])

        # sort groups
        data['groups'] = OrderedDict(sorted(data['groups'].items(), key=lambda t: t[0]))
1000665
def p_include_file(p):
    
    global CURRENT_DIR
    p[0] = [p[1] + p[2]] + p[3] + [p[4]]
    CURRENT_FILE.pop()  # Remove top of the stack
    CURRENT_DIR = os.path.dirname(CURRENT_FILE[-1])
1099622
def expand_source_paths(paths):
    
    for src_path in paths:
        # only track the source path if we can find it to avoid double-reloads
        # when the source and the compiled path change because on some
        # platforms they are not changed at the same time
        if src_path.endswith(('.pyc', '.pyo')):
            py_path = get_py_path(src_path)
            if os.path.exists(py_path):
                src_path = py_path
        yield src_path
507743
private void addPaths(Path p) {

        for (String d : p.list()) {
            File dir = new File(d);
            if (dir.exists() && dir.isDirectory()) {
                if (!includeDirectories.contains(dir))
                    includeDirectories.add(dir);
            }
        }
    }
86264
def list_files(scan_path, contains=None):
    
    file_list = []
    path = os.path.abspath(scan_path)
    for f in sorted(os.listdir(path)):
        if contains and f.find(contains) < 0:
            continue
        filepath = os.path.join(path, f)
        if os.path.isfile(filepath):
            file_list.append(filepath)
    return file_list