id int64 1 6.07M | name stringlengths 1 295 | code stringlengths 12 426k | language stringclasses 1
value | source_file stringlengths 5 202 | start_line int64 1 158k | end_line int64 1 158k | repo dict |
|---|---|---|---|---|---|---|---|
6,070,901 | setup | def setup(self, app: "Sphinx") -> None:
self._app = app # hold application object only for compatibility
self._env = app.env | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 55 | 57 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,902 | get_transforms | def get_transforms(self) -> List[Type[Transform]]:
transforms = super().get_transforms() + self.transforms
# remove transforms which is not needed for Sphinx
unused = [DanglingReferences]
for transform in unused:
if transform in transforms:
transforms.remove(... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 59 | 68 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,903 | new_document | def new_document(self) -> nodes.document:
"""
Creates a new document object which has a special reporter object good
for logging.
"""
document = super().new_document()
document.__class__ = addnodes.document # replace the class with patched version
# substitute t... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 70 | 86 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,904 | setup | def setup(self, app: "Sphinx") -> None:
self.transforms = self.transforms + app.registry.get_transforms()
super().setup(app) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 94 | 96 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,905 | read | def read(self, source: Input, parser: Parser, settings: Values) -> nodes.document:
self.source = source
if not self.parser:
self.parser = parser
self.settings = settings
self.input = self.read_source(settings.env)
self.parse()
return self.document | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 98 | 105 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,906 | read_source | def read_source(self, env: BuildEnvironment) -> str:
"""Read content from source and do post-process."""
content = self.source.read()
# emit "source-read" event
arg = [content]
env.events.emit('source-read', env.docname, arg)
return arg[0] | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 107 | 114 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,907 | setup | def setup(self, app: "Sphinx") -> None:
super().setup(app)
self.transforms = self.transforms + app.registry.get_transforms()
unused = [PreserveTranslatableMessages, Locale, RemoveTranslatableInline,
AutoIndexUpgrader, FigureAligner, SphinxDomains, DoctreeReadEvent,
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 126 | 135 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,908 | translate | def translate(self) -> None:
pass | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 143 | 144 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,909 | SphinxDummySourceClass | def SphinxDummySourceClass(source: Any, *args: Any, **kwargs: Any) -> Any:
"""Bypass source object as is to cheat Publisher."""
return source | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 147 | 149 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,910 | __init__ | def __init__(self, *args: Any, **kwargs: Any) -> None:
kwargs['error_handler'] = 'sphinx'
super().__init__(*args, **kwargs) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 154 | 156 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,911 | read_doc | def read_doc(app: "Sphinx", env: BuildEnvironment, filename: str) -> nodes.document:
"""Parse a document and convert to doctree."""
warnings.warn('sphinx.io.read_doc() is deprecated.',
RemovedInSphinx70Warning, stacklevel=2)
# set up error_handler for the target document
error_handler... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 159 | 188 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,912 | create_publisher | def create_publisher(app: "Sphinx", filetype: str) -> Publisher:
reader = SphinxStandaloneReader()
reader.setup(app)
parser = app.registry.create_source_parser(app, filetype)
if parser.__class__.__name__ == 'CommonMarkParser' and parser.settings_spec == ():
# a workaround for recommonmark
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 191 | 220 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,913 | set_id | def set_id(self, node: Element, msgnode: Optional[Element] = None,
suggested_prefix: str = '') -> str:
if docutils.__version_info__ >= (0, 16):
ret = super().set_id(node, msgnode, suggested_prefix) # type: ignore
else:
ret = super().set_id(node, msgnode)
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 30 | 43 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,914 | preserve_original_messages | def preserve_original_messages(self) -> None:
"""Preserve original translatable messages."""
raise NotImplementedError | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 60 | 62 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,915 | apply_translated_message | def apply_translated_message(self, original_message: str, translated_message: str) -> None:
"""Apply translated message."""
raise NotImplementedError | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 64 | 66 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,916 | extract_original_messages | def extract_original_messages(self) -> Sequence[str]:
"""Extract translation messages.
:returns: list of extracted messages or messages generator
"""
raise NotImplementedError | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 68 | 73 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,917 | preserve_original_messages | def preserve_original_messages(self) -> None:
# toctree entries
rawentries = self.setdefault('rawentries', [])
for title, _docname in self['entries']:
if title:
rawentries.append(title)
# :caption: option
if self.get('caption'):
self['rawc... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 84 | 93 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,918 | apply_translated_message | def apply_translated_message(self, original_message: str, translated_message: str) -> None:
# toctree entries
for i, (title, docname) in enumerate(self['entries']):
if title == original_message:
self['entries'][i] = (translated_message, docname)
# :caption: option
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 95 | 103 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,919 | extract_original_messages | def extract_original_messages(self) -> List[str]:
messages: List[str] = []
# toctree entries
messages.extend(self.get('rawentries', []))
# :caption: option
if 'rawcaption' in self:
messages.append(self['rawcaption'])
return messages | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 105 | 114 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,920 | __init__ | def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self['classes'].extend(self.classes) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 129 | 131 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,921 | child_text_separator | def child_text_separator(self):
if self.get('is_multiline'):
return ' '
else:
return super().child_text_separator | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 166 | 170 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,922 | __init__ | def __init__(self, domain: str, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self['classes'].append(domain) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 200 | 202 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,923 | astext | def astext(self) -> str:
return ' -> ' + super().astext() | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 244 | 245 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,924 | astext | def astext(self):
return '({})'.format(super().astext()) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 252 | 253 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,925 | astext | def astext(self) -> str:
return '[' + super().astext() + ']' | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 264 | 265 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,926 | __init__ | def __init__(self, rawsource: str = '', text: str = '',
*children: Element, **attributes: Any) -> None:
super().__init__(rawsource, text, *children, **attributes)
self['classes'].extend(self.classes) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 283 | 286 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,927 | __init__ | def __init__(self, rawsource: str = '', text: str = ' ',
*children: Element, **attributes: Any) -> None:
super().__init__(rawsource, text, *children, **attributes) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 296 | 298 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,928 | setup | def setup(app: "Sphinx") -> Dict[str, Any]:
app.add_node(toctree)
app.add_node(desc)
app.add_node(desc_signature)
app.add_node(desc_signature_line)
app.add_node(desc_content)
app.add_node(desc_inline)
app.add_node(desc_name)
app.add_node(desc_addname)
app.add_node(desc_type)
ap... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/addnodes.py | 528 | 578 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,929 | set_application | def set_application(self, app: "Sphinx") -> None:
"""set_application will be called from Sphinx to set app and other instance variables
:param sphinx.application.Sphinx app: Sphinx application object
"""
self._app = app
self.config = app.config
self.env = app.env | python | python-3.10.8.amd64/Lib/site-packages/sphinx/parsers.py | 36 | 43 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,930 | get_transforms | def get_transforms(self) -> List[Type[Transform]]:
"""
Sphinx's reST parser replaces a transform class for smart-quotes by its own
refs: sphinx.io.SphinxStandaloneReader
"""
transforms = super().get_transforms()
transforms.remove(SmartQuotes)
return transforms | python | python-3.10.8.amd64/Lib/site-packages/sphinx/parsers.py | 49 | 57 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,931 | parse | def parse(self, inputstring: Union[str, StringList], document: nodes.document) -> None:
"""Parse text and generate a document tree."""
self.setup_parse(inputstring, document) # type: ignore
self.statemachine = states.RSTStateMachine(
state_classes=self.state_classes,
ini... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/parsers.py | 59 | 79 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,932 | decorate | def decorate(self, content: StringList) -> None:
"""Preprocess reST content before parsing."""
prepend_prolog(content, self.config.rst_prolog)
append_epilog(content, self.config.rst_epilog) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/parsers.py | 81 | 84 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,933 | setup | def setup(app: "Sphinx") -> Dict[str, Any]:
app.add_source_parser(RSTParser)
return {
'version': 'builtin',
'parallel_read_safe': True,
'parallel_write_safe': True,
} | python | python-3.10.8.amd64/Lib/site-packages/sphinx/parsers.py | 87 | 94 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,934 | __init__ | def __init__(self, srcdir: str, confdir: Optional[str], outdir: str, doctreedir: str,
buildername: str, confoverrides: Optional[Dict] = None,
status: Optional[IO] = sys.stdout, warning: Optional[IO] = sys.stderr,
freshenv: bool = False, warningiserror: bool = False,
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 130 | 262 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,935 | _init_i18n | def _init_i18n(self) -> None:
"""Load translated strings from the configured localedirs if enabled in
the configuration.
"""
if self.config.language == 'en':
self.translator, has_translation = locale.init([], None)
else:
logger.info(bold(__('loading transl... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 264 | 290 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,936 | _init_env | def _init_env(self, freshenv: bool) -> BuildEnvironment:
filename = path.join(self.doctreedir, ENV_PICKLE_FILENAME)
if freshenv or not os.path.exists(filename):
return self._create_fresh_env()
else:
return self._load_existing_env(filename) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 292 | 297 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,937 | _create_fresh_env | def _create_fresh_env(self) -> BuildEnvironment:
env = BuildEnvironment(self)
self._fresh_env_used = True
return env | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 299 | 302 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,938 | _load_existing_env | def _load_existing_env(self, filename: str) -> BuildEnvironment:
try:
with progress_message(__('loading pickled environment')):
with open(filename, 'rb') as f:
env = pickle.load(f)
env.setup(self)
self._fresh_env_used = Fals... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 304 | 314 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,939 | _post_init_env | def _post_init_env(self) -> None:
if self._fresh_env_used:
self.env.find_files(self.config, self.builder)
del self._fresh_env_used | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 316 | 319 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,940 | preload_builder | def preload_builder(self, name: str) -> None:
self.registry.preload_builder(self, name) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 321 | 322 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,941 | create_builder | def create_builder(self, name: str) -> "Builder":
if name is None:
logger.info(__('No builder selected, using default: html'))
name = 'html'
return self.registry.create_builder(self, name, self.env) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 324 | 329 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,942 | _init_builder | def _init_builder(self) -> None:
if not hasattr(self.builder, "env"):
self.builder.set_environment(self.env)
self.builder.init()
self.events.emit('builder-inited') | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 331 | 335 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,943 | build | def build(self, force_all: bool = False, filenames: Optional[List[str]] = None) -> None:
self.phase = BuildPhase.READING
try:
if force_all:
self.builder.build_all()
elif filenames:
self.builder.build_specific(filenames)
else:
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 339 | 386 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,944 | setup_extension | def setup_extension(self, extname: str) -> None:
"""Import and setup a Sphinx extension module.
Load the extension given by the module *name*. Use this if your
extension needs the features provided by another extension. No-op if
called twice.
"""
logger.debug('[app] se... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 390 | 398 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,945 | require_sphinx | def require_sphinx(self, version: str) -> None:
"""Check the Sphinx version if requested.
Compare *version* with the version of the running Sphinx, and abort the
build when it is too old.
:param version: The required version in the form of ``major.minor``.
.. versionadded:: 1.... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 400 | 411 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,946 | connect | def connect(self, event: str, callback: Callable, priority: int = 500) -> int:
"""Register *callback* to be called when *event* is emitted.
For details on available core events and the arguments of callback
functions, please see :ref:`events`.
:param event: The name of target event
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 414 | 433 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,947 | disconnect | def disconnect(self, listener_id: int) -> None:
"""Unregister callback by *listener_id*.
:param listener_id: A listener_id that :meth:`connect` returns
"""
logger.debug('[app] disconnecting event: [id=%s]', listener_id)
self.events.disconnect(listener_id) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 435 | 441 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,948 | emit | def emit(self, event: str, *args: Any,
allowed_exceptions: Tuple[Type[Exception], ...] = ()) -> List:
"""Emit *event* and pass *arguments* to the callback functions.
Return the return values of all callbacks as a list. Do not emit core
Sphinx events in extensions!
:param ... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 443 | 458 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,949 | emit_firstresult | def emit_firstresult(self, event: str, *args: Any,
allowed_exceptions: Tuple[Type[Exception], ...] = ()) -> Any:
"""Emit *event* and pass *arguments* to the callback functions.
Return the result of the first callback that doesn't return ``None``.
:param event: The name... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 460 | 476 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,950 | add_builder | def add_builder(self, builder: Type["Builder"], override: bool = False) -> None:
"""Register a new builder.
:param builder: A builder class
:param override: If true, install the builder forcedly even if another builder
is already installed as the same name
.. v... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 480 | 490 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,951 | add_config_value | def add_config_value(self, name: str, default: Any, rebuild: Union[bool, str],
types: Any = ()) -> None:
"""Register a configuration value.
This is necessary for Sphinx to recognize new values and set default
values accordingly.
:param name: The name of the co... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 493 | 530 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,952 | add_event | def add_event(self, name: str) -> None:
"""Register an event called *name*.
This is needed to be able to emit it.
:param name: The name of the event
"""
logger.debug('[app] adding event: %r', name)
self.events.add(name) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 532 | 540 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,953 | set_translator | def set_translator(self, name: str, translator_class: Type[nodes.NodeVisitor],
override: bool = False) -> None:
"""Register or override a Docutils translator class.
This is used to register a custom output translator or to replace a
builtin translator. This allows extens... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 542 | 559 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,954 | add_node | def add_node(self, node: Type[Element], override: bool = False,
**kwargs: Tuple[Callable, Optional[Callable]]) -> None:
"""Register a Docutils node class.
This is necessary for Docutils internals. It may also be used in the
future to validate nodes in the parsed documents.
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 561 | 603 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,955 | add_enumerable_node | def add_enumerable_node(self, node: Type[Element], figtype: str,
title_getter: Optional[TitleGetter] = None, override: bool = False,
**kwargs: Tuple[Callable, Callable]) -> None:
"""Register a Docutils node class as a numfig target.
Sphinx numbers... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 605 | 632 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,956 | add_directive | def add_directive(self, name: str, cls: Type[Directive], override: bool = False) -> None:
"""Register a Docutils directive.
:param name: The name of the directive
:param cls: A directive class
:param override: If false, do not install it if another directive
is ... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 634 | 681 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,957 | add_role | def add_role(self, name: str, role: Any, override: bool = False) -> None:
"""Register a Docutils role.
:param name: The name of role
:param role: A role function
:param override: If false, do not install it if another role
is already installed as the same name
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 683 | 702 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,958 | add_generic_role | def add_generic_role(self, name: str, nodeclass: Any, override: bool = False) -> None:
"""Register a generic Docutils role.
Register a Docutils role that does nothing but wrap its contents in the
node given by *nodeclass*.
:param override: If false, do not install it if another role
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 704 | 725 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,959 | add_domain | def add_domain(self, domain: Type[Domain], override: bool = False) -> None:
"""Register a domain.
:param domain: A domain class
:param override: If false, do not install it if another domain
is already installed as the same name
If true, uncondi... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 727 | 739 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,960 | add_directive_to_domain | def add_directive_to_domain(self, domain: str, name: str,
cls: Type[Directive], override: bool = False) -> None:
"""Register a Docutils directive in a domain.
Like :meth:`add_directive`, but the directive is added to the domain
named *domain*.
:param dom... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 741 | 759 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,961 | add_role_to_domain | def add_role_to_domain(self, domain: str, name: str, role: Union[RoleFunction, XRefRole],
override: bool = False) -> None:
"""Register a Docutils role in a domain.
Like :meth:`add_role`, but the role is added to the domain named
*domain*.
:param domain: The n... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 761 | 779 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,962 | add_index_to_domain | def add_index_to_domain(self, domain: str, index: Type[Index], override: bool = False
) -> None:
"""Register a custom index for a domain.
Add a custom *index* class to the domain named *domain*.
:param domain: The name of the target domain
:param index: The ... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 781 | 797 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,963 | add_object_type | def add_object_type(self, directivename: str, rolename: str, indextemplate: str = '',
parse_node: Optional[Callable] = None,
ref_nodeclass: Optional[Type[TextElement]] = None,
objname: str = '', doc_field_types: List = [], override: bool = False
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 799 | 865 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,964 | add_crossref_type | def add_crossref_type(self, directivename: str, rolename: str, indextemplate: str = '',
ref_nodeclass: Optional[Type[TextElement]] = None, objname: str = '',
override: bool = False) -> None:
"""Register a new crossref object type.
This method is very ... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 867 | 906 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,965 | add_transform | def add_transform(self, transform: Type[Transform]) -> None:
"""Register a Docutils transform to be applied after parsing.
Add the standard docutils :class:`Transform` subclass *transform* to
the list of transforms that are applied after Sphinx parses a reST
document.
:param tr... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 908 | 941 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,966 | add_post_transform | def add_post_transform(self, transform: Type[Transform]) -> None:
"""Register a Docutils transform to be applied before writing.
Add the standard docutils :class:`Transform` subclass *transform* to
the list of transforms that are applied before Sphinx writes a
document.
:param ... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 943 | 952 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,967 | add_js_file | def add_js_file(self, filename: Optional[str], priority: int = 500,
loading_method: Optional[str] = None, **kwargs: Any) -> None:
"""Register a JavaScript file to include in the HTML output.
:param filename: The name of a JavaScript file that the default HTML
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 954 | 1,021 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,968 | add_css_file | def add_css_file(self, filename: str, priority: int = 500, **kwargs: Any) -> None:
"""Register a stylesheet to include in the HTML output.
:param filename: The name of a CSS file that the default HTML
template will include. It must be relative to the HTML
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,023 | 1,084 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,969 | add_stylesheet | def add_stylesheet(
self, filename: str, alternate: bool = False, title: Optional[str] = None
) -> None:
"""An alias of :meth:`add_css_file`.
.. deprecated:: 1.8
"""
logger.warning('The app.add_stylesheet() is deprecated. '
'Please use app.add_css_file... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,086 | 1,105 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,970 | add_latex_package | def add_latex_package(self, packagename: str, options: Optional[str] = None,
after_hyperref: bool = False) -> None:
r"""Register a package to include in the LaTeX source code.
Add *packagename* to the list of packages that LaTeX source code will
include. If you provid... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,107 | 1,128 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,971 | add_lexer | def add_lexer(self, alias: str, lexer: Type[Lexer]) -> None:
"""Register a new lexer for source code.
Use *lexer* to highlight code blocks with the given language *alias*.
.. versionadded:: 0.6
.. versionchanged:: 2.1
Take a lexer class as an argument. An instance of lexers... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,130 | 1,141 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,972 | add_autodocumenter | def add_autodocumenter(self, cls: Any, override: bool = False) -> None:
"""Register a new documenter class for the autodoc extension.
Add *cls* as a new documenter class for the :mod:`sphinx.ext.autodoc`
extension. It must be a subclass of
:class:`sphinx.ext.autodoc.Documenter`. This ... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,143 | 1,164 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,973 | add_autodoc_attrgetter | def add_autodoc_attrgetter(self, typ: Type, getter: Callable[[Any, str, Any], Any]
) -> None:
"""Register a new ``getattr``-like function for the autodoc extension.
Add *getter*, which must be a function with an interface compatible to
the :func:`getattr` builtin,... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,166 | 1,179 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,974 | add_search_language | def add_search_language(self, cls: Any) -> None:
"""Register a new language for the HTML search index.
Add *cls*, which must be a subclass of
:class:`sphinx.search.SearchLanguage`, as a support language for
building the HTML full-text search index. The class must have a *lang*
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,181 | 1,195 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,975 | add_source_suffix | def add_source_suffix(self, suffix: str, filetype: str, override: bool = False) -> None:
"""Register a suffix of source files.
Same as :confval:`source_suffix`. The users can override this
using the config setting.
:param override: If false, do not install it the same suffix
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,197 | 1,209 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,976 | add_source_parser | def add_source_parser(self, parser: Type[Parser], override: bool = False) -> None:
"""Register a parser class.
:param override: If false, do not install it if another parser
is already installed for the same suffix.
If true, unconditionally install the ... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,211 | 1,225 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,977 | add_env_collector | def add_env_collector(self, collector: Type[EnvironmentCollector]) -> None:
"""Register an environment collector class.
Refer to :ref:`collector-api`.
.. versionadded:: 1.6
"""
logger.debug('[app] adding environment collector: %r', collector)
collector().enable(self) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,227 | 1,235 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,978 | add_html_theme | def add_html_theme(self, name: str, theme_path: str) -> None:
"""Register a HTML Theme.
The *name* is a name of theme, and *theme_path* is a full path to the
theme (refs: :ref:`distribute-your-theme`).
.. versionadded:: 1.6
"""
logger.debug('[app] adding HTML theme: %r,... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,237 | 1,246 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,979 | add_html_math_renderer | def add_html_math_renderer(self, name: str,
inline_renderers: Tuple[Callable, Callable] = None,
block_renderers: Tuple[Callable, Callable] = None) -> None:
"""Register a math renderer for HTML.
The *name* is a name of math renderer. Both *i... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,248 | 1,262 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,980 | add_message_catalog | def add_message_catalog(self, catalog: str, locale_dir: str) -> None:
"""Register a message catalog.
:param catalog: The name of the catalog
:param locale_dir: The base path of the message catalog
For more details, see :func:`sphinx.locale.get_translation()`.
.. versionadded::... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,264 | 1,275 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,981 | is_parallel_allowed | def is_parallel_allowed(self, typ: str) -> bool:
"""Check whether parallel processing is allowed or not.
:param typ: A type of processing; ``'read'`` or ``'write'``.
"""
if typ == 'read':
attrname = 'parallel_read_safe'
message_not_declared = __("the %s extension... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,278 | 1,311 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,982 | set_html_assets_policy | def set_html_assets_policy(self, policy):
"""Set the policy to include assets in HTML pages.
- always: include the assets in all the pages
- per_page: include the assets only in pages where they are used
.. versionadded: 4.1
"""
if policy not in ('always', 'per_page'):
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,313 | 1,323 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,983 | html_themes | def html_themes(self) -> Dict[str, str]:
warnings.warn('app.html_themes is deprecated.',
RemovedInSphinx60Warning)
return self.registry.html_themes | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,326 | 1,329 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,984 | init | def init(
self,
builder: "Builder",
theme: Optional[Theme] = None,
dirs: Optional[List[str]] = None
) -> None:
"""Called by the builder to initialize the template system.
*builder* is the builder object; you'll probably want to look at the
value of ``builder.... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,338 | 1,352 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,985 | newest_template_mtime | def newest_template_mtime(self) -> float:
"""Called by the builder to determine if output files are outdated
because of template changes. Return the mtime of the newest template
file that was changed. The default implementation returns ``0``.
"""
return 0 | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,354 | 1,359 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,986 | render | def render(self, template: str, context: Dict) -> None:
"""Called by the builder to render a template given as a filename with
a specified context (a Python dictionary).
"""
raise NotImplementedError('must be implemented in subclasses') | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,361 | 1,365 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,987 | render_string | def render_string(self, template: str, context: Dict) -> str:
"""Called by the builder to render a template given as a string with a
specified context (a Python dictionary).
"""
raise NotImplementedError('must be implemented in subclasses') | python | python-3.10.8.amd64/Lib/site-packages/sphinx/application.py | 1,367 | 1,371 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,988 | __init__ | def __init__(self, name: str, module: Any, **kwargs: Any) -> None:
self.name = name
self.module = module
self.metadata = kwargs
self.version = kwargs.pop('version', 'unknown version')
# The extension supports parallel read or not. The default value
# is ``None``. It me... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/extension.py | 19 | 33 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,989 | verify_needs_extensions | def verify_needs_extensions(app: "Sphinx", config: Config) -> None:
"""Check that extensions mentioned in :confval:`needs_extensions` satisfy the version
requirement, and warn if an extension is not loaded.
Warns if an extension in :confval:`needs_extension` is not loaded.
:raises VersionRequirementEr... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/extension.py | 36 | 70 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,990 | setup | def setup(app: "Sphinx") -> Dict[str, Any]:
app.connect('config-inited', verify_needs_extensions, priority=800)
return {
'version': 'builtin',
'parallel_read_safe': True,
'parallel_write_safe': True,
} | python | python-3.10.8.amd64/Lib/site-packages/sphinx/extension.py | 73 | 80 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,991 | add_uids | def add_uids(doctree: Node, condition: Any) -> Iterator[Node]:
"""Add a unique id to every node in the `doctree` which matches the
condition and yield the nodes.
:param doctree:
A :class:`docutils.nodes.document` instance.
:param condition:
A callable which returns either ``True`` or `... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/versioning.py | 26 | 38 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,992 | merge_doctrees | def merge_doctrees(old: Node, new: Node, condition: Any) -> Iterator[Node]:
"""Merge the `old` doctree with the `new` one while looking at nodes
matching the `condition`.
Each node which replaces another one or has been added to the `new` doctree
will be yielded.
:param condition:
A callab... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/versioning.py | 41 | 105 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,993 | get_ratio | def get_ratio(old: str, new: str) -> float:
"""Return a "similarity ratio" (in percent) representing the similarity
between the two strings where 0 is equal and anything above less than equal.
"""
if not all([old, new]):
return VERSIONING_RATIO
if IS_SPEEDUP:
return Levenshtein.dist... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/versioning.py | 108 | 118 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,994 | levenshtein_distance | def levenshtein_distance(a: str, b: str) -> int:
"""Return the Levenshtein edit distance between two strings *a* and *b*."""
if a == b:
return 0
if len(a) < len(b):
a, b = b, a
if not a:
return len(b)
previous_row = list(range(len(b) + 1))
for i, column1 in enumerate(a):
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/versioning.py | 121 | 138 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,995 | apply | def apply(self, **kwargs: Any) -> None:
env = self.env
old_doctree = None
if not env.versioning_condition:
return
if env.versioning_compare:
# get old doctree
try:
filename = path.join(env.doctreedir, env.docname + '.doctree')
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/versioning.py | 145 | 164 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,996 | setup | def setup(app: "Sphinx") -> Dict[str, Any]:
app.add_transform(UIDTransform)
return {
'version': 'builtin',
'parallel_read_safe': True,
'parallel_write_safe': True,
} | python | python-3.10.8.amd64/Lib/site-packages/sphinx/versioning.py | 167 | 174 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,997 | __init__ | def __init__(
self, message: str, orig_exc: Optional[Exception] = None, modname: Optional[str] = None
) -> None:
super().__init__(message)
self.message = message
self.orig_exc = orig_exc
self.modname = modname | python | python-3.10.8.amd64/Lib/site-packages/sphinx/errors.py | 42 | 48 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,998 | category | def category(self) -> str: # type: ignore
if self.modname:
return 'Extension error (%s)' % self.modname
else:
return 'Extension error' | python | python-3.10.8.amd64/Lib/site-packages/sphinx/errors.py | 51 | 55 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,999 | __repr__ | def __repr__(self) -> str:
if self.orig_exc:
return '%s(%r, %r)' % (self.__class__.__name__,
self.message, self.orig_exc)
return '%s(%r)' % (self.__class__.__name__, self.message) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/errors.py | 57 | 61 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,071,000 | __str__ | def __str__(self) -> str:
parent_str = super().__str__()
if self.orig_exc:
return '%s (exception: %s)' % (parent_str, self.orig_exc)
return parent_str | python | python-3.10.8.amd64/Lib/site-packages/sphinx/errors.py | 63 | 67 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.