Will return the subset of $dimensions that are not found in $additionalSelects

@param $dimensions
@param array $additionalSelects
@return array
773945
protected function getDimensionsToSelect($dimensions, $additionalSelects)
    {
        if (empty($additionalSelects)) {
            return $dimensions;
        }

        $dimensionsToSelect = array();
        foreach ($dimensions as $selectAs => $dimension) {
            $asAlias = $this->getSelectAliasAs($dimension);
            foreach ($additionalSelects as $additionalSelect) {
                if (strpos($additionalSelect, $asAlias) === false) {
                    $dimensionsToSelect[$selectAs] = $dimension;
                }
            }
        }

        $dimensionsToSelect = array_unique($dimensionsToSelect);
        return $dimensionsToSelect;
    }
854885
public function AllExplicitDimensions()
	{
		// In PHP 7.0 $this is passed to closure functions automatically but not in earlier versions
		$contexts = &$this->contexts;
		$namespaces = $this->instance->getInstanceNamespaces();

		$result = array_reduce( array_keys( $this->contexts ), function( $carry, $context ) use( &$contexts, &$namespaces )
		{
			$ctx = $contexts[ $context ];
			$explicitMembers = isset( $ctx['entity']['segment']['explicitMember'] )
				? $ctx['entity']['segment']['explicitMember']
				: ( isset( $ctx['segment']['explicitMember'] )
					  ? $ctx['segment']['explicitMember']
					  : ( isset( $ctx['entity']['scenario']['explicitMember'] )
							? $ctx['entity']['scenario']['explicitMember']
							: ( isset( $ctx['scenario']['explicitMember'] )
					  			? $ctx['scenario']['explicitMember']
								: null
							  )
					  	)
				  );

			if ( ! $explicitMembers ) return $carry;

			foreach ( $explicitMembers as $explicitMember )
			{
				$qname = qname( $explicitMember['dimension'], $namespaces );
				$carry[ $qname->clarkNotation() ][] = $context;
			}

			return $carry;

		}, array() );

		return $result;
	}
462474
public function export($item, array $extraAttributes = []): array
    {
        /** @var Volume $item */
        $attributeObj = [];
        $extraAttributes = array_merge($extraAttributes, $this->additionalAttributes(\get_class($item)));
        foreach($extraAttributes as $attribute) {
            $attributeObj[$attribute] = $item->$attribute;
        }

        $hasUrls = (bool) $item->hasUrls;
        $volumeObj = array_merge([
            'name' => $item->name,
            'handle' => $item->handle,
            'type' => \get_class($item),
            'hasUrls' => $hasUrls,
            'url' => $hasUrls ? $item->url : null,
            'settings' => $item->settings,
            'fieldLayout' => $this->exportFieldLayout($item->getFieldLayout()),
            'requiredFields' => $this->exportRequiredFields($item->getFieldLayout()),
        ], $attributeObj);

        if (\count($volumeObj['requiredFields']) <= 0) {
            unset($volumeObj['requiredFields']);
        }

        return $this->stripNulls($volumeObj);
    }
857168
protected function addTopResultsToSuggestions(SearchRequest $searchRequest, $suggestions, array $additionalFilters) : array
    {
        $maxDocuments = $this->typoScriptConfiguration->getSuggestNumberOfTopResults();

        // perform the current search.
        $searchRequest->setResultsPerPage($maxDocuments);
        $searchRequest->setAdditionalFilters($additionalFilters);

        $didASecondSearch = false;
        $documents = [];

        $searchResultSet = $this->doASearch($searchRequest);
        $results = $searchResultSet->getSearchResults();
        if (count($results) > 0) {
            $documents = $this->addDocumentsWhenLimitNotReached($documents, $results, $maxDocuments);
        }

        $suggestionKeys = array_keys($suggestions);
        $bestSuggestion = reset($suggestionKeys);
        $bestSuggestionRequest = $searchRequest->getCopyForSubRequest();
        $bestSuggestionRequest->setRawQueryString($bestSuggestion);
        $bestSuggestionRequest->setResultsPerPage($maxDocuments);
        $bestSuggestionRequest->setAdditionalFilters($additionalFilters);

        // No results found, use first proposed suggestion to perform the search
        if (count($documents) === 0 && !empty($suggestions) && ($searchResultSet = $this->doASearch($bestSuggestionRequest)) && count($searchResultSet->getSearchResults()) > 0) {
            $didASecondSearch = true;
            $documentsToAdd = $searchResultSet->getSearchResults();
            $documents = $this->addDocumentsWhenLimitNotReached($documents, $documentsToAdd, $maxDocuments);
        }

        return $this->getResultArray($searchRequest, $suggestions, $documents, $didASecondSearch);
    }
278717
public function getRubric($id, array $additionalFields = array())
    {
        return $this->getSingle(
            'catalog/rubric/get',
            'Rubric',
            array('id' => (int)$id, 'fields' => self::getArray($additionalFields))
        );
    }
1047075
private function buildPropertySelect($alias, $propertyName, $locale, &$additionalFields)
    {
        foreach ($this->structureManager->getStructures(static::$structureType) as $structure) {
            if ($structure->hasProperty($propertyName)) {
                $property = $structure->getProperty($propertyName);
                $additionalFields[$locale][] = [
                    'name' => $alias,
                    'property' => $property,
                    'templateKey' => $structure->getKey(),
                ];
            }
        }
    }
1042246
public function additionalClass($additionalClass)
    {
        $additionalClasses = $this->getAdditionalClasses();
        
        if (($key = array_search($additionalClass, $additionalClasses)) !== false) {
            unset($additionalClasses[$key]);
        }
        
        $additionalClasses[] = $additionalClass;
        $this->setAdditionalClasses($additionalClasses);
    }
841821
public function setAdditionalCondition($additionalCondition, $additionalConditionSql)
	{
		if ( ! empty($additionalCondition)) {
			$additionalCondition = '(' . $additionalCondition . ')';
		}
		$this->additionalCondition = $additionalCondition;

		if ( ! empty($additionalConditionSql)) {
			$additionalConditionSql = '(' . $additionalConditionSql . ')';
		}
		$this->additionalConditionSql = $additionalConditionSql;
	}
1292668
private static function processSegmentForExplicitDimensions( $variableSet, $segment )
	{
		$results = array();

		if ( isset( $segment['explicitMember'] ) )
		{
			foreach ( $segment['explicitMember'] as $explicitMember )
			{
				$dimension = $explicitMember['dimension'];
				$member = $explicitMember['member'];

				$dimensionQName = qname( $dimension, $variableSet->xbrlInstance->getInstanceNamespaces() );
				$memberQName = qname( $member, $variableSet->xbrlInstance->getInstanceNamespaces() );

				$results[ $dimensionQName->clarkNotation() ][] = $memberQName->clarkNotation();
			}
		}

		return $results;
	}
235797
public function export($item, array $extraAttributes = []): array
    {
        /** @var Section $item */
        $attributeObj = [];
        $extraAttributes = array_merge($extraAttributes, $this->additionalAttributes(\get_class($item)), $this->additionalAttributes($item->type));
        foreach($extraAttributes as $attribute) {
            if ($attribute === 'propagateEntries') {
                $attributeObj[$attribute] = (bool) $item->$attribute;
            } else {
                $attributeObj[$attribute] = $item->$attribute;
            }
        }

        $sectionObj = array_merge([
            'name' => $item->name,
            'handle' => $item->handle,
            'type' => $item->type,
            'enableVersioning' => (bool) $item->enableVersioning,
        ], $attributeObj);

        $siteSettings = $item->getSiteSettings();
        $sectionObj['siteSettings'] = [];
        foreach ($siteSettings as $siteSetting) {
            $hasUrls = (bool) $siteSetting->hasUrls;
            $sectionObj['siteSettings'][] = [
                'siteId' => $siteSetting->getSite()->primary ? null : $siteSetting->getSite()->handle,
                'hasUrls' => $hasUrls,
                'uriFormat' => $hasUrls ? $siteSetting->uriFormat : null,
                'template' => $siteSetting->template,
                'enabledByDefault' => (bool) $siteSetting->enabledByDefault,
            ];
        }
        $entryTypes = $item->getEntryTypes();
        $sectionObj['entryTypes'] = [];
        foreach ($entryTypes as $entryType) {
            $sectionObj['entryTypes'][] = Architect::$processors->entryTypes->export($entryType);
        }

        return $this->stripNulls($sectionObj);
    }
162445
private function addNamespaces( $additionalNamespaces )
	{
		// Load any additional namespaces
		foreach ( $additionalNamespaces as $namespaces )
		{
			if ( is_null( $namespaces ) || ! is_array( $namespaces ) )
			{
				continue;
			}

			foreach ( $namespaces as $prefix => $namespace )
			{
				if ( empty( $prefix ) ) continue;
				$this->nsMgr->addNamespace( $prefix, $namespace );
			}
		}
	}
733313
public function getAllAllowedCombinations()
    {
        $configuration = $this->contentDimensionPresetSource->getAllPresets();
        $dimensionCombinations = [];
        $dimensionNames = array_keys($configuration);
        $dimensionCount = count($dimensionNames);

        if ($dimensionCount === 0) {
            // This is correct, we have one allowed combination which is no dimension values (empty array).
            return [[]];
        }

        // Reset all presets first just to be sure
        foreach ($configuration as $dimensionName => &$dimensionConfiguration) {
            reset($dimensionConfiguration['presets']);
        }
        unset($dimensionConfiguration);

        while (true) {
            $skipCurrentCombination = false;
            $currentPresetCombination = [
                'withPresetIdentifiers' => [],
                'withDimensionValues' => []
            ];
            foreach ($dimensionNames as $dimensionName) {
                $presetIdentifierForDimension = key($configuration[$dimensionName]['presets']);
                $presetForDimension = current($configuration[$dimensionName]['presets']);

                if (!is_array($presetForDimension) || !isset($presetForDimension['values'])) {
                    $skipCurrentCombination = true;
                }

                $currentPresetCombination['withPresetIdentifiers'][$dimensionName] = $presetIdentifierForDimension;
                $currentPresetCombination['withDimensionValues'][$dimensionName] = $presetForDimension['values'];
            }

            if ($skipCurrentCombination === false && $this->contentDimensionPresetSource->isPresetCombinationAllowedByConstraints($currentPresetCombination['withPresetIdentifiers'])) {
                $dimensionCombinations[] = $currentPresetCombination['withDimensionValues'];
            }

            $nextDimension = 0;
            $hasValue = next($configuration[$dimensionNames[$nextDimension]]['presets']);
            while ($hasValue === false) {
                reset($configuration[$dimensionNames[$nextDimension]]['presets']);
                $nextDimension++;
                if (!isset($dimensionNames[$nextDimension])) {
                    // we have gone through all dimension combinations now.
                    return $dimensionCombinations;
                }
                $hasValue = next($configuration[$dimensionNames[$nextDimension]]['presets']);
            }
        }
    }
259979
public static function getSchemasByNamespaces(array $namespaces)
    {
        $schemas = [];

        /** @var SchemaDescriptor $schema */
        foreach (self::$schemasByCurie as $schema) {
            if (in_array($schema->getId()->getNamespace(), $namespaces)) {
                $schemas[] = $schema;
            }
        }

        return $schemas;
    }
445983
def iterative_select(obj, dimensions, selects, depth=None):
    
    ndims = len(dimensions)
    depth = depth if depth is not None else ndims
    items = []
    if isinstance(selects, dict):
        for k, v in selects.items():
            items += iterative_select(obj.select(**{dimensions[ndims-depth]: k}),
                                      dimensions, v, depth-1)
    else:
        for s in selects:
            items.append((s, obj.select(**{dimensions[-1]: s[-1]})))
    return items
115610
public function matchesWorkspaceAndDimensions($workspace, array $dimensions = null)
    {
        if ($this->workspace->getName() !== $workspace->getName()) {
            return false;
        }
        if ($dimensions !== null) {
            $nodeDimensionValues = $this->dimensionValues;
            foreach ($dimensions as $dimensionName => $dimensionValues) {
                if (isset($nodeDimensionValues[$dimensionName]) && $nodeDimensionValues[$dimensionName] !== [] && array_intersect($nodeDimensionValues[$dimensionName], $dimensionValues) === []) {
                    return false;
                }
            }
        }

        return true;
    }
547650
public function renderDimensions(array $dimensions)
    {
        $rendered = [];
        foreach ($dimensions as $dimensionIdentifier => $dimensionValue) {
            $dimensionConfiguration = $this->contentDimensionsConfiguration[$dimensionIdentifier];
            $preset = $this->findPresetInDimension($dimensionConfiguration, $dimensionValue);
            $rendered[] = $dimensionConfiguration['label'] . ' ' . $preset['label'];
        }

        return implode(', ', $rendered);
    }
1261108
public function selectMultiple($name, $options = array(), $selected = null, array $attributes = array(), array $extra = array())
    {
        $attributes[] = 'multiple';
        return $this->doBuild('select', $name, $selected, $attributes, $extra, $options);
    }