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
safety-research/bloom
04c26c1b42b78a0d28df13af3ed1acad3984d0da
3
train
train
tests/test_transcript_utils.py
test_adds_event_with_reasoning
assert
string_literal
33
import json import tempfile from pathlib import Path from bloom.transcript_utils import ( add_transcript_event, format_transcript_for_judge, generate_id, get_transcript_format, init_transcript_metadata, load_transcript, ) class TestAddTranscriptEvent: def test_adds_event_with_reasoning(se...
"text"
04c26c1b42b78a0d28df13af3ed1acad3984d0da
3
v2_extractor_at_anchor
safety-research/bloom
04c26c1b42b78a0d28df13af3ed1acad3984d0da
3
train
train
tests/test_transcript_utils.py
test_adds_tool_message
assert
string_literal
29
import json import tempfile from pathlib import Path from bloom.transcript_utils import ( add_transcript_event, format_transcript_for_judge, generate_id, get_transcript_format, init_transcript_metadata, load_transcript, ) class TestAddTranscriptEvent: def test_adds_tool_message(self): ...
"tool"
04c26c1b42b78a0d28df13af3ed1acad3984d0da
3
v2_extractor_at_anchor
safety-research/bloom
04c26c1b42b78a0d28df13af3ed1acad3984d0da
3
train
train
tests/test_transcript_utils.py
test_creates_metadata
assert
string_literal
28
import json import tempfile from pathlib import Path from bloom.transcript_utils import ( add_transcript_event, format_transcript_for_judge, generate_id, get_transcript_format, init_transcript_metadata, load_transcript, ) class TestInitTranscriptMetadata: def test_creates_metadata(self): ...
"v3.0"
04c26c1b42b78a0d28df13af3ed1acad3984d0da
3
v2_extractor_at_anchor
safety-research/bloom
04c26c1b42b78a0d28df13af3ed1acad3984d0da
3
train
train
tests/test_transcript_utils.py
test_combines_metadata_and_events
assert
variable
26
import json import tempfile from pathlib import Path from bloom.transcript_utils import ( add_transcript_event, format_transcript_for_judge, generate_id, get_transcript_format, init_transcript_metadata, load_transcript, ) class TestGetTranscriptFormat: def test_combines_metadata_and_event...
events
04c26c1b42b78a0d28df13af3ed1acad3984d0da
3
v2_extractor_at_anchor
safety-research/bloom
04c26c1b42b78a0d28df13af3ed1acad3984d0da
3
train
train
tests/test_transcript_utils.py
test_loads_new_format
assert
variable
25
import json import tempfile from pathlib import Path from bloom.transcript_utils import ( add_transcript_event, format_transcript_for_judge, generate_id, get_transcript_format, init_transcript_metadata, load_transcript, ) class TestLoadTranscript: def test_loads_new_format(self): ...
result
04c26c1b42b78a0d28df13af3ed1acad3984d0da
3
v2_extractor_at_anchor
safety-research/bloom
04c26c1b42b78a0d28df13af3ed1acad3984d0da
3
train
train
tests/test_transcript_utils.py
test_loads_new_format
assert
string_literal
26
import json import tempfile from pathlib import Path from bloom.transcript_utils import ( add_transcript_event, format_transcript_for_judge, generate_id, get_transcript_format, init_transcript_metadata, load_transcript, ) class TestLoadTranscript: def test_loads_new_format(self): ...
"test"
04c26c1b42b78a0d28df13af3ed1acad3984d0da
3
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/conftest.py
call_method_and_assert_uri_contains
assert
variable
171
import pytest import pytest_asyncio from binance.client import Client from binance.async_client import AsyncClient import os import asyncio import logging from binance.ws.streams import ThreadedWebsocketManager proxies = {} proxy = os.getenv("PROXY") proxy = "http://51.83.140.52:16301" api_key = os.getenv("TEST_API...
uri
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_api_request.py
test_api_exception
pytest.raises
variable
16
from binance.client import Client from binance.exceptions import BinanceAPIException, BinanceRequestException import pytest import requests_mock import os proxies = {} proxy = os.getenv("PROXY") client = Client("api_key", "api_secret", {"proxies": proxies}) def test_api_exception(): """Test API response Exceptio...
BinanceAPIException)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_api_request.py
test_invalid_json
pytest.raises
variable
16
from binance.client import Client from binance.exceptions import BinanceAPIException, BinanceRequestException import pytest import requests_mock import os proxies = {} proxy = os.getenv("PROXY") client = Client("api_key", "api_secret", {"proxies": proxies}) def test_invalid_json(): """Test Invalid response Excep...
BinanceRequestException)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client.py
test_time_unit_microseconds
assert
numeric_literal
18
import pytest from binance.async_client import AsyncClient from .conftest import proxy, api_key, api_secret, testnet from binance.exceptions import BinanceAPIException, BinanceRequestException from aiohttp import ClientResponse, hdrs from aiohttp.helpers import TimerNoop from yarl import URL pytestmark = [pytest.mark...
16
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client.py
test_time_unit_milloseconds
assert
numeric_literal
18
import pytest from binance.async_client import AsyncClient from .conftest import proxy, api_key, api_secret, testnet from binance.exceptions import BinanceAPIException, BinanceRequestException from aiohttp import ClientResponse, hdrs from aiohttp.helpers import TimerNoop from yarl import URL pytestmark = [pytest.mark...
13
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client.py
test_handle_response
assert
collection
36
import pytest from binance.async_client import AsyncClient from .conftest import proxy, api_key, api_secret, testnet from binance.exceptions import BinanceAPIException, BinanceRequestException from aiohttp import ClientResponse, hdrs from aiohttp.helpers import TimerNoop from yarl import URL pytestmark = [pytest.mark...
{}
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client.py
test_clientAsync_initialization
assert
none_literal
14
import pytest from binance.async_client import AsyncClient from .conftest import proxy, api_key, api_secret, testnet from binance.exceptions import BinanceAPIException, BinanceRequestException from aiohttp import ClientResponse, hdrs from aiohttp.helpers import TimerNoop from yarl import URL pytestmark = [pytest.mark...
None
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client.py
test_handle_response
assert
collection
31
import pytest from binance.async_client import AsyncClient from .conftest import proxy, api_key, api_secret, testnet from binance.exceptions import BinanceAPIException, BinanceRequestException from aiohttp import ClientResponse, hdrs from aiohttp.helpers import TimerNoop from yarl import URL pytestmark = [pytest.mark...
{"key": "value"}
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client.py
test_handle_response
pytest.raises
variable
47
import pytest from binance.async_client import AsyncClient from .conftest import proxy, api_key, api_secret, testnet from binance.exceptions import BinanceAPIException, BinanceRequestException from aiohttp import ClientResponse, hdrs from aiohttp.helpers import TimerNoop from yarl import URL pytestmark = [pytest.mark...
BinanceAPIException)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client.py
test_handle_response
pytest.raises
variable
41
import pytest from binance.async_client import AsyncClient from .conftest import proxy, api_key, api_secret, testnet from binance.exceptions import BinanceAPIException, BinanceRequestException from aiohttp import ClientResponse, hdrs from aiohttp.helpers import TimerNoop from yarl import URL pytestmark = [pytest.mark...
BinanceRequestException)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client_futures.py
test_futures_create_get_edit_cancel_order
assert_*
variable
22
from datetime import datetime import pytest from .test_order import assert_contract_order from .test_get_order_book import assert_ob pytestmark = [pytest.mark.futures, pytest.mark.asyncio] async def test_futures_create_get_edit_cancel_order(futuresClientAsync): ticker = await futuresClientAsync.futures_ticker(sy...
order)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client_futures.py
test_futures_order_book
assert_*
variable
12
from datetime import datetime import pytest from .test_order import assert_contract_order from .test_get_order_book import assert_ob pytestmark = [pytest.mark.futures, pytest.mark.asyncio] async def test_futures_order_book(futuresClientAsync): order_book = await futuresClientAsync.futures_order_book(symbol="BTCU...
order_book)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client_gift_card copy.py
test_gift_card_create_verify_and_redeem
assert
none_literal
9
import pytest pytestmark = [pytest.mark.gift_card, pytest.mark.asyncio] async def test_gift_card_create_verify_and_redeem(liveClientAsync): # create a gift card response = await liveClientAsync.gift_card_create(token="USDT", amount=1.0) assert response["data"]["referenceNo"] is not
None
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client_gift_card copy.py
test_gift_card_create_verify_and_redeem
assert
string_literal
15
import pytest pytestmark = [pytest.mark.gift_card, pytest.mark.asyncio] async def test_gift_card_create_verify_and_redeem(liveClientAsync): # create a gift card response = await liveClientAsync.gift_card_create(token="USDT", amount=1.0) assert response["data"]["referenceNo"] is not None assert respons...
"SUCCESS"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client_gift_card copy.py
test_gift_card_create_verify_and_redeem
assert
complex_expr
20
import pytest pytestmark = [pytest.mark.gift_card, pytest.mark.asyncio] async def test_gift_card_create_verify_and_redeem(liveClientAsync): # create a gift card response = await liveClientAsync.gift_card_create(token="USDT", amount=1.0) assert response["data"]["referenceNo"] is not None assert respons...
redeem_response["data"]["referenceNo"]
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client_ws_futures_requests.py
test_ws_futures_create_get_edit_cancel_order_with_orjson
assert_*
variable
28
import asyncio import pytest import sys from binance.exceptions import BinanceAPIException, BinanceWebsocketUnableToConnect from .test_get_order_book import assert_ob from .test_order import assert_contract_order @pytest.mark.asyncio() async def test_ws_futures_create_get_edit_cancel_order_with_orjson(futuresClientAs...
order)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client_ws_futures_requests.py
test_concurrent_ws_futures_get_order_book
assert_*
variable
25
import asyncio import pytest import sys from binance.exceptions import BinanceAPIException, BinanceWebsocketUnableToConnect from .test_get_order_book import assert_ob from .test_order import assert_contract_order @pytest.mark.asyncio async def test_concurrent_ws_futures_get_order_book(futuresClientAsync): symbols...
orderbook)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client_ws_futures_requests.py
test_concurrent_ws_futures_get_order_book
assert
func_call
23
import asyncio import pytest import sys from binance.exceptions import BinanceAPIException, BinanceWebsocketUnableToConnect from .test_get_order_book import assert_ob from .test_order import assert_contract_order @pytest.mark.asyncio async def test_concurrent_ws_futures_get_order_book(futuresClientAsync): symbols...
len(symbols)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client_ws_futures_requests.py
test_bad_request
pytest.raises
variable
12
import asyncio import pytest import sys from binance.exceptions import BinanceAPIException, BinanceWebsocketUnableToConnect from .test_get_order_book import assert_ob from .test_order import assert_contract_order @pytest.mark.asyncio() async def test_bad_request(futuresClientAsync): with pytest.raises(
BinanceAPIException)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_async_client_ws_futures_requests.py
test_ws_futures_fail_to_connect
pytest.raises
variable
14
import asyncio import pytest import sys from binance.exceptions import BinanceAPIException, BinanceWebsocketUnableToConnect from .test_get_order_book import assert_ob from .test_order import assert_contract_order @pytest.mark.asyncio async def test_ws_futures_fail_to_connect(futuresClientAsync): # Simulate WebSoc...
BinanceWebsocketUnableToConnect)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client.py
test_time_unit_microseconds
assert
numeric_literal
16
import pytest from binance.client import Client from binance.exceptions import BinanceAPIException, BinanceRequestException from .conftest import proxies, api_key, api_secret, testnet, call_method_and_assert_uri_contains def test_time_unit_microseconds(): micro_client = Client( api_key, api_secret,...
16
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client.py
test_time_unit_milloseconds
assert
numeric_literal
16
import pytest from binance.client import Client from binance.exceptions import BinanceAPIException, BinanceRequestException from .conftest import proxies, api_key, api_secret, testnet, call_method_and_assert_uri_contains def test_time_unit_milloseconds(): milli_client = Client( api_key, api_secret,...
13
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client.py
test_handle_response
assert
collection
21
import pytest from binance.client import Client from binance.exceptions import BinanceAPIException, BinanceRequestException from .conftest import proxies, api_key, api_secret, testnet, call_method_and_assert_uri_contains def test_handle_response(client): # Test successful JSON response mock_response = type('Re...
{}
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client.py
test_client_initialization
assert
none_literal
8
import pytest from binance.client import Client from binance.exceptions import BinanceAPIException, BinanceRequestException from .conftest import proxies, api_key, api_secret, testnet, call_method_and_assert_uri_contains def test_client_initialization(client): assert client.API_KEY is not
None
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client.py
test_handle_response
assert
collection
14
import pytest from binance.client import Client from binance.exceptions import BinanceAPIException, BinanceRequestException from .conftest import proxies, api_key, api_secret, testnet, call_method_and_assert_uri_contains def test_handle_response(client): # Test successful JSON response mock_response = type('Re...
{"key": "value"}
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client.py
test_handle_response
pytest.raises
variable
37
import pytest from binance.client import Client from binance.exceptions import BinanceAPIException, BinanceRequestException from .conftest import proxies, api_key, api_secret, testnet, call_method_and_assert_uri_contains def test_handle_response(client): # Test successful JSON response mock_response = type('Re...
BinanceAPIException)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client.py
test_handle_response
pytest.raises
variable
29
import pytest from binance.client import Client from binance.exceptions import BinanceAPIException, BinanceRequestException from .conftest import proxies, api_key, api_secret, testnet, call_method_and_assert_uri_contains def test_handle_response(client): # Test successful JSON response mock_response = type('Re...
BinanceRequestException)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_futures.py
test_futures_create_get_edit_cancel_order
assert_*
variable
22
from datetime import datetime import re import pytest import requests_mock from .test_order import assert_contract_order from .test_get_order_book import assert_ob def test_futures_create_get_edit_cancel_order(futuresClient): ticker = futuresClient.futures_ticker(symbol="LTCUSDT") positions = futuresClient.fu...
order)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_futures.py
test_futures_order_book
assert_*
variable
12
from datetime import datetime import re import pytest import requests_mock from .test_order import assert_contract_order from .test_get_order_book import assert_ob def test_futures_order_book(futuresClient): order_book = futuresClient.futures_order_book(symbol="BTCUSDT") assert_ob(
order_book)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_futures.py
test_futures_coin_account_order_history_download_mock
assert
variable
49
from datetime import datetime import re import pytest import requests_mock from .test_order import assert_contract_order from .test_get_order_book import assert_ob def close_all_futures_positions(futuresClient): # Get all open positions positions = futuresClient.futures_position_information(symbol="LTCUSDT") ...
expected_response
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_gift_card.py
test_gift_card_create_verify_and_redeem
assert
none_literal
10
import pytest import requests_mock pytestmark = pytest.mark.gift_card def test_gift_card_create_verify_and_redeem(liveClient): # create a gift card response = liveClient.gift_card_create(token="USDT", amount=1.0) assert response["data"]["referenceNo"] is not
None
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_gift_card.py
test_gift_card_create_verify_and_redeem
assert
string_literal
14
import pytest import requests_mock pytestmark = pytest.mark.gift_card def test_gift_card_create_verify_and_redeem(liveClient): # create a gift card response = liveClient.gift_card_create(token="USDT", amount=1.0) assert response["data"]["referenceNo"] is not None assert response["data"]["code"] is not...
"SUCCESS"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_gift_card.py
test_mock_gift_card_fetch_token_limit
assert
variable
23
import pytest import requests_mock pytestmark = pytest.mark.gift_card def test_mock_gift_card_fetch_token_limit(liveClient): """Test gift card token limit endpoint with mocked response""" expected_response = { "code": "000000", "message": "success", "data": [{"coin": "BNB", "fromMin": ...
expected_response
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_gift_card.py
test_gift_card_create_verify_and_redeem
assert
complex_expr
19
import pytest import requests_mock pytestmark = pytest.mark.gift_card def test_gift_card_create_verify_and_redeem(liveClient): # create a gift card response = liveClient.gift_card_create(token="USDT", amount=1.0) assert response["data"]["referenceNo"] is not None assert response["data"]["code"] is not...
redeem_response["data"]["referenceNo"]
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_ws_api.py
test_ws_time_microseconds
assert
numeric_literal
15
from binance.client import Client from .conftest import proxies, api_key, api_secret, testnet from .test_get_order_book import assert_ob def test_ws_time_microseconds(): micro_client = Client( api_key, api_secret, {"proxies": proxies}, testnet=testnet, time_unit="MICROSECOND...
16
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_ws_api.py
test_ws_time_milliseconds
assert
numeric_literal
15
from binance.client import Client from .conftest import proxies, api_key, api_secret, testnet from .test_get_order_book import assert_ob def test_ws_time_milliseconds(): milli_client = Client( api_key, api_secret, {"proxies": proxies}, testnet=testnet, time_unit="MILLISECOND...
13
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_ws_api.py
test_ws_get_order_book
assert_*
variable
8
from binance.client import Client from .conftest import proxies, api_key, api_secret, testnet from .test_get_order_book import assert_ob def test_ws_get_order_book(client): orderbook = client.ws_get_order_book(symbol="BTCUSDT") assert_ob(
orderbook)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_ws_futures_requests.py
test_ws_futures_create_get_edit_cancel_order
assert_*
variable
19
import pytest from binance.exceptions import BinanceAPIException from .test_get_order_book import assert_ob from .test_order import assert_contract_order def test_ws_futures_create_get_edit_cancel_order(futuresClient): ticker = futuresClient.ws_futures_get_order_book_ticker(symbol="LTCUSDT") positions = future...
order)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_ws_futures_requests.py
test_ws_futures_get_order_book
assert_*
variable
9
import pytest from binance.exceptions import BinanceAPIException from .test_get_order_book import assert_ob from .test_order import assert_contract_order def test_ws_futures_get_order_book(futuresClient): orderbook = futuresClient.ws_futures_get_order_book(symbol="BTCUSDT") assert_ob(
orderbook)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_client_ws_futures_requests.py
test_bad_request
pytest.raises
variable
8
import pytest from binance.exceptions import BinanceAPIException from .test_get_order_book import assert_ob from .test_order import assert_contract_order def test_bad_request(futuresClient): with pytest.raises(
BinanceAPIException)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_cryptography.py
test_encryption
assert
complex_expr
50
from binance.client import Client test_cases = [ { "description": "Unencrypted PKCS8 ed22519 private key", "private_key": "-----BEGIN PRIVATE KEY-----\nMC4CAQAwBQYDK2VwBCIEIPQmzwVKJETqVd7L9E/DFbkvrOigy1tLL+9QF0mSn6dV\n-----END PRIVATE KEY-----\n", "password": None, "expected_signatu...
case["expected_signature"]
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_depth_cache.py
test_add_bids
assert
numeric_literal
21
from binance.ws.depthcache import DepthCache from decimal import Decimal import pytest TEST_SYMBOL = "BNBBTC" def fresh_cache(): return DepthCache(TEST_SYMBOL, Decimal) def test_add_bids(fresh_cache): """Verify basic functionality for adding a bid to the cache""" high_bid = [0.111, 489] mid_bid = [0....
3
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_depth_cache.py
test_add_asks
assert
func_call
26
from binance.ws.depthcache import DepthCache from decimal import Decimal import pytest TEST_SYMBOL = "BNBBTC" def fresh_cache(): return DepthCache(TEST_SYMBOL, Decimal) def test_add_asks(fresh_cache): """Verify basic functionality for adding an ask to the cache""" high_ask = [0.111, 489] mid_ask = [0...
sorted(asks)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_depth_cache.py
test_add_bids
assert
func_call
23
from binance.ws.depthcache import DepthCache from decimal import Decimal import pytest TEST_SYMBOL = "BNBBTC" def fresh_cache(): return DepthCache(TEST_SYMBOL, Decimal) def test_add_bids(fresh_cache): """Verify basic functionality for adding a bid to the cache""" high_bid = [0.111, 489] mid_bid = [0....
sorted(bids, reverse=True)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_futures.py
test_futures_position_information
assert
string_literal
40
import requests_mock import json from binance.client import Client import re client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_futures_position_information(): with requests_mock.mock() as m: url_matcher = re.compile( r"https:\/\/fapi.binance.com\/fapi\/v3\/positi...
"LTCUSDT".lower()
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_futures.py
test_futures_account_balance
assert
string_literal
14
import requests_mock import json from binance.client import Client import re client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_futures_account_balance(): with requests_mock.mock() as m: url_matcher = re.compile(r"https:\/\/fapi.binance.com\/fapi\/v3\/balance\?.+") m....
"/fapi/v3/balance"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_futures.py
test_futures_position_information
assert
string_literal
41
import requests_mock import json from binance.client import Client import re client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_futures_position_information(): with requests_mock.mock() as m: url_matcher = re.compile( r"https:\/\/fapi.binance.com\/fapi\/v3\/positi...
"/fapi/v3/positionrisk"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_futures.py
test_futures_position_information_version_override
assert
string_literal
41
import requests_mock import json from binance.client import Client import re client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_futures_position_information_version_override(): with requests_mock.mock() as m: url_matcher = re.compile( r"https:\/\/fapi.binance.com\...
"/fapi/v2/positionrisk"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_futures.py
test_futures_account_config
assert
string_literal
16
import requests_mock import json from binance.client import Client import re client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_futures_account_config(): with requests_mock.mock() as m: url_matcher = re.compile( r"https:\/\/fapi.binance.com\/fapi\/v1\/accountConfi...
"/fapi/v1/accountconfig"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_get_order_book.py
assert_ob
assert
numeric_literal
16
import pytest from binance.exceptions import BinanceAPIException def assert_ob(order_book): assert isinstance(order_book, dict) assert "lastUpdateId" in order_book assert "bids" in order_book assert "asks" in order_book assert isinstance(order_book["bids"], list) assert isinstance(order_book["...
2
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_get_order_book.py
test_get_order_book_with_limit
assert
numeric_literal
29
import pytest from binance.exceptions import BinanceAPIException def assert_ob(order_book): assert isinstance(order_book, dict) assert "lastUpdateId" in order_book assert "bids" in order_book assert "asks" in order_book assert isinstance(order_book["bids"], list) assert isinstance(order_book["...
5
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_get_order_book.py
assert_ob
assert
variable
7
import pytest from binance.exceptions import BinanceAPIException def assert_ob(order_book): assert isinstance(order_book, dict) assert "lastUpdateId" in
order_book
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_get_order_book.py
test_get_order_book_with_limit
assert_*
variable
28
import pytest from binance.exceptions import BinanceAPIException def assert_ob(order_book): assert isinstance(order_book, dict) assert "lastUpdateId" in order_book assert "bids" in order_book assert "asks" in order_book assert isinstance(order_book["bids"], list) assert isinstance(order_book["...
order_book)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_headers.py
test_get_headers
assert
variable
15
import requests_mock import pytest from aioresponses import aioresponses from binance import Client, AsyncClient client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_get_headers(): with requests_mock.mock() as m: m.get("https://api.binance.com/api/v3/account", json={}, status_...
headers
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_headers.py
test_post_headers_overriden
assert
string_literal
22
import requests_mock import pytest from aioresponses import aioresponses from binance import Client, AsyncClient client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_post_headers_overriden(): with requests_mock.mock() as m: m.post("https://api.binance.com/api/v3/order", json={...
"myvalue"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_headers.py
test_get_headers
assert
string_literal
16
import requests_mock import pytest from aioresponses import aioresponses from binance import Client, AsyncClient client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_get_headers(): with requests_mock.mock() as m: m.get("https://api.binance.com/api/v3/account", json={}, status_...
"application/json"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_headers.py
test_post_headers
assert
string_literal
16
import requests_mock import pytest from aioresponses import aioresponses from binance import Client, AsyncClient client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_post_headers(): with requests_mock.mock() as m: m.post("https://api.binance.com/api/v3/order", json={}, status_...
"application/x-www-form-urlencoded"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_historical_klines.py
test_start_and_limit
assert
numeric_literal
65
from binance.client import Client import pytest import requests_mock client = Client("api_key", "api_secret", ping=False) def test_start_and_limit(): """Test start_str and limit work correctly with integer timestamp""" first_available_res = [ [ 1500004800000, "0.00005000", ...
5
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_historical_klines.py
test_historical_kline_generator
assert
numeric_literal
63
from binance.client import Client import pytest import requests_mock client = Client("api_key", "api_secret", ping=False) def test_historical_kline_generator(): """Test kline historical generator""" first_available_res = [ [ 1500004800000, "0.00005000", "0.00005300...
0
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_historical_klines.py
test_exact_amount
assert
numeric_literal
67
from binance.client import Client import pytest import requests_mock client = Client("api_key", "api_secret", ping=False) def test_exact_amount(): """Test Exact amount returned""" first_available_res = [ [ 1500004800000, "0.00005000", "0.00005300", "0.0...
500
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_historical_klines.py
test_start_and_end_str
assert
numeric_literal
61
from binance.client import Client import pytest import requests_mock client = Client("api_key", "api_secret", ping=False) def test_start_and_end_str(): """Test start_str and end_str work correctly with string""" first_available_res = [ [ 1500004800000, "0.00005000", ...
300
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_historical_klines.py
test_historical_kline_generator
pytest.raises
variable
65
from binance.client import Client import pytest import requests_mock client = Client("api_key", "api_secret", ping=False) def test_historical_kline_generator(): """Test kline historical generator""" first_available_res = [ [ 1500004800000, "0.00005000", "0.00005300...
StopIteration)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_ids.py
test_swap_batch_id
assert
variable
18
import re import requests_mock import pytest from aioresponses import aioresponses from binance import Client, AsyncClient client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_swap_batch_id(): with requests_mock.mock() as m: m.post("https://fapi.binance.com/fapi/v1/batchOrders...
text
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_ids.py
test_spot_id
assert
string_literal
17
import re import requests_mock import pytest from aioresponses import aioresponses from binance import Client, AsyncClient client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_spot_id(): with requests_mock.mock() as m: m.post("https://api.binance.com/api/v3/order", json={}, st...
"BUY"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_ids.py
test_spot_id
assert
string_literal
19
import re import requests_mock import pytest from aioresponses import aioresponses from binance import Client, AsyncClient client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_spot_id(): with requests_mock.mock() as m: m.post("https://api.binance.com/api/v3/order", json={}, st...
"0.1"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_ids.py
test_spot_id
assert
string_literal
18
import re import requests_mock import pytest from aioresponses import aioresponses from binance import Client, AsyncClient client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_spot_id(): with requests_mock.mock() as m: m.post("https://api.binance.com/api/v3/order", json={}, st...
"MARKET"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_ids.py
test_spot_id
assert
string_literal
16
import re import requests_mock import pytest from aioresponses import aioresponses from binance import Client, AsyncClient client = Client(api_key="api_key", api_secret="api_secret", ping=False) def test_spot_id(): with requests_mock.mock() as m: m.post("https://api.binance.com/api/v3/order", json={}, st...
"LTCUSDT"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_init.py
test_version
assert
none_literal
20
from binance import ( AsyncClient, Client, DepthCacheManager, OptionsDepthCacheManager, ThreadedDepthCacheManager, FuturesDepthCacheManager, BinanceSocketManager, ThreadedWebsocketManager, BinanceSocketType, KeepAliveWebsocket, ReconnectingWebsocket ) def test_version(): ...
None
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_ping.py
test_papi_ping_sync
assert
none_literal
10
import os import pytest proxies = {} proxy = os.getenv("PROXY") def test_papi_ping_sync(client): ping_response = client.papi_ping() assert ping_response is not
None
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_before_reconnect
assert
numeric_literal
24
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
1
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_before_reconnect
assert
none_literal
22
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
None
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_init
assert
string_literal
18
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
"/test"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_recieve_invalid_json
assert
string_literal
29
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
"error"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_get_reconnect_wait
assert
variable
17
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
wait_time
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_handle_message_invalid_json
pytest.raises
variable
18
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
Exception)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_init
assert
string_literal
17
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
"wss://test.url"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_json_loads
assert
collection
19
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
{"key": "value"}
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_recv_message
assert
collection
19
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
{"test": "data"}
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_connect_max_reconnects_exceeded
assert
complex_expr
32
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
ws.MAX_RECONNECTS
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_recieve_invalid_json
assert
string_literal
30
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
"JSONDecodeError"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_receive_valid_json
assert
func_call
30
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
json.loads(msgRecv)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_json_loads_invalid
pytest.raises
complex_expr
18
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
json.JSONDecodeError)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_init
assert
complex_expr
19
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
WSListenerState.INITIALISING
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_reconnecting_websocket.py
test_connect_max_reconnects_exceeded
pytest.raises
variable
27
import sys import pytest import gzip import json from unittest.mock import patch, create_autospec from binance.ws.reconnecting_websocket import ReconnectingWebsocket from binance.ws.constants import WSListenerState from binance.exceptions import BinanceWebsocketUnableToConnect from websockets import WebSocketClientProt...
BinanceWebsocketUnableToConnect)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_socket_manager.py
assert_message
assert
numeric_literal
7
from binance import BinanceSocketManager, AsyncClient import pytest def assert_message(msg): assert msg["stream"] == "!ticker@arr" assert len(msg["data"]) >
0
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_socket_manager.py
test_ticker_socket
assert_*
variable
19
from binance import BinanceSocketManager, AsyncClient import pytest def assert_message(msg): assert msg["stream"] == "!ticker@arr" assert len(msg["data"]) > 0 @pytest.mark.asyncio() async def test_ticker_socket(): client = await AsyncClient.create(testnet=True) bm = BinanceSocketManager(client) t...
res)
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_socket_manager.py
assert_message
assert
string_literal
6
from binance import BinanceSocketManager, AsyncClient import pytest def assert_message(msg): assert msg["stream"] ==
"!ticker@arr"
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_streams.py
test_socket_stopped_on_aexit
assert
collection
16
import sys from binance import BinanceSocketManager import pytest from binance.async_client import AsyncClient from .conftest import proxy, api_key, api_secret, testnet @pytest.mark.skipif(sys.version_info < (3, 8), reason="websockets_proxy Python 3.8+") @pytest.mark.asyncio async def test_socket_stopped_on_aexit(cli...
{}
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_streams.py
test_socket_spot_market_time_unit_microseconds
assert
numeric_literal
19
import sys from binance import BinanceSocketManager import pytest from binance.async_client import AsyncClient from .conftest import proxy, api_key, api_secret, testnet @pytest.mark.skipif(sys.version_info < (3, 8), reason="websockets_proxy Python 3.8+") @pytest.mark.asyncio async def test_socket_spot_market_time_uni...
16
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_streams.py
test_socket_spot_market_time_unit_milliseconds
assert
numeric_literal
19
import sys from binance import BinanceSocketManager import pytest from binance.async_client import AsyncClient from .conftest import proxy, api_key, api_secret, testnet @pytest.mark.skipif(sys.version_info < (3, 8), reason="websockets_proxy Python 3.8+") @pytest.mark.asyncio async def test_socket_spot_market_time_uni...
13
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_streams.py
test_socket_stopped_on_aexit
assert
variable
18
import sys from binance import BinanceSocketManager import pytest from binance.async_client import AsyncClient from .conftest import proxy, api_key, api_secret, testnet @pytest.mark.skipif(sys.version_info < (3, 8), reason="websockets_proxy Python 3.8+") @pytest.mark.asyncio async def test_socket_stopped_on_aexit(cli...
ts1
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_streams_options.py
test_options_ticker_by_expiration
assert
numeric_literal
29
import sys import pytest import logging from binance import BinanceSocketManager pytestmark = [ pytest.mark.skipif(sys.version_info < (3, 8), reason="websockets_proxy Python 3.8+"), pytest.mark.asyncio ] logger = logging.getLogger(__name__) OPTION_SYMBOL = "BTC-250926-40000-P" UNDERLYING_SYMBOL = "BTC" EXPIR...
0
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_streams_options.py
test_options_multiplex
assert
variable
33
import sys import pytest import logging from binance import BinanceSocketManager pytestmark = [ pytest.mark.skipif(sys.version_info < (3, 8), reason="websockets_proxy Python 3.8+"), pytest.mark.asyncio ] logger = logging.getLogger(__name__) OPTION_SYMBOL = "BTC-250926-40000-P" UNDERLYING_SYMBOL = "BTC" EXPIR...
msg
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor
sammchardy/python-binance
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
train
train
tests/test_streams_options.py
test_options_recent_trades
assert
string_literal
29
import sys import pytest import logging from binance import BinanceSocketManager pytestmark = [ pytest.mark.skipif(sys.version_info < (3, 8), reason="websockets_proxy Python 3.8+"), pytest.mark.asyncio ] logger = logging.getLogger(__name__) OPTION_SYMBOL = "BTC-250926-40000-P" UNDERLYING_SYMBOL = "BTC" EXPIR...
'trade'
5ee540ef76b7a7849ed256ce0b58786c7b35536c
47
v2_extractor_at_anchor