1
0
Fork 0

Merging upstream version 25.0.3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:37:40 +01:00
parent 03b67e2ec9
commit 021892b3ff
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
84 changed files with 33016 additions and 31040 deletions

28
benchmarks/helpers.py Normal file
View file

@ -0,0 +1,28 @@
import typing as t
def border(columns: t.Iterable[str]) -> str:
columns = " | ".join(columns)
return f"| {columns} |"
def ascii_table(table: list[dict[str, t.Any]]) -> str:
columns = []
for row in table:
for key in row:
if key not in columns:
columns.append(key)
widths = {column: max(len(column), 15) for column in columns}
lines = [
border(column.rjust(width) for column, width in widths.items()),
border(str("-" * width) for width in widths.values()),
]
for row in table:
lines.append(
border(str(row[column]).rjust(width)[0:width] for column, width in widths.items())
)
return "\n".join(lines)