Validates sortable list

@param SS_List $list
@throws Exception
2191
public function validateSortField(SS_List $list)
    {
        $field = $this->getSortField();

        // Check extra fields on many many relation types
        if ($list instanceof ManyManyList) {
            $extra = $list->getExtraFields();

            if ($extra && array_key_exists($field, $extra)) {
                return;
            }
        } elseif ($list instanceof ManyManyThroughList) {
            $manipulator = $this->getManyManyInspector($list);
            $fieldTable = DataObject::getSchema()->tableForField($manipulator->getJoinClass(), $field);
            if ($fieldTable) {
                return;
            }
        }

        $classes = ClassInfo::dataClassesFor($list->dataClass());

        foreach ($classes as $class) {
            if (singleton($class)->hasDataBaseField($field)) {
                return;
            }
        }

        throw new Exception("Couldn't find the sort field '" . $field . "'");
    }
135427
protected void validateOrderList(SqlSelect select) {
		// ORDER BY is validated in a scope where aliases in the SELECT clause
		// are visible. For example, "SELECT empno AS x FROM emp ORDER BY x"
		// is valid.
		SqlNodeList orderList = select.getOrderList();
		if (orderList == null) {
			return;
		}
		if (!shouldAllowIntermediateOrderBy()) {
			if (!cursorSet.contains(select)) {
				throw newValidationError(select, RESOURCE.invalidOrderByPos());
			}
		}
		final SqlValidatorScope orderScope = getOrderScope(select);
		Objects.requireNonNull(orderScope);

		List<SqlNode> expandList = new ArrayList<>();
		for (SqlNode orderItem : orderList) {
			SqlNode expandedOrderItem = expand(orderItem, orderScope);
			expandList.add(expandedOrderItem);
		}

		SqlNodeList expandedOrderList = new SqlNodeList(
			expandList,
			orderList.getParserPosition());
		select.setOrderBy(expandedOrderList);

		for (SqlNode orderItem : expandedOrderList) {
			validateOrderItem(select, orderItem);
		}
	}
809416
function validSemverTag(list, tag) {
    if (semver.valid(tag)) {
        list.push(tag);
    }

    return list;
}
1333788
protected function clear_list($list)
	{
		is_array($list) or $list = array($list);

		foreach ($list as $_list)
		{
			$this->{$_list} = array();
		}
	}
164168
protected function prepareListFieldValue(array &$list)
    {
        foreach ($list as &$item) {
            $this->setItemThumb($item, $this->image, array('placeholder' => false));
        }
    }
528318
public static <T> List<T> sort(List<T> list, Comparator<? super T> comparator) {
        Collections.sort(list, comparator);
        return list;
    }
734920
public function setList($list)
    {
        $this->list = $list;
        $this->failover = $this->list;
        return $this;
    }
793559
public function setImageList($list) {
		// validate data
		foreach ($list as $guid) {
			if (!filter_var($guid, FILTER_VALIDATE_INT)) {
				return false;
			}
		}

		$listString = serialize($list);
		$this->orderedImages = $listString;
		return true;
	}
1242592
protected function _continuationCheck($list)
    {
        foreach ($list as $val) {
            if (($val instanceof Horde_Imap_Client_Interaction_Command_Continuation) ||
                (($val instanceof Horde_Imap_Client_Data_Format_String) &&
                 $val->literal())) {
                return true;
            }

            if (($val instanceof Horde_Imap_Client_Data_Format_List) &&
                $this->_continuationCheck($val)) {
                return true;
            }
        }

        return false;
    }
89879
public static function sort($list)
	{
		for( $i=sizeof( $list ) - 1; $i>=1; $i-- )
			for( $j=0; $j<$i; $j++ )
				if( $list[$j] > $list[$j+1] ) 
					self::swap( $list, $j, $j + 1 );
		return $list;
	}
712800
public function setPrefetch(SS_List $list) {
		if(!$list instanceof SS_List) {
			throw new Exception('Prefetch list must be an instance of SS_List');
		}

		$this->prefetch = $list;

		return $this;
	}
649064
public static function sort(ArrayList &$list, Comparator $comparator)
    {
        $array = $list->toArray();
        usort($array, [$comparator, "compare"]);
        $list->replace($array);
        return $list;
    }
145222
public static <E extends Comparable<E>> void sortDescending(List<E> list) {
        Quicksort.sort(list, 0, list.size() - 1, true);
    }
992816
private function projectList(EntryList $list)
    {
        $headers = array_keys(iterator_to_array($this->getHeaders($list->getEntity())));
        $statement = $list->deliverQueryObject()->execute();

        foreach ($statement as $result) {
            if ($entry = $list->getResult($result)) {
                yield $this->orderedEntry(iterator_to_array($this->projectEntry($entry)), $headers);
            }
        }
    }
1231596
public function validationResponse(\Psc\Form\ValidatorExceptionList $list, $format = ServiceResponse::JSON, MetadataGenerator $metadataGenerator = NULL) {
    if ($format === ServiceResponse::JSON) {
      $body = (object) array('errors'=>array());
    
      foreach ($list->getExceptions() as $validatorException) {
        $body->errors[$validatorException->field] = $validatorException->getMessage();
      }
    
      return HTTPResponseException::BadRequest(json_encode($body), NULL, array('Content-Type'=>'application/json'));
    } else {
      $metadataGenerator = $metadataGenerator ?: new MetadataGenerator();
      
      return HTTPException::BadRequest(
          $list->getMessage(),
          $list,
          array_merge(
            array('Content-Type'=>'text/html'),
            $metadataGenerator->validationList($list)->toHeaders()
          )
      );
    }
  }
570695
protected function _setValidationErrors($errorList)
    {
        if (!is_null($errorList)) {
            $errorList = $this->_normalizeIterable($errorList);
        }

        $this->validationErrors = $errorList;
    }
698444
public function filterList(ItemList $list)
    {
        if ($this->association !== null && $this->getSelectedEntry()) {
            $list->filterByAssociatedEntry($this->association, $this->getSelectedEntry());
        }
    }