zhicao/dreamzero main
PYTHON
Verdict: BENIGN
Local reference
Suspicious dependency
Inferred
| 1 |
"""Client for communicating with a policy server. |
|
| 2 |
|
|
| 3 |
Adapted from https://github.com/robo-arena/roboarena/ |
References a public code-forge URL |
| 4 |
|
|
| 5 |
""" |
|
| 6 |
|
|
| 7 |
import logging |
|
| 8 |
import time |
|
| 9 |
from typing import Dict, Tuple |
|
| 10 |
|
|
| 11 |
import websockets.sync.client |
Python websockets client usage |
| 12 |
from typing_extensions import override |
|
| 13 |
|
|
| 14 |
from openpi_client.base_policy import BasePolicy |
|
| 15 |
from openpi_client import msgpack_numpy |
|
| 16 |
|
|
| 17 |
# The websockets library by default sends a ping every 20 seconds and |
|
| 18 |
# expects a pong response within 20 seconds. However, the sever may not |
|
| 19 |
# send a pong response … |
|
| 19:68 |
…st. |
|
| 20 |
# Increase the ping interval and timeout so that the client can wait |
|
| 21 |
# for a longer time before closing the connection. |
|
| 22 |
PING_INTERVAL_SECS = 60 |
|
| 31:31 |
…tr = "0.0.0.0", port: int = 8000) -> None: |
|
| 32 |
self._uri = f"ws://{host}:{port}" |
|
| 33 |
self._packer = msgpack_numpy.Packer() |
|
| 34 |
self._ws, self._server_metadata = self._wait_for_server() |
|
| 35 |
|
|
| 40:31 |
… for server at {self._uri}...") |
|
| 41 |
try: |
|
| 42 |
conn = websockets.sync.client.connect( |
Python websockets client usage |
| 43 |
self._uri, |
|
| 44 |
compression=None, |
|
| 45 |
max_size=None, |
|
| 46 |
ping_interval=PI… |
|
| 47:44 |
…ECS, |
|
| 48 |
) |
|
| 49 |
metadata = msgpack_numpy.unpackb(conn.recv()) |
|
| 50 |
return conn, metadata |
|
| 51 |
except: |
|
| 52 |
logging.info("Connection to server with ws:// failed. Trying wss:// ...") |
|
| 53 |
|
|
| 54 |
self._uri = "wss://" + self._uri.split("//")[1] |
|
| 55 |
conn = websockets.sync.client.connect( |
|
| 56 |
self._uri, |
|
| 57 |
compression=None,… |
|
Micro-behaviors
| 1 |
"""Client for communicating with a policy server. |
|
| 2 |
|
|
| 3 |
Adapted from https://github.com/robo-arena/roboarena/ |
|
| 4 |
|
|
| 5 |
""" |
|
| 6 |
|
|
| 7 |
import logging |
|
| 8 |
import time |
|
| 9 |
from typing import Dict, Tuple |
|
| 10 |
|
|
| 11 |
import websockets.sync.client |
|
| 12 |
from typing_extensions import override |
|
| 13 |
|
|
| 14 |
from openpi_client.base_policy import BasePolicy |
|
| 15 |
from openpi_client import msgpack_numpy |
|
| 16 |
|
|
| 17 |
# The websockets library by default sends a ping every 20 seconds and |
|
| 18 |
# expects a pong response within 20 seconds. However, the sever may not |
|
| 19 |
# send a pong response … |
|
| 47:44 |
…ECS, |
|
| 48 |
) |
|
| 49 |
metadata = msgpack_numpy.unpackb(conn.recv()) |
|
| 50 |
return conn, metadata |
|
| 51 |
except: |
|
| 52 |
logging.info("Connection to server with ws:// failed. Trying wss:// ...") |
|
| 53 |
|
|
| 54 |
self._uri = "wss://" + self._uri.split("//")[1] |
|
| 55 |
conn = websockets.sync.client.connect( |
|
| 56 |
self._uri, |
|
| 57 |
compression=None,… |
|
| 1 |
"""Client for communicating with a policy server. |
|
| 2 |
|
|
| 3 |
Adapted from https://github.com/robo-arena/roboarena/ |
|
| 4 |
|
|
| 5 |
""" |
|
| 6 |
|
|
| 7 |
import logging |
|
| 8 |
import time |
|
| 9 |
from typing import Dict, Tuple |
|
| 10 |
|
|
| 11 |
import websockets.sync.client |
|
| 12 |
from typing_extensions import override |
|
| 13 |
|
|
| 14 |
from openpi_client.base_policy import BasePolicy |
|
| 15 |
from openpi_client import msgpack_numpy |
|
| 16 |
|
|
| 17 |
# The websockets library by default sends a ping every 20 seconds and |
|
| 18 |
# expects a pong response within 20 seconds. However, the sever may not |
|
| 19 |
# send a pong response … |
|
| 40:31 |
… for server at {self._uri}...") |
|
| 41 |
try: |
|
| 42 |
conn = websockets.sync.client.connect( |
|
| 43 |
self._uri, |
|
| 44 |
compression=None, |
|
| 45 |
max_size=None, |
|
| 46 |
ping_interval=PI… |
|
Metadata
| 19:68 |
…st. |
|
| 20 |
# Increase the ping interval and timeout so that the client can wait |
|
| 21 |
# for a longer time before closing the connection. |
|
| 22 |
PING_INTERVAL_SECS = 60 |
|
| 1 |
"""Client for communicating with a policy server. |
|
| 2 |
|
|
| 3 |
Adapted from https://github.com/robo-arena/roboarena/ |
|
| 4 |
|
|
| 5 |
""" |
|
| 6 |
|
|
| 7 |
import logging |
|
| 8 |
import time |
|
| 9 |
from typing import Dict, Tuple |
|
| 10 |
|
|
| 11 |
import websockets.sync.client |
|
| 12 |
from typing_extensions import override |
|
| 13 |
|
|
| 14 |
from openpi_client.base_policy import BasePolicy |
|
| 15 |
from openpi_client import msgpack_numpy |
|
| 16 |
|
|
| 17 |
# The websockets library by default sends a ping every 20 seconds and |
|
| 18 |
# expects a pong response within 20 seconds. However, the sever may not |
|
| 19 |
# send a pong response … |
|
Identity
| SHA-256 |
4f9f062bdc5bec081a459b75a29825c0438f15d22da601e20305e843cd05b5f1 |
| Filename |
policy_client.py |
| Package |
zhicao/dreamzero |
| Version |
main |
| PURL |
pkg:huggingface/zhicao/dreamzero@main |
Timeline
| First seen |
13 Aug 2026 21:18 UTC |
| First analyzed |
29 Aug 2026 14:23 UTC |
| Last analyzed |
29 Aug 2026 14:23 UTC |
| Last updated |
29 Aug 2026 14:23 UTC |
Labeling
| Label |
unknown |
| Label source |
forager |
| Traits version |
b59b7 |