1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648
|
[inline]
instring='''"""This is a docstring with a link.
Here is an elaborate description containing a link.
`Area Under the Receiver Operating Characteristic Curve (ROC AUC)
<https://en.wikipedia.org/wiki/Receiver_operating_characteristic#Further_interpretations>`_.
"""'''
outstring='''"""This is a docstring with a link.
Here is an elaborate description containing a link. `Area Under the
Receiver Operating Characteristic Curve (ROC AUC)
<https://en.wikipedia.org/wiki/Receiver_operating_characteristic#Further_interpretations>`_.
"""'''
[inline.short]
instring='''"""This is yanf with a short link.
See `the link <https://www.link.com>`_ for more details.
"""'''
outstring='''"""This is yanf with a short link.
See `the link <https://www.link.com>`_ for more details.
"""'''
[inline.long]
instring='''"""Helpful docstring.
A larger description that starts here. https://github.com/apache/kafka/blob/2.5/clients/src/main/java/org/apache/kafka/common/requests/DescribeConfigsResponse.java
A larger description that ends here.
"""'''
outstring='''"""Helpful docstring.
A larger description that starts here.
https://github.com/apache/kafka/blob/2.5/clients/src/main/java/org/apache/kafka/common/requests/DescribeConfigsResponse.java
A larger description that ends here.
"""'''
[only.link]
instring='''"""
`Source of this snippet
<https://www.freecodecamp.org/news/how-to-flatten-a-dictionary-in-python-in-4-different-ways/>`_.
"""'''
outstring='''"""
`Source of this snippet
<https://www.freecodecamp.org/news/how-to-flatten-a-dictionary-in-python-in-4-different-ways/>`_.
"""'''
[issue_75]
instring='''"""This is another docstring with `a link`_.
.. a link: http://www.reliqual.com/wiki/how_to_use_ramstk/verification_and_validation_module/index.html.
"""'''
outstring='''"""This is another docstring with `a link`_.
.. a link: http://www.reliqual.com/wiki/how_to_use_ramstk/verification_and_validation_module/index.html.
"""'''
[issue_75_2]
instring='''"""This is another docstring with a link.
See http://www.reliqual.com/wiki/how_to_use_ramstk/verification_and_validation_module/index.html for additional information.
"""'''
outstring='''"""This is another docstring with a link.
See
http://www.reliqual.com/wiki/how_to_use_ramstk/verification_and_validation_module/index.html
for additional information.
"""'''
[issue_75_3]
instring='''"""This is yanf with a short link.
See http://www.reliaqual.com for examples.
"""'''
outstring='''"""This is yanf with a short link.
See http://www.reliaqual.com for examples.
"""'''
[issue_140]
instring='''"""This is a docstring with a link that causes a wrap.
See `the link <https://www.link.com/a/long/link/that/causes/line/break>`_ for more details.
"""'''
outstring='''"""This is a docstring with a link that causes a wrap.
See
`the link <https://www.link.com/a/long/link/that/causes/line/break>`_
for more details.
"""'''
[issue_140_2]
instring='''"""Helpful docstring.
A larger description that starts here.
https://github.com/apache/kafka/blob/2.5/clients/src/main/java/org/apache/kafka/common/requests/DescribeConfigsResponse.java
A larger description that ends here.
"""'''
outstring='''"""Helpful docstring.
A larger description that starts here.
https://github.com/apache/kafka/blob/2.5/clients/src/main/java/org/apache/kafka/common/requests/DescribeConfigsResponse.java
A larger description that ends here.
"""'''
[issue_140_3]
instring='''"""Do something.
See https://www.postgresql.org/docs/current/static/role-removal.html
"""'''
outstring='''"""Do something.
See
https://www.postgresql.org/docs/current/static/role-removal.html
"""'''
[issue_145]
instring='''"""<Short decription>
.. _linspace API: https://numpy.org/doc/stable/reference/generated/numpy.linspace.html
.. _arange API: https://numpy.org/doc/stable/reference/generated/numpy.arange.html
.. _logspace API: https://numpy.org/doc/stable/reference/generated/numpy.logspace.html
"""'''
outstring='''"""<Short decription>
.. _linspace API: https://numpy.org/doc/stable/reference/generated/numpy.linspace.html
.. _arange API: https://numpy.org/doc/stable/reference/generated/numpy.arange.html
.. _logspace API: https://numpy.org/doc/stable/reference/generated/numpy.logspace.html
"""'''
[issue_150]
instring='''"""
Translates incoming json to a processable Entity.
Stackoverflow reference: <https://stackoverflow.com/questions/69617489/can-i-get-incoming-extra-fields-from-pydantic>
"""'''
outstring='''"""Translates incoming json to a processable Entity.
Stackoverflow reference: <https://stackoverflow.com/questions/69617489/can-i-get-incoming-extra-fields-from-pydantic>
"""'''
[issue_157]
instring='''"""Get the Python type of a Click parameter.
See the list of `custom types provided by Click
<https://click.palletsprojects.com/en/8.1.x/api/?highlight=intrange#types>`_.
"""'''
outstring='''"""Get the Python type of a Click parameter.
See the list of
`custom types provided by Click <https://click.palletsprojects.com/en/8.1.x/api/?highlight=intrange#types>`_.
"""'''
[issue_157_2]
instring='''"""Fetch parameters values from configuration file and merge them with the
defaults.
User configuration is `merged to the context default_map as Click does
<https://click.palletsprojects.com/en/8.1.x/commands/#context-defaults>`_.
This allow user's config to only overrides defaults. Values sets from direct
command line parameters, environment variables or interactive prompts, takes
precedence over any values from the config file.
"""'''
outstring='''"""Fetch parameters values from configuration file and merge them with the
defaults.
User configuration is
`merged to the context default_map as Click does <https://click.palletsprojects.com/en/8.1.x/commands/#context-defaults>`_.
This allow user's config to only overrides defaults. Values sets from direct
command line parameters, environment variables or interactive prompts, takes
precedence over any values from the config file.
"""'''
[issue_157_3]
instring='''"""Introspects current CLI and list its parameters and metadata.
.. important::
Click doesn't keep a list of all parsed arguments and their origin.
So we need to emulate here what's happening during CLI invokation.
But can't even to that because the raw, pre-parsed arguments are
not available anywhere.
"""'''
outstring='''"""Introspects current CLI and list its parameters and metadata.
.. important::
Click doesn't keep a list of all parsed arguments and their origin.
So we need to emulate here what's happening during CLI invokation.
But can't even to that because the raw, pre-parsed arguments are
not available anywhere.
"""'''
[issue_157_4]
instring='''"""Search on local file system or remote URL files matching the provided pattern.
``pattern`` is considered as an URL only if it is parseable as such
and starts with ``http://`` or ``https://``.
.. important::
This is a straight `copy of the functools.cache implementation
<https://github.com/python/cpython/blob/55a26de6ba938962dc23f2495723cf0f4f3ab7c6/Lib/functools.py#L647-L653>`_,
which is only `available in the standard library starting with Python v3.9
<https://docs.python.org/3/library/functools.html?highlight=caching#functools.cache>`.
"""'''
outstring='''"""Search on local file system or remote URL files matching the provided
pattern.
``pattern`` is considered as an URL only if it is parseable as such
and starts with ``http://`` or ``https://``.
.. important::
This is a straight `copy of the functools.cache implementation
<https://github.com/python/cpython/blob/55a26de6ba938962dc23f2495723cf0f4f3ab7c6/Lib/functools.py#L647-L653>`_,
which is only `available in the standard library starting with Python v3.9
<https://docs.python.org/3/library/functools.html?highlight=caching#functools.cache>`.
"""'''
[issue_157_5]
instring='''"""Locate and call the ``mpm`` CLI.
The output must supports both `Xbar dialect
<https://github.com/matryer/xbar-plugins/blob/main/CONTRIBUTING.md#plugin-api>`_
and `SwiftBar dialect <https://github.com/swiftbar/SwiftBar#plugin-api>`_.
"""'''
outstring='''"""Locate and call the ``mpm`` CLI.
The output must supports both
`Xbar dialect <https://github.com/matryer/xbar-plugins/blob/main/CONTRIBUTING.md#plugin-api>`_
and `SwiftBar dialect <https://github.com/swiftbar/SwiftBar#plugin-api>`_.
"""'''
[issue_157_6]
instring='''"""Install one or more packages.
Installation will proceed first with packages unambiguously tied to a manager. You can have an
influence on that with more precise package specifiers (like purl) and/or tighter selection of managers.
For other untied packages, mpm will try to find the best manager to install it with. Their installation
will be attempted with each manager, in the order they were selected. If we have the certainty, by the way
of a search operation, that this package is not available from this manager, we'll skip the installation
and try the next available manager.
"""'''
outstring='''"""Install one or more packages.
Installation will proceed first with packages unambiguously tied to a manager. You
can have an influence on that with more precise package specifiers (like purl)
and/or tighter selection of managers.
For other untied packages, mpm will try to find the best manager to install it with.
Their installation will be attempted with each manager, in the order they were
selected. If we have the certainty, by the way of a search operation, that this
package is not available from this manager, we'll skip the installation and try the
next available manager.
"""'''
[issue_157_7]
instring='''def hanging_rest_link():
"""
`Source of this snippet
<https://www.freecodecamp.org/news/how-to-flatten-a-dictionary-in-python-in-4-different-ways/>`_.
"""
def sub_func_test():
def long_line_link():
"""Get the Python type of a Click parameter.
See the list of `custom types provided by Click
<https://click.palletsprojects.com/en/8.1.x/api/?highlight=intrange#types>`_.
"""'''
outstring='''def hanging_rest_link():
"""
`Source of this snippet
<https://www.freecodecamp.org/news/how-to-flatten-a-dictionary-in-python-in-4-different-ways/>`_.
"""
def sub_func_test():
def long_line_link():
"""Get the Python type of a Click parameter.
See the list of
`custom types provided by Click <https://click.palletsprojects.com/en/8.1.x/api/?highlight=intrange#types>`_.
"""'''
[issue_157_8]
instring='''def mixed_links():
"""Implements the minimal code necessary to locate and call the ``mpm`` CLI on the system.
Once ``mpm`` is located, we can rely on it to produce the main output of the plugin.
The output must supports both `Xbar dialect
<https://github.com/matryer/xbar-plugins/blob/main/CONTRIBUTING.md#plugin-api>`_
and `SwiftBar dialect <https://github.com/swiftbar/SwiftBar#plugin-api>`_.
"""
XKCD_MANAGER_ORDER = ("pip", "brew", "npm", "dnf", "apt", "steamcmd")
"""Sequence of package managers as defined by `XKCD #1654: Universal Install Script
<https://xkcd.com/1654/>`_.
See the corresponding :issue:`implementation rationale in issue #10 <10>`.
"""
HASH_HEADERS = (
"Date",
"From",
"To",
)
"""
Default ordered list of headers to use to compute the unique hash of a mail.
By default we choose to exclude:
``Cc``
Since ``mailman`` apparently `sometimes trims list members
<https://mail.python.org/pipermail/mailman-developers/2002-September/013233.html>`_
from the ``Cc`` header to avoid sending duplicates. Which means that copies of mail
reflected back from the list server will have a different ``Cc`` to the copy saved by
the MUA at send-time.
``Bcc``
Because copies of the mail saved by the MUA at send-time will have ``Bcc``, but copies
reflected back from the list server won't.
``Reply-To``
Since a mail could be ``Cc``'d to two lists with different ``Reply-To`` munging
options set.
"""'''
outstring='''def mixed_links():
"""Implements the minimal code necessary to locate and call the ``mpm`` CLI
on the system.
Once ``mpm`` is located, we can rely on it to produce the main output of the plugin.
The output must supports both `Xbar dialect
<https://github.com/matryer/xbar-plugins/blob/main/CONTRIBUTING.md#plugin-api>`_
and `SwiftBar dialect <https://github.com/swiftbar/SwiftBar#plugin-api>`_.
"""
XKCD_MANAGER_ORDER = ("pip", "brew", "npm", "dnf", "apt", "steamcmd")
"""Sequence of package managers as defined by `XKCD #1654: Universal Install Script
<https://xkcd.com/1654/>`_.
See the corresponding :issue:`implementation rationale in issue #10 <10>`.
"""
HASH_HEADERS = (
"Date",
"From",
"To",
)
"""Default ordered list of headers to use to compute the unique hash of a mail.
By default we choose to exclude:
``Cc``
Since ``mailman`` apparently `sometimes trims list members
<https://mail.python.org/pipermail/mailman-developers/2002-September/013233.html>`_
from the ``Cc`` header to avoid sending duplicates. Which means that copies of mail
reflected back from the list server will have a different ``Cc`` to the copy saved by
the MUA at send-time.
``Bcc``
Because copies of the mail saved by the MUA at send-time will have ``Bcc``, but copies
reflected back from the list server won't.
``Reply-To``
Since a mail could be ``Cc``'d to two lists with different ``Reply-To`` munging
options set.
"""'''
[issue_157_9]
instring='''def load_conf():
"""Fetch parameters values from configuration file and merge them with the
defaults.
User configuration is `merged to the context default_map as Click does
<https://click.palletsprojects.com/en/8.1.x/commands/#context-defaults>`_.
This allow user's config to only overrides defaults. Values sets from direct
command line parameters, environment variables or interactive prompts, takes
precedence over any values from the config file.
"""
strict_selection_match = False
"""
Install sub-command try each user-selected manager until it find one providing
the package we seek to install, after which the process stop. This mean not all
managers will be called, so we allow the CLI output checks to partially match.
"""
platforms = {"LINUX", "MACOS", "WSL2"}
"""Homebrew core is now compatible with `Linux and Windows Subsystem for Linux
(WSL) 2 <https://docs.brew.sh/Homebrew-on-Linux>`_.
"""'''
outstring='''def load_conf():
"""Fetch parameters values from configuration file and merge them with the
defaults.
User configuration is
`merged to the context default_map as Click does <https://click.palletsprojects.com/en/8.1.x/commands/#context-defaults>`_.
This allow user's config to only overrides defaults. Values sets from direct
command line parameters, environment variables or interactive prompts, takes
precedence over any values from the config file.
"""
strict_selection_match = False
"""Install sub-command try each user-selected manager until it find one
providing the package we seek to install, after which the process stop.
This mean not all managers will be called, so we allow the CLI output checks to
partially match.
"""
platforms = {"LINUX", "MACOS", "WSL2"}
"""Homebrew core is now compatible with `Linux and Windows Subsystem for Linux
(WSL) 2 <https://docs.brew.sh/Homebrew-on-Linux>`_.
"""'''
[issue_157_10]
instring='''"""Patch and tweak `Python's standard library mail box constructors.
<https://docs.python.org/3.11/library/mailbox.html>`_ to set sane defaults.
Also forces out our own message factories to add deduplication tools and utilities.
"""
"""Patch and tweak `Python's standard library mail box constructors
<https://docs.python.org/3.11/library/mailbox.html>`_ to set sane defaults.
Also forces out our own message factories to add deduplication tools and utilities.
"""
def generate_platforms_graph(
graph_id: str, description: str, groups: frozenset
) -> str:
"""Generates an `Euler diagram <https://xkcd.com/2721/>`_ of platform and their
grouping.
Euler diagrams are
`not supported by mermaid yet <https://github.com/mermaid-js/mermaid/issues/2583>`_
so we fallback on a flowchart
without arrows.
Returns a ready to use and properly indented MyST block.
"""
def load_conf(self, ctx, param, path_pattern):
"""Fetch parameters values from configuration file and merge them with the
defaults.
User configuration is `merged to the context default_map as Click does
<https://click.palletsprojects.com/en/8.1.x/commands/#context-defaults>`_.
This allow user's config to only overrides defaults. Values sets from direct
command line parameters, environment variables or interactive prompts, takes
precedence over any values from the config file.
"""
def pytest_addoption(parser):
"""Add custom command line options.
Based on `Pytest's documentation examples
<https://docs.pytest.org/en/latest/example/simple.html#control-skipping-of-tests-according-to-command-line-option>`_.
By default, runs non-destructive tests and skips destructive ones.
"""'''
outstring='''"""Patch and tweak `Python's standard library mail box constructors.
<https://docs.python.org/3.11/library/mailbox.html>`_ to set sane defaults.
Also forces out our own message factories to add deduplication tools and utilities.
"""
"""Patch and tweak `Python's standard library mail box constructors
<https://docs.python.org/3.11/library/mailbox.html>`_ to set sane defaults.
Also forces out our own message factories to add deduplication tools and utilities.
"""
def generate_platforms_graph(
graph_id: str, description: str, groups: frozenset
) -> str:
"""Generates an `Euler diagram <https://xkcd.com/2721/>`_ of platform and their
grouping.
Euler diagrams are
`not supported by mermaid yet <https://github.com/mermaid-js/mermaid/issues/2583>`_
so we fallback on a flowchart
without arrows.
Returns a ready to use and properly indented MyST block.
"""
def load_conf(self, ctx, param, path_pattern):
"""Fetch parameters values from configuration file and merge them with the
defaults.
User configuration is
`merged to the context default_map as Click does <https://click.palletsprojects.com/en/8.1.x/commands/#context-defaults>`_.
This allow user's config to only overrides defaults. Values sets from direct
command line parameters, environment variables or interactive prompts, takes
precedence over any values from the config file.
"""
def pytest_addoption(parser):
"""Add custom command line options.
Based on `Pytest's documentation examples
<https://docs.pytest.org/en/latest/example/simple.html#control-skipping-of-tests-according-to-command-line-option>`_.
By default, runs non-destructive tests and skips destructive ones.
"""'''
[issue_157_11]
instring='''"""Fetch parameters values from configuration file and merge them with the defaults.
User configuration is `merged to the context default_map as Click does
<https://click.palletsprojects.com/en/8.1.x/commands/#context-defaults>`_.
This allow user's config to only overrides defaults. Values sets from direct
command line parameters, environment variables or interactive prompts, takes
precedence over any values from the config file.
"""'''
outstring='''"""Fetch parameters values from configuration file and merge them with the
defaults.
User configuration is
`merged to the context default_map as Click does <https://click.palletsprojects.com/en/8.1.x/commands/#context-defaults>`_.
This allow user's config to only overrides defaults. Values sets from direct
command line parameters, environment variables or interactive prompts, takes
precedence over any values from the config file.
"""'''
[issue_159]
instring='''"""Blah blah.
This will normally be used with https://aaaaaaaa.bbb.ccccccccc.com/xxxxx/xxx_xxxxxxxxxxx to generate the xxx
"""'''
outstring='''"""Blah blah.
This will normally be used with
https://aaaaaaaa.bbb.ccccccccc.com/xxxxx/xxx_xxxxxxxxxxx
to generate the xxx
"""'''
[issue_180]
instring='''"""Django settings for webapp project.
Generated by 'django-admin startproject' using Django 4.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""'''
outstring='''"""Django settings for webapp project.
Generated by 'django-admin startproject' using Django 4.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""'''
[issue_189]
instring='''"""This method doesn't do anything.
https://example.com/this-is-just-a-long-url/designed-to-trigger/the-wrapping-of-the-description
"""'''
outstring='''"""This method doesn't do anything.
https://example.com/this-is-just-a-long-url/designed-to-trigger/the-wrapping-of-the-description
"""'''
[issue_199]
instring='''"""
This is a short desription.
Here is a link to the github issue
https://github.com/PyCQA/docformatter/issues/199
This is a long description.
"""'''
outstring='''"""This is a short desription.
Here is a link to the github issue
https://github.com/PyCQA/docformatter/issues/199
This is a long description.
"""'''
[issue_210]
instring='''"""Short description.
This graphics format generates terminal escape codes that transfer
PNG data to a TTY using the `kitty graphics protocol`__.
__ https://sw.kovidgoyal.net/kitty/graphics-protocol/
"""'''
outstring='''"""Short description.
This graphics format generates terminal escape codes that transfer
PNG data to a TTY using the `kitty graphics protocol`__.
__ https://sw.kovidgoyal.net/kitty/graphics-protocol/
"""'''
[issue_218]
instring='''"""Construct a candidate project URL from the bundle and app name.
It's not a perfect guess, but it's better than having "https://example.com".
:param bundle: The bundle identifier.
:param app_name: The app name.
:returns: The candidate project URL
"""'''
outstring='''"""Construct a candidate project URL from the bundle and app name.
It's not a perfect guess, but it's better than having
"https://example.com".
:param bundle: The bundle identifier.
:param app_name: The app name.
:returns: The candidate project URL
"""'''
|