Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
12
102
prompt
stringlengths
242
11.5M
relative_path
stringlengths
12
89
benedict.utils.type_util.is_json_serializable
You are a Python programmer. Here is all the context you may find useful to complete the function: Based on the information above, please complete the function: #CURRENT_FILE: python-benedict/benedict/utils/type_util.py import pathlib import re from datetime import datetime from decimal import Decimal def is_json_s...
python-benedict/benedict/utils/type_util.py
feedparser.urls.convert_to_idn
You are a Python programmer. Here is all the context you may find useful to complete the function: Based on the information above, please complete the function: #CURRENT_FILE: feedparser/feedparser/urls.py import re import urllib.parse from .html import _BaseHTMLProcessor def convert_to_idn(url): """Convert a U...
feedparser/feedparser/urls.py
mistune.toc.add_toc_hook
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE mistune/src/mistune/toc.py def render_toc_ul(toc): """Render a <ul> table of content HTML. The param "toc" should be formatted into this structure:: [ (level, id, text), ] F...
mistune/src/mistune/toc.py
mistune.plugins.table.table_in_quote
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE mistune/src/mistune/plugins/table.py 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_...
mistune/src/mistune/plugins/table.py
mistune.plugins.table.table_in_list
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE mistune/src/mistune/plugins/table.py def table_in_quote(md): """Enable table plugin in block quotes.""" md.block.insert_rule(md.block.block_quote_rules, 'table', before='paragraph') md.block.insert_rul...
mistune/src/mistune/plugins/table.py
xmnlp.utils.parallel_handler
You are a Python programmer. Here is all the context you may find useful to complete the function: Based on the information above, please complete the function: #CURRENT_FILE: xmnlp/xmnlp/utils/__init__.py import os import re import concurrent.futures as futures from functools import partial from typing import Any, ...
xmnlp/xmnlp/utils/__init__.py
parsel.utils.shorten
You are a Python programmer. Here is all the context you may find useful to complete the function: Based on the information above, please complete the function: #CURRENT_FILE: parsel/parsel/utils.py import re from typing import Any, Iterable, Iterator, List, Match, Pattern, Union, cast from w3lib.html import replace...
parsel/parsel/utils.py
parsel.xpathfuncs.set_xpathfunc
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE parsel/parsel/xpathfuncs.py def setup() -> None: set_xpathfunc("has-class", has_class) Based on the information above, please complete the function: #CURRENT_FILE: parsel/parsel/xpathfuncs.py import re from...
parsel/parsel/xpathfuncs.py
dominate.dom_tag._get_thread_context
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE dominate/dominate/dom_tag.py def attr(*args, **kwargs): ''' Set attributes on the current active tag context ''' c = get_current() dicts = args + (kwargs,) for d in dicts: for attr, value in d.item...
dominate/dominate/dom_tag.py
dominate.util.system
You are a Python programmer. Here is all the context you may find useful to complete the function: Based on the information above, please complete the function: #CURRENT_FILE: dominate/dominate/util.py import re from .dom_tag import dom_tag import subprocess def system(cmd, data=None): ''' pipes the output of a...
dominate/dominate/util.py
dominate.util.url_unescape
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE dominate/dominate/util.py def unescape(data): ''' unescapes html entities. the opposite of escape. ''' cc = re.compile(r'&(?:(?:#(\d+))|([^;]+));') result = [] m = cc.search(data) while m: resul...
dominate/dominate/util.py
rows.fields.DatetimeField.serialize
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE rows/rows/fields.py def fields(self): possible, skip = self._possible_types, self._skip if possible: # Create a header with placeholder values for each detected column # an...
rows/rows/fields.py
rows.fields.Field.serialize
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE rows/rows/fields.py def is_null(value): if value is None: return True elif type(value) is six.binary_type: value = value.strip().lower() return not value or value in NULL_BYTES ...
rows/rows/fields.py
rows.fields.EmailField.serialize
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE rows/rows/fields.py def unique_values(values): result = [] for value in values: if not is_null(value) and value not in result: result.append(value) return result # FILE rows/rows/f...
rows/rows/fields.py
rows.fields.as_string
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE rows/rows/fields.py def fields(self): possible, skip = self._possible_types, self._skip if possible: # Create a header with placeholder values for each detected column # an...
rows/rows/fields.py
rows.fields.get_items
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE rows/rows/fields.py def fields(self): possible, skip = self._possible_types, self._skip if possible: # Create a header with placeholder values for each detected column # an...
rows/rows/fields.py
pycorrector.proper_corrector.load_dict_file
You are a Python programmer. Here is all the context you may find useful to complete the function: Based on the information above, please complete the function: #CURRENT_FILE: pycorrector/pycorrector/proper_corrector.py import os from codecs import open import pypinyin from loguru import logger from pycorrector impo...
pycorrector/pycorrector/proper_corrector.py
natasha.span.envelop_spans
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE natasha/natasha/span.py def adapt_spans(spans): for span in spans: yield Span(span.start, span.stop, span.type) # FILE natasha/natasha/span.py class Span(Record): __attributes__ = ['start', 'stop'...
natasha/natasha/span.py
googleapiclient._helpers.parse_unique_urlencoded
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE google-api-python-client/googleapiclient/_helpers.py def _add_query_parameter(url, name, value): """Adds a query parameter to a url. Replaces the current value if it already exists in the URL. Args: ...
google-api-python-client/googleapiclient/_helpers.py
jinja2.async_utils.auto_aiter
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE Jinja2/src/jinja2/async_utils.py async def auto_to_list( value: "t.Union[t.AsyncIterable[V], t.Iterable[V]]", ) -> t.List["V"]: return [x async for x in auto_aiter(value)] # FILE Jinja2/src/jinja2/async_u...
Jinja2/src/jinja2/async_utils.py
jinja2.utils.consume
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE Jinja2/src/jinja2/utils.py class LRUCache: """A simple LRU Cache implementation.""" def __init__(self, capacity: int) -> None: self.capacity = capacity self._mapping: t.Dict[t.Any, t.Any] =...
Jinja2/src/jinja2/utils.py
pycorrector.utils.tokenizer.segment
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE pycorrector/pycorrector/utils/tokenizer.py def split_text_by_maxlen(text, maxlen=512): """ 文本切分为句子,以句子maxlen切分 :param text: str :param maxlen: int, 最大长度 :return: list, (sentence, idx) """ ...
pycorrector/pycorrector/utils/tokenizer.py
jinja2.utils.object_type_repr
You are a Python programmer. Here is all the context you may find useful to complete the function: # LIB typing_extensions.py def final(f): """This decorator can be used to indicate to type checkers that the decorated method cannot be overridden, and decorated class cannot be subclassed. For ex...
Jinja2/src/jinja2/utils.py
jinja2.utils.LRUCache.setdefault
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE Jinja2/src/jinja2/utils.py class Namespace: """A namespace object that can hold arbitrary attributes. It may be initialized from a dictionary or with keyword arguments.""" def __init__(*args: t.Any, *...
Jinja2/src/jinja2/utils.py
sumy.summarizers.sum_basic.SumBasicSummarizer._compute_word_freq
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE sumy/sumy/summarizers/_summarizer.py class AbstractSummarizer(object): def __init__(self, stemmer=null_stemmer): if not callable(stemmer): raise ValueError("Stemmer has to be a callable obj...
sumy/sumy/summarizers/sum_basic.py
sumy.summarizers.sum_basic.SumBasicSummarizer._compute_average_probability_of_words
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE sumy/sumy/summarizers/_summarizer.py class AbstractSummarizer(object): def __init__(self, stemmer=null_stemmer): if not callable(stemmer): raise ValueError("Stemmer has to be a callable obj...
sumy/sumy/summarizers/sum_basic.py
sumy.summarizers.lex_rank.LexRankSummarizer._compute_idf
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE sumy/sumy/summarizers/_summarizer.py class AbstractSummarizer(object): def __init__(self, stemmer=null_stemmer): if not callable(stemmer): raise ValueError("Stemmer has to be a callable obj...
sumy/sumy/summarizers/lex_rank.py
sumy.summarizers.lex_rank.LexRankSummarizer.cosine_similarity
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE sumy/sumy/summarizers/_summarizer.py class AbstractSummarizer(object): def __init__(self, stemmer=null_stemmer): if not callable(stemmer): raise ValueError("Stemmer has to be a callable obj...
sumy/sumy/summarizers/lex_rank.py
sumy.evaluation.rouge._get_ngrams
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE sumy/sumy/evaluation/rouge.py def rouge_n(evaluated_sentences, reference_sentences, n=2): """ Computes ROUGE-N of two text collections of sentences. Sourece: http://research.microsoft.com/en-us/um/peop...
sumy/sumy/evaluation/rouge.py
sumy.evaluation.rouge._split_into_words
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE sumy/sumy/evaluation/rouge.py def rouge_n(evaluated_sentences, reference_sentences, n=2): """ Computes ROUGE-N of two text collections of sentences. Sourece: http://research.microsoft.com/en-us/um/peop...
sumy/sumy/evaluation/rouge.py
falcon.inspect.register_router
You are a Python programmer. Here is all the context you may find useful to complete the function: # FILE falcon/falcon/inspect.py def to_string(self, verbose=False, internal=False) -> str: """Return a string representation of this class. Args: verbose (bool, optional): Adds more informati...
falcon/falcon/inspect.py
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
4