Retrieve all the pages from the current directory,
 add them to the site and sort them.

 dir - The String representing the directory retrieve the pages from.
 dot_pages - The Array of pages in the dir.

 Returns nothing.
175490
def retrieve_pages(dir, dot_pages)
      site.pages.concat(PageReader.new(site, dir).read(dot_pages))
    end
408773
function getFiles(dir) {
    var files = [];

    var traverse = function (dir) {
        var dirList = dir.listFiles();
        dirList.forEach(function (file) {
            if (/\.css$/.test(file)) {
                files.push(file);
            } else if (file.isDirectory()) {
                traverse(file);
            }
        });
    };

    traverse(dir);

    return files;
}
211236
def _get_pages_with_headings(self, pages: Dict) -> Dict:
        '''
        '''

        def _recursive_process_pages(pages_subset, parent_is_dict):
            if isinstance(pages_subset, dict):
                new_pages_subset = {}
                for key, value in pages_subset.items():
                    if not key:
                        key = self._mkdocs_config.get('default_subsection_title', '…')

                    new_pages_subset[key] = _recursive_process_pages(value, True)

            elif isinstance(pages_subset, list):
                new_pages_subset = []
                for item in pages_subset:
                    new_pages_subset.append(_recursive_process_pages(item, False))

            elif isinstance(pages_subset, str):
                if not parent_is_dict:
                    new_pages_subset = self._get_page_with_optional_heading(pages_subset)

                else:
                    new_pages_subset = pages_subset

            else:
                new_pages_subset = pages_subset

            return new_pages_subset

        new_pages = _recursive_process_pages(pages, False)

        self.logger.debug(f'All pages with their headings: {new_pages}')

        return new_pages
1237119
def get_pages():
    ''''''
    pages =[]
    counter = 1

    print "Checking for themes..."

    while(True):
        page = urllib.urlopen('http://dotshare.it/category/terms/colors/p/%d/' % counter)
        print "Page%d:  %s" % (counter, "OK" if (page.code < 400) else "Fail!")
        if page.code >= 400:
            break
        pages.append(page)
        counter += 1

    print "Found %d pages." % (counter - 1)
    return pages
389804
function pages() {
  return gulp.src(['src/pages/**/*.html', '!src/pages/archive/**/*.html'])
    .pipe(panini({
      root: 'src/pages',
      layouts: 'src/layouts',
      partials: 'src/partials',
      helpers: 'src/helpers'
    }))
    .pipe(inky())
    .pipe(gulp.dest('dist'));
}
1178392
def get_files_recursively_from directory
        dir = Pathname.new directory
        return nil  unless (dir.directory?)
        return dir.each_child.map do |file|
          next file.realpath.to_path            if (file.file?)
          next get_files_recursively_from file  if (file.directory?)
        end .flatten
      end
1009570
function getFolders(dir) {
  try {
    return fs.readdirSync(dir)
      .filter(function (file) {
        return exports.isDirectory(path.join(dir, file));
      });
  } catch (ex) {
    return [];
  }
}
1084184
def dirs(self, *args, **kwargs):
        
        return [p for p in self.listdir(*args, **kwargs) if p.isdir()]
127230
public function pages()
    {
        //Returns on pages index
        if ($this->request->isUrl(['_name' => 'pagesCategories'])) {
            return;
        }

        $pages = $this->Pages->find('active')
            ->select(['title', 'slug'])
            ->order([sprintf('%s.title', $this->Pages->getAlias()) => 'ASC'])
            ->cache(sprintf('widget_list'), $this->Pages->getCacheName())
            ->all();

        $this->set(compact('pages'));
    }
1250965
def get_link_pages(links):
        
        link_pages = []
        i = 0
        while i < len(links):
            link_page = []
            while i < len(links) and len(link_page) < 10:
                link_page.append(links[i])
                i += 1
            link_pages.append(link_page)
        return link_pages
292674
def get_page(self, index=None):
        """"""
        if index is None:
            widget = self.pages_widget.currentWidget()
        else:
            widget = self.pages_widget.widget(index)
        return widget.widget()
121279
def retrieve_posts(dir)
      return if outside_configured_directory?(dir)

      site.posts.docs.concat(post_reader.read_posts(dir))
      site.posts.docs.concat(post_reader.read_drafts(dir)) if site.show_drafts
    end
1057486
def _list_directory(self, folder_id=''):
    
        '''  '''
        
        title = '%s._list_directory' % self.__class__.__name__
        
    # construct default response
        file_list = []
    
    # construct request kwargs
        list_kwargs = {
            'spaces': self.drive_space,
            'fields': 'nextPageToken, files(id, name, parents, mimeType)'
        }
    
    # add query field for parent
        if folder_id:
            list_kwargs['q'] = "'%s' in parents" % folder_id
    
    # retrieve space id
        if not self.space_id:
            self._get_space()
        
    # send request
        page_token = 1
        while page_token:
            try:
                response = self.drive.list(**list_kwargs).execute()
            except:
                raise DriveConnectionError(title)
        
        # populate list from response
            results = response.get('files', [])
            for file in results:
                if not folder_id and file.get('parents', [])[0] != self.space_id:
                    pass
                else:
                    yield file.get('id', ''), file.get('name', ''), file.get('mimeType', '')
    
        # get page token
            page_token = response.get('nextPageToken', None)
            if page_token:
                list_kwargs['pageToken'] = page_token
        
        return file_list
330021
def retrieve_static_files(dir, dot_static_files)
      theme_static_files = []
      dot_static_files.each do |file|
        theme_static_files << StaticFile.new(@site, dir, "/", file)
      end
      site.static_files.concat(theme_static_files)
    end
1091335
def get_page_numbers(current_page, num_pages):
    

    if current_page <= 2:
        start_page = 1
    else:
        start_page = current_page - 2

    if num_pages <= 4:
        end_page = num_pages
    else:
        end_page = start_page + 4
        if end_page > num_pages:
            end_page = num_pages

    pages = []
    if current_page != 1:
        pages.append('first')
        pages.append('previous')
    pages.extend([i for i in range(start_page, end_page + 1)])
    if current_page != num_pages:
        pages.append('next')
        pages.append('last')
    return pages
419876
def dir_list(load):
    '''
    
    '''
    ret = set()
    files = file_list(load)
    for f in files:
        dirname = f
        while dirname:
            dirname = os.path.dirname(dirname)
            if dirname:
                ret.add(dirname)
    return list(ret)
555469
function(url) {
    var dir;
    if (typeof url === "string" && url) {
      dir = url.split("#")[0].split("?")[0];
      dir = url.slice(0, url.lastIndexOf("/") + 1);
    }
    return dir;
  }