sample_id
stringlengths
21
196
text
stringlengths
105
936k
metadata
dict
category
stringclasses
6 values
ccxt/ccxt:python/ccxt/static_dependencies/bip/utils/crypto/ripemd.py
# Copyright (c) 2022 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/utils/crypto/ripemd.py", "license": "MIT License", "lines": 47, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/bip/utils/crypto/scrypt.py
# Copyright (c) 2022 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/utils/crypto/scrypt.py", "license": "MIT License", "lines": 56, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/bip/utils/crypto/sha2.py
# Copyright (c) 2022 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/utils/crypto/sha2.py", "license": "MIT License", "lines": 142, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/bip/utils/crypto/sha3.py
# Copyright (c) 2022 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/utils/crypto/sha3.py", "license": "MIT License", "lines": 79, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/bip/utils/misc/algo.py
# Copyright (c) 2021 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/utils/misc/algo.py", "license": "MIT License", "lines": 87, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/bip/utils/misc/base32.py
# Copyright (c) 2021 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/utils/misc/base32.py", "license": "MIT License", "lines": 121, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/bip/utils/misc/bit.py
# Copyright (c) 2021 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/utils/misc/bit.py", "license": "MIT License", "lines": 94, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/bip/utils/misc/bytes.py
# Copyright (c) 2021 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/utils/misc/bytes.py", "license": "MIT License", "lines": 162, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/bip/utils/misc/data_bytes.py
# Copyright (c) 2021 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/utils/misc/data_bytes.py", "license": "MIT License", "lines": 143, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/bip/utils/misc/integer.py
# Copyright (c) 2021 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/utils/misc/integer.py", "license": "MIT License", "lines": 78, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/bip/utils/misc/string.py
# Copyright (c) 2021 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/utils/misc/string.py", "license": "MIT License", "lines": 44, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/bip/utils/typing/literal.py
# Copyright (c) 2022 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/utils/typing/literal.py", "license": "MIT License", "lines": 25, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/bip/wif/wif.py
# Copyright (c) 2021 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/bip/wif/wif.py", "license": "MIT License", "lines": 114, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:python/ccxt/static_dependencies/dydx_v4_client/registry.py
from google.protobuf.json_format import ParseDict from google.protobuf.any_pb2 import Any from .dydxprotocol.sending.transfer_pb2 import ( MsgDepositToSubaccount, MsgWithdrawFromSubaccount, ) from .dydxprotocol.sending.tx_pb2 import MsgCreateTransfer from .dydxprotocol.clob.tx_pb2 import ( MsgPlaceOrder, ...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/dydx_v4_client/registry.py", "license": "MIT License", "lines": 34, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
ccxt/ccxt:python/ccxt/static_dependencies/mnemonic/mnemonic.py
# # Copyright (c) 2013 Pavol Rusnak # Copyright (c) 2017 mruddy # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, ...
{ "repo_id": "ccxt/ccxt", "file_path": "python/ccxt/static_dependencies/mnemonic/mnemonic.py", "license": "MIT License", "lines": 245, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ccxt/ccxt:examples/py/set_markets_from_exchange.py
# -*- coding: utf-8 -*- import asyncio import os import sys root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') import ccxt.async_support as ccxt # noqa: E402 import psutil # noqa: E402 def get_memory_usage(): """Get current memory usage in MB...
{ "repo_id": "ccxt/ccxt", "file_path": "examples/py/set_markets_from_exchange.py", "license": "MIT License", "lines": 28, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
ccxt/ccxt:examples/py/ws_test_load.py
import asyncio import os import sys import psutil import time from collections import defaultdict from datetime import datetime sys.path.append('./python') import ccxt.pro as ccxt class PerformanceMetrics: def __init__(self): self.message_count = defaultdict(int) self.error_count = defaultdict(in...
{ "repo_id": "ccxt/ccxt", "file_path": "examples/py/ws_test_load.py", "license": "MIT License", "lines": 96, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:tools/lib/file_downloader.py
#!/usr/bin/env python3 """ CLI tool for downloading files and querying the comma API. Called by C++ replay/cabana via subprocess. Subcommands: route-files <route> - Get route file URLs as JSON download <url> - Download URL to local cache, print local path devices - List user's devices a...
{ "repo_id": "commaai/openpilot", "file_path": "tools/lib/file_downloader.py", "license": "MIT License", "lines": 119, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ui/lib/tests/test_handle_state_change.py
"""Tests for WifiManager._handle_state_change. Tests the state machine in isolation by constructing a WifiManager with mocked DBus, then calling _handle_state_change directly with NM state transitions. """ import pytest from jeepney.low_level import MessageType from pytest_mock import MockerFixture from openpilot.sys...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/lib/tests/test_handle_state_change.py", "license": "MIT License", "lines": 702, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
commaai/openpilot:selfdrive/ui/translations/potools.py
"""Pure Python tools for managing .po translation files. Replaces GNU gettext CLI tools (xgettext, msginit, msgmerge) with Python implementations for extracting, creating, and updating .po files. """ import ast import os import re from dataclasses import dataclass, field from datetime import UTC, datetime from pathli...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/translations/potools.py", "license": "MIT License", "lines": 306, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:common/file_chunker.py
import math import os from pathlib import Path CHUNK_SIZE = 45 * 1024 * 1024 # 45MB, under GitHub's 50MB limit def get_chunk_name(name, idx, num_chunks): return f"{name}.chunk{idx+1:02d}of{num_chunks:02d}" def get_manifest_path(name): return f"{name}.chunkmanifest" def get_chunk_paths(path, file_size): num_c...
{ "repo_id": "commaai/openpilot", "file_path": "common/file_chunker.py", "license": "MIT License", "lines": 30, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:system/ui/widgets/icon_widget.py
import pyray as rl from openpilot.system.ui.lib.application import gui_app from openpilot.system.ui.widgets import Widget class IconWidget(Widget): def __init__(self, image_path: str, size: tuple[int, int], opacity: float = 1.0): super().__init__() self._texture = gui_app.texture(image_path, size[0], size[1...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/widgets/icon_widget.py", "license": "MIT License", "lines": 13, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:system/ui/widgets/layouts.py
from enum import IntFlag from openpilot.system.ui.widgets import Widget class Alignment(IntFlag): LEFT = 0 # TODO: implement # H_CENTER = 2 # RIGHT = 4 TOP = 8 V_CENTER = 16 BOTTOM = 32 class HBoxLayout(Widget): """ A Widget that lays out child Widgets horizontally. """ def __init__(self, wi...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/widgets/layouts.py", "license": "MIT License", "lines": 45, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:system/ui/widgets/nav_widget.py
from __future__ import annotations import abc import pyray as rl from collections.abc import Callable from openpilot.system.ui.widgets import Widget from openpilot.common.filter_simple import BounceFilter, FirstOrderFilter from openpilot.system.ui.lib.application import gui_app, MousePos, MouseEvent SWIPE_AWAY_THRESH...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/widgets/nav_widget.py", "license": "MIT License", "lines": 169, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:common/parameterized.py
import sys import pytest import inspect class parameterized: @staticmethod def expand(cases): cases = list(cases) if not cases: return lambda func: pytest.mark.skip("no parameterized cases")(func) def decorator(func): params = [p for p in inspect.signature(func).parameters if p != 'self'...
{ "repo_id": "commaai/openpilot", "file_path": "common/parameterized.py", "license": "MIT License", "lines": 38, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/tests/test_widget_leaks.py
import pyray as rl rl.set_config_flags(rl.ConfigFlags.FLAG_WINDOW_HIDDEN) import gc import weakref import pytest from openpilot.system.ui.lib.application import gui_app from openpilot.system.ui.widgets import Widget # mici dialogs from openpilot.selfdrive.ui.mici.layouts.onboarding import TrainingGuide as MiciTraining...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/tests/test_widget_leaks.py", "license": "MIT License", "lines": 99, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
commaai/openpilot:system/hardware/tici/lpa.py
# SGP.22 v2.3: https://www.gsma.com/solutions-and-impact/technologies/esim/wp-content/uploads/2021/07/SGP.22-v2.3.pdf import atexit import base64 import math import os import serial import sys from collections.abc import Generator from openpilot.system.hardware.base import LPABase, Profile DEFAULT_DEVICE = "/dev/t...
{ "repo_id": "commaai/openpilot", "file_path": "system/hardware/tici/lpa.py", "license": "MIT License", "lines": 233, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:tools/longitudinal_maneuvers/maneuver_helpers.py
from enum import IntEnum class Axis(IntEnum): TIME = 0 EGO_POSITION = 1 LEAD_DISTANCE= 2 EGO_V = 3 LEAD_V = 4 EGO_A = 5 D_REL = 6 axis_labels = {Axis.TIME: 'Time (s)', Axis.EGO_POSITION: 'Ego position (m)', Axis.LEAD_DISTANCE: 'Lead absolute position (m)', Ax...
{ "repo_id": "commaai/openpilot", "file_path": "tools/longitudinal_maneuvers/maneuver_helpers.py", "license": "MIT License", "lines": 16, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:selfdrive/ui/tests/diff/replay_script.py
from __future__ import annotations from typing import TYPE_CHECKING from collections.abc import Callable from dataclasses import dataclass from cereal import car, log, messaging from cereal.messaging import PubMaster from openpilot.common.basedir import BASEDIR from openpilot.common.params import Params from openpilot...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/tests/diff/replay_script.py", "license": "MIT License", "lines": 182, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
commaai/openpilot:selfdrive/modeld/compile_warp.py
#!/usr/bin/env python3 import time import pickle import numpy as np from pathlib import Path from tinygrad.tensor import Tensor from tinygrad.helpers import Context from tinygrad.device import Device from tinygrad.engine.jit import TinyJit from openpilot.system.camerad.cameras.nv12_info import get_nv12_info from openp...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/modeld/compile_warp.py", "license": "MIT License", "lines": 160, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:selfdrive/debug/mem_usage.py
#!/usr/bin/env python3 import argparse import os from collections import defaultdict import numpy as np from openpilot.common.utils import tabulate from openpilot.tools.lib.logreader import LogReader DEMO_ROUTE = "5beb9b58bd12b691/0000010a--a51155e496" MB = 1024 * 1024 TABULATE_OPTS = dict(tablefmt="simple_grid", st...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/debug/mem_usage.py", "license": "MIT License", "lines": 185, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ubloxd/binary_struct.py
""" Binary struct parsing DSL. Defines a declarative schema for binary messages using dataclasses and type annotations. """ import struct from enum import Enum from dataclasses import dataclass, is_dataclass from typing import Annotated, Any, TypeVar, get_args, get_origin class FieldType: """Base class for field ...
{ "repo_id": "commaai/openpilot", "file_path": "system/ubloxd/binary_struct.py", "license": "MIT License", "lines": 233, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ubloxd/glonass.py
""" Parses GLONASS navigation strings per GLONASS ICD specification. http://gauss.gge.unb.ca/GLONASS.ICD.pdf https://www.unavco.org/help/glossary/docs/ICD_GLONASS_4.0_(1998)_en.pdf """ from typing import Annotated from openpilot.system.ubloxd import binary_struct as bs class Glonass(bs.BinaryStruct): class String...
{ "repo_id": "commaai/openpilot", "file_path": "system/ubloxd/glonass.py", "license": "MIT License", "lines": 134, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:system/ubloxd/gps.py
""" Parses GPS navigation subframes per IS-GPS-200E specification. https://www.gps.gov/technical/icwg/IS-GPS-200E.pdf """ from typing import Annotated from openpilot.system.ubloxd import binary_struct as bs class Gps(bs.BinaryStruct): class Tlm(bs.BinaryStruct): preamble: Annotated[bytes, bs.const(bs.bytes_fi...
{ "repo_id": "commaai/openpilot", "file_path": "system/ubloxd/gps.py", "license": "MIT License", "lines": 102, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:system/ubloxd/ubx.py
""" UBX protocol parser """ from enum import IntEnum from typing import Annotated from openpilot.system.ubloxd import binary_struct as bs class GnssType(IntEnum): gps = 0 sbas = 1 galileo = 2 beidou = 3 imes = 4 qzss = 5 glonass = 6 class Ubx(bs.BinaryStruct): GnssType = GnssType class RxmRawx(...
{ "repo_id": "commaai/openpilot", "file_path": "system/ubloxd/ubx.py", "license": "MIT License", "lines": 162, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:common/i2c.py
import os import fcntl import ctypes # I2C constants from /usr/include/linux/i2c-dev.h I2C_SLAVE = 0x0703 I2C_SLAVE_FORCE = 0x0706 I2C_SMBUS = 0x0720 # SMBus transfer types I2C_SMBUS_READ = 1 I2C_SMBUS_WRITE = 0 I2C_SMBUS_BYTE_DATA = 2 I2C_SMBUS_I2C_BLOCK_DATA = 8 I2C_SMBUS_BLOCK_MAX = 32 class _I2cSmbusData(ctype...
{ "repo_id": "commaai/openpilot", "file_path": "common/i2c.py", "license": "MIT License", "lines": 63, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py
import io import sys import markdown import numpy as np import matplotlib.pyplot as plt from openpilot.common.realtime import DT_MDL from openpilot.selfdrive.controls.tests.test_following_distance import desired_follow_distance from openpilot.tools.longitudinal_maneuvers.maneuver_helpers import Axis, axis_labels from o...
{ "repo_id": "commaai/openpilot", "file_path": "tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py", "license": "MIT License", "lines": 251, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/pandad/pandad_api_impl.py
import time from cereal import log NO_TRAVERSAL_LIMIT = 2**64 - 1 # Cache schema fields for faster access (avoids string lookup on each field access) _cached_reader_fields = None # (address_field, dat_field, src_field) for reading _cached_writer_fields = None # (address_field, dat_field, src_field) for writing de...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/pandad/pandad_api_impl.py", "license": "MIT License", "lines": 66, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:scripts/ci_results.py
#!/usr/bin/env python3 """Fetch CI results from GitHub Actions and Jenkins.""" import argparse import json import subprocess import time import urllib.error import urllib.request from datetime import datetime JENKINS_URL = "https://jenkins.comma.life" DEFAULT_TIMEOUT = 1800 # 30 minutes POLL_INTERVAL = 30 # seconds...
{ "repo_id": "commaai/openpilot", "file_path": "scripts/ci_results.py", "license": "MIT License", "lines": 174, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/controls/tests/test_latcontrol_torque_buffer.py
from openpilot.common.parameterized import parameterized from cereal import car, log from opendbc.car.car_helpers import interfaces from opendbc.car.toyota.values import CAR as TOYOTA from opendbc.car.vehicle_model import VehicleModel from openpilot.common.realtime import DT_CTRL from openpilot.selfdrive.controls.lib....
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/controls/tests/test_latcontrol_torque_buffer.py", "license": "MIT License", "lines": 29, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
commaai/openpilot:system/camerad/cameras/nv12_info.py
# Python version of system/camerad/cameras/nv12_info.h # Calculations from third_party/linux/include/msm_media_info.h (VENUS_BUFFER_SIZE) def align(val: int, alignment: int) -> int: return ((val + alignment - 1) // alignment) * alignment def get_nv12_info(width: int, height: int) -> tuple[int, int, int, int]: """...
{ "repo_id": "commaai/openpilot", "file_path": "system/camerad/cameras/nv12_info.py", "license": "MIT License", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:common/transformations/transformations.py
import numpy as np # Constants a = 6378137.0 b = 6356752.3142 esq = 6.69437999014e-3 e1sq = 6.73949674228e-3 def geodetic2ecef_single(g): """ Convert geodetic coordinates (latitude, longitude, altitude) to ECEF. """ try: if len(g) != 3: raise ValueError("Geodetic must be size 3") except TypeErro...
{ "repo_id": "commaai/openpilot", "file_path": "common/transformations/transformations.py", "license": "MIT License", "lines": 275, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/debug/analyze-msg-size.py
#!/usr/bin/env python3 import argparse from tqdm import tqdm from cereal.services import SERVICE_LIST, QueueSize from openpilot.tools.lib.logreader import LogReader if __name__ == "__main__": parser = argparse.ArgumentParser(description="Analyze message sizes from a log route") parser.add_argument("route", nargs...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/debug/analyze-msg-size.py", "license": "MIT License", "lines": 70, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/tests/diff/diff.py
#!/usr/bin/env python3 import os import sys import subprocess import webbrowser import argparse from pathlib import Path from openpilot.common.basedir import BASEDIR DIFF_OUT_DIR = Path(BASEDIR) / "selfdrive" / "ui" / "tests" / "diff" / "report" HTML_TEMPLATE_PATH = Path(__file__).with_name("diff_template.html") def...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/tests/diff/diff.py", "license": "MIT License", "lines": 107, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
commaai/openpilot:selfdrive/ui/tests/diff/replay.py
#!/usr/bin/env python3 import os import argparse import coverage import pyray as rl from typing import Literal from collections.abc import Callable from cereal.messaging import PubMaster from openpilot.common.params import Params from openpilot.common.prefix import OpenpilotPrefix from openpilot.selfdrive.ui.tests.dif...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/tests/diff/replay.py", "license": "MIT License", "lines": 107, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
commaai/openpilot:selfdrive/assets/sounds/make_beeps.py
import numpy as np from scipy.io import wavfile sr = 48000 max_int16 = 2**15 - 1 def harmonic_beep(freq, duration_seconds): n_total = int(sr * duration_seconds) signal = np.sin(2 * np.pi * freq * np.arange(n_total) / sr) x = np.arange(n_total) exp_scale = np.exp(-x/5.5e3) return max_int16 * sign...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/assets/sounds/make_beeps.py", "license": "MIT License", "lines": 14, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:selfdrive/ui/mici/layouts/home.py
import datetime import time from cereal import log import pyray as rl from collections.abc import Callable from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.layouts import HBoxLayout from openpilot.system.ui.widgets.icon_widget import IconWidget from openpilot.system.ui.widgets.label impo...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/layouts/home.py", "license": "MIT License", "lines": 166, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/layouts/main.py
import pyray as rl import cereal.messaging as messaging from openpilot.selfdrive.ui.mici.layouts.home import MiciHomeLayout from openpilot.selfdrive.ui.mici.layouts.settings.settings import SettingsLayout from openpilot.selfdrive.ui.mici.layouts.offroad_alerts import MiciOffroadAlerts from openpilot.selfdrive.ui.mici.o...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/layouts/main.py", "license": "MIT License", "lines": 98, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/layouts/offroad_alerts.py
import pyray as rl import re import time from dataclasses import dataclass from enum import IntEnum from openpilot.common.params import Params from openpilot.selfdrive.selfdrived.alertmanager import OFFROAD_ALERTS from openpilot.system.hardware import HARDWARE from openpilot.system.ui.widgets import Widget from openpil...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/layouts/offroad_alerts.py", "license": "MIT License", "lines": 250, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/layouts/onboarding.py
from enum import IntEnum import weakref import math import numpy as np import pyray as rl from openpilot.common.filter_simple import FirstOrderFilter from openpilot.system.hardware import HARDWARE from openpilot.system.ui.lib.application import FontWeight, gui_app from openpilot.system.ui.widgets import Widget from op...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/layouts/onboarding.py", "license": "MIT License", "lines": 387, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/layouts/settings/developer.py
from openpilot.common.time_helpers import system_time_valid from openpilot.system.ui.widgets.scroller import NavScroller from openpilot.selfdrive.ui.mici.widgets.button import BigButton, BigToggle, BigParamControl, BigCircleParamControl from openpilot.selfdrive.ui.mici.widgets.dialog import BigDialog, BigInputDialog fr...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/layouts/settings/developer.py", "license": "MIT License", "lines": 125, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:selfdrive/ui/mici/layouts/settings/device.py
import os import threading import pyray as rl from enum import IntEnum from collections.abc import Callable from openpilot.common.basedir import BASEDIR from openpilot.common.params import Params from openpilot.common.time_helpers import system_time_valid from openpilot.system.ui.widgets.scroller import NavRawScrollPa...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/layouts/settings/device.py", "license": "MIT License", "lines": 265, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/layouts/settings/firehose.py
import requests import threading import time import pyray as rl from openpilot.common.api import api_get from openpilot.common.params import Params from openpilot.common.swaglog import cloudlog from openpilot.selfdrive.ui.lib.api_helpers import get_token from openpilot.selfdrive.ui.ui_state import ui_state, device fro...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/layouts/settings/firehose.py", "license": "MIT License", "lines": 184, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/layouts/settings/settings.py
from openpilot.common.params import Params from openpilot.system.ui.widgets.scroller import NavScroller from openpilot.selfdrive.ui.mici.widgets.button import BigButton from openpilot.selfdrive.ui.mici.layouts.settings.toggles import TogglesLayoutMici from openpilot.selfdrive.ui.mici.layouts.settings.network import Net...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/layouts/settings/settings.py", "license": "MIT License", "lines": 41, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:selfdrive/ui/mici/layouts/settings/toggles.py
from cereal import log from openpilot.system.ui.widgets.scroller import NavScroller from openpilot.selfdrive.ui.mici.widgets.button import BigParamControl, BigMultiParamToggle from openpilot.system.ui.lib.application import gui_app from openpilot.selfdrive.ui.layouts.settings.common import restart_needed_callback from...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/layouts/settings/toggles.py", "license": "MIT License", "lines": 71, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:selfdrive/ui/mici/onroad/alert_renderer.py
import time from enum import StrEnum from typing import NamedTuple import pyray as rl import random import string from dataclasses import dataclass from cereal import messaging, log, car from openpilot.selfdrive.ui.ui_state import ui_state from openpilot.common.filter_simple import BounceFilter, FirstOrderFilter from o...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/onroad/alert_renderer.py", "license": "MIT License", "lines": 288, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/onroad/augmented_road_view.py
import time import numpy as np import pyray as rl from cereal import messaging, car, log from msgq.visionipc import VisionStreamType from openpilot.selfdrive.ui.ui_state import ui_state, UIStatus from openpilot.selfdrive.ui.mici.onroad import SIDE_PANEL_WIDTH from openpilot.selfdrive.ui.mici.onroad.alert_renderer impor...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/onroad/augmented_road_view.py", "license": "MIT License", "lines": 301, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/onroad/cameraview.py
import platform import numpy as np import pyray as rl from msgq.visionipc import VisionIpcClient, VisionStreamType, VisionBuf from openpilot.common.swaglog import cloudlog from openpilot.system.hardware import TICI from openpilot.system.ui.lib.application import gui_app from openpilot.system.ui.lib.egl import init_egl...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/onroad/cameraview.py", "license": "MIT License", "lines": 341, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/onroad/confidence_ball.py
import math import pyray as rl from openpilot.selfdrive.ui.mici.onroad import SIDE_PANEL_WIDTH from openpilot.selfdrive.ui.ui_state import ui_state, UIStatus from openpilot.system.ui.widgets import Widget from openpilot.system.ui.lib.application import gui_app from openpilot.common.filter_simple import FirstOrderFilter...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/onroad/confidence_ball.py", "license": "MIT License", "lines": 64, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:selfdrive/ui/mici/onroad/driver_camera_dialog.py
import pyray as rl from cereal import log, messaging from msgq.visionipc import VisionStreamType from openpilot.selfdrive.ui.mici.onroad.cameraview import CameraView from openpilot.selfdrive.ui.mici.onroad.driver_state import DriverStateRenderer from openpilot.selfdrive.ui.ui_state import ui_state, device from openpilo...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/onroad/driver_camera_dialog.py", "license": "MIT License", "lines": 202, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/onroad/driver_state.py
import pyray as rl import numpy as np import math from cereal import log from openpilot.common.filter_simple import FirstOrderFilter from openpilot.system.ui.lib.application import gui_app from openpilot.system.ui.widgets import Widget from openpilot.selfdrive.ui.ui_state import ui_state AlertSize = log.SelfdriveState...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/onroad/driver_state.py", "license": "MIT License", "lines": 178, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/onroad/hud_renderer.py
import pyray as rl from dataclasses import dataclass from openpilot.common.constants import CV from openpilot.selfdrive.ui.mici.onroad.torque_bar import TorqueBar from openpilot.selfdrive.ui.ui_state import ui_state, UIStatus from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.l...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/onroad/hud_renderer.py", "license": "MIT License", "lines": 222, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/onroad/model_renderer.py
import colorsys import numpy as np import pyray as rl from cereal import messaging, car from dataclasses import dataclass, field from openpilot.common.params import Params from openpilot.common.filter_simple import FirstOrderFilter from openpilot.selfdrive.locationd.calibrationd import HEIGHT_INIT from openpilot.selfdr...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/onroad/model_renderer.py", "license": "MIT License", "lines": 382, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/onroad/torque_bar.py
import math import time from functools import wraps from collections import OrderedDict import numpy as np import pyray as rl from opendbc.car import ACCELERATION_DUE_TO_GRAVITY from openpilot.selfdrive.ui.mici.onroad import blend_colors from openpilot.selfdrive.ui.ui_state import ui_state, UIStatus from openpilot.sys...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/onroad/torque_bar.py", "license": "MIT License", "lines": 205, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/widgets/button.py
import math import pyray as rl from typing import Union from enum import Enum from collections.abc import Callable from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.label import UnifiedLabel from openpilot.system.ui.widgets.scroller import DO_ZOOM from openpilot.system.ui.lib.application i...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/widgets/button.py", "license": "MIT License", "lines": 290, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/widgets/dialog.py
import abc import math import pyray as rl from typing import Union from collections.abc import Callable from openpilot.system.ui.widgets.nav_widget import NavWidget from openpilot.system.ui.widgets.label import UnifiedLabel, gui_label from openpilot.system.ui.widgets.mici_keyboard import MiciKeyboard from openpilot.sys...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/widgets/dialog.py", "license": "MIT License", "lines": 205, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/mici/widgets/pairing_dialog.py
import pyray as rl import qrcode import numpy as np import time from openpilot.common.api import Api from openpilot.common.swaglog import cloudlog from openpilot.common.params import Params from openpilot.selfdrive.ui.ui_state import ui_state from openpilot.system.ui.widgets.nav_widget import NavWidget from openpilot....
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/mici/widgets/pairing_dialog.py", "license": "MIT License", "lines": 89, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ui/lib/scroll_panel2.py
import os import math import pyray as rl from collections.abc import Callable from enum import Enum from typing import cast from openpilot.system.ui.lib.application import gui_app, MouseEvent from openpilot.system.hardware import TICI from collections import deque MIN_VELOCITY = 10 # px/s, changes from auto scroll to...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/lib/scroll_panel2.py", "license": "MIT License", "lines": 192, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ui/mici_reset.py
#!/usr/bin/env python3 import os import sys import threading import time from enum import IntEnum import pyray as rl from openpilot.system.hardware import PC from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.slider impor...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/mici_reset.py", "license": "MIT License", "lines": 119, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ui/mici_updater.py
#!/usr/bin/env python3 import sys import subprocess import threading import pyray as rl from enum import IntEnum from openpilot.system.hardware import HARDWARE from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.lib.wifi_manager import WifiManager from openpilot.system.ui.widge...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/mici_updater.py", "license": "MIT License", "lines": 167, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ui/tici_reset.py
#!/usr/bin/env python3 import os import sys import threading import time from enum import IntEnum import pyray as rl from openpilot.system.hardware import PC from openpilot.system.ui.lib.application import gui_app, FontWeight, FONT_SCALE from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets....
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/tici_reset.py", "license": "MIT License", "lines": 102, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ui/tici_updater.py
#!/usr/bin/env python3 import sys import subprocess import threading import pyray as rl from enum import IntEnum from openpilot.system.hardware import HARDWARE from openpilot.system.ui.lib.application import gui_app, FontWeight, FONT_SCALE from openpilot.system.ui.lib.wifi_manager import WifiManager from openpilot.sys...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/tici_updater.py", "license": "MIT License", "lines": 140, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ui/widgets/mici_keyboard.py
from enum import IntEnum import pyray as rl import numpy as np from openpilot.system.ui.lib.application import gui_app, FontWeight, MousePos, MouseEvent from openpilot.system.ui.lib.text_measure import measure_text_cached from openpilot.system.ui.widgets import Widget from openpilot.common.filter_simple import BounceFi...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/widgets/mici_keyboard.py", "license": "MIT License", "lines": 319, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ui/widgets/scroller_tici.py
import pyray as rl from openpilot.system.ui.lib.scroll_panel import GuiScrollPanel from openpilot.system.ui.widgets import Widget ITEM_SPACING = 40 LINE_COLOR = rl.GRAY LINE_PADDING = 40 class LineSeparator(Widget): def __init__(self, height: int = 1): super().__init__() self._rect = rl.Rectangle(0, 0, 0, ...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/widgets/scroller_tici.py", "license": "MIT License", "lines": 69, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:system/ui/widgets/slider.py
from collections.abc import Callable import pyray as rl from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.label import UnifiedLabel from openpilot.common.filter_simple import FirstOrderFilter class SmallSlider(Widget):...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/widgets/slider.py", "license": "MIT License", "lines": 146, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/tests/profile_onroad.py
#!/usr/bin/env python3 import os import time import cProfile import pyray as rl import numpy as np from msgq.visionipc import VisionIpcServer, VisionStreamType from openpilot.selfdrive.ui.ui_state import ui_state from openpilot.selfdrive.ui.mici.layouts.main import MiciMainLayout from openpilot.system.ui.lib.applicati...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/tests/profile_onroad.py", "license": "MIT License", "lines": 89, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
commaai/openpilot:selfdrive/assets/fonts/process.py
#!/usr/bin/env python3 from pathlib import Path import json import pyray as rl FONT_DIR = Path(__file__).resolve().parent SELFDRIVE_DIR = FONT_DIR.parents[1] TRANSLATIONS_DIR = SELFDRIVE_DIR / "ui" / "translations" LANGUAGES_FILE = TRANSLATIONS_DIR / "languages.json" GLYPH_PADDING = 6 EXTRA_CHARS = "–‑✓×°§•X⚙✕◀▶✔⌫⇧␣...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/assets/fonts/process.py", "license": "MIT License", "lines": 105, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ui/lib/multilang.py
from importlib.resources import files import json import os import re from openpilot.common.basedir import BASEDIR from openpilot.common.swaglog import cloudlog try: from openpilot.common.params import Params except ImportError: Params = None SYSTEM_UI_DIR = os.path.join(BASEDIR, "system", "ui") UI_DIR = files("o...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/lib/multilang.py", "license": "MIT License", "lines": 177, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/layouts/onboarding.py
import os import re import threading from enum import IntEnum import pyray as rl from openpilot.common.basedir import BASEDIR from openpilot.system.ui.lib.application import FontWeight, gui_app from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widg...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/layouts/onboarding.py", "license": "MIT License", "lines": 166, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ubloxd/ubloxd.py
#!/usr/bin/env python3 import math import capnp import calendar import numpy as np from collections import defaultdict from dataclasses import dataclass from cereal import log from cereal import messaging from openpilot.system.ubloxd.ubx import Ubx from openpilot.system.ubloxd.gps import Gps from openpilot.system.ublo...
{ "repo_id": "commaai/openpilot", "file_path": "system/ubloxd/ubloxd.py", "license": "MIT License", "lines": 468, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot: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...
{ "repo_id": "commaai/openpilot", "file_path": "system/journald.py", "license": "MIT License", "lines": 36, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot: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...
{ "repo_id": "commaai/openpilot", "file_path": "system/proclogd.py", "license": "MIT License", "lines": 245, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/controls/tests/test_torqued_lat_accel_offset.py
import numpy as np from cereal import car, messaging from opendbc.car import ACCELERATION_DUE_TO_GRAVITY from opendbc.car import structs from opendbc.car.lateral import get_friction, FRICTION_THRESHOLD from openpilot.common.realtime import DT_MDL from openpilot.selfdrive.locationd.torqued import TorqueEstimator, MIN_BU...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/controls/tests/test_torqued_lat_accel_offset.py", "license": "MIT License", "lines": 61, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
commaai/openpilot:selfdrive/ui/lib/api_helpers.py
import time from functools import lru_cache from openpilot.common.api import Api from openpilot.common.time_helpers import system_time_valid TOKEN_EXPIRY_HOURS = 2 @lru_cache(maxsize=1) def _get_token(dongle_id: str, t: int): if not system_time_valid(): raise RuntimeError("System time is not valid, cannot gene...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/lib/api_helpers.py", "license": "MIT License", "lines": 12, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:system/ui/lib/networkmanager.py
from enum import IntEnum # NetworkManager device states class NMDeviceState(IntEnum): # https://networkmanager.dev/docs/api/1.46/nm-dbus-types.html#NMDeviceState UNKNOWN = 0 UNMANAGED = 10 UNAVAILABLE = 20 DISCONNECTED = 30 PREPARE = 40 CONFIG = 50 NEED_AUTH = 60 IP_CONFIG = 70 IP_CHECK = 80 SEC...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/lib/networkmanager.py", "license": "MIT License", "lines": 55, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:tools/lib/file_sources.py
from collections.abc import Callable from openpilot.tools.lib.comma_car_segments import get_url as get_comma_segments_url from openpilot.tools.lib.openpilotci import get_url from openpilot.tools.lib.filereader import DATA_ENDPOINT, file_exists, internal_source_available from openpilot.tools.lib.route import Route, Seg...
{ "repo_id": "commaai/openpilot", "file_path": "tools/lib/file_sources.py", "license": "MIT License", "lines": 38, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/watch3.py
#!/usr/bin/env python3 import pyray as rl from msgq.visionipc import VisionStreamType from openpilot.system.ui.lib.application import gui_app from openpilot.selfdrive.ui.onroad.cameraview import CameraView if __name__ == "__main__": gui_app.init_window("watch3") road = CameraView("camerad", VisionStreamType.VISI...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/watch3.py", "license": "MIT License", "lines": 14, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:selfdrive/ui/tests/test_raylib_ui.py
import time from openpilot.selfdrive.test.helpers import with_processes @with_processes(["ui"]) def test_raylib_ui(): """Test initialization of the UI widgets is successful.""" time.sleep(1)
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/tests/test_raylib_ui.py", "license": "MIT License", "lines": 6, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
commaai/openpilot:system/ui/lib/emoji.py
import io import re from PIL import Image, ImageDraw, ImageFont import pyray as rl from openpilot.system.ui.lib.application import FONT_DIR _emoji_font: ImageFont.FreeTypeFont | None = None _cache: dict[str, rl.Texture] = {} EMOJI_REGEX = re.compile( """[\U0001F600-\U0001F64F \U0001F300-\U0001F5FF \U0001F680-\U0001...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/lib/emoji.py", "license": "MIT License", "lines": 48, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
commaai/openpilot:selfdrive/selfdrived/helpers.py
import math from enum import StrEnum, auto from cereal import car, messaging from openpilot.common.realtime import DT_CTRL from openpilot.selfdrive.locationd.helpers import Pose from opendbc.car import ACCELERATION_DUE_TO_GRAVITY from opendbc.car.lateral import ISO_LATERAL_ACCEL from opendbc.car.interfaces import ACCE...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/selfdrived/helpers.py", "license": "MIT License", "lines": 42, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:selfdrive/ui/feedback/feedbackd.py
#!/usr/bin/env python3 import cereal.messaging as messaging from openpilot.common.params import Params from openpilot.common.swaglog import cloudlog from cereal import car from openpilot.system.micd import SAMPLE_RATE, SAMPLE_BUFFER FEEDBACK_MAX_DURATION = 10.0 ButtonType = car.CarState.ButtonEvent.Type def main(): ...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/feedback/feedbackd.py", "license": "MIT License", "lines": 61, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/tests/test_feedbackd.py
import pytest import cereal.messaging as messaging from cereal import car from openpilot.common.params import Params from openpilot.system.manager.process_config import managed_processes @pytest.mark.skip("tmp disabled") class TestFeedbackd: def setup_method(self): self.pm = messaging.PubMaster(['carState', 'ra...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/tests/test_feedbackd.py", "license": "MIT License", "lines": 42, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
commaai/openpilot:tools/scripts/ssh.py
#!/usr/bin/env python3 import os import sys import argparse import re from openpilot.common.basedir import BASEDIR from openpilot.tools.lib.auth_config import get_token from openpilot.tools.lib.api import CommaApi if __name__ == "__main__": parser = argparse.ArgumentParser(description="A helper for connecting to de...
{ "repo_id": "commaai/openpilot", "file_path": "tools/scripts/ssh.py", "license": "MIT License", "lines": 51, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:tools/scripts/extract_audio.py
#!/usr/bin/env python3 import os import sys import wave import argparse import numpy as np from openpilot.tools.lib.logreader import LogReader, ReadMode def extract_audio(route_or_segment_name, output_file=None, play=False): lr = LogReader(route_or_segment_name, default_mode=ReadMode.AUTO_INTERACTIVE) audio_mess...
{ "repo_id": "commaai/openpilot", "file_path": "tools/scripts/extract_audio.py", "license": "MIT License", "lines": 60, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:system/ui/widgets/html_render.py
import re import pyray as rl from dataclasses import dataclass from enum import Enum from typing import Any from openpilot.system.ui.lib.application import gui_app, FontWeight, FONT_SCALE from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.lib.scroll_panel import GuiScrollPanel from openpilot.syst...
{ "repo_id": "commaai/openpilot", "file_path": "system/ui/widgets/html_render.py", "license": "MIT License", "lines": 227, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/ui/widgets/ssh_key.py
import pyray as rl import requests import threading import copy from collections.abc import Callable from enum import Enum from openpilot.common.params import Params from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.lib.multilang import tr, tr_noop from openpilot.system.ui.li...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/widgets/ssh_key.py", "license": "MIT License", "lines": 109, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
commaai/openpilot:selfdrive/locationd/test/test_torqued.py
from cereal import car from openpilot.selfdrive.locationd.torqued import TorqueEstimator def test_cal_percent(): est = TorqueEstimator(car.CarParams()) msg = est.get_msg() assert msg.liveTorqueParameters.calPerc == 0 for (low, high), min_pts in zip(est.filtered_points.buckets.keys(), ...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/locationd/test/test_torqued.py", "license": "MIT License", "lines": 19, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
commaai/openpilot:selfdrive/ui/layouts/settings/firehose.py
import pyray as rl from openpilot.system.ui.lib.application import gui_app, FontWeight, FONT_SCALE from openpilot.system.ui.lib.multilang import tr, trn, tr_noop from openpilot.system.ui.lib.text_measure import measure_text_cached from openpilot.system.ui.lib.scroll_panel import GuiScrollPanel from openpilot.system.ui...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/layouts/settings/firehose.py", "license": "MIT License", "lines": 74, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:selfdrive/ui/widgets/exp_mode_button.py
import pyray as rl from openpilot.common.params import Params from openpilot.system.ui.lib.application import gui_app, FontWeight, FONT_SCALE from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.widgets import Widget class ExperimentalModeButton(Widget): def __init__(self): super().__init__...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/widgets/exp_mode_button.py", "license": "MIT License", "lines": 49, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
commaai/openpilot:selfdrive/ui/widgets/pairing_dialog.py
import pyray as rl import qrcode import numpy as np import time from openpilot.common.api import Api from openpilot.common.swaglog import cloudlog from openpilot.common.params import Params from openpilot.system.ui.widgets import Widget from openpilot.system.ui.lib.application import FontWeight, gui_app from openpilot...
{ "repo_id": "commaai/openpilot", "file_path": "selfdrive/ui/widgets/pairing_dialog.py", "license": "MIT License", "lines": 135, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex