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
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/ERC20CRV/test_inflation_delay.py
test_available_supply
assert
complex_expr
6
WEEK = 86400 * 7 YEAR = 365 * 86400 def test_available_supply(accounts, chain, token): assert token.available_supply() ==
1_303_030_303 * 10**18
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/integration/ERC20CRV/test_mintable_in_timeframe.py
test_mintable_in_timeframe
assert
numeric_literal
26
import pytest from brownie.test import strategy, given from tests.conftest import approx from tests.conftest import YEAR, YEAR_1_SUPPLY, INITIAL_SUPPLY def initial_setup(chain, token): chain.sleep(86401) token.update_mining_parameters() @given(time=strategy("decimal", min_value=1, max_value=7)) def test_mint...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/integration/LiquidityGauge/test_liquidity_gauge.py
test_mining_with_votelock
assert
numeric_literal
47
from random import random, randrange from tests.conftest import YEAR, approx MAX_UINT256 = 2 ** 256 - 1 WEEK = 7 * 86400 def test_mining_with_votelock( accounts, chain, history, mock_lp_token, token, liquidity_gauge, gauge_controller, voting_escrow): alice, bob = accounts[:2] chain.sleep(2 * W...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/integration/VotingEscrow/test_voting_escrow.py
test_voting_powers
assert
numeric_literal
47
from tests.conftest import approx H = 3600 DAY = 86400 WEEK = 7 * DAY MAXTIME = 126144000 TOL = 120 / WEEK def test_voting_powers(web3, chain, accounts, token, voting_escrow): """ Test voting power in the following scenario. Alice: ~~~~~~~ ^ | * * | | \ | ...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/ERC20CRV/test_burn.py
test_burn_all
assert
numeric_literal
12
import brownie WEEK = 86400 * 7 YEAR = 365 * 86400 ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" def test_burn_all(accounts, token): initial_supply = token.totalSupply() token.burn(initial_supply, {'from': accounts[0]}) assert token.balanceOf(accounts[0]) ==
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/ERC20CRV/test_inflation_delay.py
test_rate
assert
numeric_literal
6
WEEK = 86400 * 7 YEAR = 365 * 86400 def test_rate(accounts, chain, token): assert token.rate() ==
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/GaugeController/test_gauges_weights.py
test_n_gauges
assert
numeric_literal
11
import brownie WEEK = 7 * 86400 YEAR = 365 * 86400 TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18] GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17] def test_n_gauges(accounts, gauge_controller, three_gauges): assert gauge_controller.n_gauges() ==
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/GaugeController/test_gauges_weights.py
test_n_gauges
assert
numeric_literal
16
import brownie WEEK = 7 * 86400 YEAR = 365 * 86400 TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18] GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17] def test_n_gauges(accounts, gauge_controller, three_gauges): assert gauge_controller.n_gauges() == 0 gauge_controller.add_gauge(three_gauges[0], 0, {'from': a...
2
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/GaugeController/test_gauges_weights.py
test_n_gauges_same_gauge
assert
numeric_literal
17
import brownie WEEK = 7 * 86400 YEAR = 365 * 86400 TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18] GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17] def test_n_gauges_same_gauge(accounts, gauge_controller, three_gauges): assert gauge_controller.n_gauges() == 0 gauge_controller.add_gauge(three_gauges[0], 0,...
1
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/GaugeController/test_vote.py
test_vote_remove
assert
numeric_literal
22
import brownie import pytest YEAR = 86400 * 365 def gauge_vote_setup(accounts, chain, gauge_controller, three_gauges, voting_escrow, token): gauge_controller.add_type(b'Insurance', {'from': accounts[0]}) gauge_controller.add_gauge(three_gauges[0], 0, {'from': accounts[0]}) gauge_controller.add_gauge(three...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGauge/test_deposit_withdraw.py
test_deposit_zero
assert
numeric_literal
12
import brownie import pytest def deposit_setup(accounts, liquidity_gauge, mock_lp_token): mock_lp_token.approve(liquidity_gauge, 2 ** 256 - 1, {"from": accounts[0]}) def test_deposit_zero(accounts, liquidity_gauge, mock_lp_token): balance = mock_lp_token.balanceOf(accounts[0]) liquidity_gauge.deposit(0, {...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeReward/test_claim_rewards.py
test_claim_for_other
assert
numeric_literal
26
import pytest from tests.conftest import approx REWARD = 10 ** 20 WEEK = 7 * 86400 LP_AMOUNT = 10 ** 18 def initial_setup(accounts, coin_reward, reward_contract, mock_lp_token, liquidity_gauge_reward): # Fund coin_reward._mint_for_testing(REWARD, {'from': accounts[0]}) coin_reward.transfer(reward_contract...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeReward/test_claim_rewards_none.py
test_claim_no_deposit
assert
numeric_literal
16
REWARD = 10 ** 20 WEEK = 7 * 86400 LP_AMOUNT = 10 ** 18 def test_claim_no_deposit(accounts, chain, liquidity_gauge_reward, reward_contract, coin_reward): # Fund coin_reward._mint_for_testing(REWARD, {'from': accounts[0]}) coin_reward.transfer(reward_contract, REWARD, {'from': accounts[0]}) reward_contr...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeReward/test_deposit_withdraw_reward.py
test_deposit_zero
assert
numeric_literal
12
import brownie import pytest def deposit_setup(accounts, liquidity_gauge_reward, mock_lp_token): mock_lp_token.approve(liquidity_gauge_reward, 2 ** 256 - 1, {"from": accounts[0]}) def test_deposit_zero(accounts, liquidity_gauge_reward, mock_lp_token, reward_contract): balance = mock_lp_token.balanceOf(account...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_approve.py
test_initial_approval_is_zero
assert
numeric_literal
7
import brownie import pytest @pytest.mark.parametrize("idx", range(5)) def test_initial_approval_is_zero(reward_gauge_wrapper, accounts, idx): assert reward_gauge_wrapper.allowance(accounts[0], accounts[idx]) ==
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_approve.py
test_approval_event_fires
assert
numeric_literal
8
import brownie import pytest def test_approval_event_fires(accounts, reward_gauge_wrapper): tx = reward_gauge_wrapper.approve(accounts[1], 10**19, {'from': accounts[0]}) assert len(tx.events) ==
1
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_claim_tokens.py
test_claim_crv
assert
numeric_literal
34
import brownie import pytest import itertools MONTH = 86400 * 30 WEEK = 86400 * 7 def setup(accounts, mock_lp_token, token, minter, gauge_controller, liquidity_gauge_reward, reward_gauge_wrapper, reward_contract, coin_reward): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquid...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_claim_tokens.py
test_claim_reward_multiple
assert
numeric_literal
37
import brownie import pytest import itertools MONTH = 86400 * 30 WEEK = 86400 * 7 def setup(accounts, mock_lp_token, token, minter, gauge_controller, liquidity_gauge_reward, reward_gauge_wrapper, reward_contract, coin_reward): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquid...
1
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_deposit_withdraw.py
test_deposit
assert
numeric_literal
18
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge_...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_transfer.py
test_transfer_full_balance
assert
numeric_literal
20
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge_...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_transferFrom.py
test_transfer_full_balance
assert
numeric_literal
21
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge_...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_approve.py
test_initial_approval_is_zero
assert
numeric_literal
7
import brownie import pytest @pytest.mark.parametrize("idx", range(5)) def test_initial_approval_is_zero(gauge_wrapper, accounts, idx): assert gauge_wrapper.allowance(accounts[0], accounts[idx]) ==
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_approve.py
test_approval_event_fires
assert
numeric_literal
8
import brownie import pytest def test_approval_event_fires(accounts, gauge_wrapper): tx = gauge_wrapper.approve(accounts[1], 10**19, {'from': accounts[0]}) assert len(tx.events) ==
1
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_claim_tokens.py
test_claim
assert
numeric_literal
34
import brownie import pytest import itertools TYPE_WEIGHTS = [5e17, 1e19] GAUGE_WEIGHTS = [1e19, 1e18, 5e17] GAUGE_TYPES = [0, 0, 1] MONTH = 86400 * 30 WEEK = 7 * 86400 def setup(accounts, mock_lp_token, token, minter, gauge_controller, liquidity_gauge, gauge_wrapper): token.set_minter(minter, {'from': accounts[...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_deposit_withdraw.py
test_deposit
assert
numeric_literal
18
import brownie import pytest def deposit_setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge, 0, 0,...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_transfer.py
test_transfer_full_balance
assert
numeric_literal
20
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge, 0, 0, {'from'...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_transferFrom.py
test_transfer_full_balance
assert
numeric_literal
21
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge, 0, 0, {'from'...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/Minter/test_minter.py
test_mint
assert
numeric_literal
41
import brownie import pytest import itertools TYPE_WEIGHTS = [5e17, 1e19] GAUGE_WEIGHTS = [1e19, 1e18, 5e17] GAUGE_TYPES = [0, 0, 1] MONTH = 86400 * 30 WEEK = 7 * 86400 def minter_setup(accounts, mock_lp_token, token, minter, gauge_controller, three_gauges): token.set_minter(minter, {'from': accounts[0]}) #...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/PoolProxy/test_owner_admin.py
test_withdraw_admin_fees
assert
numeric_literal
41
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" owner_functions_mock = """ # @version 0.2.7 aave: public(uint256) donated: public(bool) withdrawn: public(uint256) @payable @external def __default__(): pass @external def set_aave_referral(referral_code: uint256): sel...
1
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/PoolProxy/test_owner_admin.py
test_withdraw_many
assert
numeric_literal
41
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" owner_functions_mock = """ # @version 0.2.7 aave: public(uint256) donated: public(bool) withdrawn: public(uint256) @payable @external def __default__(): pass @external def set_aave_referral(referral_code: uint256): sel...
5
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/PoolProxy/test_owner_admin.py
test_unset_burner
assert
numeric_literal
41
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" owner_functions_mock = """ # @version 0.2.7 aave: public(uint256) donated: public(bool) withdrawn: public(uint256) @payable @external def __default__(): pass @external def set_aave_referral(referral_code: uint256): sel...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/PoolProxy/test_parameter_admin.py
test_revert_new_parameters
assert
numeric_literal
75
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" def param_pool(accounts): pool_parameters_mock = """ amp: public(uint256) fee: public(uint256) admin_fee: public(uint256) future_amp: public(uint256) future_fee: public(uint256) future_admin_fee: public(uint256) @external ...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/PoolProxy/test_proxy_burn.py
test_burn
assert
numeric_literal
34
import brownie import pytest ETH_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" burner_mock = """ # @version 0.2.7 is_burned: public(HashMap[address, bool]) @payable @external def burn(coin: address) -> bool: self.is_burned[coin] = True ret...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrow/test_claim.py
test_claim_before_start
assert
numeric_literal
15
import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" def initial_funding(vesting, accounts): recipients = [accounts[1]] + [ZERO_ADDRESS] * 99 vesting.add_tokens(10**21, {'from': accounts[0]}) vesting.fund(recipients, [10**20] + [0] * 99, {'from': accounts[0]}) def test_claim_before_s...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrow/test_disable.py
test_disabled_at_is_initially_zero
assert
numeric_literal
8
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" def test_disabled_at_is_initially_zero(vesting, accounts): assert vesting.disabled_at(accounts[1]) ==
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrow/test_disable_and_claim.py
test_disable_before_start_time
assert
numeric_literal
16
import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" def initial_funding(vesting, accounts): recipients = [accounts[1]] + [ZERO_ADDRESS] * 99 vesting.add_tokens(10**21, {'from': accounts[0]}) vesting.fund(recipients, [10**20] + [0] * 99, {'from': accounts[0]}) def test_disable_before...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrow/test_getters.py
test_vested_supply
assert
numeric_literal
11
import pytest amounts = [10**17 * i for i in range(1, 101)] def initial_funding(vesting, accounts): vesting.add_tokens(10**21, {'from': accounts[0]}) vesting.fund(accounts[:100], amounts, {'from': accounts[0]}) def test_vested_supply(chain, vesting, end_time): assert vesting.vestedSupply() ==
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrowFactory/test_claim_simple.py
test_claim_before_start
assert
numeric_literal
8
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" def test_claim_before_start(vesting_simple, coin_a, accounts, chain, start_time): chain.sleep(start_time - chain.time() - 5) vesting_simple.claim({'from': accounts[1]}) assert coin_a.balanceOf(accounts[1]) ==
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrowFactory/test_deploy_escrow.py
test_deploys
assert
numeric_literal
16
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" def initial_funding(coin_a, vesting_factory, accounts): coin_a._mint_for_testing(10**21, {'from': accounts[0]}) coin_a.transfer(vesting_factory, 10**21, {'from': accounts[0]}) def test_deploys(accounts, vesting_factory, ...
1
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrowFactory/test_deploy_escrow.py
test_token_approval
assert
numeric_literal
13
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" def initial_funding(coin_a, vesting_factory, accounts): coin_a._mint_for_testing(10**21, {'from': accounts[0]}) coin_a.transfer(vesting_factory, 10**21, {'from': accounts[0]}) def test_token_approval(vesting_simple, vest...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrowFactory/test_disable_and_claim_simple.py
test_disable_before_start_time
assert
numeric_literal
9
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" def test_disable_before_start_time(vesting_simple, coin_a, accounts, chain, end_time): vesting_simple.toggle_disable(accounts[1], {'from': accounts[0]}) chain.sleep(end_time - chain.time()) vesting_simple.claim({'from': accounts[1]}) assert ...
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrowFactory/test_disable_simple.py
test_disabled_at_is_initially_zero
assert
numeric_literal
7
import brownie ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" def test_disabled_at_is_initially_zero(vesting_simple, accounts): assert vesting_simple.disabled_at(accounts[1]) ==
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrowFactory/test_getters_simple.py
test_vested_supply
assert
numeric_literal
3
def test_vested_supply(chain, vesting_simple, end_time): assert vesting_simple.vestedSupply() ==
0
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/ERC20CRV/test_inflation_delay.py
test_mining_epoch
assert
numeric_literal
6
WEEK = 86400 * 7 YEAR = 365 * 86400 def test_mining_epoch(accounts, chain, token): assert token.mining_epoch() ==
-1
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/GaugeController/test_vote.py
test_vote_change
assert
numeric_literal
23
import brownie import pytest YEAR = 86400 * 365 def gauge_vote_setup(accounts, chain, gauge_controller, three_gauges, voting_escrow, token): gauge_controller.add_type(b'Insurance', {'from': accounts[0]}) gauge_controller.add_gauge(three_gauges[0], 0, {'from': accounts[0]}) gauge_controller.add_gauge(three...
42
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_approve.py
test_decrease_allowance
assert
numeric_literal
9
import brownie import pytest def test_decrease_allowance(accounts, reward_gauge_wrapper): reward_gauge_wrapper.approve(accounts[1], 100, {'from': accounts[0]}) reward_gauge_wrapper.decreaseAllowance(accounts[1], 34, {'from': accounts[0]}) assert reward_gauge_wrapper.allowance(accounts[0], accounts[1]) ==...
66
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_approve.py
test_decrease_allowance
assert
numeric_literal
9
import brownie import pytest def test_decrease_allowance(accounts, gauge_wrapper): gauge_wrapper.approve(accounts[1], 100, {'from': accounts[0]}) gauge_wrapper.decreaseAllowance(accounts[1], 34, {'from': accounts[0]}) assert gauge_wrapper.allowance(accounts[0], accounts[1]) ==
66
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/PoolProxy/test_owner_admin.py
test_set_aave_referral
assert
numeric_literal
40
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" owner_functions_mock = """ # @version 0.2.7 aave: public(uint256) donated: public(bool) withdrawn: public(uint256) @payable @external def __default__(): pass @external def set_aave_referral(referral_code: uint256): sel...
42
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/PoolProxy/test_parameter_admin.py
test_apply_new_fee
assert
numeric_literal
78
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" def param_pool(accounts): pool_parameters_mock = """ amp: public(uint256) fee: public(uint256) admin_fee: public(uint256) future_amp: public(uint256) future_fee: public(uint256) future_admin_fee: public(uint256) @external ...
42
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_approve.py
test_increase_allowance
assert
numeric_literal
9
import brownie import pytest def test_increase_allowance(accounts, reward_gauge_wrapper): reward_gauge_wrapper.approve(accounts[1], 100, {'from': accounts[0]}) reward_gauge_wrapper.increaseAllowance(accounts[1], 403, {'from': accounts[0]}) assert reward_gauge_wrapper.allowance(accounts[0], accounts[1]) =...
503
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_approve.py
test_increase_allowance
assert
numeric_literal
9
import brownie import pytest def test_increase_allowance(accounts, gauge_wrapper): gauge_wrapper.approve(accounts[1], 100, {'from': accounts[0]}) gauge_wrapper.increaseAllowance(accounts[1], 403, {'from': accounts[0]}) assert gauge_wrapper.allowance(accounts[0], accounts[1]) ==
503
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrow/test_fund.py
test_event
assert
numeric_literal
14
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" AMOUNTS = [10**17 * i for i in range(1, 101)] def initial_setup(accounts, vesting): vesting.add_tokens(10**21, {'from': accounts[0]}) def test_event(vesting, accounts): tx = vesting.fund(accounts[:100], AMOUNTS, {'from':...
100
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/integration/ERC20CRV/test_mintable_in_timeframe.py
test_mintable_in_timeframe
assert
numeric_literal
28
import pytest from brownie.test import strategy, given from tests.conftest import approx from tests.conftest import YEAR, YEAR_1_SUPPLY, INITIAL_SUPPLY def initial_setup(chain, token): chain.sleep(86401) token.update_mining_parameters() @given(time=strategy("decimal", min_value=1, max_value=7)) def test_mint...
1e-7
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/GaugeController/test_vote.py
test_vote_partial
assert
numeric_literal
18
import brownie import pytest YEAR = 86400 * 365 def gauge_vote_setup(accounts, chain, gauge_controller, three_gauges, voting_escrow, token): gauge_controller.add_type(b'Insurance', {'from': accounts[0]}) gauge_controller.add_gauge(three_gauges[0], 0, {'from': accounts[0]}) gauge_controller.add_gauge(three...
1234
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrow/test_fund.py
test_initial_locked_supply
assert
func_call
14
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" AMOUNTS = [10**17 * i for i in range(1, 101)] def initial_setup(accounts, vesting): vesting.add_tokens(10**21, {'from': accounts[0]}) def test_initial_locked_supply(vesting, accounts): vesting.fund(accounts[:100], AMOUNT...
sum(AMOUNTS)
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrow/test_getters.py
test_vested_supply
assert
func_call
14
import pytest amounts = [10**17 * i for i in range(1, 101)] def initial_funding(vesting, accounts): vesting.add_tokens(10**21, {'from': accounts[0]}) vesting.fund(accounts[:100], amounts, {'from': accounts[0]}) def test_vested_supply(chain, vesting, end_time): assert vesting.vestedSupply() == 0 chain...
sum(amounts)
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeReward/test_claim_rewards.py
test_claim_two_lp
assert
func_call
40
import pytest from tests.conftest import approx REWARD = 10 ** 20 WEEK = 7 * 86400 LP_AMOUNT = 10 ** 18 def initial_setup(accounts, coin_reward, reward_contract, mock_lp_token, liquidity_gauge_reward): # Fund coin_reward._mint_for_testing(REWARD, {'from': accounts[0]}) coin_reward.transfer(reward_contract...
tuple(rewards)
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrow/test_fund.py
test_partial_recipients
assert
func_call
15
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" AMOUNTS = [10**17 * i for i in range(1, 101)] def initial_setup(accounts, vesting): vesting.add_tokens(10**21, {'from': accounts[0]}) def test_partial_recipients(vesting, accounts): recipients = accounts[:5] + [ZERO_ADDR...
sum(AMOUNTS[:5])
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/integration/ERC20CRV/test_mintable_in_timeframe.py
test_random_range_year_one
assert
func_call
18
import pytest from brownie.test import strategy, given from tests.conftest import approx from tests.conftest import YEAR, YEAR_1_SUPPLY, INITIAL_SUPPLY def initial_setup(chain, token): chain.sleep(86401) token.update_mining_parameters() @given(time1=strategy('uint', max_value=YEAR), time2=strategy('uint', ma...
rate * (end-start)
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/integration/Minter/test_minter_integration.py
test_mint
assert
func_call
72
import brownie from tests.conftest import approx def to_int(*args): # Helper function for readability return [int(a) for a in args] def test_mint(accounts, chain, mock_lp_token, gauge_controller, three_gauges, minter, token): admin, bob, charlie, dan = accounts[:4] token.set_minter(minter, {'from': ...
token.balanceOf(bob)
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrow/test_fund.py
test_unallocated_supply
assert
func_call
14
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" AMOUNTS = [10**17 * i for i in range(1, 101)] def initial_setup(accounts, vesting): vesting.add_tokens(10**21, {'from': accounts[0]}) def test_unallocated_supply(vesting, accounts): vesting.fund(accounts[:100], AMOUNTS, ...
10**21 - sum(AMOUNTS)
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrow/test_fund.py
test_multiple_calls_different_recipients
assert
func_call
20
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" AMOUNTS = [10**17 * i for i in range(1, 101)] def initial_setup(accounts, vesting): vesting.add_tokens(10**21, {'from': accounts[0]}) def test_multiple_calls_different_recipients(vesting, accounts): recipients = [account...
10**21 - (10**20 * 4)
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrow/test_fund.py
test_multiple_calls_same_recipient
assert
func_call
20
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" AMOUNTS = [10**17 * i for i in range(1, 101)] def initial_setup(accounts, vesting): vesting.add_tokens(10**21, {'from': accounts[0]}) def test_multiple_calls_same_recipient(vesting, accounts): recipients = [accounts[5]] ...
10**21 - (10**20 * 3)
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/integration/LiquidityGauge/test_deposits_withdrawals.py
invariant_total_supply
assert
func_call
83
import brownie from brownie import chain from brownie.test import strategy class StateMachine: st_account = strategy("address", length=5) st_value = strategy("uint64") st_time = strategy("uint", max_value=86400 * 365) def __init__(self, accounts, liquidity_gauge, mock_lp_token): self.accounts...
sum(self.balances.values())
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrow/test_fund.py
test_event
assert
collection
16
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" AMOUNTS = [10**17 * i for i in range(1, 101)] def initial_setup(accounts, vesting): vesting.add_tokens(10**21, {'from': accounts[0]}) def test_event(vesting, accounts): tx = vesting.fund(accounts[:100], AMOUNTS, {'from':...
[acct, expected_amount]
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_approve.py
test_approval_event_fires
assert
collection
9
import brownie import pytest def test_approval_event_fires(accounts, reward_gauge_wrapper): tx = reward_gauge_wrapper.approve(accounts[1], 10**19, {'from': accounts[0]}) assert len(tx.events) == 1 assert tx.events["Approval"].values() ==
[accounts[0], accounts[1], 10**19]
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_transfer.py
test_transfer_event_fires
assert
collection
18
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge_...
[accounts[0], accounts[1], amount]
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_transferFrom.py
test_transfer_event_fires
assert
collection
20
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge_...
[accounts[0], accounts[2], amount]
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_approve.py
test_approval_event_fires
assert
collection
9
import brownie import pytest def test_approval_event_fires(accounts, gauge_wrapper): tx = gauge_wrapper.approve(accounts[1], 10**19, {'from': accounts[0]}) assert len(tx.events) == 1 assert tx.events["Approval"].values() ==
[accounts[0], accounts[1], 10**19]
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_transfer.py
test_transfer_event_fires
assert
collection
18
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge, 0, 0, {'from'...
[accounts[0], accounts[1], amount]
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_transferFrom.py
test_transfer_event_fires
assert
collection
20
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge, 0, 0, {'from'...
[accounts[0], accounts[2], amount]
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/ERC20CRV/test_setters.py
test_set_name
assert
string_literal
8
import brownie def test_set_name(accounts, token): token.set_name("Foo Token", "FOO", {'from': accounts[0]}) assert token.name() == "Foo Token" assert token.symbol() ==
"FOO"
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/ERC20CRV/test_setters.py
test_set_name
assert
string_literal
7
import brownie def test_set_name(accounts, token): token.set_name("Foo Token", "FOO", {'from': accounts[0]}) assert token.name() ==
"Foo Token"
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGauge/test_deposit_for.py
test_set_approve_deposit_true
assert
bool_literal
6
import brownie def test_set_approve_deposit_true(accounts, liquidity_gauge): liquidity_gauge.set_approve_deposit(accounts[0], True, {'from': accounts[1]}) assert liquidity_gauge.approved_to_deposit(accounts[0], accounts[1]) is
True
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeReward/test_deposit_for_rewards.py
test_set_approve_deposit_true
assert
bool_literal
6
import brownie def test_set_approve_deposit_true(accounts, liquidity_gauge_reward): liquidity_gauge_reward.set_approve_deposit(accounts[0], True, {'from': accounts[1]}) assert liquidity_gauge_reward.approved_to_deposit(accounts[0], accounts[1]) is
True
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_approve.py
test_returns_true
assert
bool_literal
8
import brownie import pytest def test_returns_true(reward_gauge_wrapper, accounts): tx = reward_gauge_wrapper.approve(accounts[1], 10**19, {'from': accounts[0]}) assert tx.return_value is
True
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_transfer.py
test_returns_true
assert
bool_literal
18
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge_...
True
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeRewardWrapper/test_transferFrom.py
test_returns_true
assert
bool_literal
19
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge_reward, reward_gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge_...
True
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_approve.py
test_returns_true
assert
bool_literal
8
import brownie import pytest def test_returns_true(gauge_wrapper, accounts): tx = gauge_wrapper.approve(accounts[1], 10**19, {'from': accounts[0]}) assert tx.return_value is
True
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_transfer.py
test_returns_true
assert
bool_literal
18
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge, 0, 0, {'from'...
True
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGaugeWrapper/test_transferFrom.py
test_returns_true
assert
bool_literal
19
import brownie import pytest def setup(accounts, gauge_controller, minter, liquidity_gauge, gauge_wrapper, token, mock_lp_token): token.set_minter(minter, {'from': accounts[0]}) gauge_controller.add_type(b'Liquidity', 10**10, {'from': accounts[0]}) gauge_controller.add_gauge(liquidity_gauge, 0, 0, {'from'...
True
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/PoolProxy/test_owner_admin.py
test_donate_fees
assert
bool_literal
40
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" owner_functions_mock = """ # @version 0.2.7 aave: public(uint256) donated: public(bool) withdrawn: public(uint256) @payable @external def __default__(): pass @external def set_aave_referral(referral_code: uint256): sel...
True
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/VestingEscrowFactory/test_deploy_escrow.py
test_init_vars
assert
bool_literal
16
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" def initial_funding(coin_a, vesting_factory, accounts): coin_a._mint_for_testing(10**21, {'from': accounts[0]}) coin_a.transfer(vesting_factory, 10**21, {'from': accounts[0]}) def test_init_vars(vesting_simple, accounts,...
True
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
curvefi/curve-dao-contracts
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
train
train
tests/unitary/LiquidityGauge/test_deposit_for.py
test_set_approve_deposit_initial
assert
bool_literal
5
import brownie def test_set_approve_deposit_initial(accounts, liquidity_gauge): assert liquidity_gauge.approved_to_deposit(accounts[0], accounts[1]) is
False
ec70363866b7127f1d33c87dcc6d12345db2d5c0
148
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_cli.py
test_dump_styles_unicode
assert
numeric_literal
18
from click.testing import CliRunner import lookatme from lookatme.__main__ import main import lookatme.tui def run_cmd(*args): """Run the provided arguments """ runner = CliRunner() return runner.invoke(main, args) def test_dump_styles_unicode(): """Test that dump styles works correctly """ ...
0
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_cli.py
test_dump_styles_unicode
assert
complex_expr
19
from click.testing import CliRunner import lookatme from lookatme.__main__ import main import lookatme.tui def run_cmd(*args): """Run the provided arguments """ runner = CliRunner() return runner.invoke(main, args) def test_dump_styles_unicode(): """Test that dump styles works correctly """ ...
res.output
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_file_loader.py
test_file_loader
assert_*
variable
45
import lookatme.config import lookatme.contrib.file_loader as file_loader import lookatme.render.pygments from tests.utils import spec_and_text, row_text, render_markdown, assert_render TEST_STYLE = { "style": "monokai", "headings": { "default": { "fg": "bold", "bg": "", ...
rendered)
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_markdown.py
test_inline
assert
string_literal
63
import urwid import lookatme.config import lookatme.render.markdown_block import lookatme.render.pygments from lookatme.parser import Parser import lookatme.tui from tests.utils import spec_and_text, row_text, render_markdown, assert_render TEST_STYLE = { "style": "monokai", "headings": { "default": ...
b"link"
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_markdown.py
test_headings
assert_*
variable
47
import urwid import lookatme.config import lookatme.render.markdown_block import lookatme.render.pygments from lookatme.parser import Parser import lookatme.tui from tests.utils import spec_and_text, row_text, render_markdown, assert_render TEST_STYLE = { "style": "monokai", "headings": { "default": ...
rendered)
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_markdown.py
test_inline
assert
string_literal
40
import urwid import lookatme.config import lookatme.render.markdown_block import lookatme.render.pygments from lookatme.parser import Parser import lookatme.tui from tests.utils import spec_and_text, row_text, render_markdown, assert_render TEST_STYLE = { "style": "monokai", "headings": { "default": ...
b"emphasis"
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_parse.py
test_parse_metadata
assert
numeric_literal
28
import datetime from lookatme.parser import Parser def test_parse_metadata(): """Test that metadata can be correctly parsed out of a markdown presentation """ title = "Presentation Title" date = "9999-01-01" author = "The Author" input_data = f""" --- title: {title} date: {date} author: {...
1
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_parse.py
test_parse_slides
assert
numeric_literal
31
import datetime from lookatme.parser import Parser def test_parse_slides(): """Test that slide parsing works correctly """ input_data = r""" # Slide 1 * list * item * item * item Hello there this is a paragraph ```python code block ``` --- # Slide 2 More text """ parser = Parser() ...
2
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_parse.py
test_parse_smart_slides_one_h1
assert
numeric_literal
29
import datetime from lookatme.parser import Parser def test_parse_smart_slides_one_h1(): """Test that slide smart splitting works correctly """ input_data = r""" # Heading Title ## Heading 2 some text ## Heading 3 more text ## Heading 4 ### Sub heading #### Sub Heading """ parser = Parser()...
4
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_parse.py
test_parse_smart_slides_multiple_h2
assert
numeric_literal
27
import datetime from lookatme.parser import Parser def test_parse_smart_slides_multiple_h2(): """Test that slide smart splitting works correctly """ input_data = r""" ## Heading 2 some text ## Heading 3 more text ## Heading 4 ### Sub heading #### Sub Heading """ parser = Parser() meta = ...
3
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_parse.py
test_parse_metadata_empty
assert
string_literal
20
import datetime from lookatme.parser import Parser def test_parse_metadata_empty(): """Test that metadata can be correctly parsed out of a markdown presentation """ input_data = f""" --- --- remaining """ parser = Parser() input_data, meta = parser.parse_meta(input_data) assert input_...
""
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_parse.py
test_parse_metadata
assert
numeric_literal
27
import datetime from lookatme.parser import Parser def test_parse_metadata(): """Test that metadata can be correctly parsed out of a markdown presentation """ title = "Presentation Title" date = "9999-01-01" author = "The Author" input_data = f""" --- title: {title} date: {date} author: {...
9999
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_parse.py
test_parse_metadata
assert
variable
26
import datetime from lookatme.parser import Parser def test_parse_metadata(): """Test that metadata can be correctly parsed out of a markdown presentation """ title = "Presentation Title" date = "9999-01-01" author = "The Author" input_data = f""" --- title: {title} date: {date} author: {...
title
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_parse.py
test_parse_metadata
assert
variable
30
import datetime from lookatme.parser import Parser def test_parse_metadata(): """Test that metadata can be correctly parsed out of a markdown presentation """ title = "Presentation Title" date = "9999-01-01" author = "The Author" input_data = f""" --- title: {title} date: {date} author: {...
author
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_parse.py
test_parse_metadata_empty
assert
complex_expr
23
import datetime from lookatme.parser import Parser def test_parse_metadata_empty(): """Test that metadata can be correctly parsed out of a markdown presentation """ input_data = f""" --- --- remaining """ parser = Parser() input_data, meta = parser.parse_meta(input_data) assert input_...
now.day
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor
d0c-s4vage/lookatme
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
train
train
tests/test_parse.py
test_parse_metadata_empty
assert
complex_expr
21
import datetime from lookatme.parser import Parser def test_parse_metadata_empty(): """Test that metadata can be correctly parsed out of a markdown presentation """ input_data = f""" --- --- remaining """ parser = Parser() input_data, meta = parser.parse_meta(input_data) assert input_...
now.year
f50442ad4b7ccd5109f32e6ff410278d60b0b674
16
v2_extractor_at_anchor