returns an array the first item is the keys of the following items nested arrays are expected to have idententical siblings
555595
function(){
    var frameData = this.croppedFrameData(),
      packedFrames = [],
      frameDatum;

    packedFrames.push(this.packingStructure);

    for (var i = 0, len = frameData.length; i < len; i++){
      frameDatum = frameData[i];

      packedFrames.push(
        this.packArray(
          this.packingStructure,
          frameDatum
        )
      );

    }

    return packedFrames;
  }
833403
public function toArray()
    {
        $newItem = [];

        foreach ($this->items as $key => $val) {
            if ($val instanceof ArrayInterface) {
                $newItem[$key] = $val->items;
            } else {
                $newItem[$key] = $val;
            }
        }

        return $newItem;
    }
331990
def get_first_defined(data, keys, default_value=None):
    
    for key in keys:
        if key in data:
            return data[key]
    return default_value
642977
public function getItemsGroupedByTypes(): array
    {
        if (is_array($this->itemsGroupedByTypeCache)) {
            return $this->itemsGroupedByTypeCache;
        }

        $items = $this->getItems();
        $itemsGroupedByType = [];
        foreach ($items as $item) {
            if (!isset($itemsGroupedByType[$item->getType()])) {
                $itemsGroupedByType[$item->getType()] = [];
            }
            $itemsGroupedByType[$item->getType()][] = $item;
        }

        $this->itemsGroupedByTypeCache = $itemsGroupedByType;

        return $itemsGroupedByType;
    }
653047
function getCommonLastItems(arr1, arr2, butFirsts) {
  var n = Math.min(arr1.length, arr2.length) - (butFirsts || 0);

  return [arr1.slice(-n), arr2.slice(-n)];
}
181115
public function toNestedArray()
    {
        $result = [];

        foreach ($this->items as $item) {
            if (is_object($item)) {
                if (method_exists($item, 'toMap')) {
                    $result[] = $item->toMap();
                } else {
                    $result[] = (array) $item;
                }
            } else {
                $result[] = $item;
            }
        }

        return $result;
    }
80084
def keys(self):
        
        keys = []
        for key, value in self._values.items():
            if isinstance(value, (FlatDict, dict)):
                nested = [self._delimiter.join([key, k]) for k in value.keys()]
                keys += nested if nested else [key]
            else:
                keys.append(key)
        return sorted(keys)
227815
def items(self, founditems=[]): #pylint: disable=dangerous-default-value
        """"""
        l = []
        for e in self.data:
            if  e not in founditems: #prevent going in recursive loops
                l.append(e)
                if isinstance(e, AbstractElement):
                    l += e.items(l)
        return l
83037
def arrays(self):
        
        return list(chain.from_iterable(
            ([arr] if not isinstance(arr, InteractiveList) else arr.arrays
             for arr in self)))
312751
function () {
        const items = []
        _.each(this._items, (item) => {
          items.push(item.toObject())
        })
        return items
      }
129305
def nest *tree_keys, &_block
      tree_keys = tree_keys[0] if tree_keys[0].is_a? Array

      each_row.each_with_object({}) do |row, current|
        # Create tree
        *keys, last = tree_keys
        current = keys.inject(current) { |c, f| c[row[f]] ||= {} }
        name = row[last]

        if block_given?
          current[name] = yield(row, current, name)
        else
          current[name] ||= []
          current[name].push(row.to_h.delete_if { |key,_value| tree_keys.include? key })
        end
      end
    end
808887
def nested_join(array, o_str= '{', c_str= '}'):
    '''
        
    '''
    result = ''
    for x in array :
        if type(x) == type([])  :
            result  +=o_str+ nested_join(x)+ c_str
        else                    :
            result  +=x
    return result
133131
def array(self):
        
        return np.arange(self.start, self.stop, self.step)
1224286
def items(self):
        
        sorted_keys = sorted(self.keys())
        return [(k, self[k]) for k in sorted_keys]
466635
def key_list(items=None):
    '''
    
    '''
    if items is None:
        items = []

    ret = {}
    if items and isinstance(items, list):
        for item in items:
            if 'name' in item:
                # added for consistency with old code
                if 'id' not in item:
                    item['id'] = item['name']
                ret[item['name']] = item
    return ret
366997
def get_id2parents(objs):
    """"""
    id2parents = {}
    for obj in objs:
        _get_id2parents(id2parents, obj.item_id, obj)
    return id2parents
180420
protected function getWildcardValues($data, array $keys) {
        $values = [];

        if ( ! is_array($data) && ! $data instanceof Traversable) {
            if ($data instanceof IArrayable) {
                $data = $data->toArray();
            }

            if ( ! is_array($data)) {
                $data = [];
            }
        }

        if (count($keys) === 0) {
            foreach ($data as $itemKey => $itemValue) {
                $values[$itemKey] = $itemValue;
            }
        }

        if (count($keys) > 0) {
            foreach ($data as $itemKey => $itemValue) {
                // since there are still selector keys left and the next
                // item is not an array, it is safe to skip it
                if ( ! is_array($itemValue)) {
                    continue;
                }

                $nestedValues = $this->getValues($itemValue, $keys);

                foreach ($nestedValues as $nestedKey => $nestedValue) {
                    $values[$this->buildKey($itemKey, $nestedKey)] = $nestedValue;
                }
            }
        }

        return $values;
    }