Get data from nested array

@param $map array
@param $node string
@return bool|array|mixed
772773
protected function getFromNested($map, $node)
    {
        if (empty($node) || $node == '.') {
            return $map;
        }

        if ($node) {
            $terminate = false;
            $path = explode('.', $node);

            foreach ($path as $val) {
                if (!array_key_exists($val, $map)) {
                    $terminate = true;
                    break;
                }

                $map = &$map[$val];
            }

            if ($terminate) {
                return new ValueNotFound();
            }

            return $map;
        }

        return new ValueNotFound();
    }
702197
protected function optimizeLooseMap(array $map)
	{
		foreach ($map as $k => $v)
		{
			if ($k === $v)
			{
				unset($map[$k]);
			}
		}

		return $map;
	}
1341888
public function getNodesTree($nodes, $parentId)
    {
        return collect($nodes)->filter(function ($value) use ($parentId) {
            if (isset($value['parent_id'])) {
                if ($value['parent_id'] == $parentId) {
                    return true;
                }

                return false;
            }

            return true;
        })->mapWithKeys(function ($value, $key) use ($nodes) {
            $data = [
                'id'    => (string) $value['id'],
                'label' => $value['label'],
            ];

            if (isset($value['parent_id'])) {
                $children = $this->getNodesTree($nodes, $value['id']);
                if ($children->isNotEmpty()) {
                    $data['children'] = $children;
                }
            }

            return [
                $key => $data,
            ];
        })->values();
    }
879926
function getMapData$1(map, key) {
  var data = map.__data__;
  return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
}
45453
public function _process($val, $map) {
		foreach ($map as $m => $arg) {
			if (is_numeric($m)) {
				$m = $arg;
				$arg = null;
			}

			if ($arg !== null) {
				$ret = call_user_func($m, $val, $arg);
			} else {
				$ret = call_user_func($m, $val);
			}

			if ($ret !== false) {
				$val = $ret;
			}
		}
		return $val;
	}
268516
public function hasArrayValues($key, $message = null) {
        $key = s('%s.*', $key);

        return new StringNode($this, $key, $message);
    }
1054941
private function prepareNode(&$node, $key)
    {
        if (!isset($node[$key])) {
            $node[$key] = null;
        } elseif (!is_array($node[$key])) {
            $node[$key] = [$node[$key]];
        }
    }
1182764
public static function get(array $root, string $key){
        $nodes  = self::getMatchedNodes($root, $key);

        if(empty($nodes)){
            return null;
        }else if(count($nodes) === 1){
            return array_pop($nodes);
        }

        return $nodes;
    }
88468
public function getNode($index)
    {
        if (is_string($index) and in_array($index, $this->nodesEntities)) {
            if (false !== ($key = array_search($index, $this->nodesEntities))) {
                if ($this->offsetExists($key)) {
                    return $this->offsetGet($index);
                }
            }
        }

        return false;
    }
1266754
public V get(Map<?, V> map){
		for (Object k : keys){
			V v = map.get(k);
			if (v != null){
				return v;
			}
		}
		return null;
	}
351874
public function getNode($key, array $query = array())
    {
        try {
            $response = $this->guzzleclient->get(
                $this->buildKeyUri($key),
                array(
                    'query' => $query
                )
            );
        } catch (BadResponseException $e) {
            $response = $e->getResponse();
        }
        $body = json_decode($response->getBody(), true);
        if (JSON_ERROR_NONE !== json_last_error()) {
            throw new RuntimeException('Unable to parse response body into JSON: ' . json_last_error());
        }
        if (isset($body['errorCode'])) {
            throw new KeyNotFoundException($body['message'], $body['errorCode']);
        }
        return $body['node'];
    }
1210888
public static <BEAN, KEYTYPE> Set<KEYTYPE> getNoDataKeySet(Map<KEYTYPE, BEAN> map) {
		Set<KEYTYPE> keySet = null;
		Iterator<Entry<KEYTYPE, BEAN>> iterator = map.entrySet().iterator();
		while (iterator.hasNext()) {
			Entry<KEYTYPE, BEAN> entry = iterator.next();
			BEAN bean = entry.getValue();
			if (bean == null) {
				if (keySet == null) {
					keySet = new LinkedHashSet<KEYTYPE>();
				}
				keySet.add(entry.getKey());
			}
		}
		return keySet;
	}
1257891
public function get($key) {

        if (!isset($this->hashmap[$key])) { return null; }

        $node = $this->hashmap[$key];
        if (count($this->hashmap) == 1) { return $node->getData(); }

        // refresh the access
        $this->detach($node);
        $this->attach($this->head, $node);

        return $node->getData();
    }
738708
public function getNodeByKey($key): ?Node {
        if (!$this->containsKey($key)) {
            return null;
        }
        $head = $this->getHead();
        while ($head !== null) {
            if (Comparator::equals($head->getKey(), $key)) {
                return $head;
            }
            $head = $head->getNext();
        }
        return null;
    }
1281449
@SuppressWarnings("unchecked")
	protected Map<String, Object> getNestedMap(Map<String, Object> map, String key) {
		Object value = map.get(key);
		if (value == null) {
			return Collections.emptyMap();
		}
		return (Map<String, Object>) value;
	}
208312
private static function _nodeToArray($node)
    {
        $type = null;
        if ($node instanceof DOMElement) {
            $type = $node->getAttribute('type');
        }

        switch($type) {
        case 'array':
            $array = [];
            foreach ($node->childNodes as $child) {
                $value = self::_nodeToValue($child);
                if ($value !== null) {
                    $array[] = $value;
                }
            }
            return $array;
        case 'collection':
            $collection = [];
            foreach ($node->childNodes as $child) {
                $value = self::_nodetoValue($child);
                if ($value !== null) {
                    if (!isset($collection[$child->nodeName])) {
                        $collection[$child->nodeName] = [];
                    }
                    $collection[$child->nodeName][] = self::_nodeToValue($child);
                }
            }
            return $collection;
        default:
            $values = [];
            if ($node->childNodes->length === 1 && $node->childNodes->item(0) instanceof DOMText) {
                return $node->childNodes->item(0)->nodeValue;
            } else {
                foreach ($node->childNodes as $child) {
                    if (!$child instanceof DOMText) {
                        $values[$child->nodeName] = self::_nodeToValue($child);
                    }
                }
                return $values;
            }
        }
    }
1351599
public function collect(Map $map, array $encodedPolylines = [])
    {
        return $this->collectValues($map->getOverlayManager()->getEncodedPolylines(), $encodedPolylines);
    }