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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_api/test_main.py | test_load_presets | assert | collection | 14 | from markdown_it import MarkdownIt
from markdown_it.token import Token
def test_load_presets():
md = MarkdownIt("zero")
assert md.get_active_rules() == {
"block": ["paragraph"],
"core": ["normalize", "block", "inline"],
"inline": ["text"],
"inline2": ["balance_pairs", "text_coll... | { "core": ["normalize", "block", "inline"], "block": [ "code", "fence", "blockquote", "hr", "list", "reference", "html_block", "heading", "lheading", "paragraph", ], "inline": [ "text", "newline", "escape", "backticks", "emphasis", "link", "image", "autolink", "html_inline", "entity", ], "inline2": ["balance_pairs", "e... | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_api/test_main.py | test_get_rules | assert | collection | 8 | from markdown_it import MarkdownIt
from markdown_it.token import Token
def test_get_rules():
md = MarkdownIt("zero")
# print(md.get_all_rules())
assert md.get_all_rules() == | { "core": [ "normalize", "block", "inline", "linkify", "replacements", "smartquotes", ], "block": [ "table", "code", "fence", "blockquote", "hr", "list", "reference", "html_block", "heading", "lheading", "paragraph", ], "inline": [ "text", "newline", "escape", "backticks", "strikethrough", "emphasis", "link", "image", ... | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_api/test_plugin_creation.py | test_inline_after | assert | func_call | 12 | from markdown_it import MarkdownIt
def inline_rule(state, silent):
print("plugin called")
def test_inline_after(capsys):
def _plugin(_md):
_md.inline.ruler.after("text", "new_rule", inline_rule)
MarkdownIt().use(_plugin).parse("[")
assert "plugin called" in | capsys.readouterr().out | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_api/test_token.py | test_token | assert | numeric_literal | 31 | import warnings
from markdown_it.token import Token, nest_tokens, NestedTokens
def test_token():
token = Token("name", "tag", 0)
assert token.as_dict() == {
"type": "name",
"tag": "tag",
"nesting": 0,
"attrs": None,
"map": None,
"level": 0,
"children": N... | 0 | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_api/test_token.py | test_token | assert | numeric_literal | 32 | import warnings
from markdown_it.token import Token, nest_tokens, NestedTokens
def test_token():
token = Token("name", "tag", 0)
assert token.as_dict() == {
"type": "name",
"tag": "tag",
"nesting": 0,
"attrs": None,
"map": None,
"level": 0,
"children": N... | 1 | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_api/test_token.py | test_token | assert | numeric_literal | 33 | import warnings
from markdown_it.token import Token, nest_tokens, NestedTokens
def test_token():
token = Token("name", "tag", 0)
assert token.as_dict() == {
"type": "name",
"tag": "tag",
"nesting": 0,
"attrs": None,
"map": None,
"level": 0,
"children": N... | -1 | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_api/test_token.py | test_token | assert | string_literal | 24 | import warnings
from markdown_it.token import Token, nest_tokens, NestedTokens
def test_token():
token = Token("name", "tag", 0)
assert token.as_dict() == {
"type": "name",
"tag": "tag",
"nesting": 0,
"attrs": None,
"map": None,
"level": 0,
"children": N... | "b" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_api/test_token.py | test_token | assert | string_literal | 28 | import warnings
from markdown_it.token import Token, nest_tokens, NestedTokens
def test_token():
token = Token("name", "tag", 0)
assert token.as_dict() == {
"type": "name",
"tag": "tag",
"nesting": 0,
"attrs": None,
"map": None,
"level": 0,
"children": N... | "y" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_api/test_token.py | test_nest_tokens | assert | string_literal | 24 | import warnings
from markdown_it.token import Token, nest_tokens, NestedTokens
def test_nest_tokens():
tokens = nest_tokens(
[
Token("start", "", 0),
Token("open", "", 1),
Token("open_inner", "", 1),
Token("inner", "", 0),
Token("close_inner", ""... | "open" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_api/test_token.py | test_nest_tokens | assert | string_literal | 25 | import warnings
from markdown_it.token import Token, nest_tokens, NestedTokens
def test_nest_tokens():
tokens = nest_tokens(
[
Token("start", "", 0),
Token("open", "", 1),
Token("open_inner", "", 1),
Token("inner", "", 0),
Token("close_inner", ""... | "close" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_api/test_token.py | test_nest_tokens | assert | string_literal | 33 | import warnings
from markdown_it.token import Token, nest_tokens, NestedTokens
def test_nest_tokens():
tokens = nest_tokens(
[
Token("start", "", 0),
Token("open", "", 1),
Token("open_inner", "", 1),
Token("inner", "", 0),
Token("close_inner", ""... | "inner" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_api/test_token.py | test_serialization | assert | func_call | 8 | import warnings
from markdown_it.token import Token, nest_tokens, NestedTokens
def test_serialization():
token = Token("name", "tag", 0, children=[Token("other", "tag2", 0)])
assert token == | Token.from_dict(token.as_dict()) | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_cli.py | test_parse_fail | assert | numeric_literal | 13 | import pathlib
import tempfile
from unittest.mock import patch
import pytest
from markdown_it.cli import parse
def test_parse_fail():
with pytest.raises(SystemExit) as exc_info:
parse.main(["/tmp/nonexistant_path/for_cli_test.md"])
assert exc_info.value.code == | 1 | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_cli.py | test_parse | assert | numeric_literal | 14 | import pathlib
import tempfile
from unittest.mock import patch
import pytest
from markdown_it.cli import parse
def test_parse():
with tempfile.TemporaryDirectory() as tempdir:
path = pathlib.Path(tempdir).joinpath("test.md")
path.write_text("a b c")
assert parse.main([str(path)]) == | 0 | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_cli.py | test_parse_fail | pytest.raises | variable | 11 | import pathlib
import tempfile
from unittest.mock import patch
import pytest
from markdown_it.cli import parse
def test_parse_fail():
with pytest.raises( | SystemExit) | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_cmark_spec/test_spec.py | test_spec | assert | variable | 27 | import json
from pathlib import Path
import pytest
from markdown_it import MarkdownIt
SPEC_INPUT = Path(__file__).parent.joinpath("spec.md")
TESTS_INPUT = Path(__file__).parent.joinpath("commonmark.json")
@pytest.mark.parametrize("entry", json.loads(TESTS_INPUT.read_text()))
def test_spec(entry):
md = MarkdownI... | expected | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_linkify.py | test_token_levels | assert | numeric_literal | 17 | from markdown_it import MarkdownIt
def test_token_levels():
mdit = MarkdownIt(options_update={"linkify": True}).enable("linkify")
tokens = mdit.parse("www.python.org")
inline = tokens[1]
assert inline.type == "inline"
link_open = inline.children[0]
assert link_open.type == "link_open"
link_... | 0 | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_linkify.py | test_token_levels | assert | numeric_literal | 18 | from markdown_it import MarkdownIt
def test_token_levels():
mdit = MarkdownIt(options_update={"linkify": True}).enable("linkify")
tokens = mdit.parse("www.python.org")
inline = tokens[1]
assert inline.type == "inline"
link_open = inline.children[0]
assert link_open.type == "link_open"
link_... | 1 | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_linkify.py | test_token_levels | assert | string_literal | 12 | from markdown_it import MarkdownIt
def test_token_levels():
mdit = MarkdownIt(options_update={"linkify": True}).enable("linkify")
tokens = mdit.parse("www.python.org")
inline = tokens[1]
assert inline.type == "inline"
link_open = inline.children[0]
assert link_open.type == "link_open"
link_... | "text" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_linkify.py | test_token_levels | assert | string_literal | 8 | from markdown_it import MarkdownIt
def test_token_levels():
mdit = MarkdownIt(options_update={"linkify": True}).enable("linkify")
tokens = mdit.parse("www.python.org")
inline = tokens[1]
assert inline.type == | "inline" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_port/test_fixtures.py | test_linkify | assert | func_call | 19 | from pathlib import Path
import pytest
from markdown_it import MarkdownIt
from markdown_it.utils import read_fixture_file
FIXTURE_PATH = Path(__file__).parent.joinpath("fixtures")
@pytest.mark.parametrize(
"line,title,input,expected",
read_fixture_file(FIXTURE_PATH.joinpath("linkify.md")),
)
def test_linkif... | expected.rstrip() | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_port/test_fixtures.py | test_linkify | pytest.raises | variable | 23 | from pathlib import Path
import pytest
from markdown_it import MarkdownIt
from markdown_it.utils import read_fixture_file
FIXTURE_PATH = Path(__file__).parent.joinpath("fixtures")
@pytest.mark.parametrize(
"line,title,input,expected",
read_fixture_file(FIXTURE_PATH.joinpath("linkify.md")),
)
def test_linkif... | ModuleNotFoundError) | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_port/test_misc.py | highlight_func | assert | string_literal | 6 | from markdown_it import MarkdownIt
from markdown_it import presets
def highlight_func(str_, lang, attrs):
assert lang == | "a" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_port/test_misc.py | highlight_func | assert | string_literal | 7 | from markdown_it import MarkdownIt
from markdown_it import presets
def highlight_func(str_, lang, attrs):
assert lang == "a"
assert attrs == | "b c d" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_port/test_misc.py | test_highlight_arguments | assert | string_literal | 14 | from markdown_it import MarkdownIt
from markdown_it import presets
def test_highlight_arguments():
def highlight_func(str_, lang, attrs):
assert lang == "a"
assert attrs == "b c d"
return "<pre><code>==" + str_ + "==</code></pre>"
conf = presets.commonmark.make()
conf["options"][... | "<pre><code>==hl\n==</code></pre>\n" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_port/test_no_end_newline.py | test_no_end_newline | assert | variable | 26 | import pytest
from markdown_it import MarkdownIt
@pytest.mark.parametrize(
"input,expected",
[
("#", "<h1></h1>\n"),
("###", "<h3></h3>\n"),
("` `", "<p><code> </code></p>\n"),
("``````", "<pre><code></code></pre>\n"),
("-", "<ul>\n<li></li>\n</ul>\n"),
("1.", "... | expected | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_port/test_references.py | test_ref_definitions | assert | collection | 10 | from markdown_it import MarkdownIt
def test_ref_definitions():
md = MarkdownIt()
src = "[a]: abc\n\n[b]: xyz\n\n[b]: ijk"
env = {}
tokens = md.parse(src, env)
assert tokens == | [] | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_port/test_references.py | test_use_existing_env | assert | collection | 15 | from markdown_it import MarkdownIt
def test_use_existing_env(data_regression):
md = MarkdownIt()
src = "[a]\n\n[c]: ijk"
env = {
"references": {
"A": {"title": "", "href": "abc", "map": [0, 1]},
"B": {"title": "", "href": "xyz", "map": [2, 3]},
}
}
tokens = m... | { "references": { "A": {"title": "", "href": "abc", "map": [0, 1]}, "B": {"title": "", "href": "xyz", "map": [2, 3]}, "C": {"title": "", "href": "ijk", "map": [2, 3]}, } } | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_port/test_references.py | test_ref_definitions | assert | collection | 11 | from markdown_it import MarkdownIt
def test_ref_definitions():
md = MarkdownIt()
src = "[a]: abc\n\n[b]: xyz\n\n[b]: ijk"
env = {}
tokens = md.parse(src, env)
assert tokens == []
assert env == | { "references": { "A": {"title": "", "href": "abc", "map": [0, 1]}, "B": {"title": "", "href": "xyz", "map": [2, 3]}, }, "duplicate_refs": [{"href": "ijk", "label": "B", "map": [4, 5], "title": ""}], } | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_sibling_traverse | assert | none_literal | 21 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_sibling_traverse():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
tree = SyntaxTreeNode(tokens)
paragraph_inline... | None | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_type | assert | string_literal | 15 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_type():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
tree = SyntaxTreeNode(tokens)
# Root type is "root"
a... | "root" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_sibling_traverse | assert | string_literal | 16 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_sibling_traverse():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
tree = SyntaxTreeNode(tokens)
paragraph_inline... | "text" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_type | assert | string_literal | 20 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_type():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
tree = SyntaxTreeNode(tokens)
# Root type is "root"
as... | "inline" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_sibling_traverse | assert | string_literal | 18 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_sibling_traverse():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
tree = SyntaxTreeNode(tokens)
paragraph_inline... | "strong" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_type | assert | string_literal | 17 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_type():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
tree = SyntaxTreeNode(tokens)
# Root type is "root"
as... | "heading" | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_walk | assert | variable | 27 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_walk():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
tree = SyntaxTreeNode(tokens)
expected_node_types = (
... | expected_type | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_property_passthrough | assert | complex_expr | 16 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_property_passthrough():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
heading_open = tokens[0]
tree = SyntaxTree... | heading_node.tag | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_property_passthrough | assert | complex_expr | 17 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_property_passthrough():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
heading_open = tokens[0]
tree = SyntaxTree... | heading_node.map | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_property_passthrough | assert | complex_expr | 21 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_property_passthrough():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
heading_open = tokens[0]
tree = SyntaxTree... | heading_node.info | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_property_passthrough | assert | complex_expr | 22 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_property_passthrough():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
heading_open = tokens[0]
tree = SyntaxTree... | heading_node.meta | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_property_passthrough | assert | complex_expr | 18 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_property_passthrough():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
heading_open = tokens[0]
tree = SyntaxTree... | heading_node.level | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
executablebooks/markdown-it-py | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | train | train | tests/test_tree.py | test_tree_to_tokens_conversion | assert | variable | 14 | from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode
EXAMPLE_MARKDOWN = """
## Heading here
Some paragraph text and **emphasis here** and more text here.
"""
def test_tree_to_tokens_conversion():
tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
tokens_after_roundtrip = SyntaxTreeNode(t... | tokens_after_roundtrip | 22a65b358f05c16e900dfe1716708a4512ccf973 | 61 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/go-counting/go_counting_test.py | test_a_stone_and_not_a_territory_on_5x5_board | self.assertSetEqual | func_call | 17 | import unittest
from go_counting import (
Board,
WHITE,
BLACK,
NONE,
)
class GoCountingTest(unittest.TestCase):
def test_a_stone_and_not_a_territory_on_5x5_board(self):
board = Board([" B ", " B B ", "B W B", " W W ", " W "])
stone, territory = board.territory(x=1, y=1)
... | set()) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/robot-name/robot_name_test.py | test_different_robots_have_different_names | self.assertNotEqual | func_call | 12 | import unittest
import random
from robot_name import Robot
class RobotNameTest(unittest.TestCase):
name_re = r'^[A-Z]{2}\d{3}$'
def test_different_robots_have_different_names(self):
self | Robot().name) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/concept/cater-waiter/sets_test.py | test_separate_appetizers | self.assertEqual | func_call | 48 | import unittest
import pytest
from sets import (clean_ingredients,
check_drinks,
categorize_dish,
tag_special_ingredients,
compile_ingredients,
separate_appetizers,
singleton_ingredients)
from sets_categories_d... | sorted(result)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/concept/making-the-grade/loops_test.py | test_round_scores | self.assertEqual | func_call | 30 | import unittest
import pytest
from loops import (
round_scores,
count_failed_students,
above_threshold,
letter_grades,
student_ranking,
perfect_score)
class MakingTheGradeTest(unittest.TestCase):
@pytest.mark.task(taskno=1)
def test_round_scores(self):
data = [
([],... | sorted(result)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/rational-numbers/rational_numbers_test.py | test_add_two_positive_rational_numbers | self.assertEqual | func_call | 12 | from __future__ import division
import unittest
from rational_numbers import (
Rational,
)
class RationalNumbersTest(unittest.TestCase):
def test_add_two_positive_rational_numbers(self):
self.assertEqual(Rational(1, 2) + Rational(2, 3), | Rational(7, 6)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/rational-numbers/rational_numbers_test.py | test_add_a_rational_number_to_its_additive_inverse | self.assertEqual | func_call | 12 | from __future__ import division
import unittest
from rational_numbers import (
Rational,
)
class RationalNumbersTest(unittest.TestCase):
def test_add_a_rational_number_to_its_additive_inverse(self):
self.assertEqual(Rational(1, 2) + Rational(-1, 2), | Rational(0, 1)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/rational-numbers/rational_numbers_test.py | test_subtract_two_negative_rational_numbers | self.assertEqual | func_call | 12 | from __future__ import division
import unittest
from rational_numbers import (
Rational,
)
class RationalNumbersTest(unittest.TestCase):
def test_subtract_two_negative_rational_numbers(self):
self.assertEqual(Rational(-1, 2) - Rational(-2, 3), | Rational(1, 6)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/rational-numbers/rational_numbers_test.py | test_multiply_two_positive_rational_numbers | self.assertEqual | func_call | 12 | from __future__ import division
import unittest
from rational_numbers import (
Rational,
)
class RationalNumbersTest(unittest.TestCase):
def test_multiply_two_positive_rational_numbers(self):
self.assertEqual(Rational(1, 2) * Rational(2, 3), | Rational(1, 3)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/rational-numbers/rational_numbers_test.py | test_multiply_a_rational_number_by_its_reciprocal | self.assertEqual | func_call | 12 | from __future__ import division
import unittest
from rational_numbers import (
Rational,
)
class RationalNumbersTest(unittest.TestCase):
def test_multiply_a_rational_number_by_its_reciprocal(self):
self.assertEqual(Rational(1, 2) * Rational(2, 1), | Rational(1, 1)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/rational-numbers/rational_numbers_test.py | test_multiply_a_rational_number_by_1 | self.assertEqual | func_call | 12 | from __future__ import division
import unittest
from rational_numbers import (
Rational,
)
class RationalNumbersTest(unittest.TestCase):
def test_multiply_a_rational_number_by_1(self):
self.assertEqual(Rational(1, 2) * Rational(1, 1), | Rational(1, 2)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/rational-numbers/rational_numbers_test.py | test_divide_two_positive_rational_numbers | self.assertEqual | func_call | 12 | from __future__ import division
import unittest
from rational_numbers import (
Rational,
)
class RationalNumbersTest(unittest.TestCase):
def test_divide_two_positive_rational_numbers(self):
self.assertEqual(Rational(1, 2) / Rational(2, 3), | Rational(3, 4)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/meetup/meetup_test.py | test_first_monday_of_march_2013 | self.assertEqual | func_call | 13 | from datetime import date
import unittest
from meetup import (
meetup,
MeetupDayException,
)
class MeetupTest(unittest.TestCase):
def test_first_monday_of_march_2013(self):
self.assertEqual(meetup(2013, 3, "1st", "Monday"), | date(2013, 3, 4)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/meetup/meetup_test.py | test_first_monday_of_april_2013 | self.assertEqual | func_call | 13 | from datetime import date
import unittest
from meetup import (
meetup,
MeetupDayException,
)
class MeetupTest(unittest.TestCase):
def test_first_monday_of_april_2013(self):
self.assertEqual(meetup(2013, 4, "1st", "Monday"), | date(2013, 4, 1)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/meetup/meetup_test.py | test_first_tuesday_of_may_2013 | self.assertEqual | func_call | 13 | from datetime import date
import unittest
from meetup import (
meetup,
MeetupDayException,
)
class MeetupTest(unittest.TestCase):
def test_first_tuesday_of_may_2013(self):
self.assertEqual(meetup(2013, 5, "1st", "Tuesday"), | date(2013, 5, 7)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/meetup/meetup_test.py | test_first_tuesday_of_june_2013 | self.assertEqual | func_call | 13 | from datetime import date
import unittest
from meetup import (
meetup,
MeetupDayException,
)
class MeetupTest(unittest.TestCase):
def test_first_tuesday_of_june_2013(self):
self.assertEqual(meetup(2013, 6, "1st", "Tuesday"), | date(2013, 6, 4)) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/accumulate/accumulate_test.py | test_composition | self.assertEqual | variable | 10 | import unittest
from accumulate import accumulate
class AccumulateTest(unittest.TestCase):
def test_composition(self):
inp = [10, 17, 23]
self.assertEqual( | inp) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/accumulate/accumulate_test.py | test_recursive | self.assertEqual | variable | 11 | import unittest
from accumulate import accumulate
class AccumulateTest(unittest.TestCase):
def test_recursive(self):
inp = ['a', 'b', 'c']
out = [['a1', 'a2', 'a3'], ['b1', 'b2', 'b3'], ['c1', 'c2', 'c3']]
self.assertEqual( | out) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/custom-set/custom_set_test.py | test_nothing_is_contained_in_an_empty_set | self.assertNotIn | variable | 12 | import unittest
from custom_set import (
CustomSet,
)
class CustomSetTest(unittest.TestCase):
def test_nothing_is_contained_in_an_empty_set(self):
sut = CustomSet()
self.assertNotIn(1, | sut) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/dominoes/dominoes_test.py | assert_same_dominoes | self.assertEqual | variable | 20 | import unittest
from dominoes import (
can_chain,
)
class DominoesTest(unittest.TestCase):
def normalize_dominoes(self, dominoes):
return list(sorted(tuple(sorted(domino)) for domino in dominoes))
def assert_same_dominoes(self, input_dominoes, output_chain):
msg = (
"Dominoes... | msg) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/paasio/paasio_test.py | test_meteredsocket_context_manager_exception_raise | assert_* | variable | 23 | import errno
import os
import unittest
from unittest.mock import ANY, call, NonCallableMagicMock, patch
from test_utils import MockSock, MockFile, MockException, ZEN, SuperMock
from paasio import MeteredFile, MeteredSocket
class PaasioTest(unittest.TestCase):
def test_meteredsocket_context_manager_exception_rai... | ANY) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/strain/strain_test.py | test_empty_keep | self.assertEqual | variable | 11 | import unittest
from strain import keep, discard
class StrainTest(unittest.TestCase):
def test_empty_keep(self):
inp = [2, 4, 6, 8, 10]
out = []
self.assertEqual(keep(inp, lambda x: x % 2 == 1), | out) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/strain/strain_test.py | test_keep_everything | self.assertEqual | variable | 10 | import unittest
from strain import keep, discard
class StrainTest(unittest.TestCase):
def test_keep_everything(self):
inp = [2, 4, 6, 8, 10]
self.assertEqual(keep(inp, lambda x: x % 2 == 0), | inp) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/concept/guidos-gorgeous-lasagna/lasagna_test.py | test_preparation_time_in_minutes | self.assertEqual | variable | 15 | import unittest
import pytest
class LasagnaTest(unittest.TestCase):
@pytest.mark.task(taskno=3)
def test_preparation_time_in_minutes(self):
input_data = [1, 2, 5, 8, 11, 15]
result_data = [item * 2 for item in input_data]
for variant, (layers, time) in enumerate(zip(input_data, result... | time) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/custom-set/custom_set_test.py | test_empty_sets_are_equal | self.assertEqual | variable | 13 | import unittest
from custom_set import (
CustomSet,
)
class CustomSetTest(unittest.TestCase):
def test_empty_sets_are_equal(self):
set1 = CustomSet()
set2 = CustomSet()
self.assertEqual(set1, | set2) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/etl/etl_test.py | test_single_letter | self.assertEqual | variable | 12 | import unittest
from etl import (
transform,
)
class EtlTest(unittest.TestCase):
def test_single_letter(self):
legacy_data = {1: ["A"]}
data = {"a": 1}
self.assertEqual(transform(legacy_data), | data) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/go-counting/go_counting_test.py | test_open_corner_territory_on_5x5_board | self.assertEqual | variable | 16 | import unittest
from go_counting import (
Board,
WHITE,
BLACK,
NONE,
)
class GoCountingTest(unittest.TestCase):
def test_open_corner_territory_on_5x5_board(self):
board = Board([" B ", " B B ", "B W B", " W W ", " W "])
stone, territory = board.territory(x=1, y=4)
sel... | NONE) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/robot-simulator/robot_simulator_test.py | test_changes_north_to_east | self.assertEqual | variable | 19 | import unittest
from robot_simulator import (
Robot,
NORTH,
EAST,
SOUTH,
WEST,
)
class RobotSimulatorTest(unittest.TestCase):
def test_changes_north_to_east(self):
robot = Robot(NORTH, 0, 0)
robot.move("R")
self.assertEqual(robot.coordinates, (0, 0))
self.ass... | EAST) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/robot-simulator/robot_simulator_test.py | test_changes_south_to_west | self.assertEqual | variable | 19 | import unittest
from robot_simulator import (
Robot,
NORTH,
EAST,
SOUTH,
WEST,
)
class RobotSimulatorTest(unittest.TestCase):
def test_changes_south_to_west(self):
robot = Robot(SOUTH, 0, 0)
robot.move("R")
self.assertEqual(robot.coordinates, (0, 0))
self.ass... | WEST) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/tree-building/tree_building_test.py | test_empty_list_input | self.assertIsNone | variable | 11 | import unittest
from tree_building import Record, BuildTree
class TreeBuildingTest(unittest.TestCase):
def test_empty_list_input(self):
records = []
root = BuildTree(records)
self.assertIsNone( | root) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/go-counting/go_counting_test.py | test_black_corner_territory_on_5x5_board | self.assertEqual | variable | 15 | import unittest
from go_counting import (
Board,
WHITE,
BLACK,
NONE,
)
class GoCountingTest(unittest.TestCase):
def test_black_corner_territory_on_5x5_board(self):
board = Board([" B ", " B B ", "B W B", " W W ", " W "])
stone, territory = board.territory(x=0, y=1)
sel... | BLACK) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/go-counting/go_counting_test.py | test_white_center_territory_on_5x5_board | self.assertEqual | variable | 16 | import unittest
from go_counting import (
Board,
WHITE,
BLACK,
NONE,
)
class GoCountingTest(unittest.TestCase):
def test_white_center_territory_on_5x5_board(self):
board = Board([" B ", " B B ", "B W B", " W W ", " W "])
stone, territory = board.territory(x=2, y=3)
se... | WHITE) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/palindrome-products/palindrome_products_test.py | test_empty_result_for_smallest_if_no_palindrome_in_the_range | self.assertIsNone | variable | 13 | import unittest
from palindrome_products import (
largest,
smallest,
)
class PalindromeProductsTest(unittest.TestCase):
def test_empty_result_for_smallest_if_no_palindrome_in_the_range(self):
value, factors = smallest(min_factor=1002, max_factor=1003)
self.assertIsNone( | value) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/robot-name/robot_name_test.py | test_reset_name | self.assertNotEqual | variable | 28 | import unittest
import random
from robot_name import Robot
class RobotNameTest(unittest.TestCase):
name_re = r'^[A-Z]{2}\d{3}$'
def test_reset_name(self):
# Set a seed
seed = "Totally random."
# Initialize RNG using the seed
random.seed(seed)
# Call the generator
... | name2) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/robot-simulator/robot_simulator_test.py | test_at_origin_facing_north | self.assertEqual | variable | 18 | import unittest
from robot_simulator import (
Robot,
NORTH,
EAST,
SOUTH,
WEST,
)
class RobotSimulatorTest(unittest.TestCase):
def test_at_origin_facing_north(self):
robot = Robot(NORTH, 0, 0)
self.assertEqual(robot.coordinates, (0, 0))
self.assertEqual(robot.directio... | NORTH) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/robot-simulator/robot_simulator_test.py | test_at_negative_position_facing_south | self.assertEqual | variable | 18 | import unittest
from robot_simulator import (
Robot,
NORTH,
EAST,
SOUTH,
WEST,
)
class RobotSimulatorTest(unittest.TestCase):
def test_at_negative_position_facing_south(self):
robot = Robot(SOUTH, -1, -1)
self.assertEqual(robot.coordinates, (-1, -1))
self.assertEqual... | SOUTH) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/accumulate/accumulate_test.py | test_empty_sequence | self.assertEqual | collection | 8 | import unittest
from accumulate import accumulate
class AccumulateTest(unittest.TestCase):
def test_empty_sequence(self):
self.assertEqual(accumulate([], lambda x: x / 2), | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/allergies/allergies_test.py | test_no_allergies | self.assertEqual | collection | 11 | import unittest
from allergies import (
Allergies,
)
class AllergiesTest(unittest.TestCase):
def test_no_allergies(self):
self.assertEqual(Allergies(0).lst, | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/change/change_test.py | test_no_coins_make_0_change | self.assertEqual | collection | 11 | import unittest
from change import (
find_fewest_coins,
)
class ChangeTest(unittest.TestCase):
def test_no_coins_make_0_change(self):
self.assertEqual(find_fewest_coins([1, 5, 10, 21, 25], 0), | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/dot-dsl/dot_dsl_test.py | test_empty_graph | self.assertEqual | collection | 10 | import unittest
from dot_dsl import Graph, Node, Edge, NODE, EDGE, ATTR
class DotDslTest(unittest.TestCase):
def test_empty_graph(self):
g = Graph()
self.assertEqual(g.nodes, | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/dot-dsl/dot_dsl_test.py | test_empty_graph | self.assertEqual | collection | 12 | import unittest
from dot_dsl import Graph, Node, Edge, NODE, EDGE, ATTR
class DotDslTest(unittest.TestCase):
def test_empty_graph(self):
g = Graph()
self.assertEqual(g.nodes, [])
self.assertEqual(g.edges, [])
self.assertEqual(g.attrs, | {}) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/forth/forth_test.py | test_drop_removes_the_top_value_on_the_stack_if_it_is_the_only_one | self.assertEqual | collection | 12 | import unittest
from forth import (
evaluate,
StackUnderflowError,
)
class ForthTest(unittest.TestCase):
def test_drop_removes_the_top_value_on_the_stack_if_it_is_the_only_one(self):
self.assertEqual(evaluate(["1 drop"]), | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/list-ops/list_ops_test.py | test_append_empty_lists | self.assertEqual | collection | 17 | import unittest
from list_ops import (
append,
concat,
foldl,
foldr,
length,
reverse,
filter as list_ops_filter,
map as list_ops_map,
)
class ListOpsTest(unittest.TestCase):
def test_append_empty_lists(self):
self.assertEqual(append([], []), | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/minesweeper/minesweeper_test.py | test_no_rows | self.assertEqual | collection | 10 | import unittest
from minesweeper import (
annotate,
)
class MinesweeperTest(unittest.TestCase):
def test_no_rows(self):
self.assertEqual(annotate([]), | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/pascals-triangle/pascals_triangle_test.py | test_zero_rows | self.assertEqual | collection | 21 | import unittest
from pascals_triangle import rows
TRIANGLE = [
[1],
[1, 1],
[1, 2, 1],
[1, 3, 3, 1],
[1, 4, 6, 4, 1],
[1, 5, 10, 10, 5, 1],
[1, 6, 15, 20, 15, 6, 1],
[1, 7, 21, 35, 35, 21, 7, 1],
[1, 8, 28, 56, 70, 56, 28, 8, 1],
[1, 9, 36, 84, 126, 126, 84, 36, 9, 1]
]
class ... | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/prime-factors/prime_factors_test.py | test_no_factors | self.assertEqual | collection | 10 | import unittest
from prime_factors import (
factors,
)
class PrimeFactorsTest(unittest.TestCase):
def test_no_factors(self):
self.assertEqual(factors(1), | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/pythagorean-triplet/pythagorean_triplet_test.py | test_no_matching_triplets_for_1001 | self.assertCountEqual | collection | 11 | import unittest
from pythagorean_triplet import (
triplets_with_sum,
)
class PythagoreanTripletTest(unittest.TestCase):
def test_no_matching_triplets_for_1001(self):
self.assertCountEqual(triplets_with_sum(1001), | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/react/react_test.py | test_callbacks_only_fire_on_change | self.assertEqual | collection | 21 | import unittest
from functools import partial
from react import InputCell, ComputeCell
class ReactTest(unittest.TestCase):
def test_callbacks_only_fire_on_change(self):
input_ = InputCell(1)
output = ComputeCell(
[input_],
lambda inputs: 111 if inputs[0] < 3 else 222
... | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/secret-handshake/secret_handshake_test.py | test_reversing_no_actions_still_gives_no_actions | self.assertEqual | collection | 11 | import unittest
from secret_handshake import (
commands,
)
class SecretHandshakeTest(unittest.TestCase):
def test_reversing_no_actions_still_gives_no_actions(self):
self.assertEqual(commands("10000"), | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/sieve/sieve_test.py | test_no_primes_under_two | self.assertEqual | collection | 10 | import unittest
from sieve import (
primes,
)
class SieveTest(unittest.TestCase):
def test_no_primes_under_two(self):
self.assertEqual(primes(1), | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/simple-linked-list/simple_linked_list_test.py | test_empty_linked_list_to_list_is_empty | self.assertEqual | collection | 10 | import unittest
from simple_linked_list import LinkedList, EmptyListException
class SimpleLinkedListTest(unittest.TestCase):
def test_empty_linked_list_to_list_is_empty(self):
sut = LinkedList()
self.assertEqual(list(sut), | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/spiral-matrix/spiral_matrix_test.py | test_empty_spiral | self.assertEqual | collection | 10 | import unittest
from spiral_matrix import (
spiral_matrix,
)
class SpiralMatrixTest(unittest.TestCase):
def test_empty_spiral(self):
self.assertEqual(spiral_matrix(0), | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/strain/strain_test.py | test_empty_sequence | self.assertEqual | collection | 8 | import unittest
from strain import keep, discard
class StrainTest(unittest.TestCase):
def test_empty_sequence(self):
self.assertEqual(keep([], lambda x: x % 2 == 0), | []) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/all-your-base/all_your_base_test.py | test_single_bit_one_to_decimal | self.assertEqual | collection | 10 | import unittest
from all_your_base import (
rebase,
)
class AllYourBaseTest(unittest.TestCase):
def test_single_bit_one_to_decimal(self):
self.assertEqual(rebase(2, [1], 10), | [1]) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/all-your-base/all_your_base_test.py | test_binary_to_single_decimal | self.assertEqual | collection | 11 | import unittest
from all_your_base import (
rebase,
)
class AllYourBaseTest(unittest.TestCase):
def test_binary_to_single_decimal(self):
self.assertEqual(rebase(2, [1, 0, 1], 10), | [5]) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/all-your-base/all_your_base_test.py | test_empty_list | self.assertEqual | collection | 11 | import unittest
from all_your_base import (
rebase,
)
class AllYourBaseTest(unittest.TestCase):
def test_empty_list(self):
self.assertEqual(rebase(2, [], 10), | [0]) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/forth/forth_test.py | test_addition_can_add_two_numbers | self.assertEqual | collection | 12 | import unittest
from forth import (
evaluate,
StackUnderflowError,
)
class ForthTest(unittest.TestCase):
def test_addition_can_add_two_numbers(self):
self.assertEqual(evaluate(["1 2 +"]), | [3]) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/forth/forth_test.py | test_multiplication_can_multiply_two_numbers | self.assertEqual | collection | 12 | import unittest
from forth import (
evaluate,
StackUnderflowError,
)
class ForthTest(unittest.TestCase):
def test_multiplication_can_multiply_two_numbers(self):
self.assertEqual(evaluate(["2 4 *"]), | [8]) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
exercism/python | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | train | train | exercises/practice/forth/forth_test.py | test_division_can_divide_two_numbers | self.assertEqual | collection | 12 | import unittest
from forth import (
evaluate,
StackUnderflowError,
)
class ForthTest(unittest.TestCase):
def test_division_can_divide_two_numbers(self):
self.assertEqual(evaluate(["12 3 /"]), | [4]) | 3e40a4faed41663622954e0617b05590d1c1ce43 | 951 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.