Get slots as [key1 => value1, key2 => value2, ...]

@return array
422041
public function getSlotsAsArray() {
		$slots = [];
		if(!is_array($this->getSlots())) {
			return $slots;
		}

		foreach($this->getSlots() as $key => $slot) {
			$slots[$key] = $slot->getValue();
		}

		return $slots;
	}
549297
protected function get_slots_by_slot_number($slots) {
        if (!$slots) {
            return array();
        }
        $newslots = array();
        foreach ($slots as $slot) {
            $newslots[$slot->slot] = $slot;
        }
        return $newslots;
    }
370365
public function toPrivateArray()
    {
        return array(
            'number' => $this->getNumber(),
            'holder_name' => $this->getHolderName(),
            'expiration_year' => $this->getExpirationYear(),
            'expiration_month' => $this->getExpirationMonth(),
            'security_code' => $this->getSecurityCode(),
        );
    }
685182
public function apriori() : array
    {
        $L = [];
        $L[1] = $this->items();
        $L[1] = $this->frequent($L[1]);

        for ($k = 2; !empty($L[$k - 1]); ++$k) {
            $L[$k] = $this->candidates($L[$k - 1]);
            $L[$k] = $this->frequent($L[$k]);
        }

        return $L;
    }
1037708
public function getSlot($key)
    {
        foreach ($this->slots as $slot) {
            if ($slot->getKey() === $key) {
                return $slot;
            }
        }

        return null;
    }
831787
protected function getKeyAsArray()
    {
        $result = [];
        if ( ! empty( $this->compositeKey )) {
            foreach ($this->compositeKey as $key) {
                $result[$key] = $this->{$key};
            }
        } else {
            $result[$this->getKeyName()] = $this->getKey();
        }

        return $result;
    }
803366
public function populate_slots_with_sections() {
        $sections = array_values($this->sections);
        foreach ($sections as $i => $section) {
            if (isset($sections[$i + 1])) {
                $section->lastslot = $sections[$i + 1]->firstslot - 1;
            } else {
                $section->lastslot = count($this->slotsinorder);
            }
            for ($slot = $section->firstslot; $slot <= $section->lastslot; $slot += 1) {
                $this->slotsinorder[$slot]->section = $section;
            }
        }
    }
1188028
public function get_slots($page = 'all') {
        if ($page === 'all') {
            $numbers = array();
            foreach ($this->pagelayout as $numbersonpage) {
                $numbers = array_merge($numbers, $numbersonpage);
            }
            return $numbers;
        } else {
            return $this->pagelayout[$page];
        }
    }
1044314
public function apriori(): array
    {
        $L = [];

        $items = $this->frequent($this->items());
        for ($k = 1; isset($items[0]); ++$k) {
            $L[$k] = $items;
            $items = $this->frequent($this->candidates($items));
        }

        return $L;
    }
285009
def get_occupied_slots(instance):
    
    return [slot for slot in get_all_slots(type(instance))
            if hasattr(instance,slot)]
239288
private function get_slot() {
		for ($i = 0; $i < $this->max_processes; $i++) {
			if ($this->processes[$i] == -1) {
				return $i;
			}
		}
		return -1;
	}
176106
protected function generateSortedKeysMap(): array
    {
        $sortedKeysMap = [];

        $startKeys = $this->startKeys;
        $middleKeys = $this->middleKeys;
        $endKeys = $this->endKeys;
        $beforeKeys = $this->beforeKeys;
        $afterKeys = $this->afterKeys;
        $flattenFunction = function ($value, $key, $step) use (&$sortedKeysMap, &$beforeKeys, &$afterKeys, &$flattenFunction) {
            if (isset($beforeKeys[$value])) {
                array_walk_recursive($beforeKeys[$value], $flattenFunction, $step);
                unset($beforeKeys[$value]);
            }
            $sortedKeysMap[$step][] = $value;
            if (isset($afterKeys[$value])) {
                array_walk_recursive($afterKeys[$value], $flattenFunction, $step);
                unset($afterKeys[$value]);
            }
        };

        // 1st step: collect regular keys and process before / after if keys occurred
        array_walk_recursive($startKeys, $flattenFunction, 0);
        array_walk_recursive($middleKeys, $flattenFunction, 2);
        array_walk_recursive($endKeys, $flattenFunction, 4);

        // 2nd step: process before / after leftovers for unmatched keys
        array_walk_recursive($beforeKeys, $flattenFunction, 1);
        array_walk_recursive($afterKeys, $flattenFunction, 3);

        ksort($sortedKeysMap);
        return $sortedKeysMap;
    }
977913
public function getValuesWithModifiers()
    {
        $values = array_map(function ($value) {
            return [$value];
        }, array_flip($this->getValues()));

        $valuesWithModifiers = $values + $this->getModifiers(); // merge and keep keys (append)

        ksort($valuesWithModifiers);

        return $valuesWithModifiers;
    }
363151
public function getSpacesAsChoices(): array
    {
        $spaces = [];

        foreach ($this->clientsConfig as $clientConfig) {
            /** @var \Contentful\Delivery\Client $client */
            $client = $clientConfig['service'];

            $spaces[$client->getSpace()->getName()] = $clientConfig['space'];
        }

        return $spaces;
    }
209669
protected function templateSlotsToArray($slots)
    {
        $result = array();
        foreach ($slots as $slot) {
            $result[$slot->getSlotName()] = $slot->getRepeated();
        }

        return $result;
    }
956550
public function getValues() {
        $exploded = explode(",", $this->getValue());
        $values = array();
        foreach ($exploded as $entry){
            $values[] = trim($entry);
        }

        return $values;
    }
21584
def get_slots(self):
        
        positions = map(
            lambda uid: self.get_item_slot(uid), self.get_analyses_uids())
        return map(lambda pos: str(pos), sorted(set(positions)))