Build custom Array2Object instance.
503040
public function build()
    {
        if ($this->getContext()) {
            $context = $this->getContext();
        } else {
            $context = new Object2ArrayContext();
        }

        $this->prepareContext($context);

        return new Object2Array($context);
    }
426055
function arrayToObject(arrayOfObjects) {
    var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';

    var convertedObject = {};

    arrayOfObjects.forEach(function (object) {
      convertedObject[object[key]] = object;
    });

    return convertedObject;
  }
834658
function array2object(array) {
    var result = {};
    array.forEach(function(e) {
        if (e) {
            var kv = e.trim().split(':');
            if (isNumber(kv[1])) {
                kv[1] = Number(kv[1]);
            } else if (isBoolean(kv[1])) {
                kv[1] = toBoolean(kv[1]);
            } else if (isDateType(kv[1])) {
                kv[1] = convert2Date(kv[1]);
            };
            result[kv[0]] = kv[1];
        };
    });
    return result;
}
747846
function buildAPIs(vueObj) {
  const funcArray = [propsAPIObject, methodsAPIObject, eventsAPIObject, slotsAPIObject]

  const compAPIObj = funcArray.reduce((apiObj, curFn) => {
    const obj = curFn(vueObj)

    if (obj !== null) {
      Object.assign(apiObj, obj)
    }
    return apiObj
  }, {})
  
  return compAPIObj
}
276619
public static function buildArray($object) {
		$array = array();

		foreach ($object as $key => $value) {
			if (is_object($value)) {
				$array[$key] = self::buildArray($value);
			} else {
				$array[$key] = $value;
			}
		}

		return $array;
	}
25085
function objectToArray(o, order) {
    order = order || Object.keys(o);

    return order.map(function(k) {
      return o[k];
    });
  }
641664
public function createObjectType() : ObjectConstructorCallbackDefiner
    {
        return new ObjectConstructorCallbackDefiner($this->class, function (callable $typeCallback) {
            $this->createObjectCallback = function (array $input) use ($typeCallback) {
                $className = $this->class->getClassName();

                /** @var TypedObject|string $instanceOrType */
                $instanceOrType = $typeCallback($input);

                if (is_string($instanceOrType)) {
                    if (class_exists($instanceOrType) && is_a($instanceOrType, $className, true)) {
                        $instanceOrType = $instanceOrType::definition()->newCleanInstance();
                    }
                }

                if (!($instanceOrType instanceof $className)) {
                    throw InvalidReturnValueException::format(
                        'Invalid create object callback return value: expecting class compatible with %s, %s given',
                        $className, is_string($instanceOrType) ? $instanceOrType : Debug::getType($instanceOrType)
                    );
                }

                return $instanceOrType;
            };
        });
    }
747483
function array(obj) {
  if ('array' === type(obj)) return obj;
  if ('arguments' === type(obj)) return Array.prototype.slice.call(obj, 0);

  return obj  // Only transform objects in to an array when they exist.
    ? [obj]
    : [];
}
987704
private function buildDataFromObject($object)
    {
        $result = array();

        $stack = new \SplStack();
        $stack->push($object);

        while (!$stack->isEmpty()) {
            $current = $stack->pop();
            if (is_object($current)) {
                array_push($result, $current);
            }

            foreach ($this->getDataFromItem($current) as $propertyName => $propertyValue) {
                if (is_object($propertyValue) || is_array($propertyValue)) {
                    $stack->push($propertyValue);
                }
            }
        }

        return $result;
    }
756397
function _buildEnumeratorOnObjectArray (object) {
    var attributes = new _gpfA.Map(object).filter(_gpfA.EnumerableAttribute),
        members = attributes.getMembers();
    return _gpfArrayEnumerator(object[members[0]]);
}
569940
function(rawObj, arrayInst){
                // create an instance
                var inst = rawObj.constructor === Model ?
                    rawObj : new Model(rawObj);

                // set a pointer to the array
                inst.$$array = arrayInst;

                return inst;
            }
146135
def addobject1(bunchdt, data, commdct, key, **kwargs):
    """"""
    obj = newrawobject(data, commdct, key)
    abunch = obj2bunch(data, commdct, obj)
    data.dt[key].append(obj)
    bunchdt[key].append(abunch)
    # adict = getnamedargs(*args, **kwargs)
    for kkey, value in iteritems(kwargs):
        abunch[kkey] = value
    return abunch
854657
public static function buildObject($array) {
        $obj = new \stdClass();

        foreach ($array as $key => $value) {
            if (is_array($value) || is_object($value)) {
                $obj->{$key} = static::buildObject($value);
            } else {
                $obj->{$key} = static::autobox($value);
            }
        }

        return $obj;
    }
889107
function _combineObject(params, arr) {
  var ret = {};
  _lodash2.default.each(arr, function (arg, i) {
    ret[params[i]] = arg;
  });
  return ret;
}
33156
public static Object[] subarray(Object[] array, int startIndexInclusive, int endIndexExclusive) {
        int newSize = endIndexExclusive - startIndexInclusive;
        Class<?> type = array.getClass().getComponentType();
        if (newSize <= 0) {
            return (Object[]) Array.newInstance(type, 0);
        }
        Object[] subarray = (Object[]) Array.newInstance(type, newSize);
        System.arraycopy(array, startIndexInclusive, subarray, 0, newSize);
        return subarray;
    }
638129
public static function arrayToObject(array $array = [])
    {
        if (!is_array($array)) {
            throw new \Exception('Not an array');
        }

        $object = new \stdClass();
        if (is_array($array) && count($array) > 0) {
            foreach ($array as $name => $value) {
                if (is_array($value)) {
                    $object->{$name} = self::arrayToObject($value);
                } else {
                    $object->{$name} = $value;
                }
            }
        }

        return $object;
    }
935501
private static function _arrayToObjectDeeply($array,$obj,$classMap=[],$fieldAccess=true,$currentPrefix="")
    {
        $prefix=$currentPrefix;
        if(!empty($prefix)){
            $prefix.=".";
        }
        if(is_array($array) && is_object($obj)){
            $props=[];
            if($fieldAccess){
                $props=array_keys(get_object_vars($obj));
            }
            foreach ($array as $name => $value){
                $key=$prefix.$name;
                if(array_key_exists($key, $classMap)){
                    if(is_array($value)){
                        $map=$classMap[$key];
                        $class=$map[0];
                        $isArray=$map[1];

                        if($isArray && is_array($value)){
                            $objArray=[];
                            foreach ($value as $_name => $_value){
                                $_obj=new $class();
                                self::_arrayToObjectDeeply($_value, $_obj,$classMap,$fieldAccess,$key);
                                $objArray[$_name]=$_obj;
                            }
                            self::_setProperty($obj, $name, $objArray,$props);
                        }else{
                            $_obj=new $class();
                            self::_arrayToObjectDeeply($value, $_obj,$classMap,$fieldAccess,$key);
                            self::_setProperty($obj, $name, $_obj,$props);
                        }
                    }
                }else{
                    self::_setProperty($obj, $name, $value,$props);
                }
            }
        }
    }