Dataset Viewer
Auto-converted to Parquet Duplicate
namespace
stringlengths
12
102
type
stringclasses
2 values
project_path
stringclasses
115 values
completion_path
stringlengths
20
110
signature_position
sequencelengths
2
2
body_position
sequencelengths
2
2
dependency
dict
requirement
dict
tests
sequencelengths
1
5
indent
int64
2
12
anchor_name
stringlengths
18
115
anchor_text
dict
dependencies
dict
import_statements
sequencelengths
0
140
target_function_prompt
stringlengths
15
74.4k
prompt
stringlengths
306
805k
dependency_context
stringlengths
56
1.93M
target_function_name
stringlengths
2
63
target_source
stringlengths
12
89
example
stringlengths
0
23.4k
top
listlengths
0
39
cross_file_context
stringlengths
34
804k
benedict.utils.type_util.is_json_serializable
function
Text-Processing/python-benedict
Text-Processing/python-benedict/benedict/utils/type_util.py
[ 53, 53 ]
[ 54, 55 ]
{ "cross_file": [], "intra_class": [], "intra_file": [] }
{ "Arguments": ":param val: Any. The input value to be checked for JSON serializability.\n:return: Bool. True if the input value is JSON serializable, False otherwise.", "Functionality": "Check if the input value is JSON serializable. It checks if the input value is of the JSON serializable types." }
[ "tests/utils/test_type_util.py::type_util_test_case::test_is_json_serializable" ]
4
is_json_serializable@python-benedict/benedict/utils/type_util.py
{ "description": "DOCSTRING", "file_path": "python-benedict/benedict/utils/type_util.py", "incoming_calls": [], "name": "is_json_serializable", "signature": "def is_json_serializable(val):\n" }
{ "negative": { "classes": [], "functions": [ { "code": "def is_bool(val):\n return isinstance(val, bool)", "description": "DOCSTRING", "file_path": "python-benedict/benedict/utils/type_util.py", "incoming_calls": [], "name": "is_bool@python-benedict/benedict/u...
[ "from datetime import datetime", "import re", "from decimal import Decimal", "import pathlib" ]
def is_json_serializable(val):
You are a Python programmer working with a repository. Here is all the context you may find useful to complete the function: #CURRENT FILE: python-benedict/benedict/utils/type_util.py from datetime import datetime import re from decimal import Decimal import pathlib def is_dict(val): return isinstance(val, dict) d...
{ "functions": [], "classes": [], "variable": [] }
is_json_serializable
python-benedict/benedict/utils/type_util.py
[ { "content": [ "def is_dict(val):\n return isinstance(val, dict)", "def is_string(val):\n return isinstance(val, str)", "def is_dict_or_list(val):\n return isinstance(val, (dict, list))", "def is_none(val):\n return val is None", "def is_list(val):\n return isinstanc...
#CURRENT FILE: python-benedict/benedict/utils/type_util.py from datetime import datetime import re from decimal import Decimal import pathlib def is_dict(val): return isinstance(val, dict) def is_string(val): return isinstance(val, str) def is_dict_or_list(val): return isinstance(val, (dict, list)) def is_...
feedparser.urls.convert_to_idn
function
Text-Processing/feedparser
Text-Processing/feedparser/feedparser/urls.py
[ 61, 61 ]
[ 66, 83 ]
{ "cross_file": [], "intra_class": [], "intra_file": [] }
{ "Arguments": ":param url: String. The URL to be converted to IDN notation.\n:return: String. The URL in IDN notation.", "Functionality": "Convert a URL to IDN notation. It checks if the host can be encoded in ASCII. If not, it converts the host to IDN form." }
[ "tests/runtests.py::TestConvertToIdn::test_port", "tests/runtests.py::TestConvertToIdn::test_idn", "tests/runtests.py::TestConvertToIdn::test_control" ]
4
convert_to_idn@feedparser/feedparser/urls.py
{ "description": "Convert a URL to IDN notation", "file_path": "feedparser/feedparser/urls.py", "incoming_calls": [ "get@feedparser/feedparser/http.py" ], "name": "convert_to_idn", "signature": "def convert_to_idn(url):\n" }
{ "negative": { "classes": [ { "base_classes": [ "_BaseHTMLProcessor" ], "code": "class RelativeURIResolver(_BaseHTMLProcessor):\n relative_uris = {\n ('a', 'href'),\n ('applet', 'codebase'),\n ('area', 'href'),\n ('audio', 'src'),\n ('...
[ "from .html import _BaseHTMLProcessor", "import re", "import urllib.parse" ]
def convert_to_idn(url): """Convert a URL to IDN notation"""
You are a Python programmer working with a repository. Here is all the context you may find useful to complete the function: #CURRENT FILE: feedparser/feedparser/urls.py from .html import _BaseHTMLProcessor import re import urllib.parse def _urljoin(base, uri): uri = _urifixer.sub(r'\1\3', uri) try: ur...
{ "functions": [], "classes": [], "variable": [] }
convert_to_idn
feedparser/feedparser/urls.py
def get(url, etag=None, modified=None, agent=None, referrer=None, handlers=None, request_headers=None, result=None): if handlers is None: handlers = [] elif not isinstance(handlers, list): handlers = [handlers] if request_headers is None: request_headers = {} # Deal with the fee...
[ { "content": [ "def _urljoin(base, uri):\n uri = _urifixer.sub(r'\\1\\3', uri)\n try:\n uri = urllib.parse.urljoin(base, uri)\n except ValueError:\n uri = ''\n return uri", "def resolve_relative_uris(html_source, base_uri, encoding, type_):\n p = RelativeURIResolver(base...
#CURRENT FILE: feedparser/feedparser/urls.py from .html import _BaseHTMLProcessor import re import urllib.parse def _urljoin(base, uri): uri = _urifixer.sub(r'\1\3', uri) try: uri = urllib.parse.urljoin(base, uri) except ValueError: uri = '' return uri def resolve_relative_uris(html_sou...
mistune.toc.add_toc_hook
function
Text-Processing/mistune
Text-Processing/mistune/src/mistune/toc.py
[ 4, 4 ]
[ 23, 44 ]
{ "cross_file": [], "intra_class": [], "intra_file": [] }
{ "Arguments": ":param md: Markdown instance. The instance of the Markdown class.\n:param min_level: Integer. The minimum heading level to include in the TOC.\n:param max_level: Integer. The maximum heading level to include in the TOC.\n:param heading_id: Function. A function to generate heading_id.\n:return: No retu...
[ "tests/test_hooks.py::TestTocHook::test_customize_heading_id_func" ]
4
add_toc_hook@mistune/src/mistune/toc.py
{ "description": "Add a hook to save toc items into ``state.env``. This is\nusually helpful for doc generator::\n\n import mistune\n from mistune.toc import add_toc_hook, render_toc_ul\n\n md = mistune.create_markdown(...)\n add_toc_hook(md)\n\n html, state = md.parse(text)\n toc_items = state.env['...
{ "negative": { "classes": [], "functions": [ { "code": "def toc_hook(md, state):\n headings = []\n\n for tok in state.tokens:\n if tok['type'] == 'heading':\n level = tok['attrs']['level']\n if min_level <= level <= max_level:\n ...
[ "from .util import striptags" ]
def add_toc_hook(md, min_level=1, max_level=3, heading_id=None): """Add a hook to save toc items into ``state.env``. This is usually helpful for doc generator:: import mistune from mistune.toc import add_toc_hook, render_toc_ul md = mistune.create_markdown(...) add_toc_hook(md)...
You are a Python programmer working with a repository. Here is all the context you may find useful to complete the function: #CURRENT FILE: mistune/src/mistune/toc.py from .util import striptags def toc_hook(md, state): headings = [] for tok in state.tokens: if tok['type'] == 'heading': ...
{ "functions": [ { "name": "normalize_toc_item@mistune/src/mistune/toc.py", "description": "DOCSTRING", "code": "def normalize_toc_item(md, token):\n text = token['text']\n tokens = md.inline(text, {})\n html = md.renderer(tokens, {})\n text = striptags(html)\n attrs = token['attr...
add_toc_hook
mistune/src/mistune/toc.py
def toc_hook(md, state): headings = [] for tok in state.tokens: if tok['type'] == 'heading': level = tok['attrs']['level'] if min_level <= level <= max_level: headings.append(tok) toc_items = [] for i, tok in enumerate(hea...
[ { "content": [ "def toc_hook(md, state):\n headings = []\n\n for tok in state.tokens:\n if tok['type'] == 'heading':\n level = tok['attrs']['level']\n if min_level <= level <= max_level:\n headings.append(tok)\n\n toc_items =...
#CURRENT FILE: mistune/src/mistune/toc.py from .util import striptags def toc_hook(md, state): headings = [] for tok in state.tokens: if tok['type'] == 'heading': level = tok['attrs']['level'] if min_level <= level <= max_level: headings....
mistune.plugins.table.table_in_quote
function
Text-Processing/mistune
Text-Processing/mistune/src/mistune/plugins/table.py
[ 170, 170 ]
[ 172, 173 ]
{ "cross_file": [], "intra_class": [], "intra_file": [] }
{ "Arguments": ":param md: Markdown. The Markdown instance.\n:return: No return values.", "Functionality": "This function enables the table plugin in block quotes by inserting rules for table and nptable before the paragraph in the block quote rules." }
[ "tests/test_plugins.py::TestExtraPlugins::test_table_in_quote" ]
4
table_in_quote@mistune/src/mistune/plugins/table.py
{ "description": "Enable table plugin in block quotes.", "file_path": "mistune/src/mistune/plugins/table.py", "incoming_calls": [], "name": "table_in_quote", "signature": "def table_in_quote(md):\n" }
{ "negative": { "classes": [], "functions": [ { "code": "def _process_row(text, aligns):\n cells = CELL_SPLIT.split(text)\n if len(cells) != len(aligns):\n return None\n\n children = [\n {\n 'type': 'table_cell',\n 'text': text.strip(),\n '...
[ "from ..helpers import PREVENT_BACKSLASH", "import re" ]
def table_in_quote(md): """Enable table plugin in block quotes."""
You are a Python programmer working with a repository. Here is all the context you may find useful to complete the function: #CURRENT FILE: mistune/src/mistune/plugins/table.py from ..helpers import PREVENT_BACKSLASH import re def table_in_list(md): """Enable table plugin in list.""" md.block.insert_rule(md.bl...
{ "functions": [], "classes": [], "variable": [] }
table_in_quote
mistune/src/mistune/plugins/table.py
[ { "content": [ "def table_in_list(md):\n \"\"\"Enable table plugin in list.\"\"\"\n md.block.insert_rule(md.block.list_rules, 'table', before='paragraph')\n md.block.insert_rule(md.block.list_rules, 'nptable', before='paragraph')", "__all__ = ['table', 'table_in_quote', 'table_in_list']", ...
#CURRENT FILE: mistune/src/mistune/plugins/table.py from ..helpers import PREVENT_BACKSLASH import re def table_in_list(md): """Enable table plugin in list.""" md.block.insert_rule(md.block.list_rules, 'table', before='paragraph') md.block.insert_rule(md.block.list_rules, 'nptable', before='paragraph') __a...
mistune.plugins.table.table_in_list
function
Text-Processing/mistune
Text-Processing/mistune/src/mistune/plugins/table.py
[ 176, 176 ]
[ 178, 179 ]
{ "cross_file": [], "intra_class": [], "intra_file": [] }
{"Arguments":":param md: Markdown. The Markdown instance to enable the table plugin in the list.\n:r(...TRUNCATED)
[ "tests/test_plugins.py::TestExtraPlugins::test_table_in_list" ]
4
table_in_list@mistune/src/mistune/plugins/table.py
{"description":"Enable table plugin in list.","file_path":"mistune/src/mistune/plugins/table.py","in(...TRUNCATED)
{"negative":{"classes":[],"functions":[{"code":"def _process_row(text, aligns):\n cells = CELL_SP(...TRUNCATED)
[ "from ..helpers import PREVENT_BACKSLASH", "import re" ]
def table_in_list(md): """Enable table plugin in list."""
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
{ "functions": [], "classes": [], "variable": [] }
table_in_list
mistune/src/mistune/plugins/table.py
[{"content":["def table_in_quote(md):\n \"\"\"Enable table plugin in block quotes.\"\"\"\n md.(...TRUNCATED)
"#CURRENT FILE: mistune/src/mistune/plugins/table.py\nfrom ..helpers import PREVENT_BACKSLASH\nimpor(...TRUNCATED)
xmnlp.utils.parallel_handler
function
Text-Processing/xmnlp
Text-Processing/xmnlp/xmnlp/utils/__init__.py
[ 90, 92 ]
[ 101, 107 ]
{ "cross_file": [], "intra_class": [], "intra_file": [] }
{"Arguments":":param callback: Callable. The callback function to be applied to the list of texts.\n(...TRUNCATED)
[ "tests/test_xmnlp.py::test_radical_parallel", "tests/test_xmnlp.py::test_pinyin_parallel" ]
4
parallel_handler@xmnlp/xmnlp/utils/__init__.py
{"description":"parallel handler\nArgs:\n callback: callback function\n texts: List[str]\n n_jobs(...TRUNCATED)
{"negative":{"classes":[],"functions":[{"code":"def filelist(path: str) -> Generator[str, None, None(...TRUNCATED)
["from typing import Any","from typing import Callable","from typing import Generator","from typing (...TRUNCATED)
"def parallel_handler(callback: Callable, texts: List[str], n_jobs: int = 2, **kwargs) -> Generator[(...TRUNCATED)
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
"{\n \"functions\": [],\n \"classes\": [\n {\n \"name\": \"List@PyLaTeX/pylatex/lists.py\"(...TRUNCATED)
parallel_handler
xmnlp/xmnlp/utils/__init__.py
[{"content":["def split_text(doc: str) -> List[str]:\n sents = []\n for line in re_line_skip.s(...TRUNCATED)
"#FILE PyLaTeX/pylatex/lists.py\nclass List(Environment):\n \"\"\"A base class that represents a (...TRUNCATED)
parsel.utils.shorten
function
Text-Processing/parsel
Text-Processing/parsel/parsel/utils.py
[ 87, 87 ]
[ 89, 95 ]
{ "cross_file": [], "intra_class": [], "intra_file": [] }
{"Arguments":":param text: String. The input text to be shortened.\n:param width: Integer. The width(...TRUNCATED)
[ "tests/test_utils.py::test_shorten" ]
4
shorten@parsel/parsel/utils.py
{"description":"Truncate the given text to fit in the given width.","file_path":"parsel/parsel/utils(...TRUNCATED)
{"negative":{"classes":[{"base_classes":["Environment"],"code":"class List(Environment):\n \"\"\"(...TRUNCATED)
["from typing import Any","from typing import Iterable","from typing import Iterator","from typing i(...TRUNCATED)
"def shorten(text: str, width: int, suffix: str = \"...\") -> str:\n \"\"\"Truncate the given tex(...TRUNCATED)
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
{ "functions": [], "classes": [], "variable": [] }
shorten
parsel/parsel/utils.py
"def __str__(self) -> str:\n data = repr(shorten(self.get(), width=40))\n return f\"<{(...TRUNCATED)
[{"content":["def flatten(x: Iterable[Any]) -> List[Any]:\n \"\"\"flatten(sequence) -> list\n (...TRUNCATED)
"#CURRENT FILE: parsel/parsel/utils.py\nfrom typing import Any\nfrom typing import Iterable\nfrom ty(...TRUNCATED)
parsel.xpathfuncs.set_xpathfunc
function
Text-Processing/parsel
Text-Processing/parsel/parsel/xpathfuncs.py
[ 13, 13 ]
[ 27, 31 ]
{ "cross_file": [], "intra_class": [], "intra_file": [] }
{"Arguments":":param fname: String. The identifier under which the function will be registered.\n:pa(...TRUNCATED)
[ "tests/test_xpathfuncs.py::XPathFuncsTestCase::test_set_xpathfunc" ]
4
set_xpathfunc@parsel/parsel/xpathfuncs.py
{"description":"Register a custom extension function to use in XPath expressions.\n\nThe function ``(...TRUNCATED)
{"negative":{"classes":[],"functions":[{"code":"def has_class(context: Any, *classes: str) -> bool:\(...TRUNCATED)
["from typing import Any","from typing import Callable","from typing import Optional","import re","f(...TRUNCATED)
"def set_xpathfunc(fname: str, func: Optional[Callable]) -> None: # type: ignore[type-arg]\n \"\(...TRUNCATED)
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
{ "functions": [], "classes": [], "variable": [] }
set_xpathfunc
parsel/parsel/xpathfuncs.py
def setup() -> None: set_xpathfunc("has-class", has_class)
[{"content":["def has_class(context: Any, *classes: str) -> bool:\n \"\"\"has-class function.\n\n(...TRUNCATED)
"#CURRENT FILE: parsel/parsel/xpathfuncs.py\nfrom typing import Any\nfrom typing import Callable\nfr(...TRUNCATED)
dominate.dom_tag._get_thread_context
function
Text-Processing/dominate
Text-Processing/dominate/dominate/dom_tag.py
[ 47, 47 ]
[ 48, 51 ]
{ "cross_file": [], "intra_class": [], "intra_file": [] }
{"Arguments":":param: No input parameters.\n:return: Integer. The hash value of the current thread c(...TRUNCATED)
[ "tests/test_dom_tag.py::test___get_thread_context" ]
2
_get_thread_context@dominate/dominate/dom_tag.py
{"description":"DOCSTRING","file_path":"dominate/dominate/dom_tag.py","incoming_calls":["get_current(...TRUNCATED)
{"negative":{"classes":[{"base_classes":["dom_tag"],"code":"class container(dom_tag):\n '''\n Cont(...TRUNCATED)
["from . import util","from collections import defaultdict","from collections import namedtuple","fr(...TRUNCATED)
def _get_thread_context():
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
{ "functions": [], "classes": [], "variable": [] }
_get_thread_context
dominate/dominate/dom_tag.py
"def get_current(default=_get_current_none):\n '''\n get the current tag being used as a with cont(...TRUNCATED)
[]
"#CURRENT FILE: dominate/dominate/dom_tag.py\nfrom . import util\nfrom collections import defaultdic(...TRUNCATED)
dominate.util.system
function
Text-Processing/dominate
Text-Processing/dominate/dominate/util.py
[ 45, 45 ]
[ 49, 52 ]
{ "cross_file": [], "intra_class": [], "intra_file": [] }
{"Arguments":":param cmd: String. The system command to be executed.\n:param data: Bytes. Optional i(...TRUNCATED)
[ "tests/test_utils.py::test_system" ]
2
system@dominate/dominate/util.py
{"description":"pipes the output of a program","file_path":"dominate/dominate/util.py","incoming_cal(...TRUNCATED)
{"negative":{"classes":[{"base_classes":["dom_tag"],"code":"class container(dom_tag):\n '''\n Cont(...TRUNCATED)
[ "from .dom_tag import dom_tag", "import re" ]
def system(cmd, data=None): ''' pipes the output of a program '''
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
{ "functions": [], "classes": [], "variable": [] }
system
dominate/dominate/util.py
"def test_system():\n d = div()\n d += util.system('echo Hello World')\n assert d.render().replac(...TRUNCATED)
[{"content":["def escape(data, quote=True): # stolen from std lib cgi\n '''\n Escapes special cha(...TRUNCATED)
"#CURRENT FILE: dominate/dominate/util.py\nfrom .dom_tag import dom_tag\nimport re\n\ndef escape(dat(...TRUNCATED)
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
23