repo_id
stringclasses
400 values
commit_sha
stringclasses
400 values
commit_index
int32
0
951
in_repo_split
stringclasses
1 value
cross_repo_split
stringclasses
1 value
test_file
stringlengths
7
121
test_function
stringlengths
1
108
assertion_type
stringclasses
32 values
difficulty
stringclasses
8 values
context_lines
int32
3
600
prefix
large_stringlengths
44
113k
target
large_stringlengths
1
498
anchor_sha
stringclasses
400 values
anchor_index
int32
0
951
qna_source
stringclasses
1 value
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_subaru.py
test_es_uds_message
self.assertFalse
func_call
67
import enum import unittest from opendbc.car.subaru.values import SubaruSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from functools import partial def lk...
self._tx(self._es_uds_msg(msg)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_tesla.py
test_rx_hook_speed_mismatch
self.assertTrue
func_call
134
import random import unittest import numpy as np from opendbc.car.tesla.values import TeslaSafetyFlags from opendbc.car.tesla.carcontroller import get_max_angle_delta, get_max_angle, get_safety_CP from opendbc.car.structs import CarParams from opendbc.car.vehicle_model import VehicleModel from opendbc.can import CANDe...
self._rx(self._speed_msg(speed)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_acc_cancel
self.assertFalse
func_call
36
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
self._tx(self._accel_msg(accel)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_honda.py
test_honda_fwd_brake_latching
self.assertFalse
func_call
45
import unittest import numpy as np from opendbc.car.honda.values import HondaSafetyFlags from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety.tests.common import CANPackerPanda, MAX_WRONG_COUNTERS HONDA_N_COM...
self.safety.get_honda_fwd_brake())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/hyundai_common.py
test_cancel_button
self.assertFalse
func_call
27
import unittest import opendbc.safety.tests.common as common from opendbc.safety.tests.libsafety import libsafety_py from opendbc.safety.tests.common import make_msg class HyundaiLongitudinalBase(common.LongitudinalAccelSafetyTest): DISABLED_ECU_UDS_MSG: tuple[int, int] DISABLED_ECU_ACTUATION_MSG: tuple[int, int...
self.safety.get_controls_allowed())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_body.py
test_rx_hook
self.assertFalse
func_call
33
import unittest from opendbc.car.structs import CarParams import opendbc.safety.tests.common as common from opendbc.safety.tests.libsafety import libsafety_py from opendbc.safety.tests.common import CANPackerPanda class TestBody(common.PandaSafetyTest): TX_MSGS = [[0x250, 0], [0x251, 0], [0x1, 0], [0x1...
self.safety.get_controls_allowed())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_defaults.py
test_default_controls_not_allowed
self.assertTrue
func_call
20
import unittest import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py class TestAllOutput(TestDefaultRxHookBase): TX_MSGS = [[addr, bus] for addr in common.PandaSafetyTest.SCANNED_ADDRS for bus in range(4)] def...
self.safety.get_controls_allowed())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_ford.py
test_rx_hook
self.assertEqual
func_call
197
import numpy as np import random import unittest import opendbc.safety.tests.common as common from opendbc.car.ford.carcontroller import MAX_LATERAL_ACCEL from opendbc.car.ford.values import FordSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py from opendbc.s...
self.safety.get_controls_allowed())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_ford.py
test_angle_measurements
self.assertEqual
func_call
185
import numpy as np import random import unittest import opendbc.safety.tests.common as common from opendbc.car.ford.carcontroller import MAX_LATERAL_ACCEL from opendbc.car.ford.values import FordSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py from opendbc.s...
round(curvature * self.DEG_TO_CAN))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_gm.py
test_cancel_button
self.assertFalse
func_call
36
import unittest from opendbc.car.gm.values import GMSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda class GmLongitudinalBase(common.PandaCarSafetyTest, comm...
self.safety.get_controls_allowed())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_honda.py
test_disengage_on_main
self.assertTrue
func_call
18
import unittest import numpy as np from opendbc.car.honda.values import HondaSafetyFlags from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety.tests.common import CANPackerPanda, MAX_WRONG_COUNTERS HONDA_N_COM...
self.safety.get_controls_allowed())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_rivian.py
test_rx_hook
self.assertFalse
func_call
96
import unittest from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.car.rivian.values import RivianSafetyFlags from opendbc.car.rivian.riviancan import checksum...
self.safety.get_controls_allowed())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_rx_hook
self.assertFalse
func_call
88
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
self.safety.get_controls_allowed())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_mqb.py
test_cancel_button
self.assertFalse
func_call
42
import unittest import numpy as np from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.car.volkswagen.values import VolkswagenSafetyFlags MAX_ACCEL = 2.0 MIN_AC...
self.safety.get_controls_allowed())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_pq.py
test_cancel_button
self.assertFalse
func_call
38
import unittest from opendbc.car.volkswagen.values import VolkswagenSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda MSG_LENKHILFE_3 = 0x0D0 # RX from ...
self.safety.get_controls_allowed())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/hyundai_common.py
test_disabled_ecu_alive
self.assertFalse
func_call
30
import unittest import opendbc.safety.tests.common as common from opendbc.safety.tests.libsafety import libsafety_py from opendbc.safety.tests.common import make_msg class HyundaiLongitudinalBase(common.LongitudinalAccelSafetyTest): DISABLED_ECU_UDS_MSG: tuple[int, int] DISABLED_ECU_ACTUATION_MSG: tuple[int, int...
self.safety.get_relay_malfunction())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_ford.py
test_prevent_lkas_action
self.assertFalse
func_call
178
import numpy as np import random import unittest import opendbc.safety.tests.common as common from opendbc.car.ford.carcontroller import MAX_LATERAL_ACCEL from opendbc.car.ford.values import FordSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py from opendbc.s...
self._tx(self._lkas_command_msg(1)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_ford.py
test_angle_measurements
self.assertEqual
func_call
184
import numpy as np import random import unittest import opendbc.safety.tests.common as common from opendbc.car.ford.carcontroller import MAX_LATERAL_ACCEL from opendbc.car.ford.values import FordSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py from opendbc.s...
round(-curvature * self.DEG_TO_CAN))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_mqb.py
test_torque_measurements
self.assertEqual
func_call
95
import unittest import numpy as np from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.car.volkswagen.values import VolkswagenSafetyFlags MAX_ACCEL = 2.0 MIN_AC...
self.safety.get_torque_driver_min())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_mqb.py
test_torque_measurements
self.assertEqual
func_call
96
import unittest import numpy as np from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.car.volkswagen.values import VolkswagenSafetyFlags MAX_ACCEL = 2.0 MIN_AC...
self.safety.get_torque_driver_max())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_pq.py
test_torque_measurements
self.assertEqual
func_call
88
import unittest from opendbc.car.volkswagen.values import VolkswagenSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda MSG_LENKHILFE_3 = 0x0D0 # RX from ...
self.safety.get_torque_driver_min())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_pq.py
test_torque_measurements
self.assertEqual
func_call
89
import unittest from opendbc.car.volkswagen.values import VolkswagenSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda MSG_LENKHILFE_3 = 0x0D0 # RX from ...
self.safety.get_torque_driver_max())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_body.py
test_rx_hook
self.assertTrue
func_call
36
import unittest from opendbc.car.structs import CarParams import opendbc.safety.tests.common as common from opendbc.safety.tests.libsafety import libsafety_py from opendbc.safety.tests.common import CANPackerPanda class TestBody(common.PandaSafetyTest): TX_MSGS = [[0x250, 0], [0x251, 0], [0x1, 0], [0x1...
self._rx(self._torque_cmd_msg(0, 0)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_body.py
test_tx_hook
self.assertFalse
func_call
33
import unittest from opendbc.car.structs import CarParams import opendbc.safety.tests.common as common from opendbc.safety.tests.libsafety import libsafety_py from opendbc.safety.tests.common import CANPackerPanda class TestBody(common.PandaSafetyTest): TX_MSGS = [[0x250, 0], [0x251, 0], [0x1, 0], [0x1...
self._tx(self._torque_cmd_msg(0, 0)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_body.py
test_can_flasher
self.assertTrue
func_call
35
import unittest from opendbc.car.structs import CarParams import opendbc.safety.tests.common as common from opendbc.safety.tests.libsafety import libsafety_py from opendbc.safety.tests.common import CANPackerPanda class TestBody(common.PandaSafetyTest): TX_MSGS = [[0x250, 0], [0x251, 0], [0x1, 0], [0x1...
self._tx(common.make_msg(0, 0x1, 8)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_hyundai_canfd.py
test_acc_cancel
self.assertTrue
func_call
48
from parameterized import parameterized_class import unittest from opendbc.car.hyundai.values import HyundaiSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda f...
self._tx(self._acc_cancel_msg(True)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_mqb.py
test_redundant_brake_signals
self.assertFalse
func_call
91
import unittest import numpy as np from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.car.volkswagen.values import VolkswagenSafetyFlags MAX_ACCEL = 2.0 MIN_AC...
self.safety.get_brake_pressed_prev())
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_body.py
test_rx_hook
self.assertTrue
func_call
39
import unittest from opendbc.car.structs import CarParams import opendbc.safety.tests.common as common from opendbc.safety.tests.libsafety import libsafety_py from opendbc.safety.tests.common import CANPackerPanda class TestBody(common.PandaSafetyTest): TX_MSGS = [[0x250, 0], [0x251, 0], [0x1, 0], [0x1...
self._rx(self._motors_data_msg(0, 0)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_hyundai_canfd.py
test_acc_cancel
self.assertFalse
func_call
50
from parameterized import parameterized_class import unittest from opendbc.car.hyundai.values import HyundaiSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda f...
self._tx(self._acc_cancel_msg(False)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_pq.py
test_spam_cancel_safety_check
self.assertFalse
func_call
36
import unittest from opendbc.car.volkswagen.values import VolkswagenSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda MSG_LENKHILFE_3 = 0x0D0 # RX from ...
self._tx(self._button_msg(_set=True)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_car_interfaces.py
test_car_interfaces
assert
func_call
76
import os import math import hypothesis.strategies as st import pytest from hypothesis import Phase, given, settings from collections.abc import Callable from typing import Any from opendbc.car import DT_CTRL, CanData, structs from opendbc.car.car_helpers import interfaces from opendbc.car.fingerprints import FW_VERSI...
len(car_params.longitudinalTuning.kpBP)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_mqb.py
test_spam_cancel_safety_check
self.assertFalse
func_call
39
import unittest import numpy as np from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.car.volkswagen.values import VolkswagenSafetyFlags MAX_ACCEL = 2.0 MIN_AC...
self._tx(self._gra_acc_01_msg(_set=1)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_chrysler.py
test_buttons
self.assertEqual
func_call
64
import unittest from opendbc.car.chrysler.values import ChryslerSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda class TestChryslerSafety(common.PandaCarSafe...
self._tx(self._button_msg(resume=True)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_chrysler.py
test_buttons
self.assertTrue
func_call
67
import unittest from opendbc.car.chrysler.values import ChryslerSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda class TestChryslerSafety(common.PandaCarSafe...
self._tx(self._button_msg(cancel=True)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_defaults.py
test_rx_hook
self.assertTrue
func_call
15
import unittest import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py class TestDefaultRxHookBase(common.PandaSafetyTest): FWD_BUS_LOOKUP = {} def test_rx_hook(self): # default rx hook allows all msgs for bus in rang...
self._rx(common.make_msg(bus, addr, 8)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_elm327.py
test_tx_hook
self.assertEqual
func_call
29
import unittest import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety import DLC_TO_LEN from opendbc.safety.tests.libsafety import libsafety_py from opendbc.safety.tests.test_defaults import TestDefaultRxHookBase GM_CAMERA_DIAG_ADDR = 0x24B class TestElm327(TestDe...
self._tx(common.make_msg(bus, addr, 8)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_mazda.py
test_buttons
self.assertTrue
func_call
73
import unittest from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda class TestMazdaSafety(common.PandaCarSafetyTest, common.DriverTorqueSteeringSafetyTest): TX_MSGS = [[...
self._tx(self._button_msg(cancel=True)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_mazda.py
test_buttons
self.assertFalse
func_call
74
import unittest from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda class TestMazdaSafety(common.PandaCarSafetyTest, common.DriverTorqueSteeringSafetyTest): TX_MSGS = [[...
self._tx(self._button_msg(resume=True)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_lta_steer_cmd
self.assertTrue
func_call
56
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
self._tx(self._lta_msg(0, 0, angle, 0)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_lta_steer_cmd
self.assertTrue
func_call
78
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
self._tx(self._lta_msg(1, 1, angle, 0)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_pq.py
test_spam_cancel_safety_check
self.assertTrue
func_call
34
import unittest from opendbc.car.volkswagen.values import VolkswagenSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda MSG_LENKHILFE_3 = 0x0D0 # RX from ...
self._tx(self._button_msg(cancel=True)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_pq.py
test_spam_cancel_safety_check
self.assertFalse
func_call
35
import unittest from opendbc.car.volkswagen.values import VolkswagenSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda MSG_LENKHILFE_3 = 0x0D0 # RX from ...
self._tx(self._button_msg(resume=True)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_hyundai.py
test_no_aeb_fca11
self.assertFalse
func_call
83
import random import unittest from opendbc.car.hyundai.values import HyundaiSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.safety.tests.hyundai...
self._tx(self._fca11_msg(aeb_decel=1.0)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_mqb.py
test_spam_cancel_safety_check
self.assertTrue
func_call
37
import unittest import numpy as np from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.car.volkswagen.values import VolkswagenSafetyFlags MAX_ACCEL = 2.0 MIN_AC...
self._tx(self._gra_acc_01_msg(cancel=1)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_mqb.py
test_spam_cancel_safety_check
self.assertFalse
func_call
38
import unittest import numpy as np from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.car.volkswagen.values import VolkswagenSafetyFlags MAX_ACCEL = 2.0 MIN_AC...
self._tx(self._gra_acc_01_msg(resume=1)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_lta_steer_cmd
self.assertEqual
func_call
77
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
self._tx(self._lta_msg(1, 1, angle, 100)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_gm.py
test_buttons
self.assertEqual
func_call
35
import unittest from opendbc.car.gm.values import GMSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda class TestGmCameraSafety(TestGmCameraSafetyBase): TX_M...
self._tx(self._button_msg(Buttons.CANCEL)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_hyundai.py
test_no_aeb_scc12
self.assertFalse
func_call
81
import random import unittest from opendbc.car.hyundai.values import HyundaiSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.safety.tests.hyundai...
self._tx(self._accel_msg(0, aeb_req=True)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_subaru.py
test_es_uds_message
self.assertTrue
func_call
54
import enum import unittest from opendbc.car.subaru.values import SubaruSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from functools import partial def lk...
self._tx(self._es_uds_msg(tester_present)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_routes.py
test_test_route_present
assert
func_call
10
import pytest from opendbc.car.values import PLATFORMS from opendbc.car.tests.routes import non_tested_cars, routes @pytest.mark.parametrize("platform", PLATFORMS.keys()) def test_test_route_present(platform): tested_platforms = [r.car_model for r in routes] assert platform in
set(tested_platforms) | set(non_tested_cars)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_hyundai.py
test_no_aeb_fca11
self.assertFalse
func_call
81
import random import unittest from opendbc.car.hyundai.values import HyundaiSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.safety.tests.hyundai...
self._tx(self._fca11_msg(vsm_aeb_req=True)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_hyundai.py
test_no_aeb_fca11
self.assertFalse
func_call
82
import random import unittest from opendbc.car.hyundai.values import HyundaiSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.safety.tests.hyundai...
self._tx(self._fca11_msg(fca_aeb_req=True)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_hyundai.py
test_no_aeb_scc12
self.assertFalse
func_call
82
import random import unittest from opendbc.car.hyundai.values import HyundaiSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.safety.tests.hyundai...
self._tx(self._accel_msg(0, aeb_decel=1.0)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_elm327.py
test_tx_hook
self.assertEqual
func_call
34
import unittest import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety import DLC_TO_LEN from opendbc.safety.tests.libsafety import libsafety_py from opendbc.safety.tests.test_defaults import TestDefaultRxHookBase GM_CAMERA_DIAG_ADDR = 0x24B class TestElm327(TestDe...
self._tx(common.make_msg(0, 0x700, msg_len)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_hyundai_canfd.py
test_acc_cancel
self.assertFalse
func_call
49
from parameterized import parameterized_class import unittest from opendbc.car.hyundai.values import HyundaiSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda f...
self._tx(self._acc_cancel_msg(True, accel=1)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_subaru.py
test_es_uds_message
self.assertFalse
func_call
57
import enum import unittest from opendbc.car.subaru.values import SubaruSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from functools import partial def lk...
self._tx(self._es_uds_msg(not_tester_present)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_acc_cancel
self.assertEqual
func_call
38
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
self._tx(self._accel_msg(accel, cancel_req=1)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_lka_steer_cmd
self.assertEqual
func_call
50
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
self._tx(self._torque_cmd_msg(torque, steer_req)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/toyota/tests/test_toyota.py
test_tss2_dbc
assert
string_literal
25
from hypothesis import given, settings, strategies as st from opendbc.car import Bus from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.toyota.fingerprints import FW_VERSIONS from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC...
"toyota_nodsu_pt_generated"
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_lta_2_steer_cmd
self.assertEqual
string_literal
46
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
f"{req=} {req2=} {angle=}")
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_defaults.py
test_spam_can_buses
self.assertEqual
string_literal
23
import unittest import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py class TestAllOutput(TestDefaultRxHookBase): TX_MSGS = [[addr, bus] for addr in common.PandaSafetyTest.SCANNED_ADDRS for bus in range(4)] def...
f"allowed TX {addr=} {bus=}")
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_lta_steer_cmd
self.assertEqual
string_literal
82
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
f"{req=} {req2=} {angle=} {torque_wind_down=}")
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/e2e/test_artifact.py
test_convert_error_invalid_type
assert
numeric_literal
38
import json import platform import re from pathlib import Path from subprocess import STDOUT, CalledProcessError from test.conftest import skip_if_docker, skip_if_no_container, skip_if_podman_too_old, skip_if_windows from test.e2e.utils import RamalamaExecWorkspace, check_output import pytest def path_to_uri(path): ...
2
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/e2e/test_artifact.py
test_artifact_lifecycle_basic
assert
numeric_literal
54
import json import platform import re from pathlib import Path from subprocess import STDOUT, CalledProcessError from test.conftest import skip_if_docker, skip_if_no_container, skip_if_podman_too_old, skip_if_windows from test.e2e.utils import RamalamaExecWorkspace, check_output import pytest def path_to_uri(path): ...
0
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/e2e/test_artifact.py
test_artifact_overwrite_same_name
assert
numeric_literal
59
import json import platform import re from pathlib import Path from subprocess import STDOUT, CalledProcessError from test.conftest import skip_if_docker, skip_if_no_container, skip_if_podman_too_old, skip_if_windows from test.e2e.utils import RamalamaExecWorkspace, check_output import pytest def path_to_uri(path): ...
1
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/e2e/test_help.py
test_container_engine_flag_validation
assert
numeric_literal
57
import json import os import platform import re import string from subprocess import STDOUT, CalledProcessError from test.conftest import skip_if_no_container from test.e2e.utils import RamalamaExecWorkspace, check_output, get_ramalama_subcommands import pytest from ramalama.version import version as ramalama_version...
2
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/e2e/test_list.py
test_json_output
assert
numeric_literal
32
import json import re from datetime import datetime from test.e2e.utils import RamalamaExecWorkspace import pytest HEADING_REGEX = "NAME *MODIFIED *SIZE" TEST_IMAGE = "ollama://smollm:135m" def shared_ctx(): """Provides an isolated and shared context for all tests in the module. Creates a ramalama workspace...
0
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/e2e/test_serve.py
test_generation_with_bad_id
assert
numeric_literal
47
import itertools import json import logging import os import platform import random import re import string from contextlib import contextmanager from pathlib import Path from subprocess import STDOUT, CalledProcessError from test.conftest import ( skip_if_container, skip_if_darwin, skip_if_docker, skip...
2
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_common.py
test_populate_volume_success
assert
numeric_literal
59
import os import shutil import subprocess from contextlib import ExitStack from pathlib import Path from sys import platform from unittest.mock import MagicMock, Mock, mock_open, patch import pytest from ramalama.cli import configure_subcommands, create_argument_parser from ramalama.common import ( accel_image, ...
3
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_common.py
test_populate_volume_success
assert
numeric_literal
60
import os import shutil import subprocess from contextlib import ExitStack from pathlib import Path from sys import platform from unittest.mock import MagicMock, Mock, mock_open, patch import pytest from ramalama.cli import configure_subcommands, create_argument_parser from ramalama.common import ( accel_image, ...
2
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_config.py
test_correct_config_defaults
assert
numeric_literal
35
import os from unittest.mock import patch import pytest from ramalama.config import ( DEFAULT_PORT, BaseConfig, RamalamaImages, default_config, get_default_engine, get_default_store, load_env_config, ) from ramalama.log_levels import LogLevel def isolate_config(): """ Isolate test...
0
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_config.py
test_file_config_overrides_defaults
assert
numeric_literal
40
import os from unittest.mock import patch import pytest from ramalama.config import ( DEFAULT_PORT, BaseConfig, RamalamaImages, default_config, get_default_engine, get_default_store, load_env_config, ) from ramalama.log_levels import LogLevel def isolate_config(): """ Isolate test...
8
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_config.py
test_config_multiple_env_layers
assert
numeric_literal
46
import os from unittest.mock import patch import pytest from ramalama.config import ( DEFAULT_PORT, BaseConfig, RamalamaImages, default_config, get_default_engine, get_default_store, load_env_config, ) from ramalama.log_levels import LogLevel def isolate_config(): """ Isolate test...
4
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_config.py
test_config_type_coercion
assert
numeric_literal
47
import os from unittest.mock import patch import pytest from ramalama.config import ( DEFAULT_PORT, BaseConfig, RamalamaImages, default_config, get_default_engine, get_default_store, load_env_config, ) from ramalama.log_levels import LogLevel def isolate_config(): """ Isolate test...
2
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_file_loader.py
test_image_file_manager_load_single_image_file
assert
numeric_literal
21
import os import tempfile from unittest.mock import mock_open, patch import pytest from ramalama.file_loaders.file_manager import ImageFileManager, OpanAIChatAPIMessageBuilder, TextFileManager from ramalama.file_loaders.file_types.base import BaseFileLoader from ramalama.file_loaders.file_types.image import BasicImag...
1
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_file_loader.py
test_image_file_manager_load_multiple_images
assert
numeric_literal
23
import os import tempfile from unittest.mock import mock_open, patch import pytest from ramalama.file_loaders.file_manager import ImageFileManager, OpanAIChatAPIMessageBuilder, TextFileManager from ramalama.file_loaders.file_types.base import BaseFileLoader from ramalama.file_loaders.file_types.image import BasicImag...
2
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_file_loader.py
test_builder_partition_files_single_text_file
assert
numeric_literal
26
import os import tempfile from unittest.mock import mock_open, patch import pytest from ramalama.file_loaders.file_manager import ImageFileManager, OpanAIChatAPIMessageBuilder, TextFileManager from ramalama.file_loaders.file_types.base import BaseFileLoader from ramalama.file_loaders.file_types.image import BasicImag...
0
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_file_loader_integration.py
test_chat_with_file_input_no_input_specified
assert
numeric_literal
28
import os import tempfile from unittest.mock import MagicMock, patch import pytest from ramalama.chat import RamaLamaShell, chat class TestFileUploadChatIntegration: @patch('urllib.request.urlopen') def test_chat_with_file_input_no_input_specified(self, mock_urlopen): """Test chat functionality when...
0
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_file_loader_integration.py
test_chat_with_file_input_single_file
assert
numeric_literal
32
import os import tempfile from unittest.mock import MagicMock, patch import pytest from ramalama.chat import RamaLamaShell, chat class TestFileUploadChatIntegration: @patch('urllib.request.urlopen') def test_chat_with_file_input_single_file(self, mock_urlopen): """Test chat functionality with a sing...
1
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_file_loader_integration.py
test_chat_with_image_input_directory
assert
numeric_literal
41
import os import tempfile from unittest.mock import MagicMock, patch import pytest from ramalama.chat import RamaLamaShell, chat class TestImageUploadChatIntegration: @patch('urllib.request.urlopen') def test_chat_with_image_input_directory(self, mock_urlopen): """Test chat functionality with a dire...
2
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_file_loader_with_data.py
test_load_single_text_file
assert
numeric_literal
24
import os import tempfile from pathlib import Path import pytest from ramalama.file_loaders.file_manager import OpanAIChatAPIMessageBuilder class TestFileUploadWithDataFiles: def data_dir(self): """Get the path to the test data directory.""" current_dir = Path(__file__).parent return cur...
1
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_file_loader_with_data.py
test_load_multiple_image_files
assert
numeric_literal
37
import os import tempfile from pathlib import Path import pytest from ramalama.file_loaders.file_manager import OpanAIChatAPIMessageBuilder class TestImageUploadWithDataFiles: def data_dir(self): """Get the path to the test data directory.""" current_dir = Path(__file__).parent return cu...
3
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_file_loader_with_data.py
test_mixed_image_formats
assert
numeric_literal
41
import os import tempfile from pathlib import Path import pytest from ramalama.file_loaders.file_manager import OpanAIChatAPIMessageBuilder class TestImageUploadWithDataFiles: def data_dir(self): """Get the path to the test data directory.""" current_dir = Path(__file__).parent return cu...
8
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_layered_config.py
test_layered_mixin_reverse_order_processing
assert
numeric_literal
27
from dataclasses import dataclass, field from typing import Any, Dict, List from ramalama.layered_config import LayeredMixin, build_subconfigs, deep_merge, extract_defaults def default_simple_config() -> SimpleConfig: return SimpleConfig(name="default_simple", value=42) def default_nested_config() -> NestedConfi...
2
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_max_tokens.py
test_max_tokens_cli_argument_parsing
assert
numeric_literal
28
import argparse from unittest.mock import patch import pytest from ramalama.command.context import RamalamaArgsContext from ramalama.config import default_config class TestMaxTokensCLI: def test_max_tokens_cli_argument_parsing(self): """Test that --max-tokens argument is properly parsed.""" pars...
0
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_model_store.py
test_try_convert_existing_chat_template_converts_flat_jinja
assert
numeric_literal
68
import os import pytest from ramalama.common import generate_sha256_binary from ramalama.model_store.global_store import GlobalModelStore from ramalama.model_store.reffile import RefJSONFile, StoreFile, StoreFileType from ramalama.model_store.snapshot_file import ( LocalSnapshotFile, SnapshotFile, Snapsho...
1
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_proxy_support.py
test_proxy_handler_installed
assert
numeric_literal
47
import urllib.request from unittest.mock import MagicMock, patch import pytest from ramalama.proxy_support import _get_proxy_env, _is_socks_proxy, get_proxy_info, setup_proxy_support def clearenv(monkeypatch): # Clear any proxy env vars that might exist for var in [ 'http_proxy', 'HTTP_PROXY'...
0
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_rlcr.py
test_find_model_file_with_no_value_label
assert
numeric_literal
50
import subprocess import tempfile import warnings from unittest.mock import Mock, patch import pytest from ramalama.arg_types import StoreArgs from ramalama.transports.rlcr import RamalamaContainerRegistry, find_model_file_in_image def suppress_rlcr_warnings(): """Suppress expected warnings from RLCR model file ...
2
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/e2e/test_help.py
test_unsupported_transport_message
assert
numeric_literal
58
import json import os import platform import re import string from subprocess import STDOUT, CalledProcessError from test.conftest import skip_if_no_container from test.e2e.utils import RamalamaExecWorkspace, check_output, get_ramalama_subcommands import pytest from ramalama.version import version as ramalama_version...
22
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/e2e/test_rm.py
test_delete_non_existing_image
assert
numeric_literal
16
import random import re from pathlib import Path from subprocess import STDOUT, CalledProcessError from test.e2e.utils import RamalamaExecWorkspace, check_output import pytest @pytest.mark.e2e def test_delete_non_existing_image(): image_name = f"rm_random_image_{random.randint(0, 9999)}" with pytest.raises(Ca...
22
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/e2e/test_serve.py
test_non_existing_model
assert
numeric_literal
47
import itertools import json import logging import os import platform import random import re import string from contextlib import contextmanager from pathlib import Path from subprocess import STDOUT, CalledProcessError from test.conftest import ( skip_if_container, skip_if_darwin, skip_if_docker, skip...
22
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_config.py
test_correct_config_defaults
assert
numeric_literal
44
import os from unittest.mock import patch import pytest from ramalama.config import ( DEFAULT_PORT, BaseConfig, RamalamaImages, default_config, get_default_engine, get_default_store, load_env_config, ) from ramalama.log_levels import LogLevel def isolate_config(): """ Isolate test...
-1
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_config.py
test_env_overrides_file_and_default
assert
numeric_literal
42
import os from unittest.mock import patch import pytest from ramalama.config import ( DEFAULT_PORT, BaseConfig, RamalamaImages, default_config, get_default_engine, get_default_store, load_env_config, ) from ramalama.log_levels import LogLevel def isolate_config(): """ Isolate test...
16
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_layered_config.py
test_layered_mixin_defaults_preserved
assert
numeric_literal
25
from dataclasses import dataclass, field from typing import Any, Dict, List from ramalama.layered_config import LayeredMixin, build_subconfigs, deep_merge, extract_defaults def default_simple_config() -> SimpleConfig: return SimpleConfig(name="default_simple", value=42) def default_nested_config() -> NestedConfi...
42
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_layered_config.py
test_layered_mixin_with_dataclass_subconfigs
assert
numeric_literal
42
from dataclasses import dataclass, field from typing import Any, Dict, List from ramalama.layered_config import LayeredMixin, build_subconfigs, deep_merge, extract_defaults def default_simple_config() -> SimpleConfig: return SimpleConfig(name="default_simple", value=42) def default_nested_config() -> NestedConfi...
60
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_max_tokens.py
test_max_tokens_cli_negative_value
assert
numeric_literal
24
import argparse from unittest.mock import patch import pytest from ramalama.command.context import RamalamaArgsContext from ramalama.config import default_config class TestMaxTokensCLI: def test_max_tokens_cli_negative_value(self): """Test that --max-tokens accepts negative values.""" parser = a...
-1
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/e2e/test_serve.py
test_serve_with_non_existing_images
assert
numeric_literal
50
import itertools import json import logging import os import platform import random import re import string from contextlib import contextmanager from pathlib import Path from subprocess import STDOUT, CalledProcessError from test.conftest import ( skip_if_container, skip_if_darwin, skip_if_docker, skip...
125
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_config.py
test_correct_config_defaults
assert
numeric_literal
36
import os from unittest.mock import patch import pytest from ramalama.config import ( DEFAULT_PORT, BaseConfig, RamalamaImages, default_config, get_default_engine, get_default_store, load_env_config, ) from ramalama.log_levels import LogLevel def isolate_config(): """ Isolate test...
256
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_layered_config.py
test_build_subconfigs_simple_nested
assert
numeric_literal
30
from dataclasses import dataclass, field from typing import Any, Dict, List from ramalama.layered_config import LayeredMixin, build_subconfigs, deep_merge, extract_defaults def default_simple_config() -> SimpleConfig: return SimpleConfig(name="default_simple", value=42) def default_nested_config() -> NestedConfi...
123
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor
containers/ramalama
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
train
train
test/unit/test_layered_config.py
test_build_subconfigs_simple_nested
assert
numeric_literal
34
from dataclasses import dataclass, field from typing import Any, Dict, List from ramalama.layered_config import LayeredMixin, build_subconfigs, deep_merge, extract_defaults def default_simple_config() -> SimpleConfig: return SimpleConfig(name="default_simple", value=42) def default_nested_config() -> NestedConfi...
456
3afda31e80b372ae6b7a13ba358c0eb83c8ceebb
119
v2_extractor_at_anchor