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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_handler/test_pre_checkout_query.py | handle | assert | complex_expr | 10 | from typing import Any
from aiogram.handlers import PreCheckoutQueryHandler
from aiogram.types import PreCheckoutQuery, User
class MyHandler(PreCheckoutQueryHandler):
async def handle(self) -> Any:
assert self.event == event
assert self.from_user == | self.event.from_user | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_handler/test_shipping_query.py | handle | assert | complex_expr | 10 | from typing import Any
from aiogram.handlers import ShippingQueryHandler
from aiogram.types import ShippingAddress, ShippingQuery, User
class MyHandler(ShippingQueryHandler):
async def handle(self) -> Any:
assert self.event == event
assert self.from_user == | self.event.from_user | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_utils/test_callback_answer.py | test_answer | assert | complex_expr | 31 | from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from aiogram.exceptions import CallbackAnswerException
from aiogram.methods import AnswerCallbackQuery
from aiogram.types import CallbackQuery, User
from aiogram.utils.callback_answer import CallbackAnswer, CallbackAnswerMiddleware
class TestCallbac... | callback_answer.text | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_add_sticker_to_set.py | test_bot_method | assert | complex_expr | 16 | from aiogram.methods import AddStickerToSet
from aiogram.types import InputSticker
from tests.mocked_bot import MockedBot
class TestAddStickerToSet:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(AddStickerToSet, ok=True, result=True)
response: bool = await bo... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_answer_callback_query.py | test_bot_method | assert | complex_expr | 11 | from aiogram.methods import AnswerCallbackQuery, Request
from tests.mocked_bot import MockedBot
class TestAnswerCallbackQuery:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(AnswerCallbackQuery, ok=True, result=True)
response: bool = await bot.answer_callback_... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_answer_inline_query.py | test_bot_method | assert | complex_expr | 27 | from aiogram import Bot
from aiogram.methods import AnswerInlineQuery, Request
from aiogram.types import (
InlineQueryResult,
InlineQueryResultArticle,
InlineQueryResultPhoto,
InputTextMessageContent,
)
from tests.mocked_bot import MockedBot
class TestAnswerInlineQuery:
async def test_bot_method(se... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_answer_pre_checkout_query.py | test_bot_method | assert | complex_expr | 13 | from aiogram.methods import AnswerPreCheckoutQuery, Request
from tests.mocked_bot import MockedBot
class TestAnswerPreCheckoutQuery:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(AnswerPreCheckoutQuery, ok=True, result=True)
response: bool = await bot.answer_... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_answer_shipping_query.py | test_bot_method | assert | complex_expr | 11 | from aiogram.methods import AnswerShippingQuery, Request
from tests.mocked_bot import MockedBot
class TestAnswerShippingQuery:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(AnswerShippingQuery, ok=True, result=True)
response: bool = await bot.answer_shipping_... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_answer_web_app_query.py | test_bot_method | assert | complex_expr | 19 | from aiogram.methods import AnswerWebAppQuery
from aiogram.types import InlineQueryResultPhoto, SentWebAppMessage
from tests.mocked_bot import MockedBot
class TestAnswerWebAppQuery:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(AnswerWebAppQuery, ok=True, result=SentW... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_approve_chat_join_request.py | test_bot_method | assert | complex_expr | 14 | from aiogram.methods import ApproveChatJoinRequest, Request
from tests.mocked_bot import MockedBot
class TestApproveChatJoinRequest:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(ApproveChatJoinRequest, ok=True, result=None)
response: bool = await bot.approve... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_ban_chat_member.py | test_bot_method | assert | complex_expr | 11 | from aiogram.methods import BanChatMember, Request
from tests.mocked_bot import MockedBot
class TestKickChatMember:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(BanChatMember, ok=True, result=True)
response: bool = await bot.ban_chat_member(chat_id=-42, user... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_ban_chat_sender_chat.py | test_bot_method | assert | complex_expr | 14 | from aiogram.methods import BanChatSenderChat, Request
from tests.mocked_bot import MockedBot
class TestBanChatSenderChat:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(BanChatSenderChat, ok=True, result=True)
response: bool = await bot.ban_chat_sender_chat(
... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_close.py | test_bot_method | assert | complex_expr | 11 | from aiogram.methods import Close, Request
from tests.mocked_bot import MockedBot
class TestClose:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(Close, ok=True, result=True)
response: bool = await bot.close()
request = bot.get_request()
asser... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_close_forum_topic.py | test_bot_method | assert | complex_expr | 14 | from aiogram.methods import CloseForumTopic, Request
from tests.mocked_bot import MockedBot
class TestCloseForumTopic:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(CloseForumTopic, ok=True, result=True)
response: bool = await bot.close_forum_topic(
... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_close_general_forum_topic.py | test_bot_method | assert | complex_expr | 11 | from aiogram.methods import CloseGeneralForumTopic, Request
from tests.mocked_bot import MockedBot
class TestCloseGeneralForumTopic:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(CloseGeneralForumTopic, ok=True, result=True)
response: bool = await bot.close_g... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_copy_message.py | test_bot_method | assert | complex_expr | 16 | from aiogram.methods import CopyMessage, Request
from aiogram.types import MessageId
from tests.mocked_bot import MockedBot
class TestCopyMessage:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(CopyMessage, ok=True, result=MessageId(message_id=42))
response: M... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_copy_messages.py | test_bot_method | assert | complex_expr | 29 | from random import randint
from aiogram.methods import CopyMessages
from aiogram.types import MessageId
from tests.mocked_bot import MockedBot
class TestCopyMessages:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
CopyMessages,
ok=True,
... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_create_chat_invite_link.py | test_bot_method | assert | complex_expr | 24 | from aiogram.methods import CreateChatInviteLink, Request
from aiogram.types import ChatInviteLink, User
from tests.mocked_bot import MockedBot
class TestCreateChatInviteLink:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
CreateChatInviteLink,
... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_create_forum_topic.py | test_bot_method | assert | complex_expr | 19 | from aiogram.methods import CreateForumTopic, Request
from aiogram.types import ForumTopic
from tests.mocked_bot import MockedBot
class TestCreateForumTopic:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
CreateForumTopic,
ok=True,
... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_create_invoice_link.py | test_bot_method | assert | complex_expr | 21 | from aiogram.methods import CreateInvoiceLink, Request
from aiogram.types import LabeledPrice
from tests.mocked_bot import MockedBot
class TestCreateInvoiceLink:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
CreateInvoiceLink, ok=True, result="https://t.m... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_create_new_sticker_set.py | test_bot_method | assert | complex_expr | 22 | from aiogram.enums import StickerFormat
from aiogram.methods import CreateNewStickerSet, Request
from aiogram.types import FSInputFile, InputSticker
from tests.mocked_bot import MockedBot
class TestCreateNewStickerSet:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(Cre... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_decline_chat_join_request.py | test_bot_method | assert | complex_expr | 14 | from aiogram.methods import DeclineChatJoinRequest, Request
from tests.mocked_bot import MockedBot
class TestDeclineChatJoinRequest:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(DeclineChatJoinRequest, ok=True, result=True)
response: bool = await bot.decline... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_delete_chat_photo.py | test_bot_method | assert | complex_expr | 11 | from aiogram.methods import DeleteChatPhoto, Request
from tests.mocked_bot import MockedBot
class TestDeleteChatPhoto:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(DeleteChatPhoto, ok=True, result=True)
response: bool = await bot.delete_chat_photo(chat_id=42... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_delete_chat_sticker_set.py | test_bot_method | assert | complex_expr | 11 | from aiogram.methods import DeleteChatStickerSet, Request
from tests.mocked_bot import MockedBot
class TestDeleteChatStickerSet:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(DeleteChatStickerSet, ok=True, result=True)
response: bool = await bot.delete_chat_s... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_delete_forum_topic.py | test_bot_method | assert | complex_expr | 14 | from aiogram.methods import DeleteForumTopic, Request
from tests.mocked_bot import MockedBot
class TestDeleteForumTopic:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(DeleteForumTopic, ok=True, result=True)
response: bool = await bot.delete_forum_topic(
... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_api/test_methods/test_delete_message.py | test_bot_method | assert | complex_expr | 11 | from aiogram.methods import DeleteMessage, Request
from tests.mocked_bot import MockedBot
class TestDeleteMessage:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(DeleteMessage, ok=True, result=True)
response: bool = await bot.delete_message(chat_id=42, message... | prepare_result.result | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_dispatcher/test_router.py | test_including_routers | assert | collection | 35 | import pytest
from aiogram.dispatcher.event.bases import UNHANDLED, SkipHandler, skip
from aiogram.dispatcher.event.telegram import TelegramEventObserver
from aiogram.dispatcher.router import Router
class TestRouter:
def test_including_routers(self):
router1 = Router()
router2 = Router()
r... | [] | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_flags/test_getter.py | test_extract_flags_from_object | assert | collection | 20 | from unittest.mock import patch
import pytest
from aiogram import F
from aiogram.dispatcher.event.handler import HandlerObject
from aiogram.dispatcher.flags import (
check_flags,
extract_flags,
extract_flags_from_object,
get_flag,
)
class TestGetters:
def test_extract_flags_from_object(self):
... | {} | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_fsm/storage/test_storages.py | test_set_data | assert | collection | 13 | import pytest
from aiogram.fsm.storage.base import BaseStorage, StorageKey
from tests.mocked_bot import MockedBot
def create_storage_key(bot: MockedBot):
return StorageKey(chat_id=-42, user_id=42, bot_id=bot.id)
class TestStorages:
async def test_set_data(self, bot: MockedBot, storage: BaseStorage, storage_... | {} | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_fsm/test_context.py | test_address_mapping | assert | collection | 32 | import pytest
from aiogram.fsm.context import FSMContext
from aiogram.fsm.storage.base import StorageKey
from aiogram.fsm.storage.memory import MemoryStorage
from tests.mocked_bot import MockedBot
def state(bot: MockedBot):
storage = MemoryStorage()
key = StorageKey(user_id=42, chat_id=-42, bot_id=bot.id)
... | {} | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_fsm/test_scene.py | test_history_manager_pop_if_history_become_empty_after_pop | assert | collection | 50 | import inspect
import platform
from datetime import datetime
from unittest.mock import ANY, AsyncMock, patch
import pytest
from aiogram import Dispatcher, F, Router
from aiogram.dispatcher.event.bases import NextMiddlewareType
from aiogram.exceptions import SceneException
from aiogram.filters import StateFilter
from ... | {} | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_fsm/test_scene.py | test_history_manager_all_if_history_empty | assert | collection | 46 | import inspect
import platform
from datetime import datetime
from unittest.mock import ANY, AsyncMock, patch
import pytest
from aiogram import Dispatcher, F, Router
from aiogram.dispatcher.event.bases import NextMiddlewareType
from aiogram.exceptions import SceneException
from aiogram.filters import StateFilter
from ... | [] | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_fsm/test_state.py | test_empty | assert | collection | 15 | import sys
import pytest
from aiogram.fsm.state import State, StatesGroup, any_state
PY312_OR_GREATER = sys.version_info >= (3, 12)
class TestStatesGroup:
def test_empty(self):
class MyGroup(StatesGroup):
pass
assert MyGroup.__states__ == | () | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_utils/test_media_group.py | test_build_empty | assert | collection | 17 | import pytest
from aiogram.types import (
InputMediaAudio,
InputMediaDocument,
InputMediaPhoto,
InputMediaVideo,
MessageEntity,
)
from aiogram.utils.media_group import MediaGroupBuilder
class TestMediaGroupBuilder:
def test_build_empty(self):
builder = MediaGroupBuilder()
ass... | [] | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_dispatcher/test_router.py | test_emit_startup | assert | collection | 26 | import pytest
from aiogram.dispatcher.event.bases import UNHANDLED, SkipHandler, skip
from aiogram.dispatcher.event.telegram import TelegramEventObserver
from aiogram.dispatcher.router import Router
class TestRouter:
async def test_emit_startup(self):
router1 = Router()
router2 = Router()
... | [2] | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
aiogram/aiogram | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | train | train | tests/test_dispatcher/test_router.py | test_router_chain_tail | assert | collection | 23 | import pytest
from aiogram.dispatcher.event.bases import UNHANDLED, SkipHandler, skip
from aiogram.dispatcher.event.telegram import TelegramEventObserver
from aiogram.dispatcher.router import Router
class TestRouter:
async def test_router_chain_tail(self):
r1 = Router(name="Router 1")
r2_1 = Rout... | (r3,) | 75323ac8c3e8c2671d5d79d607cb9ee0a1bcf8b2 | 248 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/chapters/c09_functions.py | program | assert_* | numeric_literal | 50 | import ast
import inspect
from textwrap import indent
from core.exercises import assert_equal
from core.text import ExerciseStep, Page, VerbatimStep, MessageStep, search_ast
class introducing_assert_equal(VerbatimStep):
text = f"""
An important part of writing programs is testing that they work correctly.... | 4) | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/chapters/c09_functions.py | program | assert_* | numeric_literal | 20 | import ast
import inspect
from textwrap import indent
from core.exercises import assert_equal
from core.text import ExerciseStep, Page, VerbatimStep, MessageStep, search_ast
class complete_quadruple_tests(VerbatimStep):
program_in_text = False
def program(self):
def double(x):
... | 8) | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/chapters/c09_functions.py | program | assert_* | numeric_literal | 51 | import ast
import inspect
from textwrap import indent
from core.exercises import assert_equal
from core.text import ExerciseStep, Page, VerbatimStep, MessageStep, search_ast
class introducing_assert_equal(VerbatimStep):
text = f"""
An important part of writing programs is testing that they work correctly.... | 10) | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | assert_trees_equal | assert | variable | 355 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | t2 | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | are_trees_equal | assert_* | variable | 328 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | t2) | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | clean_step_class | assert | variable | 155 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | text | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | assert_trees_equal | assert_* | variable | 340 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | vc2) | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | get_predictions | assert | variable | 240 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | choices | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | get_predictions | assert | string_literal | 233 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | "Error" | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | assert_trees_equal | assert | func_call | 338 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | len(t2) | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | assert_trees_equal | assert | func_call | 336 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | type(t2) | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | step_texts | assert | func_call | 318 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | str(result) | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | test_values | assert | func_call | 389 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | len(inputs) | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | clean_step_class | assert | string_literal | 120 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | "step_name_here" | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | assert_trees_equal | assert_* | func_call | 350 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | list(ast.iter_fields(t2))) | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | clean_program | assert | string_literal | 75 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | f" return {func.__name__}" | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | core/text.py | clean_program | assert | string_literal | 74 | from __future__ import annotations
import ast
import inspect
import itertools
import re
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from functools import cached_property, cache
from importlib import import_module
from io import StringIO
from pathlib import Path
from random import shu... | f"def {t.get_code_bit('solution')}(self):" | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | predict_output | assert | numeric_literal | 411 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | 6 | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | await_result | assert | variable | 379 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | full | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | show_hints_and_solution | assert | string_literal | 362 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | "Yes" | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | _tests | assert | complex_expr | 214 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | 25 - i | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | _tests | assert | complex_expr | 215 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | 12 + i | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | show_hints_and_solution | assert | variable | 367 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | parsons | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | _tests | assert | string_literal | 212 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | "Reveal" | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | show_hints_and_solution | assert | variable | 339 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | hint_num | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | show_hints_and_solution | assert | variable | 349 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | num_hints | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | _tests | assert | string_literal | 54 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | "Settings" | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | show_hints_and_solution | assert | complex_expr | 366 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | not parsons | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | predict_output | assert | variable | 430 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | bottom_text | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | _tests | assert | string_literal | 40 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | "Login / Sign up\nTable of Contents" | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_frontend.py | check_choice_status | assert | string_literal | 461 | import sys
from pathlib import Path
from time import sleep
import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webd... | f"prediction-choice prediction-{status}" | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_linting.py | test_unused_import | assert | collection | 16 | import ast
from core.linting import lint
def lint_tree(code):
tree = ast.parse(code)
return list(lint(tree))
def test_unused_import():
code_unused_import = """
import random
def write_to_file(text, filename):
with open("log.txt", "w") as file:
file.write(text)
"""
assert lint_tree(code_un... | [ """ **Unused import `random`** You imported `random` but never used it. Did you forget to use it? Maybe you used the wrong variable in its place? If you don't need the import, just remove it entirely. """ ] | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_linting.py | test_import_shadowed_by_loop_var | assert | collection | 16 | import ast
from core.linting import lint
def lint_tree(code):
tree = ast.parse(code)
return list(lint(tree))
def test_import_shadowed_by_loop_var():
code_import_shadowed_by_loop_var = """
import pandas as pd
x=[1,2,3]
for pd in x:
print(pd)
"""
assert lint_tree(code_import_shadowed_by_loop_va... | [ """ **Import `pd` shadowed by loop variable** The name of the loop variable `pd` should be changed as it redefines the `pd` module imported earlier. Choose a different loop variable to avoid this error. """ ] | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_linting.py | test_unused_var | assert | collection | 22 | import ast
from core.linting import lint
def lint_tree(code):
tree = ast.parse(code)
return list(lint(tree))
def test_unused_var():
code_unused_var = """
import random
def write_random_to_file():
no = random.randint(1, 10)
with open("random.txt", "w") as file:
file.write(str(no))
retu... | [ """ **Unused variable `random_no`** You defined a variable `random_no` but never used it. Did you forget to use it? Maybe you used the wrong variable in its place? If you don't need it, just remove it entirely. """ ] | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_linting.py | test_redefined_while_unused | assert | collection | 19 | import ast
from core.linting import lint
def lint_tree(code):
tree = ast.parse(code)
return list(lint(tree))
def test_redefined_while_unused():
code_redefined_while_unused = """
def is_positive(number: int) -> bool:
return number > 0
def is_positive(number: int) -> bool:
return number >= 0
... | [ """ **Redefined `is_positive` without using it** You defined `is_positive` on line `2`, but before ever using it you redefined it, overwriting the original definition. In general your functions and classes should have different names. Check that you use everything you define, e.g. that you called your functions. """ ... | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_linting.py | test_import_star | assert | collection | 14 | import ast
from core.linting import lint
def lint_tree(code):
tree = ast.parse(code)
return list(lint(tree))
def test_import_star():
code_import_star = """
from base import *
print(BaseThing('hi'))
"""
assert lint_tree(code_import_star) == | [ """ **Import made using `*` ** `from base import *` imports everything from the module `base` into the current namespace. This creates a bunch of invisible unknown variables. It makes it hard to read and understand code and see where things come from. Avoid this kind of import and instead explicitly import exactly th... | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_linting.py | test_import_star_not_permitted | assert | collection | 14 | import ast
from core.linting import lint
def lint_tree(code):
tree = ast.parse(code)
return list(lint(tree))
def test_import_star_not_permitted():
code_import_star_not_permitted = """
def f():
from module import *
"""
assert lint_tree(code_import_star_not_permitted) == | [ """ **Import made using `*` ** `from module import *` imports everything from the module `module` into the current namespace. This creates a bunch of invisible unknown variables. It makes it hard to read and understand code and see where things come from. Avoid this kind of import and instead explicitly import exactl... | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_linting.py | test_multi_value_repeated_key_literal | assert | collection | 13 | import ast
from core.linting import lint
def lint_tree(code):
tree = ast.parse(code)
return list(lint(tree))
def test_multi_value_repeated_key_literal():
code_multi_value_repeated_key = """
print({'a':1,'b':2,'a':3})
"""
assert lint_tree(code_multi_value_repeated_key) == | [ """ **Dictionary key `a` repeated with different values** A dictionary cannot have multiple entries for the same key. Check your code again and change the repeated key to something unique. """, """ **Dictionary key `a` repeated with different values** A dictionary cannot have multiple entries for the same key. Check ... | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_linting.py | test_is_literal | assert | collection | 15 | import ast
from core.linting import lint
def lint_tree(code):
tree = ast.parse(code)
return list(lint(tree))
def test_is_literal():
code_is_literal = """
x='a'
'aa' is x*2
"""
assert lint_tree(code_is_literal) == | [ """ **`is` comparison with literal** You used the `is`/`is not` operator to compare with a literal (e.g. a string or number). You should have rather used the `==` / `!=` operator. The `is` operator checks if two expressions refer to the exact same object. You rarely want to use them, certainly not for basic data type... | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_steps.py | normalise_response | assert | collection | 43 | import json
import os
import random
import re
from pathlib import Path
from littleutils import only
import core.utils
from core import translation as t
from core.checker import check_entry, FullRunner
from core.text import step_test_entries, get_predictions, load_chapters
from core.utils import highlighted_markdown, ... | [] | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_steps.py | test_steps | assert | variable | 57 | import json
import os
import random
import re
from pathlib import Path
from littleutils import only
import core.utils
from core import translation as t
from core.checker import check_entry, FullRunner
from core.text import step_test_entries, get_predictions, load_chapters
from core.utils import highlighted_markdown, ... | program | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_steps.py | test_steps | assert | variable | 55 | import json
import os
import random
import re
from pathlib import Path
from littleutils import only
import core.utils
from core import translation as t
from core.checker import check_entry, FullRunner
from core.text import step_test_entries, get_predictions, load_chapters
from core.utils import highlighted_markdown, ... | get_solution | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_steps.py | test_steps | assert | complex_expr | 65 | import json
import os
import random
import re
from pathlib import Path
from littleutils import only
import core.utils
from core import translation as t
from core.checker import check_entry, FullRunner
from core.text import step_test_entries, get_predictions, load_chapters
from core.utils import highlighted_markdown, ... | not is_message | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_steps.py | test_steps | assert | complex_expr | 63 | import json
import os
import random
import re
from pathlib import Path
from littleutils import only
import core.utils
from core import translation as t
from core.checker import check_entry, FullRunner
from core.text import step_test_entries, get_predictions, load_chapters
from core.utils import highlighted_markdown, ... | 4 + is_function | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexmojaki/futurecoder | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | train | train | tests/test_steps.py | normalise_response | assert | func_call | 41 | import json
import os
import random
import re
from pathlib import Path
from littleutils import only
import core.utils
from core import translation as t
from core.checker import check_entry, FullRunner
from core.text import step_test_entries, get_predictions, load_chapters
from core.utils import highlighted_markdown, ... | highlighted_markdown(substep.text) | 9490f326fcb46c32a82bb0afd46581c262427bd2 | 56 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/clients/test_gemini.py | test_simple_completion | assert | numeric_literal | 28 | import os
from unittest.mock import MagicMock, patch
import pytest
from dotenv import load_dotenv
from rlm.clients.gemini import GeminiClient
from rlm.core.types import ModelUsageSummary, UsageSummary
load_dotenv()
class TestGeminiClientIntegration:
@pytest.mark.skipif(
not os.environ.get("GEMINI_API_K... | 1 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/clients/test_gemini.py | test_usage_tracking_initialization | assert | numeric_literal | 22 | import os
from unittest.mock import MagicMock, patch
import pytest
from dotenv import load_dotenv
from rlm.clients.gemini import GeminiClient
from rlm.core.types import ModelUsageSummary, UsageSummary
load_dotenv()
class TestGeminiClientUnit:
def test_usage_tracking_initialization(self):
"""Test that u... | 0 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/clients/test_gemini.py | test_prepare_contents_role_mapping | assert | numeric_literal | 26 | import os
from unittest.mock import MagicMock, patch
import pytest
from dotenv import load_dotenv
from rlm.clients.gemini import GeminiClient
from rlm.core.types import ModelUsageSummary, UsageSummary
load_dotenv()
class TestGeminiClientUnit:
def test_prepare_contents_role_mapping(self):
"""Test _prepa... | 3 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/clients/test_gemini.py | test_completion_with_mocked_response | assert | numeric_literal | 33 | import os
from unittest.mock import MagicMock, patch
import pytest
from dotenv import load_dotenv
from rlm.clients.gemini import GeminiClient
from rlm.core.types import ModelUsageSummary, UsageSummary
load_dotenv()
class TestGeminiClientUnit:
def test_completion_with_mocked_response(self):
"""Test comp... | 5 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/clients/test_gemini.py | test_usage_tracking_initialization | assert | collection | 19 | import os
from unittest.mock import MagicMock, patch
import pytest
from dotenv import load_dotenv
from rlm.clients.gemini import GeminiClient
from rlm.core.types import ModelUsageSummary, UsageSummary
load_dotenv()
class TestGeminiClientUnit:
def test_usage_tracking_initialization(self):
"""Test that u... | {} | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/clients/test_gemini.py | test_get_last_usage | assert | numeric_literal | 25 | import os
from unittest.mock import MagicMock, patch
import pytest
from dotenv import load_dotenv
from rlm.clients.gemini import GeminiClient
from rlm.core.types import ModelUsageSummary, UsageSummary
load_dotenv()
class TestGeminiClientUnit:
def test_get_last_usage(self):
"""Test last usage returns co... | 50 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/clients/test_gemini.py | test_completion_with_mocked_response | assert | numeric_literal | 32 | import os
from unittest.mock import MagicMock, patch
import pytest
from dotenv import load_dotenv
from rlm.clients.gemini import GeminiClient
from rlm.core.types import ModelUsageSummary, UsageSummary
load_dotenv()
class TestGeminiClientUnit:
def test_completion_with_mocked_response(self):
"""Test comp... | 10 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/clients/test_gemini.py | test_get_last_usage | assert | numeric_literal | 24 | import os
from unittest.mock import MagicMock, patch
import pytest
from dotenv import load_dotenv
from rlm.clients.gemini import GeminiClient
from rlm.core.types import ModelUsageSummary, UsageSummary
load_dotenv()
class TestGeminiClientUnit:
def test_get_last_usage(self):
"""Test last usage returns co... | 100 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/clients/test_gemini.py | test_prepare_contents_string | assert | none_literal | 21 | import os
from unittest.mock import MagicMock, patch
import pytest
from dotenv import load_dotenv
from rlm.clients.gemini import GeminiClient
from rlm.core.types import ModelUsageSummary, UsageSummary
load_dotenv()
class TestGeminiClientUnit:
def test_prepare_contents_string(self):
"""Test _prepare_con... | None | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/clients/test_gemini.py | test_simple_completion | assert | variable | 23 | import os
from unittest.mock import MagicMock, patch
import pytest
from dotenv import load_dotenv
from rlm.clients.gemini import GeminiClient
from rlm.core.types import ModelUsageSummary, UsageSummary
load_dotenv()
class TestGeminiClientIntegration:
@pytest.mark.skipif(
not os.environ.get("GEMINI_API_K... | result | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/repl/test_custom_tools.py | test_empty_custom_tools | assert | numeric_literal | 40 | import pytest
from rlm.environments import (
RESERVED_TOOL_NAMES,
SupportsCustomTools,
extract_tool_value,
format_tools_for_prompt,
parse_custom_tools,
parse_tool_entry,
validate_custom_tools,
)
from rlm.environments.local_repl import LocalREPL
def sample_tool_function(x: int) -> int:
... | 2 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/repl/test_custom_tools.py | test_tools_with_string_context | assert | numeric_literal | 47 | import pytest
from rlm.environments import (
RESERVED_TOOL_NAMES,
SupportsCustomTools,
extract_tool_value,
format_tools_for_prompt,
parse_custom_tools,
parse_tool_entry,
validate_custom_tools,
)
from rlm.environments.local_repl import LocalREPL
def sample_tool_function(x: int) -> int:
... | 4 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/repl/test_custom_tools.py | test_mixed_tools_with_descriptions | assert | numeric_literal | 50 | import pytest
from rlm.environments import (
RESERVED_TOOL_NAMES,
SupportsCustomTools,
extract_tool_value,
format_tools_for_prompt,
parse_custom_tools,
parse_tool_entry,
validate_custom_tools,
)
from rlm.environments.local_repl import LocalREPL
def sample_tool_function(x: int) -> int:
... | 6 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/repl/test_custom_tools.py | test_callable_tool_available | assert | string_literal | 39 | import pytest
from rlm.environments import (
RESERVED_TOOL_NAMES,
SupportsCustomTools,
extract_tool_value,
format_tools_for_prompt,
parse_custom_tools,
parse_tool_entry,
validate_custom_tools,
)
from rlm.environments.local_repl import LocalREPL
def sample_tool_function(x: int) -> int:
... | "" | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/repl/test_custom_tools.py | test_callable_tool_available | assert | numeric_literal | 40 | import pytest
from rlm.environments import (
RESERVED_TOOL_NAMES,
SupportsCustomTools,
extract_tool_value,
format_tools_for_prompt,
parse_custom_tools,
parse_tool_entry,
validate_custom_tools,
)
from rlm.environments.local_repl import LocalREPL
def sample_tool_function(x: int) -> int:
... | 42 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/repl/test_custom_tools.py | test_tools_persist_across_executions | assert | numeric_literal | 41 | import pytest
from rlm.environments import (
RESERVED_TOOL_NAMES,
SupportsCustomTools,
extract_tool_value,
format_tools_for_prompt,
parse_custom_tools,
parse_tool_entry,
validate_custom_tools,
)
from rlm.environments.local_repl import LocalREPL
def sample_tool_function(x: int) -> int:
... | 20 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/repl/test_custom_tools.py | test_tool_with_closure | assert | numeric_literal | 45 | import pytest
from rlm.environments import (
RESERVED_TOOL_NAMES,
SupportsCustomTools,
extract_tool_value,
format_tools_for_prompt,
parse_custom_tools,
parse_tool_entry,
validate_custom_tools,
)
from rlm.environments.local_repl import LocalREPL
def sample_tool_function(x: int) -> int:
... | 50 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/repl/test_local_repl.py | test_persistent_execution | assert | string_literal | 10 | from rlm.environments.local_repl import LocalREPL
def test_persistent_execution():
"""Test that variables persist across multiple code executions."""
repl = LocalREPL()
# Set a variable
result1 = repl.execute_code("x = 42")
assert result1.stderr == | "" | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
alexzhang13/rlm | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | train | train | tests/repl/test_local_repl.py | test_persistent_execution | assert | numeric_literal | 12 | from rlm.environments.local_repl import LocalREPL
def test_persistent_execution():
"""Test that variables persist across multiple code executions."""
repl = LocalREPL()
# Set a variable
result1 = repl.execute_code("x = 42")
assert result1.stderr == ""
assert "x" in repl.locals
assert repl... | 42 | b35a88193e77c43425f32d9ee8be7dcf41d92053 | 8 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.