repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.market_analysis import build_market_analysis_agent
from openagent.conf.llm_provider import get_available_providers
def market_analysis_agent(request):
model = request.config.getoption("--model")
logg... | "FundingRateExecutor" | assert | string_literal | tests/agent_trajectory/market_analysis.py | test_query_funding_rate | 62 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.feed_explore import build_feed_explorer_agent
from openagent.conf.llm_provider import get_available_providers
def feed_explorer_agent(request):
model = request.config.getoption("--model")
logger.info... | "FeedExecutor" | assert | string_literal | tests/agent_trajectory/feed_explore.py | test_query_social_activities | 29 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.market_analysis import build_market_analysis_agent
from openagent.conf.llm_provider import get_available_providers
def market_analysis_agent(request):
model = request.config.getoption("--model")
logg... | "market_cap_desc" | assert | string_literal | tests/agent_trajectory/market_analysis.py | test_query_coin_market | 96 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.research_analyst import build_research_analyst_agent
from openagent.conf.llm_provider import get_available_providers
def research_analyst_agent(request):
model = request.config.getoption("--model")
l... | "ProjectExecutor" | assert | string_literal | tests/agent_trajectory/research_analyst.py | test_query_project | 30 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.market_analysis import build_market_analysis_agent
from openagent.conf.llm_provider import get_available_providers
def market_analysis_agent(request):
model = request.config.getoption("--model")
logg... | "ETH" | assert | string_literal | tests/agent_trajectory/market_analysis.py | test_query_eth_price | 46 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.feed_explore import build_feed_explorer_agent
from openagent.conf.llm_provider import get_available_providers
def feed_explorer_agent(request):
model = request.config.getoption("--model")
logger.info... | "vitalik.eth" | assert | string_literal | tests/agent_trajectory/feed_explore.py | test_query_social_activities | 31 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.research_analyst import build_research_analyst_agent
from openagent.conf.llm_provider import get_available_providers
def research_analyst_agent(request):
model = request.config.getoption("--model")
l... | 0 | assert | numeric_literal | tests/agent_trajectory/research_analyst.py | test_query_project | 34 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.market_analysis import build_market_analysis_agent
from openagent.conf.llm_provider import get_available_providers
def market_analysis_agent(request):
model = request.config.getoption("--model")
logg... | "CoinMarketExecutor" | assert | string_literal | tests/agent_trajectory/market_analysis.py | test_query_coin_market | 95 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.feed_explore import build_feed_explorer_agent
from openagent.conf.llm_provider import get_available_providers
def feed_explorer_agent(request):
model = request.config.getoption("--model")
logger.info... | 0 | assert | numeric_literal | tests/agent_trajectory/feed_explore.py | test_query_social_activities | 35 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.feed_explore import build_feed_explorer_agent
from openagent.conf.llm_provider import get_available_providers
def feed_explorer_agent(request):
model = request.config.getoption("--model")
logger.info... | "TelegramNewsExecutor" | assert | string_literal | tests/agent_trajectory/feed_explore.py | test_query_telegram_news | 68 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.block_explore import build_block_explorer_agent
from openagent.conf.llm_provider import get_available_providers
def block_explorer_agent(request):
model = request.config.getoption("--model")
logger.i... | "BlockChainStatExecutor" | assert | string_literal | tests/agent_trajectory/block_explore.py | test_query_block_height | 30 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.market_analysis import build_market_analysis_agent
from openagent.conf.llm_provider import get_available_providers
def market_analysis_agent(request):
model = request.config.getoption("--model")
logg... | "BTC" | assert | string_literal | tests/agent_trajectory/market_analysis.py | test_query_btc_price | 29 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.asset_management import build_asset_management_agent
from openagent.conf.llm_provider import get_available_providers
def asset_management_agent(request):
model = request.config.getoption("--model")
l... | "SwapExecutor" | assert | string_literal | tests/agent_trajectory/asset_management.py | test_swap_eth_to_usdt | 28 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.asset_management import build_asset_management_agent
from openagent.conf.llm_provider import get_available_providers
def asset_management_agent(request):
model = request.config.getoption("--model")
l... | "0x33c0814654fa367ce67d8531026eb4481290e63c" | assert | string_literal | tests/agent_trajectory/asset_management.py | test_query_user_token_balance | 50 | null | |
webisopen/OpenAgent | import pytest
from langchain_core.messages import HumanMessage
from loguru import logger
from openagent.agents.market_analysis import build_market_analysis_agent
from openagent.conf.llm_provider import get_available_providers
def market_analysis_agent(request):
model = request.config.getoption("--model")
logg... | "BTC/USDT" | assert | string_literal | tests/agent_trajectory/market_analysis.py | test_query_funding_rate | 64 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
get_conn,
RATE_LIMIT_BYPASS_KEY... | 422 | assert | numeric_literal | picoCTF-web/tests/integration/test_user.py | test_disable_account | 285 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
get_conn,
)
def test_create_team(m... | 1 | assert | numeric_literal | picoCTF-web/tests/integration/test_teams.py | test_create_team | 76 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | [] | assert | collection | picoCTF-web/tests/integration/test_users.py | test_add_user | 152 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 5 | assert | numeric_literal | picoCTF-web/tests/integration/test_users.py | test_get_users | 36 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
clear_db,
client,
)
def test_settings(mongo_proc, redis_proc, client): # noqa
"""Test the /settings endpoint when not logged in as admin."""
# @TODO currently only tests the default values of ... | 200 | assert | numeric_literal | picoCTF-web/tests/integration/test_settings.py | test_settings | 25 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
get_conn,
RATE_LIMIT_BYPASS_KEY... | 401 | assert | numeric_literal | picoCTF-web/tests/integration/test_user.py | test_login | 39 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
get_conn,
RATE_LIMIT_BYPASS_KEY... | 0 | assert | numeric_literal | picoCTF-web/tests/integration/test_user.py | test_verify | 549 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
clear_db,
client,
)
def test_settings(mongo_proc, redis_proc, client): # noqa
"""Test the /settings endpoint when not logged in as admin."""
# @TODO currently only tests the default values of ... | v | assert | variable | picoCTF-web/tests/integration/test_settings.py | test_settings | 27 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
get_conn,
RATE_LIMIT_BYPASS_KEY... | 400 | assert | numeric_literal | picoCTF-web/tests/integration/test_user.py | test_login | 31 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 200 | assert | numeric_literal | picoCTF-web/tests/integration/test_users.py | test_get_users | 35 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
get_conn,
RATE_LIMIT_BYPASS_KEY... | 403 | assert | numeric_literal | picoCTF-web/tests/integration/test_user.py | test_login | 64 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
OTHER_USER_DEMOGRAPHICS,
load_s... | 200 | assert | numeric_literal | picoCTF-web/tests/integration/test_status.py | test_status | 33 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 0 | assert | numeric_literal | picoCTF-web/tests/integration/test_submissions.py | test_clear_all_submissions | 233 | null | |
picoCTF/picoCTF | import pytest
from shell_manager import util
@pytest.mark.parametrize(
"problem_name, expected_name",
[
("Test Problem", "test-problem"),
("01234", "p01234"),
("1 2 spaces", "p1-2--spaces"),
],
)
def test_problem_name_sanitization(problem_name, expected_name):
"""Test valid pro... | sanitized_name | assert | variable | picoCTF-shell/tests/unit/test_util.py | test_problem_name_sanitization | 16 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 6 | assert | numeric_literal | picoCTF-web/tests/integration/test_submissions.py | test_clear_all_submissions | 221 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
get_conn,
)
def test_create_team(m... | 409 | assert | numeric_literal | picoCTF-web/tests/integration/test_teams.py | test_create_team | 50 | null | |
picoCTF/picoCTF | import pytest
from shell_manager import util
@pytest.mark.parametrize("problem_name", ["", None,])
def test_invalid_prob_name_sanitization(problem_name):
"""Test invalid problem names raise an exception during sanitization."""
with pytest.raises( | Exception) | pytest.raises | variable | picoCTF-shell/tests/unit/test_util.py | test_invalid_prob_name_sanitization | 22 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 404 | assert | numeric_literal | picoCTF-web/tests/integration/test_users.py | test_get_one_user | 236 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 422 | assert | numeric_literal | picoCTF-web/tests/integration/test_team.py | test_update_team_password | 97 | null | |
picoCTF/picoCTF | import pytest
from shell_manager import config
@pytest.mark.parametrize(
"port_range, expected_string",
[
([dict(start=0, end=65535)], "[0-65535]"),
([dict(start=1000, end=1000)], "[1000]"),
(
[dict(start=1000, end=1000), dict(start=1000, end=10000)],
"[1000, 100... | returned_string | assert | variable | picoCTF-shell/tests/unit/test_config.py | test_port_range_to_str | 19 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
get_conn,
)
def test_create_team(m... | 0 | assert | numeric_literal | picoCTF-web/tests/integration/test_teams.py | test_create_team | 75 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 201 | assert | numeric_literal | picoCTF-web/tests/integration/test_stats.py | test_registration_stats | 59 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 0 | assert | numeric_literal | picoCTF-web/tests/integration/test_team.py | test_get_my_team_score | 72 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
get_conn,
RATE_LIMIT_BYPASS_KEY... | 200 | assert | numeric_literal | picoCTF-web/tests/integration/test_user.py | test_login_rate_limit | 139 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | {} | assert | collection | picoCTF-web/tests/integration/test_users.py | test_add_user | 151 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | "User not found" | assert | string_literal | picoCTF-web/tests/integration/test_users.py | test_get_one_user | 237 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 200 | assert | numeric_literal | picoCTF-web/tests/integration/test_team.py | test_get_my_team | 48 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 1 | assert | numeric_literal | picoCTF-web/tests/integration/test_team.py | test_get_my_team | 52 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
OTHER_USER_DEMOGRAPHICS,
load_s... | res.json | assert | complex_expr | picoCTF-web/tests/integration/test_status.py | test_status | 37 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 0 | assert | numeric_literal | picoCTF-web/tests/integration/test_users.py | test_add_user | 154 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 404 | assert | numeric_literal | picoCTF-web/tests/integration/test_team.py | test_join_team | 227 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 1 | assert | numeric_literal | picoCTF-web/tests/integration/test_users.py | test_add_user | 165 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 200 | assert | numeric_literal | picoCTF-web/tests/integration/test_stats.py | test_registration_stats | 34 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 201 | assert | numeric_literal | picoCTF-web/tests/integration/test_submissions.py | test_submission | 63 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | True | assert | bool_literal | picoCTF-web/tests/integration/test_submissions.py | test_clear_all_submissions | 232 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | 200 | assert | numeric_literal | picoCTF-web/tests/integration/test_submissions.py | test_clear_all_submissions | 231 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
STUDENT_2_DEMOGRAPHICS,
OTHER_U... | str(res.json) | assert | func_call | picoCTF-web/tests/integration/test_users.py | test_get_users | 44 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
get_conn,
RATE_LIMIT_BYPASS_KEY... | 1 | assert | numeric_literal | picoCTF-web/tests/integration/test_user.py | test_reset_password | 460 | null | |
picoCTF/picoCTF | from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
get_conn,
)
def test_create_team(m... | 403 | assert | numeric_literal | picoCTF-web/tests/integration/test_teams.py | test_create_team | 34 | null | |
llimllib/limbo | import json
import os
import sys
import limbo
import pytest
import vcr
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, "../../limbo/plugins"))
def msgobj(msg):
return {"text": msg, "channel": "abc123"}
def weather_env_vars(monkeypatch):
"""Disable environment variables... | attachment["pretext"] | assert | complex_expr | test/test_plugins/test_weather.py | test_basic | 35 | null | |
llimllib/limbo | from collections import namedtuple
import logging
from .mock_handler import MockHandler
import os
import sqlite3
import tempfile
import limbo
User = namedtuple('User', 'name id real_name tz')
DIR = os.path.dirname(os.path.realpath(__file__))
PARENT = os.path.split(DIR)[0]
os.environ["LIMBO_LOGFILE"] = "/tmp/deletem... | 2 | assert | numeric_literal | test/test_limbo.py | test_plugin_success | 33 | null | |
llimllib/limbo | import os
import sys
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins'))
from help import on_message
import limbo
def test_basic():
hooks = {"help": {"test": "!test help system"}}
server = limbo.FakeServer(hooks=hooks)
ret = on_message({"text": u... | hooks["help"]["test"] | assert | complex_expr | test/test_plugins/test_help.py | test_basic | 15 | null | |
llimllib/limbo | import os
import sys
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, "../../limbo/plugins"))
from banner import on_message
def test_unicode():
# Figlet just swallows unicode
ret = on_message({"text": "!banner Харито́н"}, None)
assert ret == None
# Though it wil... | "```-- ---. - ---. .-. .... . .- -..```" | assert | string_literal | test/test_plugins/test_banner.py | test_unicode | 23 | null | |
llimllib/limbo | import os
import shlex
import subprocess
import sys
DIR = os.path.dirname(os.path.realpath(__file__))
TESTPLUGINS = os.path.join(DIR, "plugins")
def sh(cmd):
# shlex.split can only handle unicode strings in python3
cmd = cmd.decode("utf8")
proc = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE)... | u"limbo> {0}\nlimbo>".format(msg) | assert | func_call | test/test_cmd.py | test_repl | 40 | null | |
llimllib/limbo | from collections import namedtuple
import logging
from .mock_handler import MockHandler
import os
import sqlite3
import tempfile
import limbo
User = namedtuple('User', 'name id real_name tz')
DIR = os.path.dirname(os.path.realpath(__file__))
PARENT = os.path.split(DIR)[0]
os.environ["LIMBO_LOGFILE"] = "/tmp/deletem... | 1 | assert | numeric_literal | test/test_limbo.py | test_config_plugin_success | 57 | null | |
llimllib/limbo | import os
import shlex
import subprocess
import sys
DIR = os.path.dirname(os.path.realpath(__file__))
TESTPLUGINS = os.path.join(DIR, "plugins")
def sh(cmd):
# shlex.split can only handle unicode strings in python3
cmd = cmd.decode("utf8")
proc = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE)... | 0 | assert | numeric_literal | test/test_cmd.py | test_cmd | 28 | null | |
llimllib/limbo | import os
import sys
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins'))
from help import on_message
import limbo
def test_extended_not_there():
hooks = {"extendedhelp": {"test": "!test help system\nline 2"}}
server = limbo.FakeServer(hooks=hooks)
... | 'No help found for not_there' | assert | string_literal | test/test_plugins/test_help.py | test_extended_not_there | 33 | null | |
llimllib/limbo | import os
import sys
from limbo import FakeServer
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins'))
from poll import on_message, ERROR_WRONG_NUMBER_OF_ARGUMENTS, ERROR_INVALID_FORMAT
def test_poll():
ret = on_message({"text": u"!poll ''"}, None)
as... | 2 | assert | numeric_literal | test/test_plugins/poll_test.py | test_poll | 31 | null | |
llimllib/limbo | from collections import namedtuple
import logging
from .mock_handler import MockHandler
import os
import sqlite3
import tempfile
import limbo
User = namedtuple('User', 'name id real_name tz')
DIR = os.path.dirname(os.path.realpath(__file__))
PARENT = os.path.split(DIR)[0]
os.environ["LIMBO_LOGFILE"] = "/tmp/deletem... | None | assert | none_literal | test/test_limbo.py | test_handle_message_subtype | 93 | null | |
llimllib/limbo | import os
import shlex
import subprocess
import sys
DIR = os.path.dirname(os.path.realpath(__file__))
TESTPLUGINS = os.path.join(DIR, "plugins")
def sh(cmd):
# shlex.split can only handle unicode strings in python3
cmd = cmd.decode("utf8")
proc = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE)... | msg | assert | variable | test/test_cmd.py | test_cmd | 27 | null | |
llimllib/limbo | import os
import sys
import vcr
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins'))
from flip import on_message
def test_count_flips_no_args():
n = 1000
heads = 0
for i in range(n):
ret = on_message({"text": u"!flip"}, None)
if r... | heads | assert | variable | test/test_plugins/test_flip.py | test_count_flips_no_args | 27 | null | |
llimllib/limbo | from collections import namedtuple
import logging
from .mock_handler import MockHandler
import os
import sqlite3
import tempfile
import limbo
User = namedtuple('User', 'name id real_name tz')
DIR = os.path.dirname(os.path.realpath(__file__))
PARENT = os.path.split(DIR)[0]
os.environ["LIMBO_LOGFILE"] = "/tmp/deletem... | 5 | assert | numeric_literal | test/test_limbo.py | test_config_plugin_success | 53 | null | |
llimllib/limbo | import json
import os
import sys
import limbo
import pytest
import vcr
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, "../../limbo/plugins"))
def msgobj(msg):
return {"text": msg, "channel": "abc123"}
def weather_env_vars(monkeypatch):
"""Disable environment variables... | ":cloud: 74°f" | assert | string_literal | test/test_plugins/test_weather.py | test_basic | 36 | null | |
llimllib/limbo | import os
import sys
import vcr
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, "../../limbo/plugins"))
from commit import on_message
def test_commit():
with vcr.use_cassette("test/fixtures/commit.yaml"):
ret = on_message({"text": "!commit"}, None)
assert ... | ret | assert | variable | test/test_plugins/test_commit.py | test_commit | 16 | null | |
llimllib/limbo | import os
import sys
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins'))
from help import on_message
import limbo
def test_extended():
hooks = {"extendedhelp": {"test": "!test help system\nline 2"}}
server = limbo.FakeServer(hooks=hooks)
ret = on... | hooks["extendedhelp"]["test"] | assert | complex_expr | test/test_plugins/test_help.py | test_extended | 27 | null | |
llimllib/limbo | import os
import sys
import vcr
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, "../../limbo/plugins"))
from wiki import on_message
def test_basic():
with vcr.use_cassette("test/fixtures/wiki_basic.yaml"):
ret = on_message({"text": "!wiki dog"}, None)
asse... | ret | assert | variable | test/test_plugins/test_wiki.py | test_basic | 16 | null | |
llimllib/limbo | import json
import os
import sys
import sqlite3
import vcr
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, "../../limbo/plugins"))
from github import on_message
from limbo.server import LimboServer
from limbo.fakeserver import FakeServer
SERVER = FakeServer(db=sqlite3.connect(... | 1 | assert | numeric_literal | test/test_plugins/test_github.py | test_basic | 41 | null | |
llimllib/limbo | import os
import sys
import vcr
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, "../../limbo/plugins"))
from cat import on_message
def test_cat():
with vcr.use_cassette("test/fixtures/cat.yaml"):
ret = on_message({"text": "!cat"}, None)
assert "https://cdn... | ret | assert | variable | test/test_plugins/test_cat.py | test_cat | 16 | null | |
llimllib/limbo | import json
import os
import sys
import limbo
import pytest
import vcr
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, "../../limbo/plugins"))
def msgobj(msg):
return {"text": msg, "channel": "abc123"}
def weather_env_vars(monkeypatch):
"""Disable environment variables... | ":cloud: 23°c" | assert | string_literal | test/test_plugins/test_weather.py | test_units | 58 | null | |
llimllib/limbo | import json
import os
import sys
import limbo
import vcr
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, "../../limbo/plugins"))
from image import on_message
bananas_images = [
"https://images.immediate.co.uk/production/volatile/sites/30/2017/01/Bunch-of-bananas-67e91d5.jp... | bananas_images | assert | variable | test/test_plugins/test_image.py | test_image | 49 | null | |
llimllib/limbo | import os
import sys
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, "../../limbo/plugins"))
from banner import on_message
def test_unicode():
# Figlet just swallows unicode
ret = on_message({"text": "!banner Харито́н"}, None)
assert ret == | None | assert | none_literal | test/test_plugins/test_banner.py | test_unicode | 19 | null | |
llimllib/limbo | import os
import sys
import vcr
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins'))
from flip import on_message
def test_no_args():
ret = on_message({"text": u"!flip"}, None)
assert "heads" in | ret | assert | variable | test/test_plugins/test_flip.py | test_no_args | 14 | null | |
llimllib/limbo | import os
import sys
from limbo import FakeServer
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins'))
from poll import on_message, ERROR_WRONG_NUMBER_OF_ARGUMENTS, ERROR_INVALID_FORMAT
def test_poll():
ret = on_message({"text": u"!poll ''"}, None)
a... | ret | assert | variable | test/test_plugins/poll_test.py | test_poll | 13 | null | |
llimllib/limbo | import json
import os
import sys
import limbo
import vcr
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, "../../limbo/plugins"))
from gif import on_message
bananas_gifs = [
"https://www.thespruceeats.com/thmb/j3JUCjFKjju2er6BzsbL1mhHRPE%3D/1500x0/filters:no_upscale():max_b... | bananas_gifs | assert | variable | test/test_plugins/test_gif.py | test_gif | 49 | null | |
llimllib/limbo | from collections import namedtuple
import logging
from .mock_handler import MockHandler
import os
import sqlite3
import tempfile
import limbo
User = namedtuple('User', 'name id real_name tz')
DIR = os.path.dirname(os.path.realpath(__file__))
PARENT = os.path.split(DIR)[0]
os.environ["LIMBO_LOGFILE"] = "/tmp/deletem... | 0 | assert | numeric_literal | test/test_limbo.py | test_config_plugin_doesnt_exist | 61 | null | |
llimllib/limbo | from collections import namedtuple
import logging
from .mock_handler import MockHandler
import os
import sqlite3
import tempfile
import limbo
User = namedtuple('User', 'name id real_name tz')
DIR = os.path.dirname(os.path.realpath(__file__))
PARENT = os.path.split(DIR)[0]
os.environ["LIMBO_LOGFILE"] = "/tmp/deletem... | True | assert | bool_literal | test/test_limbo.py | test_loop_hook | 213 | null | |
llimllib/limbo | import os
import sys
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins'))
from help import on_message
import limbo
def test_nonexistent():
hooks = {}
server = limbo.FakeServer(hooks=hooks)
ret = on_message({"text": u"!help"}, server)
assert r... | '' | assert | string_literal | test/test_plugins/test_help.py | test_nonexistent | 21 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
from PIL import Image
from Augmentor import Operations
import glob
original_dimensions = (800, 800)
larger_dimensions = (1200, 1200)
smaller_dimensions = (400, 400)
def test_resize_in_memory():
... | smaller_dimensions | assert | variable | tests/test_resize.py | test_resize_in_memory | 37 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor import ImageUtilities
from util_funcs import create_sub_folders
def test_initialise_with_subfolders... | num_of_folders | assert | variable | tests/test_load.py | test_initialise_with_subfolders | 58 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor import ImageUtilities
from util_funcs import create_sub_folders
def test_initialise_with_no_paramet... | 0 | assert | numeric_literal | tests/test_load.py | test_initialise_with_no_parameters | 26 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor.Operations import CropRandom, HSVShifting
def create_temporary_data():
standard_image_directory =... | len(generated_files) | assert | func_call | tests/test_ground_truth_by_class.py | test_histogram_equalisation_ground_truth | 104 | null | |
mdbloice/Augmentor | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
from PIL import Image
import tempfile
import io
import shutil
import glob
import random
import numpy as np
... | sample_size | assert | variable | tests/test_datapipeline.py | test_sample_with_no_masks | 67 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
from PIL import Image
from Augmentor import Operations
import glob
original_dimensions = (640, 480)
larger_dimensions = (1200, 1000)
smaller_dimensions = (360, 240)
def test_simple_multi_threading_e... | n | assert | variable | tests/test_multi_threading.py | test_simple_multi_threading_example | 31 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import tempfile
import shutil
from PIL import Image
from Augmentor import Operations
def rotate_images(tmpdir, rot):
original_dimensions = (800, 800)
im_tmp = tmpdir.mkdir("subfolder").join('test.JPEG')
im = Image.new('RGB', original_dimension... | None | assert | none_literal | tests/test_rotate.py | rotate_images | 22 | null | |
mdbloice/Augmentor | import Augmentor
import Augmentor.ImageUtilities
def test_user_param_parsing():
# Scalar input should return itself, as a integer
scalar_input = Augmentor.ImageUtilities.parse_user_parameter(user_param=5)
assert scalar_input == | 5 | assert | numeric_literal | tests/test_user_operation_parameter_input.py | test_user_param_parsing | 9 | null | |
mdbloice/Augmentor | import pytest
import numpy as np
import PIL.Image as Image
import Augmentor
def test_torch_transform():
torchvision = pytest.importorskip("torchvision")
red = np.zeros([10, 10, 3], np.uint8)
red[..., 0] = 255
red = Image.fromarray(red)
p = Augmentor.Pipeline()
# include multiple transforms... | transforms(red) | assert | func_call | tests/test_torch_transform.py | test_torch_transform | 28 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor import ImageUtilities
from util_funcs import create_sub_folders
def test_initialise_with_missing_fo... | IOError) | pytest.raises | variable | tests/test_load.py | test_initialise_with_missing_folder | 38 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor import ImageUtilities
from util_funcs import create_sub_folders
def test_initialise_with_subfolders... | num_of_images * num_of_folders | assert | complex_expr | tests/test_load.py | test_initialise_with_subfolders | 59 | null | |
mdbloice/Augmentor | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image... | None | assert | none_literal | tests/test_generators.py | test_image_generator_function | 52 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import pytest
import Augmentor
import Augmentor.Operations
def test_add_rotate_operation():
p = Augmentor.Pipeline()
assert len(p.augmentor_images) == 0
with pytest.raises(ValueError):
p.rotate(probability=1, max_left_rotation=50, ma... | 1 | assert | numeric_literal | tests/test_pipeline_add_operations.py | test_add_rotate_operation | 27 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor import ImageUtilities
from util_funcs import create_sub_folders
def test_initialise_with_subfolders... | num_of_folders * num_of_images | assert | complex_expr | tests/test_load.py | test_initialise_with_subfolders | 80 | null | |
mdbloice/Augmentor | import pytest
import numpy as np
import PIL.Image as Image
import Augmentor
def test_torch_transform():
torchvision = pytest.importorskip("torchvision")
red = np.zeros([10, 10, 3], np.uint8)
red[..., 0] = 255
red = Image.fromarray(red)
p = Augmentor.Pipeline()
# include multiple transforms... | result | assert | variable | tests/test_torch_transform.py | test_torch_transform | 34 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
from PIL import Image
from Augmentor import Operations
from util_funcs import create_colour_temp_image, create_greyscale_temp_image
def test_in_memory_distortions():
tmp, tmpdir = create_colour_... | None | assert | none_literal | tests/test_distortion.py | test_in_memory_distortions | 25 | null | |
mdbloice/Augmentor | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image... | 1 | assert | numeric_literal | tests/test_generators.py | test_generator | 217 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
from PIL import Image
from Augmentor import Operations
import glob
original_dimensions = (800, 800)
larger_dimensions = (1200, 1200)
smaller_dimensions = (400, 400)
def test_resize_in_memory():
... | larger_dimensions | assert | variable | tests/test_resize.py | test_resize_in_memory | 32 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.