Load all files from folder ore source or sources
962477
public function actionFiles() {
		$sources = [];

		$currentSource = $this->getSource();

		foreach ($this->config->sources as $key => $source) {
			if ($this->request->source && $this->request->source !== 'default' && $currentSource !== $source && $this->request->path !== './') {
				continue;
			}

			if ($this->accessControl->isAllow($this->getUserRole(), $this->action, $source->getPath())) {
				$sources[$key] = $this->read($source);
			}


		}

		return [
			'sources' => $sources
		];
	}
1203195
function loadDir(dir, db, callback) {
    callback = callback || function() {};
    
    //Get the absolute dir path if a relative path was given
    if (dir.substr(0, 1) !== '/') {
        var parentPath = module.parent.filename.split('/');
        parentPath.pop();
        dir = parentPath.join('/') + '/' + dir;
    }
    
    //Load each file in directory
    fs.readdir(dir, function(err, files){
        if (err) return callback(err);
        
        var iterator = function(file, next){
            loadFile(dir + '/' + file, db, next);
        };
        async.forEach(files, iterator, callback);
    });
}
1086371
def load_sources(self, sources):
        """"""

        self.clear()
        for s in sources:

            if isinstance(s, dict):
                s = Model.create_from_dict(s)

            self.load_source(s, build_index=False)
        self._build_src_index()
941337
def load_directory!(dir)
      paths = Dir.glob(dir).grep LeMeme::IMAGE_EXTENSIONS
      @memes.merge!(paths.reduce({}) do |images, path|
        path = File.expand_path(path)
        name = path.split.last.sub(LeMeme::IMAGE_EXTENSIONS, '').to_s
        images.merge(name => path)
      end)
    end
722946
def collect_files(path, extension):
    """"""

    # We should only call this on an actual directory; callers should do the
    # validation.
    assert os.path.isdir(path)
    out = []
    # glob would be faster (see PEP471) but python glob doesn't do **/*
    for root, _, files in os.walk(path):
        out += [os.path.join(root, f) for f in files if f.endswith(extension)]
    return out
233998
def load_directory(self, directory, **kwargs):
        
        log.setLevel(kwargs.get("log_level", self.log_level))
        conn = self.__get_conn__(**kwargs)
        file_extensions = kwargs.get('file_extensions', conn.rdf_formats)
        file_list = list_files(directory,
                               file_extensions,
                               kwargs.get('include_subfolders', False),
                               include_root=True)
        for file in file_list:
            self.load_file(file[1], **kwargs)
        log.setLevel(self.log_level)
557047
def _load_paths(self, paths, depth=0):
        '''
        
        '''

        if depth > self.MAX_DEPTH:
            return

        for path in paths:
            try:
                # avoid empty string
                if not path:
                    continue

                # cleanUp path
                if depth == 0:
                    path = os.path.expanduser(path)  # replace ~
                    path = os.path.expandvars(path)  # replace vars
                    path = os.path.normpath(path)  # replace /../ , "" will be converted to "."

                if not os.path.exists(path):
                    raise PresetException("does not exists or is a broken link or not enough permissions to read")
                elif os.path.isdir(path):
                    try:
                        for child in os.listdir(path):
                            self._load_paths([os.path.join(path, child)], depth + 1)
                    except OSError as e:
                        raise PresetException("IOError: " + e.strerror)
                elif os.path.isfile(path):
                    if path.endswith(".json"):
                        self._load_preset(path)
                else:
                    raise PresetException("not regular file")
            except PresetException as e:
                e.message = "Failed to load preset: \"{}\" [ {} ]".format(path, e.message)
                if self.strict:
                    raise
                logger.error(str(e))
415627
public function loadAll()
    {
        $this->setAll(array());
        $d = dir($this->getPath());
        $this->load($d);
        $d->close();
    }
1196807
def load_context(context, file_path=None):
    """"""
    if not file_path:
        file_path = _get_context_filepath()
    if os.path.exists(file_path):
        with io.open(file_path, encoding='utf-8') as f:
            for line in f:
                execute(line, context)
953616
def glob_files_locally(folder_path, pattern):
    """"""

    pattern = os.path.join(
        folder_path, pattern.lstrip('/')) if pattern else None

    len_folder_path = len(folder_path) + 1
    for root, _, files in os.walk(folder_path):
        for f in files:
            full_path = os.path.join(root, f)
            if not pattern or _match_path(full_path, pattern):
                yield (full_path, full_path[len_folder_path:])
1306701
def load(filename, loader=None, implicit_tuple=True, env={}, schema=None):
  """"""
  with open(filename, 'r') as f:
    return loads(f.read(),
                 filename=filename,
                 loader=loader,
                 implicit_tuple=implicit_tuple,
                 env=env,
                 schema=schema)
992957
def _load(self):
        """"""
        if self.clib is None:
            root_path = os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(__file__ )), '..'))
            path1 = os.path.join(root_path, 'sass.so')
            path2 = os.path.join(root_path, '..', 'sass.so')

            if os.path.exists(path1):
                self.clib = cdll.LoadLibrary(path1)
            elif os.path.exists(path1):
                self.clib = cdll.LoadLibrary(path2)
            else:
                raise Exception("Could not load library")

            self.clib.sass_new_context.restype = POINTER(SassContext)
            self.clib.sass_new_file_context.restype = POINTER(SassFileContext)
            self.clib.sass_new_folder_context.restype = POINTER(SassFolderContext)

            self.clib.sass_compile.restype = c_int
            self.clib.sass_compile.argtypes = [POINTER(SassContext)]

            self.clib.sass_compile_file.restype = c_int
            self.clib.sass_compile_file.argtypes = [POINTER(SassFileContext)]

            self.clib.sass_compile_folder.restype = c_int
            self.clib.sass_compile_folder.argtypes = [POINTER(SassFolderContext)]
1072591
def load(self, patterns, dirs, ignore=None):
        
        for _dir in dirs:
            data = self.read_file(_dir, ignore=ignore)
            if data:
                self.paths[_dir] = data
1264012
def load(self):
        """"""
        self._list = self._source.load()
        self._list_iter = itertools.cycle(self._list)
930537
def load_source(self):
    """"""
    if self.filename in self.STDIN_NAMES:
      self.filename = 'stdin'
      self.source = pycodestyle.stdin_get_value()
    else:
      with pep257.tokenize_open(self.filename) as fd:
        self.source = fd.read()
412752
def get_files(files, extnames=['.root']):
    """"""

    files_out = []
    for f in files:

        mime = mimetypes.guess_type(f)
        if os.path.splitext(f)[1] in extnames:
            files_out += [f]
        elif mime[0] == 'text/plain':
            files_out += list(np.loadtxt(f, unpack=True, dtype='str'))
        else:
            raise Exception('Unrecognized input type.')

    return files_out
1224244
def recursive_load(search_root):
    """"""
    for root, dirs, files in os.walk(search_root):
        dir_name = os.path.basename(root)
        if dir_name == 'fixtures':
            for file_name in files:
                fixture_path = os.path.join(root, file_name)
                execute_manage('loaddata', fixture_path)