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
coderamp-labs/gitingest
af95bae0878dc04222743dd63f2649b6fb707119
55
train
train
tests/test_repository_clone.py
test_clone_creates_parent_directory
assert_*
func_call
33
import asyncio import os from pathlib import Path from unittest.mock import AsyncMock import pytest from pytest_mock import MockerFixture from gitingest.cloning import clone_repo from gitingest.schemas import CloneConfig from gitingest.utils.exceptions import AsyncTimeoutError from gitingest.utils.git_utils import ch...
str(nested_path))
af95bae0878dc04222743dd63f2649b6fb707119
55
v2_extractor_at_anchor
coderamp-labs/gitingest
af95bae0878dc04222743dd63f2649b6fb707119
55
train
train
tests/test_repository_clone.py
test_clone_commit_without_branch
assert_*
complex_expr
34
import asyncio import os from pathlib import Path from unittest.mock import AsyncMock import pytest from pytest_mock import MockerFixture from gitingest.cloning import clone_repo from gitingest.schemas import CloneConfig from gitingest.utils.exceptions import AsyncTimeoutError from gitingest.utils.git_utils import ch...
clone_config.commit)
af95bae0878dc04222743dd63f2649b6fb707119
55
v2_extractor_at_anchor
coderamp-labs/gitingest
af95bae0878dc04222743dd63f2649b6fb707119
55
train
train
tests/test_repository_clone.py
test_clone_commit_without_branch
assert_*
complex_expr
33
import asyncio import os from pathlib import Path from unittest.mock import AsyncMock import pytest from pytest_mock import MockerFixture from gitingest.cloning import clone_repo from gitingest.schemas import CloneConfig from gitingest.utils.exceptions import AsyncTimeoutError from gitingest.utils.git_utils import ch...
clone_config.local_path)
af95bae0878dc04222743dd63f2649b6fb707119
55
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_async_client.py
test_embed_batch_types
self.assertEqual
numeric_literal
28
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join(package_dir, 'embed_job.jsonl') c...
100)
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_async_client.py
test_context_manager
self.assertIsNotNone
variable
20
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join(package_dir, 'embed_job.jsonl') c...
client)
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_async_client.py
test_embed_job_crud
self.assertEqual
string_literal
45
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join(package_dir, 'embed_job.jsonl') c...
"complete")
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_async_client.py
test_stream_equals_true
self.assertRaises
variable
19
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join(package_dir, 'embed_job.jsonl') c...
ValueError)
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_async_client.py
test_embed_job_crud
self.assertEqual
string_literal
28
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join(package_dir, 'embed_job.jsonl') c...
"validated")
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_async_client.py
test_tool_use
self.assertEqual
string_literal
47
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join(package_dir, 'embed_job.jsonl') c...
"sales_database")
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_async_client.py
test_tool_use
self.assertEqual
collection
48
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join(package_dir, 'embed_job.jsonl') c...
{"day": "2023-09-29"})
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_async_client.py
test_tool_use
self.assertEqual
collection
78
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join(package_dir, 'embed_job.jsonl') c...
[ { "tool_name": "sales_database", "average_sale_value": "404.17", "date": "2023-09-29", "id": "sales_database:0:0", "number_of_sales": "120", "total_revenue": "48500", } ])
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_client.py
test_embed_batch_types
self.assertEqual
numeric_literal
26
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem co = cohere.Client(timeout=10000) package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join...
100)
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_client.py
test_context_manager
self.assertIsNotNone
variable
18
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem co = cohere.Client(timeout=10000) package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join...
client)
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_client.py
test_embed_job_crud
self.assertEqual
string_literal
43
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem co = cohere.Client(timeout=10000) package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join...
"complete")
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_client.py
test_stream_equals_true
self.assertRaises
variable
17
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem co = cohere.Client(timeout=10000) package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join...
ValueError)
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_client.py
test_embed_job_crud
self.assertEqual
string_literal
26
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem co = cohere.Client(timeout=10000) package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join...
"validated")
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_client.py
test_tool_use
self.assertEqual
string_literal
45
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem co = cohere.Client(timeout=10000) package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join...
"sales_database")
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_client.py
test_tool_use
self.assertEqual
collection
46
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem co = cohere.Client(timeout=10000) package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join...
{"day": "2023-09-29"})
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_client.py
test_embed
self.assertIsNotNone
complex_expr
25
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem co = cohere.Client(timeout=10000) package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join...
response.embeddings.float)
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_client.py
test_embed
self.assertIsNotNone
complex_expr
26
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem co = cohere.Client(timeout=10000) package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join...
response.embeddings.float_)
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_client.py
test_tool_use
self.assertEqual
collection
76
import os import unittest import cohere from cohere import ChatMessage, ChatConnector, ClassifyExample, CreateConnectorServiceAuth, Tool, \ ToolParameterDefinitionsValue, ChatRequestToolResultsItem co = cohere.Client(timeout=10000) package_dir = os.path.dirname(os.path.abspath(__file__)) embed_job = os.path.join...
[ { "tool_name": "sales_database", "average_sale_value": "404.17", "date": "2023-09-29", "id": "sales_database:0:0", "number_of_sales": "120", "total_revenue": "48500", } ])
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_embed_utils.py
test_merge_embeddings_by_type
self.assertEqual
collection
141
import unittest from cohere import EmbedResponse_EmbeddingsByType, EmbedByTypeResponseEmbeddings, ApiMeta, ApiMetaBilledUnits, \ ApiMetaApiVersion, EmbedResponse_EmbeddingsFloats from cohere.utils import merge_embed_responses ebt_1 = EmbedResponse_EmbeddingsByType( response_type="embeddings_by_type", id="...
{"test_warning_1", "test_warning_2"})
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
cohere-ai/cohere-python
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
train
train
tests/test_embed_utils.py
test_merge_embeddings_floats
self.assertEqual
func_call
142
import unittest from cohere import EmbedResponse_EmbeddingsByType, EmbedByTypeResponseEmbeddings, ApiMeta, ApiMetaBilledUnits, \ ApiMetaApiVersion, EmbedResponse_EmbeddingsFloats from cohere.utils import merge_embed_responses ebt_1 = EmbedResponse_EmbeddingsByType( response_type="embeddings_by_type", id="...
EmbedResponse_EmbeddingsFloats( response_type="embeddings_floats", id="1, 2", texts=["hello", "goodbye", "bye", "seeya"], embeddings=[[0, 1, 2], [3, 4, 5], [7, 8, 9], [10, 11, 12]], meta=ApiMeta( api_version=ApiMetaApiVersion(version="1"), billed_units=ApiMetaBilledUnits( input_tokens=3, output_tokens=3, search_units=3...
189ce399e6bf5493d58a68edaf1a5e1c1a2b4c55
127
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_dop.py
test_GDOP
self.assertAlmostEqual
numeric_literal
22
import unittest import numpy as np from laika.raw_gnss import get_DOP, get_PDOP, get_HDOP, get_VDOP, get_TDOP from laika.lib.coordinates import geodetic2ecef class TestDOP(unittest.TestCase): def setUp(self): self.receiver = geodetic2ecef((0, 0, 0)) self.satellites = np.array([ [18935913, -3082759, ...
2.352329857908973)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_dop.py
test_PDOP
self.assertAlmostEqual
numeric_literal
22
import unittest import numpy as np from laika.raw_gnss import get_DOP, get_PDOP, get_HDOP, get_VDOP, get_TDOP from laika.lib.coordinates import geodetic2ecef class TestDOP(unittest.TestCase): def setUp(self): self.receiver = geodetic2ecef((0, 0, 0)) self.satellites = np.array([ [18935913, -3082759, ...
2.195622042769321)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_dop.py
test_HDOP
self.assertAlmostEqual
numeric_literal
22
import unittest import numpy as np from laika.raw_gnss import get_DOP, get_PDOP, get_HDOP, get_VDOP, get_TDOP from laika.lib.coordinates import geodetic2ecef class TestDOP(unittest.TestCase): def setUp(self): self.receiver = geodetic2ecef((0, 0, 0)) self.satellites = np.array([ [18935913, -3082759, ...
1.3418910470124197)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_dop.py
test_VDOP
self.assertAlmostEqual
numeric_literal
22
import unittest import numpy as np from laika.raw_gnss import get_DOP, get_PDOP, get_HDOP, get_VDOP, get_TDOP from laika.lib.coordinates import geodetic2ecef class TestDOP(unittest.TestCase): def setUp(self): self.receiver = geodetic2ecef((0, 0, 0)) self.satellites = np.array([ [18935913, -3082759, ...
1.7378390525714509)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_dop.py
test_TDOP
self.assertAlmostEqual
numeric_literal
22
import unittest import numpy as np from laika.raw_gnss import get_DOP, get_PDOP, get_HDOP, get_VDOP, get_TDOP from laika.lib.coordinates import geodetic2ecef class TestDOP(unittest.TestCase): def setUp(self): self.receiver = geodetic2ecef((0, 0, 0)) self.satellites = np.array([ [18935913, -3082759, ...
0.8442153787485294)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_downloader.py
test_download
self.assertIsNotNone
variable
32
import os import unittest from unittest.mock import patch from laika.downloader import download_and_cache_file, download_file, DownloadFailed class TestDownloader(unittest.TestCase): def setUp(self) -> None: self.cache_dir = '/tmp/gnss/'+'cddis_products' self.url_base = ( 'https://github.com/commaai/...
file)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_downloader.py
test_write_attempt_file_on_error
self.assertRaises
variable
40
import os import unittest from unittest.mock import patch from laika.downloader import download_and_cache_file, download_file, DownloadFailed class TestDownloader(unittest.TestCase): def setUp(self) -> None: self.cache_dir = '/tmp/gnss/'+'cddis_products' self.url_base = ( 'https://github.com/commaai/...
DownloadFailed)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_downloader.py
test_all_download_protocols
self.assertTrue
func_call
33
import os import unittest from unittest.mock import patch from laika.downloader import download_and_cache_file, download_file, DownloadFailed class TestDownloader(unittest.TestCase): def setUp(self) -> None: self.cache_dir = '/tmp/gnss/'+'cddis_products' self.url_base = ( 'https://github.com/commaai/...
dat and len(dat) == 197513)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_downloader.py
test_write_attempt_file_on_error
self.assertFalse
func_call
31
import os import unittest from unittest.mock import patch from laika.downloader import download_and_cache_file, download_file, DownloadFailed class TestDownloader(unittest.TestCase): def setUp(self) -> None: self.cache_dir = '/tmp/gnss/'+'cddis_products' self.url_base = ( 'https://github.com/commaai/...
os.path.exists(self.filepath_attempt))
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_ephemerides.py
test_nav_vs_orbit__old
assert
none_literal
26
from unittest.mock import Mock import numpy as np import unittest from laika.ephemeris import EphemerisType, convert_ublox_gps_ephem, read_prn_data from laika.gps_time import GPSTime from laika import AstroDog gps_times_list = [[1999, 415621.0], [2045, 455457.0], [1985, 443787.0]]...
None
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_ephemerides.py
test_read_prn_data
self.assertEqual
func_call
31
from unittest.mock import Mock import numpy as np import unittest from laika.ephemeris import EphemerisType, convert_ublox_gps_ephem, read_prn_data from laika.gps_time import GPSTime from laika import AstroDog gps_times_list = [[1999, 415621.0], [2045, 455457.0], [1985, 443787.0]]...
len(ephems))
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_ephemerides.py
test_ephemeris_parsing
self.assertEqual
variable
32
from unittest.mock import Mock import numpy as np import unittest from laika.ephemeris import EphemerisType, convert_ublox_gps_ephem, read_prn_data from laika.gps_time import GPSTime from laika import AstroDog gps_times_list = [[1999, 415621.0], [2045, 455457.0], [1985, 443787.0]]...
updated_time)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_ephemerides.py
test_ephemeris_parsing
self.assertEqual
complex_expr
40
from unittest.mock import Mock import numpy as np import unittest from laika.ephemeris import EphemerisType, convert_ublox_gps_ephem, read_prn_data from laika.gps_time import GPSTime from laika import AstroDog gps_times_list = [[1999, 415621.0], [2045, 455457.0], [1985, 443787.0]]...
ephemeris.epoch)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_ephemerides.py
test_nav_vs_orbit__old
assert_*
complex_expr
30
from unittest.mock import Mock import numpy as np import unittest from laika.ephemeris import EphemerisType, convert_ublox_gps_ephem, read_prn_data from laika.gps_time import GPSTime from laika import AstroDog gps_times_list = [[1999, 415621.0], [2045, 455457.0], [1985, 443787.0]]...
sat_info_orbit[0])
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_ephemerides.py
test_nav_vs_orbit__old
assert_*
complex_expr
31
from unittest.mock import Mock import numpy as np import unittest from laika.ephemeris import EphemerisType, convert_ublox_gps_ephem, read_prn_data from laika.gps_time import GPSTime from laika import AstroDog gps_times_list = [[1999, 415621.0], [2045, 455457.0], [1985, 443787.0]]...
sat_info_orbit[1])
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_ephemerides.py
test_nav_vs_orbit__old
assert_*
complex_expr
32
from unittest.mock import Mock import numpy as np import unittest from laika.ephemeris import EphemerisType, convert_ublox_gps_ephem, read_prn_data from laika.gps_time import GPSTime from laika import AstroDog gps_times_list = [[1999, 415621.0], [2045, 455457.0], [1985, 443787.0]]...
sat_info_orbit[2])
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_fail_caching.py
test_no_infinite_pulls
self.assertTrue
func_call
23
import unittest import time from laika.ephemeris import EphemerisType from laika.gps_time import GPSTime from laika import AstroDog gps_times_list = [[1950, 415621.0]] svIds = ['R12'] gps_times = [GPSTime(*gps_time_list) for gps_time_list in gps_times_list] class TestFailCache(unittest.TestCase): def test_no_infi...
time.time() - t0 < 10)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_fetch_sat_info.py
test_no_block_satellite_when_get_info_from_not_available_period
self.assertIsNone
variable
23
from datetime import datetime import unittest from laika import AstroDog from laika.ephemeris import EphemerisType from laika.gps_time import GPSTime class TestFetchSatInfo(unittest.TestCase): def test_no_block_satellite_when_get_info_from_not_available_period(self): '''If you first fetch satellite info from p...
sat_info)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_fetch_sat_info.py
test_fetch_data_from_distant_future
self.assertRaises
variable
13
from datetime import datetime import unittest from laika import AstroDog from laika.ephemeris import EphemerisType from laika.gps_time import GPSTime class TestFetchSatInfo(unittest.TestCase): def test_fetch_data_from_distant_future(self): dog = AstroDog() date = GPSTime.from_datetime(datetime(3120, 1, 1)) ...
RuntimeError)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_fetch_sat_info.py
test_get_all_sat_info_gps
self.assertGreater
string_literal
25
from datetime import datetime import unittest from laika import AstroDog from laika.ephemeris import EphemerisType from laika.gps_time import GPSTime class TestFetchSatInfo(unittest.TestCase): def test_get_all_sat_info_gps(self): time = GPSTime.from_datetime(datetime(2020, 5, 1, 12, 0, 0)) all_ephem_types ...
f"No ephemeris found for {kwargs}")
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_positioning.py
run_station_position
assert_*
variable
54
import numpy as np from tqdm.auto import tqdm import unittest from laika import AstroDog from shutil import copyfile import os from datetime import datetime from laika.gps_time import GPSTime from laika.downloader import download_cors_station from laika.rinex_file import RINEXFile from laika.dgps import get_station_pos...
sc01_exact_position)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_prediction_orbits.py
test_gps
self.assertGreater
numeric_literal
16
from datetime import datetime import unittest from laika import AstroDog from laika.constants import SECS_IN_HR from laika.ephemeris import EphemerisType from laika.gps_time import GPSTime class TestPredictionOrbits(unittest.TestCase): def test_gps(self): available_date = GPSTime.from_datetime(datetime(2020, 5...
0)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_prediction_orbits.py
test_gps_and_glonass_2022
self.assertTrue
complex_expr
21
from datetime import datetime import unittest from laika import AstroDog from laika.constants import SECS_IN_HR from laika.ephemeris import EphemerisType from laika.gps_time import GPSTime class TestPredictionOrbits(unittest.TestCase): def test_gps_and_glonass_2022(self): # Test GPS and GLONASS separately from...
check_date in dog.orbit_fetched_times)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_prediction_orbits.py
test_gps
self.assertTrue
complex_expr
17
from datetime import datetime import unittest from laika import AstroDog from laika.constants import SECS_IN_HR from laika.ephemeris import EphemerisType from laika.gps_time import GPSTime class TestPredictionOrbits(unittest.TestCase): def test_gps(self): available_date = GPSTime.from_datetime(datetime(2020, 5...
available_date in dog.orbit_fetched_times)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_prns.py
test_prn_from_nmea_id_for_main_constellations
self.assertEqual
variable
52
import unittest from laika.helpers import get_constellation, get_nmea_id_from_prn, get_prn_from_nmea_id MAIN_CONSTELLATIONS = [ ['G01', 1], ['G10', 10], ['G32', 32], ['S01', 33], ['S02', 34], ['S10', 42], ['S22', 54], ['S23', 55], ['S32', 64], ['S33', 120], ['S64', 151], ...
prn)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_prns.py
test_nmea_id_from_prn_for_main_constellations
self.assertEqual
variable
52
import unittest from laika.helpers import get_constellation, get_nmea_id_from_prn, get_prn_from_nmea_id MAIN_CONSTELLATIONS = [ ['G01', 1], ['G10', 10], ['G32', 32], ['S01', 33], ['S02', 34], ['S10', 42], ['S22', 54], ['S23', 55], ['S32', 64], ['S33', 120], ['S64', 151], ...
nmea_id)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_prns.py
test_nmea_id_from_invalid_prn
self.assertRaises
variable
49
import unittest from laika.helpers import get_constellation, get_nmea_id_from_prn, get_prn_from_nmea_id MAIN_CONSTELLATIONS = [ ['G01', 1], ['G10', 10], ['G32', 32], ['S01', 33], ['S02', 34], ['S10', 42], ['S22', 54], ['S23', 55], ['S32', 64], ['S33', 120], ['S64', 151], ...
ValueError)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_prns.py
test_constellation_from_prn_outside_range
self.assertEqual
variable
50
import unittest from laika.helpers import get_constellation, get_nmea_id_from_prn, get_prn_from_nmea_id MAIN_CONSTELLATIONS = [ ['G01', 1], ['G10', 10], ['G32', 32], ['S01', 33], ['S02', 34], ['S10', 42], ['S22', 54], ['S23', 55], ['S32', 64], ['S33', 120], ['S64', 151], ...
constellation)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_time.py
test_utc_converter
assert_*
numeric_literal
52
import numpy as np import unittest from laika.gps_time import GPSTime, TimeSyncer, gpst_to_utc, utc_to_gpst from datetime import datetime datetimes_strings = ['1985-10-10 19:27:01', '2002-04-27 22:22:06', '1986-01-03 06:30:57', '2019-09-15 19:30:33', '2005-12-06 14:54:22', '200...
0)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_time.py
test_utc_converter
assert_*
numeric_literal
44
import numpy as np import unittest from laika.gps_time import GPSTime, TimeSyncer, gpst_to_utc, utc_to_gpst from datetime import datetime datetimes_strings = ['1985-10-10 19:27:01', '2002-04-27 22:22:06', '1986-01-03 06:30:57', '2019-09-15 19:30:33', '2005-12-06 14:54:22', '200...
14)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_time.py
test_utc_converter
assert_*
numeric_literal
45
import numpy as np import unittest from laika.gps_time import GPSTime, TimeSyncer, gpst_to_utc, utc_to_gpst from datetime import datetime datetimes_strings = ['1985-10-10 19:27:01', '2002-04-27 22:22:06', '1986-01-03 06:30:57', '2019-09-15 19:30:33', '2005-12-06 14:54:22', '200...
15)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_time.py
test_utc_converter
assert_*
numeric_literal
46
import numpy as np import unittest from laika.gps_time import GPSTime, TimeSyncer, gpst_to_utc, utc_to_gpst from datetime import datetime datetimes_strings = ['1985-10-10 19:27:01', '2002-04-27 22:22:06', '1986-01-03 06:30:57', '2019-09-15 19:30:33', '2005-12-06 14:54:22', '200...
16)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_time.py
test_syncer
assert_*
variable
41
import numpy as np import unittest from laika.gps_time import GPSTime, TimeSyncer, gpst_to_utc, utc_to_gpst from datetime import datetime datetimes_strings = ['1985-10-10 19:27:01', '2002-04-27 22:22:06', '1986-01-03 06:30:57', '2019-09-15 19:30:33', '2005-12-06 14:54:22', '200...
delta)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_time.py
test_gps_time_dt_conversion
assert_*
variable
38
import numpy as np import unittest from laika.gps_time import GPSTime, TimeSyncer, gpst_to_utc, utc_to_gpst from datetime import datetime datetimes_strings = ['1985-10-10 19:27:01', '2002-04-27 22:22:06', '1986-01-03 06:30:57', '2019-09-15 19:30:33', '2005-12-06 14:54:22', '200...
delta_sec)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_time.py
test_gps_time_week_rollover
assert_*
complex_expr
38
import numpy as np import unittest from laika.gps_time import GPSTime, TimeSyncer, gpst_to_utc, utc_to_gpst from datetime import datetime datetimes_strings = ['1985-10-10 19:27:01', '2002-04-27 22:22:06', '1986-01-03 06:30:57', '2019-09-15 19:30:33', '2005-12-06 14:54:22', '200...
gps_time.tow)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_time.py
test_gps_time_week_rollover
assert_*
complex_expr
39
import numpy as np import unittest from laika.gps_time import GPSTime, TimeSyncer, gpst_to_utc, utc_to_gpst from datetime import datetime datetimes_strings = ['1985-10-10 19:27:01', '2002-04-27 22:22:06', '1986-01-03 06:30:57', '2019-09-15 19:30:33', '2005-12-06 14:54:22', '200...
gps_time.week)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_time.py
test_gps_time_subtraction_addition
assert_*
variable
43
import numpy as np import unittest from laika.gps_time import GPSTime, TimeSyncer, gpst_to_utc, utc_to_gpst from datetime import datetime datetimes_strings = ['1985-10-10 19:27:01', '2002-04-27 22:22:06', '1986-01-03 06:30:57', '2019-09-15 19:30:33', '2005-12-06 14:54:22', '200...
delta_sec_plus_gps)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_time.py
test_gps_time_subtraction_addition
assert_*
variable
44
import numpy as np import unittest from laika.gps_time import GPSTime, TimeSyncer, gpst_to_utc, utc_to_gpst from datetime import datetime datetimes_strings = ['1985-10-10 19:27:01', '2002-04-27 22:22:06', '1986-01-03 06:30:57', '2019-09-15 19:30:33', '2005-12-06 14:54:22', '200...
delta_sec_minus_gps)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/laika
b740b71c82a748e3520b1599487d9a7aaf728670
37
train
train
tests/test_time_range_holder.py
test_empty
self.assertFalse
complex_expr
12
from datetime import datetime import unittest from laika.helpers import TimeRangeHolder from laika.gps_time import GPSTime class TestTimeRangeHolder(unittest.TestCase): def test_empty(self): time = GPSTime.from_datetime(datetime(2020, 5, 1, 0, 0, 0)) holder = TimeRangeHolder() self.assert...
time in holder)
b740b71c82a748e3520b1599487d9a7aaf728670
37
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_checksums.py
verify_fca_giorgio_crc
assert
numeric_literal
32
import copy from opendbc.can import CANPacker, CANParser class TestCanChecksums: def verify_checksum(self, subtests, dbc_file: str, msg_name: str, msg_addr: int, test_messages: list[bytes], checksum_field: str = 'CHECKSUM', counter_field = 'COUNTER'): """ Verify that opendbc calculates...
3
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_parser_updated_list
assert
numeric_literal
22
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_parser_updated_list(self): msgs = [("CAN_FD_MESSAGE", 10), ] parser = CANParser(TEST_DBC, msgs, 0) packer = CANPacker(TEST_DBC) m...
0
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/ccp.py
_send_cro
assert
numeric_literal
23
import sys import time import struct from enum import IntEnum, Enum from dataclasses import dataclass class CcpClient: def __init__(self, panda, tx_addr: int, rx_addr: int, bus: int=0, byte_order: BYTE_ORDER=BYTE_ORDER.BIG_ENDIAN, debug=False): self.tx_addr = tx_addr self.rx_addr = rx_addr self.can_bus =...
8
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/ccp.py
build_checksum
assert
numeric_literal
202
import sys import time import struct from enum import IntEnum, Enum from dataclasses import dataclass class CcpClient: def __init__(self, panda, tx_addr: int, rx_addr: int, bus: int=0, byte_order: BYTE_ORDER=BYTE_ORDER.BIG_ENDIAN, debug=False): self.tx_addr = tx_addr self.rx_addr = rx_addr self.can_bus =...
4
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/ford/tests/test_ford.py
test_match_fw_fuzzy
assert
numeric_literal
83
import random from collections.abc import Iterable from hypothesis import settings, given, strategies as st from parameterized import parameterized from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.ford.values import CAR, FW_QUERY_CONFIG, FW_PATTERN, get_plat...
0
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/gm/tests/test_gm.py
test_can_fingerprints
assert
numeric_literal
12
from parameterized import parameterized from opendbc.car.gm.fingerprints import FINGERPRINTS from opendbc.car.gm.values import CAMERA_ACC_CAR, GM_RX_OFFSET CAMERA_DIAGNOSTIC_ADDRESS = 0x24b class TestGMFingerprint: @parameterized.expand(FINGERPRINTS.items()) def test_can_fingerprints(self, car_model, fingerprint...
0
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/gm/tests/test_gm.py
test_can_fingerprints
assert
numeric_literal
20
from parameterized import parameterized from opendbc.car.gm.fingerprints import FINGERPRINTS from opendbc.car.gm.values import CAMERA_ACC_CAR, GM_RX_OFFSET CAMERA_DIAGNOSTIC_ADDRESS = 0x24b class TestGMFingerprint: @parameterized.expand(FINGERPRINTS.items()) def test_can_fingerprints(self, car_model, fingerprint...
8
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_canfd_ecu_whitelist
assert
numeric_literal
52
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
0
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_expected_platform_codes
assert
numeric_literal
61
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
1
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_car_interfaces.py
test_car_interfaces
assert
numeric_literal
69
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...
1
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_car_interfaces.py
test_car_interfaces
assert
numeric_literal
70
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...
0
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_docs.py
test_harnesses
assert
numeric_literal
24
from collections import defaultdict import pytest from opendbc.car.car_helpers import interfaces from opendbc.car.docs import get_all_car_docs from opendbc.car.docs_definitions import Cable, Column, PartType, Star, SupportType from opendbc.car.honda.values import CAR as HONDA from opendbc.car.values import PLATFORMS ...
0
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_docs.py
test_harnesses
assert
numeric_literal
25
from collections import defaultdict import pytest from opendbc.car.car_helpers import interfaces from opendbc.car.docs import get_all_car_docs from opendbc.car.docs_definitions import Cable, Column, PartType, Star, SupportType from opendbc.car.honda.values import CAR as HONDA from opendbc.car.values import PLATFORMS ...
1
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_fw_fingerprint.py
assertFingerprints
assert
numeric_literal
23
import pytest import random import time from collections import defaultdict from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import interfaces from opendbc.car.structs import CarParams from opendbc.car.fingerprints import FW_VERSIONS from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ...
1
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_fw_fingerprint.py
test_brand_ecu_matches
assert
numeric_literal
28
import pytest import random import time from collections import defaultdict from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import interfaces from opendbc.car.structs import CarParams from opendbc.car.fingerprints import FW_VERSIONS from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ...
0
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_platform_configs.py
test_configs
assert
numeric_literal
13
from opendbc.car.values import PLATFORMS class TestPlatformConfigs: def test_configs(self, subtests): for name, platform in PLATFORMS.items(): with subtests.test(platform=str(platform)): assert platform.config._frozen if platform != "MOCK": assert len(platform.config.dbc_dict) >...
0
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/toyota/tests/test_toyota.py
test_car_sets
assert
numeric_literal
20
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...
0
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/volkswagen/tests/test_volkswagen.py
test_chassis_codes
assert
numeric_literal
20
import random import re from opendbc.car.structs import CarParams from opendbc.car.volkswagen.values import CAR, FW_QUERY_CONFIG, WMI from opendbc.car.volkswagen.fingerprints import FW_VERSIONS Ecu = CarParams.Ecu CHASSIS_CODE_PATTERN = re.compile('[A-Z0-9]{2}') SPARE_PART_FW_PATTERN = re.compile(b'\xf1\x87(?P<gate...
0
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/common.py
add_regen_tests
assert
numeric_literal
43
import os import abc import math import unittest import importlib import numpy as np from collections.abc import Callable from opendbc.can import CANPacker from opendbc.safety import ALTERNATIVE_EXPERIENCE from opendbc.safety.tests.libsafety import libsafety_py MAX_WRONG_COUNTERS = 5 MAX_SAMPLE_VALS = 6 VEHICLE_SPEED...
3
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/safety_replay/replay_drive.py
replay_drive
assert
numeric_literal
15
import argparse from collections import Counter from tqdm import tqdm from opendbc.car.carlog import carlog from opendbc.safety.tests.libsafety import libsafety_py from opendbc.safety.tests.safety_replay.helpers import package_can_msg, init_segment def replay_drive(msgs, safety_mode, param, alternative_experience): ...
0
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_checksums.py
verify_volkswagen_mqb_crc
assert
numeric_literal
37
import copy from opendbc.can import CANPacker, CANParser class TestCanChecksums: def verify_checksum(self, subtests, dbc_file: str, msg_name: str, msg_addr: int, test_messages: list[bytes], checksum_field: str = 'CHECKSUM', counter_field = 'COUNTER'): """ Verify that opendbc calculates...
16
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_dbc_parser.py
test_enough_dbcs
assert
numeric_literal
8
from opendbc.can import CANParser from opendbc.can.tests import ALL_DBCS class TestDBCParser: def test_enough_dbcs(self): # sanity check that we're running on the real DBCs assert len(ALL_DBCS) >
20
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_subaru
pytest.approx
numeric_literal
36
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_subaru(self): # Subaru is little endian dbc_file = "subaru_global_2017_generated" msgs = [("ES_LKAS", 50)] parser = CANParser(d...
1)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/ford/tests/test_ford.py
test_fw_versions
assert
numeric_literal
51
import random from collections.abc import Iterable from hypothesis import settings, given, strategies as st from parameterized import parameterized from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.ford.values import CAR, FW_QUERY_CONFIG, FW_PATTERN, get_plat...
24
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_car_interfaces.py
test_interface_attrs
assert
numeric_literal
57
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...
12
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/common.py
test_accel_limits_correct
self.assertGreater
numeric_literal
75
import os import abc import math import unittest import importlib import numpy as np from collections.abc import Callable from opendbc.can import CANPacker from opendbc.safety import ALTERNATIVE_EXPERIENCE from opendbc.safety.tests.libsafety import libsafety_py MAX_WRONG_COUNTERS = 5 MAX_SAMPLE_VALS = 6 VEHICLE_SPEED...
0)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_packer
assert
variable
19
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_packer(self): packer = CANPacker(TEST_DBC) for b in range(6): for i in range(256): values = {"COUNTER": i} addr, dat...
b
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_packer
assert
variable
20
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_packer(self): packer = CANPacker(TEST_DBC) for b in range(6): for i in range(256): values = {"COUNTER": i} addr, dat...
i
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_checksums.py
test_honda_checksum
assert
variable
61
import copy from opendbc.can import CANPacker, CANParser class TestCanChecksums: def verify_checksum(self, subtests, dbc_file: str, msg_name: str, msg_addr: int, test_messages: list[bytes], checksum_field: str = 'CHECKSUM', counter_field = 'COUNTER'): """ Verify that opendbc calculates...
std
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_checksums.py
test_honda_checksum
assert
variable
62
import copy from opendbc.can import CANPacker, CANParser class TestCanChecksums: def verify_checksum(self, subtests, dbc_file: str, msg_name: str, msg_addr: int, test_messages: list[bytes], checksum_field: str = 'CHECKSUM', counter_field = 'COUNTER'): """ Verify that opendbc calculates...
ext
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_packer_counter
assert
variable
31
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_packer_counter(self): msgs = [("CAN_FD_MESSAGE", 0), ] packer = CANPacker(TEST_DBC) parser = CANParser(TEST_DBC, msgs, 0) # packe...
cnt
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_vehicle_model.py
test_syn_ss_sol_simulate
assert_*
variable
42
import pytest import math import numpy as np from opendbc.car.honda.interface import CarInterface from opendbc.car.honda.values import CAR from opendbc.car.vehicle_model import VehicleModel, dyn_ss_sol, create_dyn_state_matrices class TestVehicleModel: def setup_method(self): CP = CarInterface.get_non_essentia...
x2)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/common.py
test_steer_req_bit_frames
self.assertEqual
variable
98
import os import abc import math import unittest import importlib import numpy as np from collections.abc import Callable from opendbc.can import CANPacker from opendbc.safety import ALTERNATIVE_EXPERIENCE from opendbc.safety.tests.libsafety import libsafety_py MAX_WRONG_COUNTERS = 5 MAX_SAMPLE_VALS = 6 VEHICLE_SPEED...
tx)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_packer_parser
pytest.approx
variable
43
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_packer_parser(self): msgs = [ ("Brake_Status", 0), ("CAN_FD_MESSAGE", 0), ("STEERING_CONTROL", 0), ] packer = CANPac...
val)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_vehicle_model.py
test_dyn_ss_sol_against_yaw_rate
pytest.approx
variable
29
import pytest import math import numpy as np from opendbc.car.honda.interface import CarInterface from opendbc.car.honda.values import CAR from opendbc.car.vehicle_model import VehicleModel, dyn_ss_sol, create_dyn_state_matrices class TestVehicleModel: def setup_method(self): CP = CarInterface.get_non_essentia...
yr2)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/common.py
_common_measurement_test
self.assertAlmostEqual
variable
111
import os import abc import math import unittest import importlib import numpy as np from collections.abc import Callable from opendbc.can import CANPacker from opendbc.safety import ALTERNATIVE_EXPERIENCE from opendbc.safety.tests.libsafety import libsafety_py MAX_WRONG_COUNTERS = 5 MAX_SAMPLE_VALS = 6 VEHICLE_SPEED...
val)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_feature_detection
assert
variable
61
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
radar
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_scale_offset
pytest.approx
variable
24
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_scale_offset(self): """Test that both scale and offset are correctly preserved""" dbc_file = "honda_civic_touring_2016_can_generated" ...
brake)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor