repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/acados_sim.py | third_party/acados/acados_template/acados_sim.py | # -*- coding: future_fstrings -*-
#
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/acados_model.py | third_party/acados/acados_template/acados_model.py | #
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/utils.py | third_party/acados/acados_template/utils.py | # -*- coding: future_fstrings -*-
#
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/builders.py | third_party/acados/acados_template/builders.py | # -*- coding: future_fstrings -*-
#
# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren,
# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor,
# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan,
# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Di... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/__init__.py | third_party/acados/acados_template/__init__.py | #
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/acados_sim_solver.py | third_party/acados/acados_template/acados_sim_solver.py | # -*- coding: future_fstrings -*-
#
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/acados_ocp_solver.py | third_party/acados/acados_template/acados_ocp_solver.py | # -*- coding: future_fstrings -*-
#
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | true |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/acados_ocp.py | third_party/acados/acados_template/acados_ocp.py | # -*- coding: future_fstrings -*-
#
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | true |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/casadi_function_generation.py | third_party/acados/acados_template/casadi_function_generation.py | #
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/gnsf/detect_affine_terms_reduce_nonlinearity.py | third_party/acados/acados_template/gnsf/detect_affine_terms_reduce_nonlinearity.py | #
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/gnsf/detect_gnsf_structure.py | third_party/acados/acados_template/gnsf/detect_gnsf_structure.py | #
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/gnsf/reformulate_with_invertible_E_mat.py | third_party/acados/acados_template/gnsf/reformulate_with_invertible_E_mat.py | #
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/gnsf/determine_trivial_gnsf_transcription.py | third_party/acados/acados_template/gnsf/determine_trivial_gnsf_transcription.py | #
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/gnsf/check_reformulation.py | third_party/acados/acados_template/gnsf/check_reformulation.py | #
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/gnsf/reformulate_with_LOS.py | third_party/acados/acados_template/gnsf/reformulate_with_LOS.py | #
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/gnsf/__init__.py | third_party/acados/acados_template/gnsf/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/gnsf/structure_detection_print_summary.py | third_party/acados/acados_template/gnsf/structure_detection_print_summary.py | #
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/third_party/acados/acados_template/gnsf/determine_input_nonlinearity_function.py | third_party/acados/acados_template/gnsf/determine_input_nonlinearity_function.py | #
# Copyright (c) The acados authors.
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/cereal/services.py | cereal/services.py | #!/usr/bin/env python3
from enum import IntEnum
from typing import Optional
# TODO: this should be automatically determined using the capnp schema
class QueueSize(IntEnum):
BIG = 10 * 1024 * 1024 # 10MB - video frames, large AI outputs
MEDIUM = 2 * 1024 * 1024 # 2MB - high freq (CAN), livestream
SMALL =... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/cereal/__init__.py | cereal/__init__.py | import os
import capnp
from importlib.resources import as_file, files
capnp.remove_import_hook()
with as_file(files("cereal")) as fspath:
CEREAL_PATH = fspath.as_posix()
log = capnp.load(os.path.join(CEREAL_PATH, "log.capnp"))
car = capnp.load(os.path.join(CEREAL_PATH, "car.capnp"))
custom = capnp.load(os.pat... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/cereal/messaging/__init__.py | cereal/messaging/__init__.py | # must be built with scons
from msgq.ipc_pyx import Context, Poller, SubSocket, PubSocket, SocketEventHandle, toggle_fake_events, \
set_fake_prefix, get_fake_prefix, delete_fake_prefix, wait_for_one_event
from msgq.ipc_pyx import MultiplePublishersError, IpcError
from msgq import fake_ev... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/cereal/messaging/tests/test_messaging.py | cereal/messaging/tests/test_messaging.py | import os
import capnp
import multiprocessing
import numbers
import random
import threading
import time
from parameterized import parameterized
import pytest
from cereal import log, car
import cereal.messaging as messaging
from cereal.services import SERVICE_LIST
events = [evt for evt in log.Event.schema.union_fields... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/cereal/messaging/tests/test_pub_sub_master.py | cereal/messaging/tests/test_pub_sub_master.py | import random
import time
from typing import Sized, cast
import cereal.messaging as messaging
from cereal.messaging.tests.test_messaging import events, random_sock, random_socks, \
random_bytes, random_carstate, assert_carstate, \
... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/cereal/messaging/tests/test_services.py | cereal/messaging/tests/test_services.py | import os
import tempfile
from typing import Dict
from parameterized import parameterized
import cereal.services as services
from cereal.services import SERVICE_LIST
class TestServices:
@parameterized.expand(SERVICE_LIST.keys())
def test_services(self, s):
service = SERVICE_LIST[s]
assert service.freque... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/cereal/messaging/tests/__init__.py | cereal/messaging/tests/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/scripts/disable-powersave.py | scripts/disable-powersave.py | #!/usr/bin/env python3
from openpilot.system.hardware import HARDWARE
if __name__ == "__main__":
HARDWARE.set_power_save(False)
| python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/scripts/reporter.py | scripts/reporter.py | #!/usr/bin/env python3
import os
import glob
import onnx
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))
MASTER_PATH = os.getenv("MASTER_PATH", BASEDIR)
MODEL_PATH = "/selfdrive/modeld/models/"
def get_checkpoint(f):
model = onnx.load(f)
metadata = {prop.key: prop.value... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/scripts/__init__.py | scripts/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/scripts/waste.py | scripts/waste.py | #!/usr/bin/env python3
import os
import time
import numpy as np
from multiprocessing import Process
from setproctitle import setproctitle
def waste(core):
os.sched_setaffinity(0, [core,])
m1 = np.zeros((200, 200)) + 0.8
m2 = np.zeros((200, 200)) + 1.2
i = 1
st = time.monotonic()
j = 0
while 1:
if (... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/release/pack.py | release/pack.py | #!/usr/bin/env python3
import importlib
import shutil
import sys
import tempfile
import zipapp
from argparse import ArgumentParser
from pathlib import Path
from openpilot.common.basedir import BASEDIR
DIRS = ['cereal', 'openpilot']
EXTS = ['.png', '.py', '.ttf', '.capnp', '.json', '.fnt', '.mo']
INTERPRETER = '/usr... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/release/release_files.py | release/release_files.py | #!/usr/bin/env python3
import os
import re
from pathlib import Path
HERE = os.path.abspath(os.path.dirname(__file__))
ROOT = HERE + "/.."
blacklist = [
".git/",
".github/workflows/",
"matlab.*.md",
# no LFS or submodules in release
".lfsconfig",
".gitattributes",
".git$",
".gitmodules",
]
# gets yo... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/version.py | system/version.py | #!/usr/bin/env python3
from dataclasses import dataclass
from functools import cache
import json
import os
import pathlib
import subprocess
from openpilot.common.basedir import BASEDIR
from openpilot.common.swaglog import cloudlog
from openpilot.common.git import get_commit, get_origin, get_branch, get_short_branch, g... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/logmessaged.py | system/logmessaged.py | #!/usr/bin/env python3
import zmq
from typing import NoReturn
import cereal.messaging as messaging
from openpilot.common.logging_extra import SwagLogFileFormatter
from openpilot.system.hardware.hw import Paths
from openpilot.common.swaglog import get_file_handler
def main() -> NoReturn:
log_handler = get_file_hand... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/proclogd.py | system/proclogd.py | #!/usr/bin/env python3
import os
from typing import NoReturn, TypedDict
from cereal import messaging
from openpilot.common.realtime import Ratekeeper
from openpilot.common.swaglog import cloudlog
JIFFY = os.sysconf(os.sysconf_names['SC_CLK_TCK'])
PAGE_SIZE = os.sysconf(os.sysconf_names['SC_PAGE_SIZE'])
def _cpu_tim... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/journald.py | system/journald.py | #!/usr/bin/env python3
import json
import subprocess
import cereal.messaging as messaging
from openpilot.common.swaglog import cloudlog
def main():
pm = messaging.PubMaster(['androidLog'])
cmd = ['journalctl', '-f', '-o', 'json']
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, text=True)
assert proc.std... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/sentry.py | system/sentry.py | """Install exception handler for process crash."""
import sentry_sdk
from enum import Enum
from sentry_sdk.integrations.threading import ThreadingIntegration
from openpilot.common.params import Params
from openpilot.system.athena.registration import is_registered_device
from openpilot.system.hardware import HARDWARE, ... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/__init__.py | system/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/micd.py | system/micd.py | #!/usr/bin/env python3
import numpy as np
from functools import cache
import threading
from cereal import messaging
from openpilot.common.realtime import Ratekeeper
from openpilot.common.utils import retry
from openpilot.common.swaglog import cloudlog
RATE = 10
FFT_SAMPLES = 1600 # 100ms
REFERENCE_SPL = 2e-5 # newto... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/statsd.py | system/statsd.py | #!/usr/bin/env python3
import os
import zmq
import time
import uuid
from pathlib import Path
from collections import defaultdict
from datetime import datetime, UTC
from typing import NoReturn
from openpilot.common.params import Params
from cereal.messaging import SubMaster
from openpilot.system.hardware.hw import Path... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/tombstoned.py | system/tombstoned.py | #!/usr/bin/env python3
import datetime
import os
import re
import shutil
import signal
import subprocess
import time
import glob
from typing import NoReturn
import openpilot.system.sentry as sentry
from openpilot.system.hardware.hw import Paths
from openpilot.common.swaglog import cloudlog
from openpilot.system.versio... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/timed.py | system/timed.py | #!/usr/bin/env python3
import datetime
import subprocess
import time
from typing import NoReturn
import cereal.messaging as messaging
from openpilot.common.time_helpers import min_date, system_time_valid
from openpilot.common.swaglog import cloudlog
from openpilot.common.params import Params
from openpilot.common.gps ... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/athena/registration.py | system/athena/registration.py | #!/usr/bin/env python3
import time
import json
import jwt
from typing import cast
from pathlib import Path
from datetime import datetime, timedelta, UTC
from openpilot.common.api import api_get, get_key_pair
from openpilot.common.params import Params
from openpilot.common.spinner import Spinner
from openpilot.selfdriv... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/athena/manage_athenad.py | system/athena/manage_athenad.py | #!/usr/bin/env python3
import time
from multiprocessing import Process
from openpilot.common.params import Params
from openpilot.system.manager.process import launcher
from openpilot.common.swaglog import cloudlog
from openpilot.system.hardware import HARDWARE
from openpilot.system.version import get_build_metadata
... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/athena/athenad.py | system/athena/athenad.py | #!/usr/bin/env python3
from __future__ import annotations
import base64
import hashlib
import io
import json
import os
import queue
import random
import select
import socket
import sys
import tempfile
import threading
import time
from dataclasses import asdict, dataclass, replace
from datetime import datetime
from fun... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/athena/__init__.py | system/athena/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/athena/tests/test_registration.py | system/athena/tests/test_registration.py | import json
from Crypto.PublicKey import RSA
from pathlib import Path
from openpilot.common.params import Params
from openpilot.system.athena.registration import register, UNREGISTERED_DONGLE_ID
from openpilot.system.athena.tests.helpers import MockResponse
from openpilot.system.hardware.hw import Paths
class TestRe... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/athena/tests/test_athenad.py | system/athena/tests/test_athenad.py | import pytest
from functools import wraps
import json
import multiprocessing
import os
import requests
import shutil
import time
import threading
import queue
from dataclasses import asdict, replace
from datetime import datetime, timedelta
from websocket import ABNF
from websocket._exceptions import WebSocketConnectio... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/athena/tests/helpers.py | system/athena/tests/helpers.py | import http.server
import socket
class MockResponse:
def __init__(self, json, status_code):
self.json = json
self.text = json
self.status_code = status_code
class EchoSocket:
def __init__(self, port):
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.bind(('127.0.0.... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/athena/tests/test_athenad_ping.py | system/athena/tests/test_athenad_ping.py | import pytest
import subprocess
import threading
import time
from typing import cast
from openpilot.common.params import Params
from openpilot.common.timeout import Timeout
from openpilot.system.athena import athenad
from openpilot.system.manager.helpers import write_onroad_params
from openpilot.system.hardware import... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/athena/tests/__init__.py | system/athena/tests/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/tests/test_logmessaged.py | system/tests/test_logmessaged.py | import glob
import os
import time
import cereal.messaging as messaging
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.hardware.hw import Paths
from openpilot.common.swaglog import cloudlog, ipchandler
class TestLogmessaged:
def setup_method(self):
# clear the IPC bu... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/tests/__init__.py | system/tests/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/esim.py | system/hardware/esim.py | #!/usr/bin/env python3
import argparse
import time
from openpilot.system.hardware import HARDWARE
if __name__ == '__main__':
parser = argparse.ArgumentParser(prog='esim.py', description='manage eSIM profiles on your comma device', epilog='comma.ai')
parser.add_argument('--backend', choices=['qmi', 'at'], default... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/hardwared.py | system/hardware/hardwared.py | #!/usr/bin/env python3
import fcntl
import os
import queue
import struct
import threading
import time
from collections import OrderedDict, namedtuple
import psutil
import cereal.messaging as messaging
from cereal import log
from cereal.services import SERVICE_LIST
from openpilot.common.utils import strip_deprecated_k... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/hw.py | system/hardware/hw.py | import os
import platform
from pathlib import Path
from openpilot.system.hardware import PC
DEFAULT_DOWNLOAD_CACHE_ROOT = "/tmp/comma_download_cache"
class Paths:
@staticmethod
def comma_home() -> str:
return os.path.join(str(Path.home()), ".comma" + os.environ.get("OPENPILOT_PREFIX", ""))
@staticmethod
... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/power_monitoring.py | system/hardware/power_monitoring.py | import time
import threading
from openpilot.common.params import Params
from openpilot.system.hardware import HARDWARE
from openpilot.common.swaglog import cloudlog
from openpilot.system.statsd import statlog
CAR_VOLTAGE_LOW_PASS_K = 0.011 # LPF gain for 45s tau (dt/tau / (dt/tau + 1))
# While driving, a battery cha... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/fan_controller.py | system/hardware/fan_controller.py | #!/usr/bin/env python3
import numpy as np
from openpilot.common.pid import PIDController
class FanController:
def __init__(self, rate: int) -> None:
self.last_ignition = False
self.controller = PIDController(k_p=0, k_i=4e-3, rate=rate)
def update(self, cur_temp: float, ignition: bool) -> int:
self.c... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/__init__.py | system/hardware/__init__.py | import os
from typing import cast
from openpilot.system.hardware.base import HardwareBase
from openpilot.system.hardware.tici.hardware import Tici
from openpilot.system.hardware.pc.hardware import Pc
TICI = os.path.isfile('/TICI')
AGNOS = os.path.isfile('/AGNOS')
PC = not TICI
if TICI:
HARDWARE = cast(HardwareBas... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/base.py | system/hardware/base.py | import os
from abc import abstractmethod, ABC
from dataclasses import dataclass, fields
from cereal import log
NetworkType = log.DeviceState.NetworkType
NetworkStrength = log.DeviceState.NetworkStrength
class LPAError(RuntimeError):
pass
class LPAProfileNotFoundError(LPAError):
pass
@dataclass
class Profile:
... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/amplifier.py | system/hardware/tici/amplifier.py | #!/usr/bin/env python3
import time
from smbus2 import SMBus
from collections import namedtuple
# https://datasheets.maximintegrated.com/en/ds/MAX98089.pdf
AmpConfig = namedtuple('AmpConfig', ['name', 'value', 'register', 'offset', 'mask'])
CONFIG = [
AmpConfig("MCLK prescaler", 0b01, 0x10, 4, 0b00110000),
AmpCon... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/esim.py | system/hardware/tici/esim.py | import json
import os
import shutil
import subprocess
from typing import Literal
from openpilot.system.hardware.base import LPABase, LPAError, LPAProfileNotFoundError, Profile
class TiciLPA(LPABase):
def __init__(self, interface: Literal['qmi', 'at'] = 'qmi'):
self.env = os.environ.copy()
self.env['LPAC_APD... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/power_monitor.py | system/hardware/tici/power_monitor.py | #!/usr/bin/env python3
import sys
import time
import datetime
import numpy as np
from collections import deque
from openpilot.common.realtime import Ratekeeper
from openpilot.common.filter_simple import FirstOrderFilter
def read_power():
with open("/sys/bus/i2c/devices/0-0040/hwmon/hwmon1/power1_input") as f:
... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/pins.py | system/hardware/tici/pins.py | # GPIO pin definitions
class GPIO:
# both GPIO_STM_RST_N and GPIO_LTE_RST_N are misnamed, they are high to reset
HUB_RST_N = 30
UBLOX_RST_N = 32
UBLOX_SAFEBOOT_N = 33
GNSS_PWR_EN = 34 # SCHEMATIC LABEL: GPIO_UBLOX_PWR_EN
STM_RST_N = 124
STM_BOOT0 = 134
STM_PWR_EN_N = 41 # because STM32H7 RST doesn't ge... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/hardware.py | system/hardware/tici/hardware.py | import math
import os
import subprocess
import time
import tempfile
from enum import IntEnum
from functools import cached_property, lru_cache
from pathlib import Path
from cereal import log
from openpilot.common.util import sudo_read, sudo_write
from openpilot.common.gpio import gpio_set, gpio_init, get_irqs_for_actio... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/__init__.py | system/hardware/tici/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/iwlist.py | system/hardware/tici/iwlist.py | import subprocess
def scan(interface="wlan0"):
result = []
try:
r = subprocess.check_output(["iwlist", interface, "scan"], encoding='utf8')
mac = None
for line in r.split('\n'):
if "Address" in line:
# Based on the adapter eithere a percentage or dBm is returned
# Add previous n... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/agnos.py | system/hardware/tici/agnos.py | #!/usr/bin/env python3
import hashlib
import json
import lzma
import os
import struct
import subprocess
import time
from collections.abc import Generator
import requests
import openpilot.system.updated.casync.casync as casync
SPARSE_CHUNK_FMT = struct.Struct('H2xI4x')
CAIBX_URL = "https://commadist.azureedge.net/agn... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/precise_power_measure.py | system/hardware/tici/precise_power_measure.py | #!/usr/bin/env python3
import numpy as np
from openpilot.system.hardware.tici.power_monitor import sample_power
if __name__ == '__main__':
print("measuring for 5 seconds")
for _ in range(3):
pwrs = sample_power()
print(f"mean {np.mean(pwrs):.2f} std {np.std(pwrs):.2f}")
| python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/tests/test_amplifier.py | system/hardware/tici/tests/test_amplifier.py | import pytest
import time
import random
import subprocess
from panda import Panda
from openpilot.system.hardware import TICI, HARDWARE
from openpilot.system.hardware.tici.amplifier import Amplifier
class TestAmplifier:
@classmethod
def setup_class(cls):
if not TICI:
pytest.skip()
def setup_method(s... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/tests/test_agnos_updater.py | system/hardware/tici/tests/test_agnos_updater.py | import json
import os
import requests
TEST_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)))
MANIFEST = os.path.join(TEST_DIR, "../agnos.json")
class TestAgnosUpdater:
def test_manifest(self):
with open(MANIFEST) as f:
m = json.load(f)
for img in m:
r = requests.head(img['url'], ... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/tests/compare_casync_manifest.py | system/hardware/tici/tests/compare_casync_manifest.py | #!/usr/bin/env python3
import argparse
import collections
import multiprocessing
import os
import requests
from tqdm import tqdm
import openpilot.system.hardware.tici.casync as casync
def get_chunk_download_size(chunk):
sha = chunk.sha.hex()
path = os.path.join(remote_url, sha[:4], sha + ".cacnk")
if os.path.... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/tests/test_esim.py | system/hardware/tici/tests/test_esim.py | import pytest
from openpilot.system.hardware import HARDWARE, TICI
from openpilot.system.hardware.base import LPAProfileNotFoundError
# https://euicc-manual.osmocom.org/docs/rsp/known-test-profile
# iccid is always the same for the given activation code
TEST_ACTIVATION_CODE = 'LPA:1$rsp.truphone.com$QRF-BETTERROAMING... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/tests/__init__.py | system/hardware/tici/tests/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tici/tests/test_power_draw.py | system/hardware/tici/tests/test_power_draw.py | from collections import defaultdict, deque
import pytest
import time
import numpy as np
from dataclasses import dataclass
from tabulate import tabulate
import cereal.messaging as messaging
from cereal.services import SERVICE_LIST
from opendbc.car.car_helpers import get_demo_car_params
from openpilot.common.mock import... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tests/test_fan_controller.py | system/hardware/tests/test_fan_controller.py | import pytest
from openpilot.system.hardware.fan_controller import FanController
ALL_CONTROLLERS = [FanController]
def patched_controller(mocker, controller_class):
mocker.patch("os.system", new=mocker.Mock())
return controller_class(2)
class TestFanController:
def wind_up(self, controller, ignition=True):
... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tests/test_power_monitoring.py | system/hardware/tests/test_power_monitoring.py | import pytest
from openpilot.common.params import Params
from openpilot.system.hardware.power_monitoring import PowerMonitoring, CAR_BATTERY_CAPACITY_uWh, \
CAR_CHARGING_RATE_W, VBATT_PAUSE_CHARGING, DELAY_SHUTDOWN_TIME_S
# Create fake time
ssb = 0.
def mock_time_monoto... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/tests/__init__.py | system/hardware/tests/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/pc/hardware.py | system/hardware/pc/hardware.py | from cereal import log
from openpilot.system.hardware.base import HardwareBase
NetworkType = log.DeviceState.NetworkType
class Pc(HardwareBase):
def get_device_type(self):
return "pc"
def get_network_type(self):
return NetworkType.wifi
| python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/hardware/pc/__init__.py | system/hardware/pc/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/manager/process_config.py | system/manager/process_config.py | import os
import operator
import platform
from cereal import car
from openpilot.common.params import Params
from openpilot.system.hardware import PC, TICI
from openpilot.system.manager.process import PythonProcess, NativeProcess, DaemonProcess
WEBCAM = os.getenv("USE_WEBCAM") is not None
def driverview(started: bool... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/manager/build.py | system/manager/build.py | #!/usr/bin/env python3
import os
import subprocess
from pathlib import Path
# NOTE: Do NOT import anything here that needs be built (e.g. params)
from openpilot.common.basedir import BASEDIR
from openpilot.common.spinner import Spinner
from openpilot.common.text_window import TextWindow
from openpilot.common.swaglog i... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/manager/helpers.py | system/manager/helpers.py | import errno
import fcntl
import os
import sys
import pathlib
import shutil
import signal
import subprocess
import tempfile
import threading
from openpilot.common.basedir import BASEDIR
from openpilot.common.params import Params
def unblock_stdout() -> None:
# get a non-blocking stdout
child_pid, child_pty = os.f... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/manager/__init__.py | system/manager/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/manager/manager.py | system/manager/manager.py | #!/usr/bin/env python3
import datetime
import os
import signal
import sys
import time
import traceback
from cereal import log
import cereal.messaging as messaging
import openpilot.system.sentry as sentry
from openpilot.common.utils import atomic_write
from openpilot.common.params import Params, ParamKeyFlag
from openp... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/manager/process.py | system/manager/process.py | import importlib
import os
import signal
import time
import subprocess
from collections.abc import Callable, ValuesView
from abc import ABC, abstractmethod
from multiprocessing import Process
from setproctitle import setproctitle
from cereal import car, log
import cereal.messaging as messaging
import openpilot.system... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/manager/test/test_manager.py | system/manager/test/test_manager.py | import os
import pytest
import signal
import time
from cereal import car
from openpilot.common.params import Params
import openpilot.system.manager.manager as manager
from openpilot.system.manager.process import ensure_running
from openpilot.system.manager.process_config import managed_processes, procs
from openpilot.... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/manager/test/__init__.py | system/manager/test/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/loggerd/deleter.py | system/loggerd/deleter.py | #!/usr/bin/env python3
import os
import shutil
import threading
from openpilot.system.hardware.hw import Paths
from openpilot.common.swaglog import cloudlog
from openpilot.system.loggerd.config import get_available_bytes, get_available_percent
from openpilot.system.loggerd.uploader import listdir_by_creation
from openp... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/loggerd/uploader.py | system/loggerd/uploader.py | #!/usr/bin/env python3
import json
import os
import random
import requests
import threading
import time
import traceback
import datetime
from collections.abc import Iterator
from cereal import log
import cereal.messaging as messaging
from openpilot.common.api import Api
from openpilot.common.utils import get_upload_st... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/loggerd/xattr_cache.py | system/loggerd/xattr_cache.py | import errno
import xattr
_cached_attributes: dict[tuple, bytes | None] = {}
def getxattr(path: str, attr_name: str) -> bytes | None:
key = (path, attr_name)
if key not in _cached_attributes:
try:
response = xattr.getxattr(path, attr_name)
except OSError as e:
# ENODATA (Linux) or ENOATTR (ma... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/loggerd/config.py | system/loggerd/config.py | import os
from openpilot.system.hardware.hw import Paths
CAMERA_FPS = 20
SEGMENT_LENGTH = 60
STATS_DIR_FILE_LIMIT = 10000
STATS_SOCKET = "ipc:///tmp/stats"
STATS_FLUSH_TIME_S = 60
def get_available_percent(default: float) -> float:
try:
statvfs = os.statvfs(Paths.log_root())
available_percent = 100.0 * st... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/loggerd/__init__.py | system/loggerd/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/loggerd/tests/test_encoder.py | system/loggerd/tests/test_encoder.py | import math
import os
import pytest
import random
import shutil
import subprocess
import time
from pathlib import Path
from parameterized import parameterized
from tqdm import trange
from openpilot.common.params import Params
from openpilot.common.timeout import Timeout
from openpilot.system.hardware import TICI
from... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/loggerd/tests/loggerd_tests_common.py | system/loggerd/tests/loggerd_tests_common.py | import os
import random
from pathlib import Path
import openpilot.system.loggerd.deleter as deleter
import openpilot.system.loggerd.uploader as uploader
from openpilot.common.params import Params
from openpilot.system.hardware.hw import Paths
from openpilot.system.loggerd.xattr_cache import setxattr
def create_rand... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/loggerd/tests/__init__.py | system/loggerd/tests/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false | |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/loggerd/tests/test_deleter.py | system/loggerd/tests/test_deleter.py | import time
import threading
from collections import namedtuple
from pathlib import Path
from collections.abc import Sequence
import openpilot.system.loggerd.deleter as deleter
from openpilot.common.timeout import Timeout, TimeoutException
from openpilot.system.loggerd.tests.loggerd_tests_common import UploaderTestCas... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/loggerd/tests/test_loggerd.py | system/loggerd/tests/test_loggerd.py | import numpy as np
import os
import re
import random
import string
import subprocess
import time
from collections import defaultdict
from pathlib import Path
import pytest
import cereal.messaging as messaging
from cereal import log
from cereal.services import SERVICE_LIST
from openpilot.common.basedir import BASEDIR
f... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/loggerd/tests/test_uploader.py | system/loggerd/tests/test_uploader.py | import os
import time
import threading
import logging
import json
from pathlib import Path
from openpilot.system.hardware.hw import Paths
from openpilot.common.swaglog import cloudlog
from openpilot.system.loggerd.uploader import main, UPLOAD_ATTR_NAME, UPLOAD_ATTR_VALUE
from openpilot.system.loggerd.tests.loggerd_te... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/sensord/sensord.py | system/sensord/sensord.py | #!/usr/bin/env python3
import os
import time
import ctypes
import select
import threading
import cereal.messaging as messaging
from cereal.services import SERVICE_LIST
from openpilot.common.util import sudo_write
from openpilot.common.realtime import config_realtime_process, Ratekeeper
from openpilot.common.swaglog im... | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
commaai/openpilot | https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/sensord/__init__.py | system/sensord/__init__.py | python | MIT | adbf68f77120b4568de68c37b8bed4ed433e01fe | 2026-01-04T14:38:40.093933Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.