an atomdrift project
Hostile 99% python Download

agilerl-arena 1.43.0

Basename is uppercase README.mdCalls glob for filename search

Evidence

Declares multi-function __all__ export list __init__.py · lines 1–30
1# Copyright 2026 AgileRL
2# SPDX-License-Identifier: Apache-2.0
3
4from __future__ import annotations
5
6from typing import TYPE_CHECKING
7
8import lazy_loader as lazy
9
10from agilerl.arena.models import AgentType
11
12if TYPE_CHECKING:
13 from rich.console import Console
14
15 from agilerl.arena.client import ArenaClient
16 from agilerl.arena.inference import Agent
17
18 console: Console
⋯9 lines
28)
29
30__all__ = ["Agent", "AgentType", "ArenaClient", "console", "error_console"]
Python stderr=identifier source form _console.py · lines 1–32
1# Copyright 2026 AgileRL
2# SPDX-License-Identifier: Apache-2.0
3
4"""Rich consoles and logging setup for the CLI.
5
6Kept out of ``agilerl.arena.__init__`` so importing the manifest contract does
7not pull in rich or install a log handler as a side effect: the platform's
8submit preflight imports ``agilerl.arena.models`` and nothing else.
9"""
10
11from __future__ import annotations
12
13import logging
14
15from rich.console import Console
16from rich.logging import RichHandler
17
18console = Console()
19error_console = Console(stderr=True)
20
21_logger = logging.getLogger("agilerl.arena")
⋯7 lines
29 _logger.propagate = False
30
31logging.getLogger("httpx").setLevel(logging.WARNING)
32logging.getLogger("httpcore").setLevel(logging.WARNING)
Imports Python base64 module auth.py · lines 1–25
1# Copyright 2026 AgileRL
2# SPDX-License-Identifier: Apache-2.0
3
4from __future__ import annotations
5
6import base64
7import binascii
8import json
9import logging
10import os
11import stat
12import time
13import webbrowser
14from pathlib import Path
15from typing import Any
16
17from keycloak import KeycloakOpenID
18from keycloak.exceptions import KeycloakError
19
20from agilerl.arena.exceptions import ArenaAuthError, ArenaTimeoutError
21
22logger = logging.getLogger(__name__)
23
24EXTERNAL_USER_ID_HEADER = "X-External-User-Id"
25_DEFAULT_ …
Python URL-safe Base64 decoder reference auth.py · lines 50–60
50:13… ccess_token or "." not in access_token:
51 return None
52 try:
53 _h, payload_b64, *_rest = access_token.split(".")
54 pad = "=" * (-len(payload_b64) % 4)
55 raw = base64.urlsafe_b64decode(payload_b64 + pad)
56 payload = json.loads(raw.decode("utf-8"))
57 exp = payload.get("exp")
58 if exp is None:
59 return None
60 return float(exp) …
Home-relative hidden directory path literal auth.py · lines 94–100
94:10… ad the raw JSON object from the credentials file (no token validation).
95
96 Used when merging OAuth tokens with other persisted keys.
97 Deployment bindings live in ``~/.arena/inference.json``.
98
99 :param credentials_path: The path to the credentials file.
100 :type credentials_path: Path | os.PathLike …

Showing the top 5 files — 7 more files (130 regions) not shown.

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.