Shows a specific item list
429923
public function showlist() {
		if ($this->getRecord() && $this->getRecord() instanceof ItemList) {
			
			if ($this->request->getExtension() == 'csv') {
				$this->response->addHeader('Content-type', 'text/csv');
				return $this->getRecord()->toCSV();
			} else {
				$content = $this->getRecord()->forTemplate();
				if ($this->request->isAjax()) {
					return $content;
				} else {
					return $this->customise(array(
						'Content' => $content
					))->renderWith(array('Page', 'Page'));
				}
			}
		}
	}
470047
public function ListingItems()
    {
        // need to get the items being listed
        $source = $this->getListingSource();

        $listType = $this->ListType ? $this->ListType : 'Page';

        $filter = array();

        $objFields = $this->getSelectableFields($listType);

        if ($source) {
            $ids = $this->getIdsFrom($source, 1);
            $ids[] = $source->ID;

            if (isset($objFields['ParentID']) && count($ids)) {
                $filter['ParentID'] = $ids;
            }
        }

        if ($this->StrictType) {
            $filter['ClassName'] = $listType;
        }

        $sortDir = $this->SortDir == 'Ascending' ? 'ASC' : 'DESC';
        $sort = $this->SortBy && isset($objFields[$this->SortBy]) ? $this->SortBy : 'Title';
        $req = Controller::has_curr() ? Controller::curr()->getRequest() : null;

        if (strlen($this->CustomSort) && $req) {
            $sortField = $req->getVar($this->CustomSort);
            if ($sortField) {
                $sort = isset($objFields[$sortField]) ? $sortField : $sort;
                $sortDir = $req->getVar($this->CustomSort . '_dir');
                $sortDir = $sortDir === 'asc' ? 'ASC' : 'DESC';
            }
        }

        // Bind these variables into the current page object because the
        // template may want to read them out after.
        //
        // - nyeholt 2017-12-19
        $this->CurrentSort = $sort;
        $this->CurrentDir = $sortDir;
        $this->CurrentSource = $source;
        $this->CurrentLink = $req ? $req->getURL() : $this->Link();

        // $sort = $this->CustomSort ? $this->CustomSort : $sort;
        $sort .= ' ' . $sortDir;

        $limit = '';

        $pageUrlVar = 'page' . $this->ID;

        $items = DataList::create($listType)->filter($filter)->sort($sort);

        if ($this->PerPage) {
            $page = isset($_REQUEST[$pageUrlVar]) ? (int) $_REQUEST[$pageUrlVar] : 0;
            $items  = $items->limit($this->PerPage, $page);
        }
        if ($this->ComponentFilterName) {
            $controller = (Controller::has_curr()) ? Controller::curr() : null;
            $tags = array();
            if ($controller && $controller instanceof ListingPageController) {
                $tagName = $controller->getRequest()->latestParam('Action');
                if ($tagName) {
                    $tags = $this->ComponentListingItems();
                    $tags = $tags->filter(array($this->ComponentFilterColumn => $tagName));
                    $tags = $tags->toArray();
                    if (!$tags) {
                        // Workaround cms/#1045
                        // - Stop infinite redirect
                        // @see: https://github.com/silverstripe/silverstripe-cms/issues/1045
                        unset($controller->extension_instances['OldPageRedirector']);

                        return $controller->httpError(404);
                    }
                }
            }

            if ($tags) {
                if (count($tags) > 1) {
                    return $controller->httpError(500, 'ComponentFilterColumn provided is not unique. ' . count($tags) . ' matches found in query.');
                }
                $tag = reset($tags);
                $tagComponent = DataObject::getSchema()->manyManyComponent($this->ListType, $this->ComponentFilterName);
                $parentClass = ClassInfo::shortName($tagComponent['parentClass']);
                $items = $items->innerJoin(
                    $tagComponent['join'],
                    "\"{$tagComponent['parentField']}\" = \"$parentClass\".\"ID\" AND \"{$tagComponent['childField']}\" = " . (int)$tag->ID
                );
            } else {
                $tags = new ArrayList();
            }
        }

        $this->extend('updateListingItems', $items);

        $newList = ArrayList::create();
        if ($items) {
            $newList = PaginatedList::create($items);
            // ensure the 0 limit is applied if configured as such
            $newList->setPageLength($this->PerPage);
            $newList->setPaginationGetVar($pageUrlVar);
            if ($items instanceof DataList) {
                $newList->setPaginationFromQuery($items->dataQuery()->query());
            }
        }

        return $newList;
    }
1008229
def list_items(path_to_directory, pattern, wanted):
    """"""
    if not path_to_directory:
        return set()
    needed = make_needed(pattern, path_to_directory, wanted)
    return [os.path.join(path_to_directory, name)
            for name in _names_in_directory(path_to_directory)
            if needed(name)]
329642
def show():
    """"""
    items = list(collection.find())
    # JSON conversion chokes on the _id objects, so we convert
    # them to strings here
    for i in items:
        i['_id'] = str(i['_id'])
    return items
928509
public function listProduct()
    {
        $this->actionListProduct();
        $this->setTitleListProduct();
        $this->setBreadcrumbListProduct();
        $this->setFilterListProduct();
        $this->setPagerListProduct();

        $this->setData('products', $this->getListProduct());
        $this->setData('currencies', $this->currency->getList(array('enabled' => true)));

        $this->outputListProduct();
    }
309906
function displayMealList() {
  // Meal list
  logResponse("[displayMealList] displaying meal list.");
	var tmpl = $("#meal_list_tmpl").html();
	var output = Mustache.to_html(tmpl, meals);
	$("#meal-list").html(output).listview('refresh');
}
456210
def episode_list(a):
    """"""
    html = get_html(ROOT + a.get('href'))
    div = html.find('div', {'class': "list detail eplist"})
    links = []
    for tag in div.find_all('a', {'itemprop': "name"}):
        links.append(tag)
    return links
1206295
def p_lconcatlist(self, p):
        ''
        p[0] = p[1] + (p[3],)
        p.set_lineno(0, p.lineno(1))
623493
function List(props) {
  warnAboutDeprecatedProp(props.mods, 'mods', 'className');

  const {
    align,
    className,
    dataAttrs,
    hideBullets,
    items,
  } = props;

  const mods = props.mods ? props.mods.slice() : [];

  mods.push(`align_${align}`);

  if (hideBullets) {
    mods.push("no-bullets");
  }

  const listClasses = classNames(getClassNamesWithMods('ui-list', mods), className);

  const itemsBlock = items.filter(Boolean).map((item, index) => (
    <li className="ui-list__item" key={index}>
      {item}
    </li>
  ));

  return (
    <ul className={listClasses} {...getDataAttributes(dataAttrs)}>
      {itemsBlock}
    </ul>
  );
}
171845
public void outputItemsPerList() {
		int max = 0;
		int min = Integer.MAX_VALUE;
		double sum = 0;
		for (int i = 0; i < numCoarseCentroids; i++) {
			// System.out.println("List " + (i + 1) + ": " + perListLoadCounter[i]);
			if (invertedLists[i].size() > max) {
				max = invertedLists[i].size();
			}
			if (invertedLists[i].size() < min) {
				min = invertedLists[i].size();
			}
			sum += invertedLists[i].size();
		}

		System.out.println("Maximum number of vectors: " + max);
		System.out.println("Minimum number of vectors: " + min);
		System.out.println("Average number of vectors: " + (sum / numCoarseCentroids));

	}
119290
def root_item_selected(self, item):
        """"""
        if self.show_all_files:
            return
        for root_item in self.get_top_level_items():
            if root_item is item:
                self.expandItem(root_item)
            else:
                self.collapseItem(root_item)
218044
def _showItemContextMenu(self, item, point, col):
        """"""
        menu = getattr(item, '_menu', None)
        if menu:
            settitle = getattr(item, '_set_menu_title', None)
            if settitle:
                settitle()
            # self._current_item tells callbacks what item the menu was referring to
            point = self.etw.mapToGlobal(point)
            self._current_item = item
            self.etw.clearSelection()
            self.etw.setItemSelected(item, True)
            menu.exec_(point)
        else:
            self._current_item = None
169644
void print_list() {
	for (int i = 0; i < works.size(); i++) {
	    final WorkItem item = (WorkItem) works.elementAt(i);
	    Util.out4.println("Dev name = " + item.dev.get_name() + ", obj name = " + item.name
		    + ", next wake_up at " + item.wake_up_date.tv_sec + ","
		    + item.wake_up_date.tv_usec);
	}
    }
841261
def _viewEntryItem(self, item=None, *dum):
        
        # if item not set, look for selected items in listview. Only 1 must be selected.
        select = True
        if item is None:
            selected = [item for item in self.etw.iterator(self.etw.Iterator.Selected) if item._ientry is not None]
            if len(selected) != 1:
                return
            item = selected[0]
            select = False;  # already selected
        else:
            # make sure item is open -- the click will cause it to close
            self.etw.expandItem(item)
        # show dialog
        ientry = getattr(item, '_ientry', None)
        if ientry is not None:
            self._viewEntryNumber(ientry, select=select)
813558
function getItemsFromList(list, itemsToGet) {
    var result = [];

    _.each(list, function (item) {
        for (var i = 0; i < itemsToGet.length; i++) {
            if (item.indexOf(itemsToGet[i]) === 0) {
                result.push(item);
            }
        }
    });

    return result;
}
860243
function getListForItem(opts: Options, value: Value, item: Block): ?Block {
    const { document } = value;
    const parent = document.getParent(item.key);
    return parent && isList(opts, parent) ? parent : null;
}
295853
function listitem(text) {
  if (inList()) {

    // capture value in trailing "text" - unescape makes regexp work
    var m = unescapeQuotes(text).match(/^(.*)\s+"([^"]*)"\s*$/);

    var txt = m ? escapeQuotes(m[1]) : text;
    var val = m ? escapeQuotes(m[2]) : text;

    return renderOption(txt, val);
  }
  return fallback.listitem.call(this, text);
}