Gets full and partial matches to multiple keys.

@param array $arr  The array to match the keys to.
@param array $keys The keys to be matched.

@return array The array of ful and partial matches of the given keys.
777707
protected static function keyMatchesMultiple(array $arr, array $keys)
    {
        $return = [];
        foreach ($keys as $key) {
            $return[$key] = static::keyMatches($arr, $key);
        }

        return $return;
    }
1345999
public function getItems(array $keys = [])
    {
        $items = [];
        foreach ($keys as $key) {
            $items[] = $this->offsetGet($key);
        }
        if (empty($keys)) {
            $items = $this->items;
        }

        return $items;
    }
1317638
public static function arrayGroup($arr, $key){
        $result = [];
        foreach($arr as $k=>$v){
            $result[$v[$key]][] = $v;
        }
        return $result;
    }
272631
function getKeysForDuplicates(array $array)
    {
        $duplicates = $newArray = [];

        foreach ($array as $key => $value) {

            if ( ! isset($newArray[ $value ])) {
                $newArray[ $value ] = $key;
                continue;
            }

            if (isset($duplicates[ $value ])) {
                $duplicates[ $value ][] = $key;
            } else {
                $duplicates[ $value ] = [
                    $newArray[ $value ],
                    $key
                ];
            }
        }

        return $duplicates;
    }
440009
public function only(array $keys)
    {
        return $this->pipe(function ($values) use ($keys) {
            $result = Result::success();

            foreach ($values as $key => $_) {
                if (in_array($key, $keys)) {
                    continue;
                }

                return $result->concat(
                    Result::failure("contains '$key'")
                );
            }

            return $result;
        });
    }
576613
public function getMulti(array $keys)
    {
        $results = array();
        foreach ($keys as $key) {
            $results[$key] = $this->get($key);
        }
        return $results;
    }
1165264
protected function fullUrlWithoutQuery($keys)
    {
        if ($keys instanceof Arrayable) {
            $keys = $keys->toArray();
        }

        $keys = (array) $keys;

        $request = request();

        $query = $request->query();
        Arr::forget($query, $keys);

        $question = $request->getBaseUrl().$request->getPathInfo() == '/' ? '/?' : '?';

        return count($request->query()) > 0
            ? $request->url().$question.http_build_query($query)
            : $request->fullUrl();
    }
314590
public function mget($keys)
	{
	    $res = [];
	    if (is_array($keys)) {
	        foreach ($keys as $k) {
	            $res[$k] = $this->get($k);
	        }
	    } else {
	        $res[$keys] = $this->get($keys);
	    }
	    
	    return $res;
	}
58042
public static function without(array $arr, string ...$keys): array
    {
        foreach ($keys as $key) {
            if (isset($arr[$key])) {
                unset($arr[$key]);
            }
        }
        return $arr;
    }
801743
public function many(array $keys)
    {
        $prefixedKeys = array_map(function ($key) {
            return $this->prefix.$key;
        }, $keys);

        $response = $this->dynamo->batchGetItem([
            'RequestItems' => [
                $this->table => [
                    'ConsistentRead' => false,
                    'Keys' => collect($prefixedKeys)->map(function ($key) {
                        return [
                            $this->keyAttribute => [
                                'S' => $key,
                            ],
                        ];
                    })->all(),
                ],
            ],
        ]);

        $now = Carbon::now();

        return array_merge(collect(array_flip($keys))->map(function () {
        })->all(), collect($response['Responses'][$this->table])->mapWithKeys(function ($response) use ($now) {
            if ($this->isExpired($response, $now)) {
                $value = null;
            } else {
                $value = $this->unserialize(
                    $response[$this->valueAttribute]['S'] ??
                    $response[$this->valueAttribute]['N'] ??
                    null
                );
            }

            return [Str::replaceFirst($this->prefix, '', $response[$this->keyAttribute]['S']) => $value];
        })->all());
    }
1341822
protected function getEligibleKeys(array $strings)
	{
		$eligibleKeys = [];
		foreach ($strings as $k => $string)
		{
			if (!is_array($string[0]) && isset($string[1]))
			{
				$suffix = serialize(array_slice($string, 1));
				$eligibleKeys[$suffix][] = $k;
			}
		}

		return $this->filterEligibleKeys($eligibleKeys);
	}
92890
public static function defaults(array $arr = null, array $defaults): array
    {
        if ($arr === null) {
            return $defaults;
        }
        foreach ($defaults as $key => $value) {
            if (!isset($arr[$key])) {
                $arr[$key] = $value;
            }
        }
        return $arr;
    }
536773
protected static function get_instances($arr) {
        $result = array();
        foreach ($arr as $key => $sub) {
            $result[$key] = new rule($sub);
        }
        return $result;
    }
763445
public function get_many($keys) {
        $return = array();
        foreach ($keys as $key) {
            if ($this->persist && array_key_exists($key, $this->store)) {
                $return[$key] = $this->store[$key];
            } else {
                $return[$key] = false;
            }
        }
        return $return;
    }
38579
public function many(array $keys)
  {
    $results = [];

    foreach ($keys as $key) {
      $results[$key] = $this->get($key);
    }

    return $results;
  }
1199619
public function hasKeys(array $keys): array
    {
        $list = [];
        foreach ($keys as $key) {
            $list[$key] = $this->hasKey((string)$key);
        }

        return $list;
    }
518525
public static function GetLowest ($array, $keys) {
		foreach ((array) $keys as $key) {
			if (isset($array[$key]) || array_key_exists($key, $array)) {
				$array = $array[$key];
			} else {
				return null;
			}
		}
		return $array;
	}