Calculate the length of the table

@return Array
766400
public function calcLength(array $data)
    {
        $lengths = array();

        foreach ($data as $table) {
            foreach ($table as $key => $value) {
                $len = strlen($value);

                if (!isset($lengths[$key]) || $len > $lengths[$key]) {
                    $lengths[$key] = $len;
                }

                if (isset($lengths[$key]) && strlen($key) > $lengths[$key]) {
                    $lengths[$key] = strlen($key);
                }
            }
        }

        return $lengths;
    }
829318
public function length2() : float {
        $value = 0;
        $count = count($this->elements);
        for ($i=0;$i<$count;$i++) {
            $value += ($this[$i] * $this[$i]);
        }
        return $value;
    }
999797
public function length()
    {
        $length = 0;

        foreach ($this->_streams as $stream) {
            $len = $stream->length();
            if ($len === null) {
                return;
            }
            $length += $len;
        }
        return $length;
    }
436806
protected function getMaxIdentifierLength()
    {
        if ($this->tableNameLengthLimit === null) {
            $this->tableNameLengthLimit = $this->entityManager->getConnection()->getDatabasePlatform()->getMaxIdentifierLength();
        }

        return $this->tableNameLengthLimit;
    }
155574
private function getTableStructure()
    {
        return array(
            'columns' => array(
                // Unique auto-incrementing primary key
                new BigInteger('id', false, null, array('auto_increment' => true, 'unsigned' => true)),

                // Identifier column
                new Varchar($this->getIdentifierColumn(), 64),

                // The blob column creates a length specification if(length), so length 0 is a nice hack to not specify length
                new Blob($this->getDataColumn(), 0)
            ),
            'constraints' => array(
                // Primary key and index constraints
                new PrimaryKey('id'),
                new UniqueKey(array($this->getIdentifierColumn()), $this->getIdentifierColumn())
            ),
        );
    }
1115533
def __get_table_size(self):
		
		length = ctypes.wintypes.DWORD()
		res = self.method(None, length, False)
		if res != errors.ERROR_INSUFFICIENT_BUFFER:
			raise RuntimeError("Error getting table length (%d)" % res)
		return length.value
578556
public function getLength() : ?float 
    {
        if ( ! $this->hasLength()) {
            $this->setLength($this->getDefaultLength());
        }
        return $this->length;
    }
447383
protected function _calculateWidths($rows)
    {
        $widths = [];
        foreach ($rows as $line) {
            foreach (array_values($line) as $k => $v) {
                $columnLength = $this->_cellWidth($v);
                if ($columnLength >= (isset($widths[$k]) ? $widths[$k] : 0)) {
                    $widths[$k] = $columnLength;
                }
            }
        }

        return $widths;
    }
265519
public function getOldValues()
    {
        return isset($this->table[count($this->table)-1]) ? $this->table[count($this->table)-1] : $this->value;
    }
544804
public function getWidth()
    {
        if ($this->width === null) {
            $this->width = intval($this->systemCall('tput cols'));
        }

        return $this->width;
    }
192317
private function getColumns()
    {
        $table = $this->table->connect($this->database, Inflector::tabilize($this->tableName));

        return $table->getColumns();
    }
299754
public function getSizeTable($database_table)
    {
        $nodes = $this->getNodesByTable($database_table);
        // scan need node`s
        foreach ($nodes as $node)
        {
            if (empty($this->_table_size_cache[$node]))
            {
                $this->_table_size_cache[$node] = $this->client($node)->tablesSize(true);
            }
        }

        $sizes = [];
        foreach ($this->_table_size_cache as $node=>$rows)
        {
            foreach ($rows as $row)
            {
                $sizes[$row['database'] . '.' . $row['table']][$node] = $row;
                @$sizes[$row['database'] . '.' . $row['table']]['total']['sizebytes'] += $row['sizebytes'];



            }
        }

        if (empty($sizes[$database_table]))
        {
            return null;
        }
        return $sizes[$database_table]['total']['sizebytes'];
    }
144401
protected function calculateRowsSize()
    {
        $this->_columnWidths = $columns = [];
        $totalWidth = 0;
        $screenWidth = $this->getScreenWidth() - self::CONSOLE_SCROLLBAR_OFFSET;

        for ($i = 0, $count = count($this->_headers); $i < $count; $i++) {
            $columns[] = ArrayHelper::getColumn($this->_rows, $i);
            $columns[$i][] = $this->_headers[$i];
        }

        foreach ($columns as $column) {
            $columnWidth = max(array_map(function ($val) {
                if (is_array($val)) {
                    $encodings = array_fill(0, count($val), $this->app->encoding);
                    return max(array_map('mb_strwidth', $val, $encodings)) + mb_strwidth($this->_listPrefix, $this->app->encoding);
                }

                return mb_strwidth($val, $this->app->encoding);
            }, $column)) + 2;
            $this->_columnWidths[] = $columnWidth;
            $totalWidth += $columnWidth;
        }

        $relativeWidth = $screenWidth / $totalWidth;

        if ($totalWidth > $screenWidth) {
            foreach ($this->_columnWidths as $j => $width) {
                $this->_columnWidths[$j] = (int) ($width * $relativeWidth);
                if ($j === count($this->_columnWidths)) {
                    $this->_columnWidths = $totalWidth;
                }
                $totalWidth -= $this->_columnWidths[$j];
            }
        }
    }
947586
private static function table()
    {
        if (!isset(self::$tableMap[static::class])) {
            if (isset(static::$table)) {
                self::$tableMap[static::class] = static::$table;
            } else {
                self::$tableMap[static::class] = strtolower((new \ReflectionClass(static::class))->getShortName());
            }
        }
        return self::$tableMap[static::class];
    }
776506
protected function getColumnWidths()
    {
        $column_widths = [];

        for ($i = 0; $i < $this->column_count; $i++) {
            if (!isset($this->data[$i])) {
                $column_widths[] = 0;
                continue;
            }
            $column_widths[] = $this->getColumnWidth($this->data[$i]);
        }

        return $column_widths;
    }
609633
public function length(): int {
        $array = \array_filter($this->heap, function ($v, $k) {
            return $v !== null;
        }, \ARRAY_FILTER_USE_BOTH);
        return \count($array) - 1;
    }
1240173
def get_table_width(self):
        
        if self.column_count == 0:
            return 0
        width = sum(self._column_widths)
        width += ((self._column_count - 1)
                  * termwidth(self.column_separator_char))
        width += termwidth(self.left_border_char)
        width += termwidth(self.right_border_char)
        return width