API reference · grader/utils.py · 116 lines
grader.utils
Small shared helpers for the grading engine.
Summary
| Name | Kind | Description |
|---|---|---|
utc_now_iso() | function | |
slugify() | function | Filesystem-safe identifier. |
json_default() | function | Best-effort JSON encoder for numpy / pandas / arbitrary objects. |
dump_json() | function | |
load_json() | function | |
is_close() | function | |
as_float() | function | |
normalize_zips() | function | Coerce mixed zip representations (int, float, str, padded) to 5-char strings. |
jaccard() | function | |
truncate() | function | |
pluralize() | function |
Constants
| Name | Value | Notes |
|---|---|---|
ZIP_RE | re.compile('^\\d{5}$') |
Functions
- json_default(obj: Any) -> Any #[source]
Best-effort JSON encoder for numpy / pandas / arbitrary objects.
- is_close(actual: Any, expected: Any, rel_tol: float = 0.0001, abs_tol: float = 0.0001) -> bool #[source]
No description.