dimensional associative array of keys to associative array indexed

@param $orig

@return array
976119
protected function k2a($orig)
    {
        $result = array();
        foreach($orig as $key=>$value){
            if($value===null){

            }else{
                $keys = explode('.',$key);
                $node = $value;
                for($i = count($keys); $i>0; $i--){
                    $k = $keys[$i-1];
                    $node = array($k => $node);
                }
                $result = array_merge_recursive($result, $node);
            }
        }

        return $result;
    }
711325
function getFromKeys(array $keys)
    {
        $result = [];
        try {
            foreach ($keys as $key)
            {
                $result[] = $this->get($key);
            }
        } catch (\Exception $e) {
            throw new exReadError($e->getMessage(), $e->getCode(), $e);
        }
    }
565587
public function toArray()
    {
        $aReturn = array();

        foreach ($this->values as $sKey => $oEntity) {
            /* @var EntityInterface $oEntity */
            $aReturn[$sKey] = $oEntity->toArray();
        }

        return $aReturn;
    }
533268
public function getKeys()
    {

        $catalog = $this->fetch($this->catalog_key);
        $catalog = is_array($catalog) ? $catalog : Array();

        $arr = Array();
        foreach ($catalog as $k => $v) {
            $arr[preg_replace("~^" . $this->namespace . "~", '', $k)] = $v;
        }
        ksort($arr);
        return $arr;
    }
218252
protected function recursiveConvertArray($data)
    {
        $out = [];

        foreach ($data as $key => $value) {
            $nkey = $this->normalize($key);

            if (in_array($nkey, $this->ignoredAttributes)) {
                continue;
            }

            $out[$nkey] = is_scalar($value) ? $value : $this->convertValue($value);
        }

        return $out;
    }
1098167
public function getAttributeArray( $keys ) {

		$data = [];

		foreach( $keys as $key ) {

			$data[ $key ] = $this->$key;
		}

		return $data;
	}
84317
public static function hierarchicalAssocToKeyed($data)
    {
        $h2k = function(&$dest, $orig, $currentKey) use(&$h2k){
            if(is_array($orig) && (count($orig)>0)){
                foreach($orig as $key=>$value){
                    if(is_array($value)){
                        $h2k($dest, $value, ($currentKey ? $currentKey . '.' : '') . $key);
                    }else{
                        $dest[($currentKey ? $currentKey . '.' : '') . $key] = $value;
                    }
                }
            }
        };

        $result = array();
        $h2k($result, $data, '');

        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;
    }
435219
public static function arraysOf(self $gen)
    {
        $sized = self::sized(function ($s) {
            return self::choose(0, $s);
        });
        return $sized->bindGen(function (RoseTree $numRose) use ($gen) {
            $seq = self::sequence(FP::repeat($numRose->getRoot(), $gen));
            return $seq->bindGen(function ($roses) {
                return self::pureGen(RoseTree::shrink(FP::args(), $roses));
            });
        });
    }
1093076
public function many(array $keys)
    {
        $return = [];

        $prefixedKeys = array_map(function ($key) {
            return $this->prefix . $key;
        }, $keys);

        $values = $this->connection()->mGet($prefixedKeys);

        foreach ($values as $index => $value) {
            $return[$keys[$index]] = is_numeric($value) ? $value : unserialize($value);
        }

        return $return;
    }
740368
protected function getTtlAndKey(array &$args)/*# : array */
    {
        if (is_numeric($args[0])) {
            $ttl = (int) array_shift($args);
            $key = $this->generateKey($args);
        } else {
            $key = $this->generateKey($args);
            $ttl = $this->ttl;
        }
        return [$ttl, $key];
    }
999026
protected function _keys($keys) {
		if (!$keys) {
			return [];
		}
		$config = $this->_config;
		$hasType = ($config['type'] === 'hasOne' || $config['type'] === 'hasMany');
		$related = Libraries::locate('models', $config[$hasType ? 'from' : 'to']);

		if (!class_exists($related)) {
			throw new ClassNotFoundException("Related model class '{$related}' not found.");
		}
		if (!$related::key()) {
			throw new ConfigException("No key defined for related model `{$related}`.");
		}
		$keys = (array) $keys;
		$related = (array) $related::key();

		if (count($keys) !== count($related)) {
			$msg = "Unmatched keys in relationship `{$config['name']}` between models ";
			$msg .= "`{$config['from']}` and `{$config['to']}`.";
			throw new ConfigException($msg);
		}
		return $hasType ? array_combine($related, $keys) : array_combine($keys, $related);
	}
739632
def reduce_by_keys(orig_dict, keys, default=None):
    
    ret = {}
    for key in keys:
        ret[key] = orig_dict.get(key, default)
    return ret
101006
private function toArrayInternal($data)
    {
        if (is_array($data)) {
            foreach ($data as $key => $value) {
                if (is_array($value)) {
                    $data[$key] = $this->toArrayInternal($value);
                }

                if (is_object($value)) {
                    $data[$key] = ArrayHelper::toArray($value);
                }
            }

            return $data;
        }
        elseif (is_object($data)) {
            return ArrayHelper::toArray($data);
        }
        else {
            return [$data];
        }
    }
563717
public function to_array($data = null)
	{
		if ($data === null)
		{
			$data = $this->_data;
		}

		$array = array();

		if (is_object($data) and ! $data instanceof \Iterator)
		{
			$data = get_object_vars($data);
		}

		if (empty($data))
		{
			return array();
		}

		foreach ($data as $key => $value)
		{
			if (is_object($value) or is_array($value))
			{
				$array[$key] = $this->to_array($value);
			}
			else
			{
				$array[$key] = $value;
			}
		}

		return $array;
	}
1090208
public static function assoc($arr, $keys) {
        $out = array();
        foreach ($arr as $cnt => $a) {
            $out[$keys[$cnt]] = $a;
        }

        return $out; 
      }
391423
function orig() {
    	$lines = array();

    	foreach ($this->edits as $edit) {
    		if ($edit->orig)
    			array_splice($lines, sizeof($lines), 0, $edit->orig);
    	}
    	return $lines;
    }