Skip to content

Commit c498a23

Browse files
committed
Add errors module to docs. Add docstrings in common module.
1 parent 334d6fa commit c498a23

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

docs/source/api/errors.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Errors Module
2+
=============
3+
4+
.. automodule:: judge0.errors
5+
:members:

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Every contribution, big or small, is valuable!
6060
api/clients
6161
api/types
6262
api/retry
63+
api/errors
6364

6465
.. toctree::
6566
:caption: Getting Involved

src/judge0/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77

88
def encode(content: Union[bytes, str, Encodeable]) -> str:
9+
"""Encode content to base64 string."""
910
if isinstance(content, bytes):
1011
return b64encode(content).decode()
1112
if isinstance(content, str):
@@ -16,6 +17,7 @@ def encode(content: Union[bytes, str, Encodeable]) -> str:
1617

1718

1819
def decode(content: Union[bytes, str]) -> str:
20+
"""Decode base64 encoded content."""
1921
if isinstance(content, bytes):
2022
return b64decode(
2123
content.decode(errors="backslashreplace"), validate=True

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy