chunk_id stringlengths 36 36 | source stringclasses 35
values | source_url stringlengths 0 290 | upstream_license stringclasses 1
value | document_id stringlengths 36 36 | chunk_index int64 0 324k | retrieved_at stringclasses 2
values | chunker_version stringclasses 4
values | content_hash stringlengths 15 64 | content stringlengths 50 44.7k | namespace stringclasses 9
values | source_name stringclasses 35
values | raw_text stringlengths 50 44.7k | cleaned_text stringlengths 50 44.7k | tags stringclasses 49
values | collection_name stringclasses 11
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3418fac5-1afb-4861-b336-fbf59b04fcc3 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,693 | supabase-export-v2 | 5e8f0fb1db38a403 | .. method:: BaseCookie.value_encode(val)
Return a tuple ``(real_value, coded_value)``. *val* can be any type, but
``coded_value`` will always be converted to a string. This method does no encoding in :class:`BaseCookie` --- it exists so it can
be overridden. | trusted_official_docs | CPython Docs | .. method:: BaseCookie.value_encode(val)
Return a tuple ``(real_value, coded_value)``. *val* can be any type, but
``coded_value`` will always be converted to a string. This method does no encoding in :class:`BaseCookie` --- it exists so it can
be overridden. | .. method:: BaseCookie.value_encode(val)
Return a tuple ``(real_value, coded_value)``. *val* can be any type, but
``coded_value`` will always be converted to a string. This method does no encoding in :class:`BaseCookie` --- it exists so it can
be overridden. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3db58aa7-974d-42a9-9a49-f31fe3d2a00e | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,700 | supabase-export-v2 | f2820275edc514b6 | The meaning for *attrs* is the same as in :meth:`output`.
.. deprecated-removed:: 3.15 3.19
This method generates a JavaScript snippet to set cookies in the browser,
which is no longer considered a standard or recommended approach. Use :meth:`~http.cookies.BaseCookie.output` instead to generate HTTP
headers. | trusted_official_docs | CPython Docs | The meaning for *attrs* is the same as in :meth:`output`.
.. deprecated-removed:: 3.15 3.19
This method generates a JavaScript snippet to set cookies in the browser,
which is no longer considered a standard or recommended approach. Use :meth:`~http.cookies.BaseCookie.output` instead to generate HTTP
headers. | The meaning for *attrs* is the same as in :meth:`output`.
.. deprecated-removed:: 3.15 3.19
This method generates a JavaScript snippet to set cookies in the browser,
which is no longer considered a standard or recommended approach. Use :meth:`~http.cookies.BaseCookie.output` instead to generate HTTP
headers. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3e6aa133-102f-435f-87a5-1a46737cd609 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,676 | supabase-export-v2 | f79e09df1bdec049 | The character set, :data:`string.ascii_letters`, :data:`string.digits` and ``!#$%&'*+-.^_`|~:`` denote the set of valid characters allowed by this module in a cookie name (as :attr:`~Morsel.key`).
.. versionchanged:: 3.3
Allowed ':' as a valid cookie name character. | trusted_official_docs | CPython Docs | The character set, :data:`string.ascii_letters`, :data:`string.digits` and ``!#$%&'*+-.^_`|~:`` denote the set of valid characters allowed by this module in a cookie name (as :attr:`~Morsel.key`).
.. versionchanged:: 3.3
Allowed ':' as a valid cookie name character. | The character set, :data:`string.ascii_letters`, :data:`string.digits` and ``!#$%&'*+-.^_`|~:`` denote the set of valid characters allowed by this module in a cookie name (as :attr:`~Morsel.key`).
.. versionchanged:: 3.3
Allowed ':' as a valid cookie name character. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3e99a791-fe38-4703-a14a-f234ebce0e6d | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,731 | supabase-export-v2 | 4a8d00d1374b62cd | Return an embeddable JavaScript snippet, which, if run on a browser which supports JavaScript, will act the same as if the HTTP header was sent.
The meaning for *attrs* is the same as in :meth:`output`. | trusted_official_docs | CPython Docs | Return an embeddable JavaScript snippet, which, if run on a browser which supports JavaScript, will act the same as if the HTTP header was sent.
The meaning for *attrs* is the same as in :meth:`output`. | Return an embeddable JavaScript snippet, which, if run on a browser which supports JavaScript, will act the same as if the HTTP header was sent.
The meaning for *attrs* is the same as in :meth:`output`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3f867b87-42ee-4c84-a05b-d85cbaf7094b | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,737 | supabase-export-v2 | 208ddc5c764be278 | .. method:: Morsel.update(values)
Update the values in the Morsel dictionary with the values in the dictionary
*values*. Raise an error if any of the keys in the *values* dict is not a
valid :rfc:`2109` attribute. | trusted_official_docs | CPython Docs | .. method:: Morsel.update(values)
Update the values in the Morsel dictionary with the values in the dictionary
*values*. Raise an error if any of the keys in the *values* dict is not a
valid :rfc:`2109` attribute. | .. method:: Morsel.update(values)
Update the values in the Morsel dictionary with the values in the dictionary
*values*. Raise an error if any of the keys in the *values* dict is not a
valid :rfc:`2109` attribute. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
494d53f1-a230-4f6a-bc0e-8bd9f0979399 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,685 | supabase-export-v2 | de7a6150627dc2d9 | .. class:: SimpleCookie([input])
This class derives from :class:`BaseCookie` and overrides :meth:`~BaseCookie.value_decode`
and :meth:`~BaseCookie.value_encode`. :class:`!SimpleCookie` supports
strings as cookie values. When setting the value, :class:`!SimpleCookie`
calls the builtin :func:`str` to convert
the valu... | trusted_official_docs | CPython Docs | .. class:: SimpleCookie([input])
This class derives from :class:`BaseCookie` and overrides :meth:`~BaseCookie.value_decode`
and :meth:`~BaseCookie.value_encode`. :class:`!SimpleCookie` supports
strings as cookie values. When setting the value, :class:`!SimpleCookie`
calls the builtin :func:`str` to convert
the valu... | .. class:: SimpleCookie([input])
This class derives from :class:`BaseCookie` and overrides :meth:`~BaseCookie.value_decode`
and :meth:`~BaseCookie.value_encode`. :class:`!SimpleCookie` supports
strings as cookie values. When setting the value, :class:`!SimpleCookie`
calls the builtin :func:`str` to convert
the valu... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
50815d44-50ba-4008-a85f-70e09e813a16 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,678 | supabase-export-v2 | dfd1f6b4b371434a | .. note::
On encountering an invalid cookie, :exc:`CookieError` is raised, so if your
cookie data comes from a browser you should always prepare for invalid data
and catch :exc:`CookieError` on parsing. | trusted_official_docs | CPython Docs | .. note::
On encountering an invalid cookie, :exc:`CookieError` is raised, so if your
cookie data comes from a browser you should always prepare for invalid data
and catch :exc:`CookieError` on parsing. | .. note::
On encountering an invalid cookie, :exc:`CookieError` is raised, so if your
cookie data comes from a browser you should always prepare for invalid data
and catch :exc:`CookieError` on parsing. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
56347e70-9184-42d9-a1e7-aa4e92a7fa48 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,673 | supabase-export-v2 | 61126bfa3db2e8c3 | --------------
The :mod:`!http.cookies` module defines classes for abstracting the concept of
cookies, an HTTP state management mechanism. It supports both simple string-only
cookies, and provides an abstraction for having any serializable data-type as
cookie value. | trusted_official_docs | CPython Docs | --------------
The :mod:`!http.cookies` module defines classes for abstracting the concept of
cookies, an HTTP state management mechanism. It supports both simple string-only
cookies, and provides an abstraction for having any serializable data-type as
cookie value. | --------------
The :mod:`!http.cookies` module defines classes for abstracting the concept of
cookies, an HTTP state management mechanism. It supports both simple string-only
cookies, and provides an abstraction for having any serializable data-type as
cookie value. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
614a6796-e8e1-4e3a-b9af-6c9d8d772fd4 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,728 | supabase-export-v2 | 7fbb96ec210c4332 | .. method:: Morsel.output(attrs=None, header='Set-Cookie:')
Return a string representation of the Morsel, suitable to be sent as an HTTP
header. By default, all the attributes are included, unless *attrs* is given, in
which case it should be a list of attributes to use. *header* is by default
``"Set-Cookie:"``. | trusted_official_docs | CPython Docs | .. method:: Morsel.output(attrs=None, header='Set-Cookie:')
Return a string representation of the Morsel, suitable to be sent as an HTTP
header. By default, all the attributes are included, unless *attrs* is given, in
which case it should be a list of attributes to use. *header* is by default
``"Set-Cookie:"``. | .. method:: Morsel.output(attrs=None, header='Set-Cookie:')
Return a string representation of the Morsel, suitable to be sent as an HTTP
header. By default, all the attributes are included, unless *attrs* is given, in
which case it should be a list of attributes to use. *header* is by default
``"Set-Cookie:"``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
71109457-de8b-4249-8be9-b7daa3dd6ea7 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,683 | supabase-export-v2 | 7fb260b21e7c7cd1 | :class:`Morsel` instances. Note that upon setting a key to a value, the value is first converted to a :class:`Morsel` containing the key and the value.
If *input* is given, it is passed to the :meth:`load` method. | trusted_official_docs | CPython Docs | :class:`Morsel` instances. Note that upon setting a key to a value, the value is first converted to a :class:`Morsel` containing the key and the value.
If *input* is given, it is passed to the :meth:`load` method. | :class:`Morsel` instances. Note that upon setting a key to a value, the value is first converted to a :class:`Morsel` containing the key and the value.
If *input* is given, it is passed to the :meth:`load` method. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
87efca94-61c5-4f32-86b4-c8bd2992f12b | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,709 | supabase-export-v2 | 2bf38b5379ddda0a | that the cookie is only transferred in HTTP requests, and is not accessible through JavaScript. This is intended to mitigate some forms of cross-site scripting.
The attribute :attr:`samesite` controls when the browser sends the cookie with
cross-site requests. This helps to mitigate CSRF attacks. Valid values are
"St... | trusted_official_docs | CPython Docs | that the cookie is only transferred in HTTP requests, and is not accessible through JavaScript. This is intended to mitigate some forms of cross-site scripting.
The attribute :attr:`samesite` controls when the browser sends the cookie with
cross-site requests. This helps to mitigate CSRF attacks. Valid values are
"St... | that the cookie is only transferred in HTTP requests, and is not accessible through JavaScript. This is intended to mitigate some forms of cross-site scripting.
The attribute :attr:`samesite` controls when the browser sends the cookie with
cross-site requests. This helps to mitigate CSRF attacks. Valid values are
"St... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
957b5799-2c4d-45da-9287-919d44636740 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,702 | supabase-export-v2 | 435618e43b14f4e9 | .. method:: BaseCookie.load(rawdata)
If *rawdata* is a string, parse it as an ``HTTP_COOKIE`` and add the values
found there as :class:`Morsel`\ s. If it is a dictionary, it is equivalent to:: | trusted_official_docs | CPython Docs | .. method:: BaseCookie.load(rawdata)
If *rawdata* is a string, parse it as an ``HTTP_COOKIE`` and add the values
found there as :class:`Morsel`\ s. If it is a dictionary, it is equivalent to:: | .. method:: BaseCookie.load(rawdata)
If *rawdata* is a string, parse it as an ``HTTP_COOKIE`` and add the values
found there as :class:`Morsel`\ s. If it is a dictionary, it is equivalent to:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
99288f30-b1f1-4f9b-be96-52ec979be3c7 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,675 | supabase-export-v2 | 08a97078e66d3f5c | when it comes to cookie handling. As a result, this module now uses parsing rules that are a bit less strict than they once were.
The character set, :data:`string.ascii_letters`, :data:`string.digits` and
``!#$%&'*+-.^_`|~:`` denote the set of valid characters allowed by this module
in a cookie name (as :attr:`~Morsel.... | trusted_official_docs | CPython Docs | when it comes to cookie handling. As a result, this module now uses parsing rules that are a bit less strict than they once were.
The character set, :data:`string.ascii_letters`, :data:`string.digits` and
``!#$%&'*+-.^_`|~:`` denote the set of valid characters allowed by this module
in a cookie name (as :attr:`~Morsel.... | when it comes to cookie handling. As a result, this module now uses parsing rules that are a bit less strict than they once were.
The character set, :data:`string.ascii_letters`, :data:`string.digits` and
``!#$%&'*+-.^_`|~:`` denote the set of valid characters allowed by this module
in a cookie name (as :attr:`~Morsel.... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aa0f6cdb-be14-464e-b46d-6179e806943d | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,708 | supabase-export-v2 | 05118d0a3eb3872b | .. attribute:: expires path comment domain max-age secure version httponly samesite partitioned
The attribute :attr:`httponly` specifies that the cookie is only transferred
in HTTP requests, and is not accessible through JavaScript. This is intended
to mitigate some forms of cross-site scripting. | trusted_official_docs | CPython Docs | .. attribute:: expires path comment domain max-age secure version httponly samesite partitioned
The attribute :attr:`httponly` specifies that the cookie is only transferred
in HTTP requests, and is not accessible through JavaScript. This is intended
to mitigate some forms of cross-site scripting. | .. attribute:: expires path comment domain max-age secure version httponly samesite partitioned
The attribute :attr:`httponly` specifies that the cookie is only transferred
in HTTP requests, and is not accessible through JavaScript. This is intended
to mitigate some forms of cross-site scripting. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aa80f517-030a-488a-bf6d-0213a66c882f | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,712 | supabase-export-v2 | 7faf408c26b16378 | cookies to make them bound to the hostname and not the registrable domain. Read `CHIPS (Cookies Having Independent Partitioned State)`_ for full details and examples.
.. _CHIPS (Cookies Having Independent Partitioned State): https://github.com/privacycg/CHIPS/blob/main/README.md | trusted_official_docs | CPython Docs | cookies to make them bound to the hostname and not the registrable domain. Read `CHIPS (Cookies Having Independent Partitioned State)`_ for full details and examples.
.. _CHIPS (Cookies Having Independent Partitioned State): https://github.com/privacycg/CHIPS/blob/main/README.md | cookies to make them bound to the hostname and not the registrable domain. Read `CHIPS (Cookies Having Independent Partitioned State)`_ for full details and examples.
.. _CHIPS (Cookies Having Independent Partitioned State): https://github.com/privacycg/CHIPS/blob/main/README.md | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c4b910a1-9a2b-47dd-9494-0bd46b5b5760 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,696 | supabase-export-v2 | c89eaa28437db747 | .. method:: BaseCookie.output(attrs=None, header='Set-Cookie:', sep='\r\n')
Return a string representation suitable to be sent as HTTP headers. *attrs* and
*header* are sent to each :class:`Morsel`'s :meth:`~Morsel.output` method. *sep* is used
to join the headers together, and is by default the combination ``'\r\n'`... | trusted_official_docs | CPython Docs | .. method:: BaseCookie.output(attrs=None, header='Set-Cookie:', sep='\r\n')
Return a string representation suitable to be sent as HTTP headers. *attrs* and
*header* are sent to each :class:`Morsel`'s :meth:`~Morsel.output` method. *sep* is used
to join the headers together, and is by default the combination ``'\r\n'`... | .. method:: BaseCookie.output(attrs=None, header='Set-Cookie:', sep='\r\n')
Return a string representation suitable to be sent as HTTP headers. *attrs* and
*header* are sent to each :class:`Morsel`'s :meth:`~Morsel.output` method. *sep* is used
to join the headers together, and is by default the combination ``'\r\n'`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c51577f1-be81-4485-9619-9fbc0880f4ea | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,694 | supabase-export-v2 | 040b4f4ef67bfd49 | type, but ``coded_value`` will always be converted to a string. This method does no encoding in :class:`BaseCookie` --- it exists so it can be overridden.
In general, it should be the case that :meth:`value_encode` and
:meth:`value_decode` are inverses on the range of *value_decode*. | trusted_official_docs | CPython Docs | type, but ``coded_value`` will always be converted to a string. This method does no encoding in :class:`BaseCookie` --- it exists so it can be overridden.
In general, it should be the case that :meth:`value_encode` and
:meth:`value_decode` are inverses on the range of *value_decode*. | type, but ``coded_value`` will always be converted to a string. This method does no encoding in :class:`BaseCookie` --- it exists so it can be overridden.
In general, it should be the case that :meth:`value_encode` and
:meth:`value_decode` are inverses on the range of *value_decode*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cd287bd4-9732-44b5-9cb4-aa41ebeec0d3 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,682 | supabase-export-v2 | 77cc2413764cc694 | .. class:: BaseCookie([input])
This class is a dictionary-like object whose keys are strings and whose values
are :class:`Morsel` instances. Note that upon setting a key to a value, the
value is first converted to a :class:`Morsel` containing the key and the value. | trusted_official_docs | CPython Docs | .. class:: BaseCookie([input])
This class is a dictionary-like object whose keys are strings and whose values
are :class:`Morsel` instances. Note that upon setting a key to a value, the
value is first converted to a :class:`Morsel` containing the key and the value. | .. class:: BaseCookie([input])
This class is a dictionary-like object whose keys are strings and whose values
are :class:`Morsel` instances. Note that upon setting a key to a value, the
value is first converted to a :class:`Morsel` containing the key and the value. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dcc9efc6-7fb7-4767-99b1-64d5dcb76580 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,691 | supabase-export-v2 | e1dd5d910ae1aa9e | .. method:: BaseCookie.value_decode(val)
Return a tuple ``(real_value, coded_value)`` from a string representation. ``real_value`` can be any type. This method does no decoding in
:class:`BaseCookie` --- it exists so it can be overridden. | trusted_official_docs | CPython Docs | .. method:: BaseCookie.value_decode(val)
Return a tuple ``(real_value, coded_value)`` from a string representation. ``real_value`` can be any type. This method does no decoding in
:class:`BaseCookie` --- it exists so it can be overridden. | .. method:: BaseCookie.value_decode(val)
Return a tuple ``(real_value, coded_value)`` from a string representation. ``real_value`` can be any type. This method does no decoding in
:class:`BaseCookie` --- it exists so it can be overridden. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e4173d17-d934-490a-9402-1375faac45ae | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,699 | supabase-export-v2 | 92f0731123a3759a | Return an embeddable JavaScript snippet, which, if run on a browser which supports JavaScript, will act the same as if the HTTP headers was sent.
The meaning for *attrs* is the same as in :meth:`output`. | trusted_official_docs | CPython Docs | Return an embeddable JavaScript snippet, which, if run on a browser which supports JavaScript, will act the same as if the HTTP headers was sent.
The meaning for *attrs* is the same as in :meth:`output`. | Return an embeddable JavaScript snippet, which, if run on a browser which supports JavaScript, will act the same as if the HTTP headers was sent.
The meaning for *attrs* is the same as in :meth:`output`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e7b2663c-e673-4ca1-a33a-b9566c7e4468 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,732 | supabase-export-v2 | e24716e6309799e6 | The meaning for *attrs* is the same as in :meth:`output`.
.. deprecated-removed:: 3.15 3.19
This method generates a JavaScript snippet to set cookies in the browser,
which is no longer considered a standard or recommended approach. Use :meth:`~http.cookies.Morsel.output` instead to generate HTTP
headers. | trusted_official_docs | CPython Docs | The meaning for *attrs* is the same as in :meth:`output`.
.. deprecated-removed:: 3.15 3.19
This method generates a JavaScript snippet to set cookies in the browser,
which is no longer considered a standard or recommended approach. Use :meth:`~http.cookies.Morsel.output` instead to generate HTTP
headers. | The meaning for *attrs* is the same as in :meth:`output`.
.. deprecated-removed:: 3.15 3.19
This method generates a JavaScript snippet to set cookies in the browser,
which is no longer considered a standard or recommended approach. Use :meth:`~http.cookies.Morsel.output` instead to generate HTTP
headers. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f20950d2-290e-49ff-b204-e7b54d09d508 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,747 | supabase-export-v2 | aa1ccaebeeb36fa3 | .. doctest:: :options: +NORMALIZE_WHITESPACE
>>> from http import cookies
>>> C = cookies.SimpleCookie()
>>> C["fig"] = "newton"
>>> C["sugar"] = "wafer"
>>> print(C) # generate HTTP headers
Set-Cookie: fig=newton
Set-Cookie: sugar=wafer
>>> print(C.output()) # same thing
Set-Cookie: fig=newton
Set-Cookie: sug... | trusted_official_docs | CPython Docs | .. doctest:: :options: +NORMALIZE_WHITESPACE
>>> from http import cookies
>>> C = cookies.SimpleCookie()
>>> C["fig"] = "newton"
>>> C["sugar"] = "wafer"
>>> print(C) # generate HTTP headers
Set-Cookie: fig=newton
Set-Cookie: sugar=wafer
>>> print(C.output()) # same thing
Set-Cookie: fig=newton
Set-Cookie: sug... | .. doctest:: :options: +NORMALIZE_WHITESPACE
>>> from http import cookies
>>> C = cookies.SimpleCookie()
>>> C["fig"] = "newton"
>>> C["sugar"] = "wafer"
>>> print(C) # generate HTTP headers
Set-Cookie: fig=newton
Set-Cookie: sugar=wafer
>>> print(C.output()) # same thing
Set-Cookie: fig=newton
Set-Cookie: sug... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fa57dcb9-78b0-4ade-8ad4-5c94311f3a09 | CPython Docs | file://datasets/cpython/Doc/library/http.cookies.rst | unknown | 65d7d1e2-6c3c-4c4d-ad68-93cf828be2c1 | 4,688 | supabase-export-v2 | 05ab9cab9f5889bf | Module :mod:`http.cookiejar` HTTP cookie handling for web *clients*. The :mod:`http.cookiejar` and :mod:`!http.cookies` modules do not depend on each other.
:rfc:`2109` - HTTP State Management Mechanism
This is the state management specification implemented by this module. | trusted_official_docs | CPython Docs | Module :mod:`http.cookiejar` HTTP cookie handling for web *clients*. The :mod:`http.cookiejar` and :mod:`!http.cookies` modules do not depend on each other.
:rfc:`2109` - HTTP State Management Mechanism
This is the state management specification implemented by this module. | Module :mod:`http.cookiejar` HTTP cookie handling for web *clients*. The :mod:`http.cookiejar` and :mod:`!http.cookies` modules do not depend on each other.
:rfc:`2109` - HTTP State Management Mechanism
This is the state management specification implemented by this module. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
04bf036f-8061-49dc-97f2-fee60a74e1fe | CPython Docs | file://datasets/cpython/Doc/library/sndhdr.rst | unknown | 4bd72812-9bbe-4576-addd-46995c0721f5 | 4,752 | supabase-export-v2 | 67ccbcfd0628d577 | part of the Python standard library. It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after being deprecated in Python 3.11. The removal was decided in :pep:`594`.
Possible replacements are third-party modules from PyPI:
:pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`. These are not supported or m... | trusted_official_docs | CPython Docs | part of the Python standard library. It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after being deprecated in Python 3.11. The removal was decided in :pep:`594`.
Possible replacements are third-party modules from PyPI:
:pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`. These are not supported or m... | part of the Python standard library. It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after being deprecated in Python 3.11. The removal was decided in :pep:`594`.
Possible replacements are third-party modules from PyPI:
:pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`. These are not supported or m... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6fe6d032-b5fb-45fc-9d33-418104c8a7d5 | CPython Docs | file://datasets/cpython/Doc/library/sndhdr.rst | unknown | 4bd72812-9bbe-4576-addd-46995c0721f5 | 4,753 | supabase-export-v2 | 48b0462ee4d9a2d4 | Possible replacements are third-party modules from PyPI: :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`. These are not supported or maintained by the Python core team.
The last version of Python that provided the :mod:`!sndhdr` module was
`Python 3.12 <https://docs.python.org/3.12/library/sndhdr.html>`_. | trusted_official_docs | CPython Docs | Possible replacements are third-party modules from PyPI: :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`. These are not supported or maintained by the Python core team.
The last version of Python that provided the :mod:`!sndhdr` module was
`Python 3.12 <https://docs.python.org/3.12/library/sndhdr.html>`_. | Possible replacements are third-party modules from PyPI: :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`. These are not supported or maintained by the Python core team.
The last version of Python that provided the :mod:`!sndhdr` module was
`Python 3.12 <https://docs.python.org/3.12/library/sndhdr.html>`_. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c9a75f24-6dd1-43dd-ae6e-bb1055b97ac5 | CPython Docs | file://datasets/cpython/Doc/library/sndhdr.rst | unknown | 4bd72812-9bbe-4576-addd-46995c0721f5 | 4,751 | supabase-export-v2 | 5737eaaa58421ee6 | .. deprecated-removed:: 3.11 3.13
This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
being deprecated in Python 3.11. The removal was decided in :pep:`594`. | trusted_official_docs | CPython Docs | .. deprecated-removed:: 3.11 3.13
This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
being deprecated in Python 3.11. The removal was decided in :pep:`594`. | .. deprecated-removed:: 3.11 3.13
This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
being deprecated in Python 3.11. The removal was decided in :pep:`594`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1ff16298-d506-439c-bb4d-a6d6b46adac9 | CPython Docs | file://datasets/cpython/Doc/library/custominterp.rst | unknown | c50e7629-eeb5-47fe-a672-956196d6d7af | 4,755 | supabase-export-v2 | 7da9b309715d3ac4 | ************************** Custom Python Interpreters **************************
The modules described in this chapter allow writing interfaces similar to
Python's interactive interpreter. If you want a Python interpreter that
supports some special feature in addition to the Python language, you should
look at the :mod... | trusted_official_docs | CPython Docs | ************************** Custom Python Interpreters **************************
The modules described in this chapter allow writing interfaces similar to
Python's interactive interpreter. If you want a Python interpreter that
supports some special feature in addition to the Python language, you should
look at the :mod... | ************************** Custom Python Interpreters **************************
The modules described in this chapter allow writing interfaces similar to
Python's interactive interpreter. If you want a Python interpreter that
supports some special feature in addition to the Python language, you should
look at the :mod... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b6aea5b7-3da8-425a-b210-66a66d0b0536 | CPython Docs | file://datasets/cpython/Doc/library/custominterp.rst | unknown | c50e7629-eeb5-47fe-a672-956196d6d7af | 4,756 | supabase-export-v2 | 62b220d01881b800 | Python language, you should look at the :mod:`code` module. (The :mod:`codeop` module is lower-level, used to support compiling a possibly incomplete chunk of Python code.)
The full list of modules described in this chapter is: | trusted_official_docs | CPython Docs | Python language, you should look at the :mod:`code` module. (The :mod:`codeop` module is lower-level, used to support compiling a possibly incomplete chunk of Python code.)
The full list of modules described in this chapter is: | Python language, you should look at the :mod:`code` module. (The :mod:`codeop` module is lower-level, used to support compiling a possibly incomplete chunk of Python code.)
The full list of modules described in this chapter is: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0e569263-be4c-4b99-9240-ee4fcb543f0d | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,794 | supabase-export-v2 | a6ee2ef5840ec166 | Put a :class:`Queue` instance into a shutdown mode.
The queue can no longer grow. Future calls to :meth:`~Queue.put` raise :exc:`QueueShutDown`. Currently blocked callers of :meth:`~Queue.put` will be unblocked
and will raise :exc:`QueueShutDown` in the formerly awaiting task. | trusted_official_docs | CPython Docs | Put a :class:`Queue` instance into a shutdown mode.
The queue can no longer grow. Future calls to :meth:`~Queue.put` raise :exc:`QueueShutDown`. Currently blocked callers of :meth:`~Queue.put` will be unblocked
and will raise :exc:`QueueShutDown` in the formerly awaiting task. | Put a :class:`Queue` instance into a shutdown mode.
The queue can no longer grow. Future calls to :meth:`~Queue.put` raise :exc:`QueueShutDown`. Currently blocked callers of :meth:`~Queue.put` will be unblocked
and will raise :exc:`QueueShutDown` in the formerly awaiting task. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1bb0d3c5-7269-4a2e-beda-d1b52d722a34 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,827 | supabase-export-v2 | 0ac2a7b325eb9fcb | # Create three worker tasks to process the queue concurrently. tasks = [] for i in range(3): task = asyncio.create_task(worker(f'worker-{i}', queue)) tasks.append(task)
# Wait until the queue is fully processed. started_at = time.monotonic()
await queue.join()
total_slept_for = time.monotonic() - started_at | trusted_official_docs | CPython Docs | # Create three worker tasks to process the queue concurrently. tasks = [] for i in range(3): task = asyncio.create_task(worker(f'worker-{i}', queue)) tasks.append(task)
# Wait until the queue is fully processed. started_at = time.monotonic()
await queue.join()
total_slept_for = time.monotonic() - started_at | # Create three worker tasks to process the queue concurrently. tasks = [] for i in range(3): task = asyncio.create_task(worker(f'worker-{i}', queue)) tasks.append(task)
# Wait until the queue is fully processed. started_at = time.monotonic()
await queue.join()
total_slept_for = time.monotonic() - started_at | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1fe4945a-9991-4e1a-a0c5-efb8ac89607b | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,829 | supabase-export-v2 | 3c93c516d5f31e8b | # Cancel our worker tasks. for task in tasks: task.cancel() # Wait until all worker tasks are cancelled. await asyncio.gather(*tasks, return_exceptions=True)
print('====')
print(f'3 workers slept in parallel for {total_slept_for:.2f} seconds')
print(f'total expected sleep time: {total_sleep_time:.2f} seconds') | trusted_official_docs | CPython Docs | # Cancel our worker tasks. for task in tasks: task.cancel() # Wait until all worker tasks are cancelled. await asyncio.gather(*tasks, return_exceptions=True)
print('====')
print(f'3 workers slept in parallel for {total_slept_for:.2f} seconds')
print(f'total expected sleep time: {total_sleep_time:.2f} seconds') | # Cancel our worker tasks. for task in tasks: task.cancel() # Wait until all worker tasks are cancelled. await asyncio.gather(*tasks, return_exceptions=True)
print('====')
print(f'3 workers slept in parallel for {total_slept_for:.2f} seconds')
print(f'total expected sleep time: {total_sleep_time:.2f} seconds') | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
23b2bbe4-d78f-44dd-bef9-d389e6cf921e | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,798 | supabase-export-v2 | 43a949f5d4aecc0f | Once the queue is empty, future calls to :meth:`~Queue.get` will raise :exc:`QueueShutDown`.
If *immediate* is true, the queue is terminated immediately. The queue is drained to be completely empty and the count
of unfinished tasks is reduced by the number of tasks drained. If unfinished tasks is zero, callers of :met... | trusted_official_docs | CPython Docs | Once the queue is empty, future calls to :meth:`~Queue.get` will raise :exc:`QueueShutDown`.
If *immediate* is true, the queue is terminated immediately. The queue is drained to be completely empty and the count
of unfinished tasks is reduced by the number of tasks drained. If unfinished tasks is zero, callers of :met... | Once the queue is empty, future calls to :meth:`~Queue.get` will raise :exc:`QueueShutDown`.
If *immediate* is true, the queue is terminated immediately. The queue is drained to be completely empty and the count
of unfinished tasks is reduced by the number of tasks drained. If unfinished tasks is zero, callers of :met... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3b5d2709-c0fb-4e52-b015-5a9da818c729 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,786 | supabase-export-v2 | f9f17cbe38a27aa0 | Put an item into the queue. If the queue is full, wait until a free slot is available before adding the item.
Raises :exc:`QueueShutDown` if the queue has been shut down. | trusted_official_docs | CPython Docs | Put an item into the queue. If the queue is full, wait until a free slot is available before adding the item.
Raises :exc:`QueueShutDown` if the queue has been shut down. | Put an item into the queue. If the queue is full, wait until a free slot is available before adding the item.
Raises :exc:`QueueShutDown` if the queue has been shut down. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4311367c-1620-47f5-8d3a-48bda78384e2 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,804 | supabase-export-v2 | cbfaf34767c2331d | will resume when all items have been processed (meaning that a :meth:`task_done` call was received for every item that had been :meth:`~Queue.put` into the queue).
Raises :exc:`ValueError` if called more times than there were
items placed in the queue. | trusted_official_docs | CPython Docs | will resume when all items have been processed (meaning that a :meth:`task_done` call was received for every item that had been :meth:`~Queue.put` into the queue).
Raises :exc:`ValueError` if called more times than there were
items placed in the queue. | will resume when all items have been processed (meaning that a :meth:`task_done` call was received for every item that had been :meth:`~Queue.put` into the queue).
Raises :exc:`ValueError` if called more times than there were
items placed in the queue. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
432d31cc-7d41-49fe-a8de-fe302b252279 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,802 | supabase-export-v2 | 4f5023053b1c0f5b | Indicate that a formerly enqueued work item is complete.
Used by queue consumers. For each :meth:`~Queue.get` used to
fetch a work item, a subsequent call to :meth:`task_done` tells the
queue that the processing on the work item is complete. | trusted_official_docs | CPython Docs | Indicate that a formerly enqueued work item is complete.
Used by queue consumers. For each :meth:`~Queue.get` used to
fetch a work item, a subsequent call to :meth:`task_done` tells the
queue that the processing on the work item is complete. | Indicate that a formerly enqueued work item is complete.
Used by queue consumers. For each :meth:`~Queue.get` used to
fetch a work item, a subsequent call to :meth:`task_done` tells the
queue that the processing on the work item is complete. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
510d88e3-ebdc-4d8b-bdc3-00311b30b246 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,760 | supabase-export-v2 | 8aa31e032ad444e8 | ------------------------------------------------
asyncio queues are designed to be similar to classes of the
:mod:`queue` module. Although asyncio queues are not thread-safe,
they are designed to be used specifically in async/await code. | trusted_official_docs | CPython Docs | ------------------------------------------------
asyncio queues are designed to be similar to classes of the
:mod:`queue` module. Although asyncio queues are not thread-safe,
they are designed to be used specifically in async/await code. | ------------------------------------------------
asyncio queues are designed to be similar to classes of the
:mod:`queue` module. Although asyncio queues are not thread-safe,
they are designed to be used specifically in async/await code. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
537dbe82-38b9-4f80-b41c-3a5c688d9ba3 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,795 | supabase-export-v2 | 8e3212605c4adaa4 | longer grow. Future calls to :meth:`~Queue.put` raise :exc:`QueueShutDown`. Currently blocked callers of :meth:`~Queue.put` will be unblocked and will raise :exc:`QueueShutDown` in the formerly awaiting task.
If *immediate* is false (the default), the queue can be wound
down normally with :meth:`~Queue.get` calls to e... | trusted_official_docs | CPython Docs | longer grow. Future calls to :meth:`~Queue.put` raise :exc:`QueueShutDown`. Currently blocked callers of :meth:`~Queue.put` will be unblocked and will raise :exc:`QueueShutDown` in the formerly awaiting task.
If *immediate* is false (the default), the queue can be wound
down normally with :meth:`~Queue.get` calls to e... | longer grow. Future calls to :meth:`~Queue.put` raise :exc:`QueueShutDown`. Currently blocked callers of :meth:`~Queue.put` will be unblocked and will raise :exc:`QueueShutDown` in the formerly awaiting task.
If *immediate* is false (the default), the queue can be wound
down normally with :meth:`~Queue.get` calls to e... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
57c910ef-965a-4439-838d-47dd559a983f | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,826 | supabase-export-v2 | 50de2942662ef7b9 | # Generate random timings and put them into the queue. total_sleep_time = 0 for _ in range(20): sleep_for = random.uniform(0.05, 1.0) total_sleep_time += sleep_for queue.put_nowait(sleep_for)
# Create three worker tasks to process the queue concurrently. tasks = []
for i in range(3):
task = asyncio.create_task(worker... | trusted_official_docs | CPython Docs | # Generate random timings and put them into the queue. total_sleep_time = 0 for _ in range(20): sleep_for = random.uniform(0.05, 1.0) total_sleep_time += sleep_for queue.put_nowait(sleep_for)
# Create three worker tasks to process the queue concurrently. tasks = []
for i in range(3):
task = asyncio.create_task(worker... | # Generate random timings and put them into the queue. total_sleep_time = 0 for _ in range(20): sleep_for = random.uniform(0.05, 1.0) total_sleep_time += sleep_for queue.put_nowait(sleep_for)
# Create three worker tasks to process the queue concurrently. tasks = []
for i in range(3):
task = asyncio.create_task(worker... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5c4a70e8-120f-48b0-8286-4aa1e6507c33 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,796 | supabase-export-v2 | c374dfaa9b7b9949 | If *immediate* is false (the default), the queue can be wound down normally with :meth:`~Queue.get` calls to extract tasks that have already been loaded.
And if :meth:`~Queue.task_done` is called for each remaining task, a
pending :meth:`~Queue.join` will be unblocked normally. | trusted_official_docs | CPython Docs | If *immediate* is false (the default), the queue can be wound down normally with :meth:`~Queue.get` calls to extract tasks that have already been loaded.
And if :meth:`~Queue.task_done` is called for each remaining task, a
pending :meth:`~Queue.join` will be unblocked normally. | If *immediate* is false (the default), the queue can be wound down normally with :meth:`~Queue.get` calls to extract tasks that have already been loaded.
And if :meth:`~Queue.task_done` is called for each remaining task, a
pending :meth:`~Queue.join` will be unblocked normally. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
67a3cdb2-6c10-405a-bed7-082a3bba8048 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,761 | supabase-export-v2 | e2b2a93d4c8324ec | to be similar to classes of the :mod:`queue` module. Although asyncio queues are not thread-safe, they are designed to be used specifically in async/await code.
Note that methods of asyncio queues don't have a *timeout* parameter;
use :func:`asyncio.wait_for` function to do queue operations with a
timeout. | trusted_official_docs | CPython Docs | to be similar to classes of the :mod:`queue` module. Although asyncio queues are not thread-safe, they are designed to be used specifically in async/await code.
Note that methods of asyncio queues don't have a *timeout* parameter;
use :func:`asyncio.wait_for` function to do queue operations with a
timeout. | to be similar to classes of the :mod:`queue` module. Although asyncio queues are not thread-safe, they are designed to be used specifically in async/await code.
Note that methods of asyncio queues don't have a *timeout* parameter;
use :func:`asyncio.wait_for` function to do queue operations with a
timeout. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
74ba7add-6712-4c03-86ee-ecde4485d770 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,803 | supabase-export-v2 | 8f6e3f9fbce760e6 | each :meth:`~Queue.get` used to fetch a work item, a subsequent call to :meth:`task_done` tells the queue that the processing on the work item is complete.
If a :meth:`join` is currently blocking, it will resume when all
items have been processed (meaning that a :meth:`task_done`
call was received for every item that... | trusted_official_docs | CPython Docs | each :meth:`~Queue.get` used to fetch a work item, a subsequent call to :meth:`task_done` tells the queue that the processing on the work item is complete.
If a :meth:`join` is currently blocking, it will resume when all
items have been processed (meaning that a :meth:`task_done`
call was received for every item that... | each :meth:`~Queue.get` used to fetch a work item, a subsequent call to :meth:`task_done` tells the queue that the processing on the work item is complete.
If a :meth:`join` is currently blocking, it will resume when all
items have been processed (meaning that a :meth:`task_done`
call was received for every item that... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
913b9c99-ce2e-4555-a760-e0a7927b8906 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,765 | supabase-export-v2 | 50129b5d6feffbf8 | A first in, first out (FIFO) queue.
If *maxsize* is less than or equal to zero, the queue size is
infinite. If it is an integer greater than ``0``, then
``await put()`` blocks when the queue reaches *maxsize*
until an item is removed by :meth:`get`. | trusted_official_docs | CPython Docs | A first in, first out (FIFO) queue.
If *maxsize* is less than or equal to zero, the queue size is
infinite. If it is an integer greater than ``0``, then
``await put()`` blocks when the queue reaches *maxsize*
until an item is removed by :meth:`get`. | A first in, first out (FIFO) queue.
If *maxsize* is less than or equal to zero, the queue size is
infinite. If it is an integer greater than ``0``, then
``await put()`` blocks when the queue reaches *maxsize*
until an item is removed by :meth:`get`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b59efd6d-7b68-4250-9865-9a79f4457985 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,783 | supabase-export-v2 | be819e7bc53196cb | Block until all items in the queue have been received and processed.
The count of unfinished tasks goes up whenever an item is added
to the queue. The count goes down whenever a consumer coroutine calls
:meth:`task_done` to indicate that the item was retrieved and all
work on it is complete. When the count of unfini... | trusted_official_docs | CPython Docs | Block until all items in the queue have been received and processed.
The count of unfinished tasks goes up whenever an item is added
to the queue. The count goes down whenever a consumer coroutine calls
:meth:`task_done` to indicate that the item was retrieved and all
work on it is complete. When the count of unfini... | Block until all items in the queue have been received and processed.
The count of unfinished tasks goes up whenever an item is added
to the queue. The count goes down whenever a consumer coroutine calls
:meth:`task_done` to indicate that the item was retrieved and all
work on it is complete. When the count of unfini... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b8e69620-b9e5-4d44-9f11-8e7bf867c102 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,767 | supabase-export-v2 | 47ca7117d97d009d | Unlike the standard library threading :mod:`queue`, the size of the queue is always known and can be returned by calling the :meth:`qsize` method.
.. versionchanged:: 3.10
Removed the *loop* parameter. | trusted_official_docs | CPython Docs | Unlike the standard library threading :mod:`queue`, the size of the queue is always known and can be returned by calling the :meth:`qsize` method.
.. versionchanged:: 3.10
Removed the *loop* parameter. | Unlike the standard library threading :mod:`queue`, the size of the queue is always known and can be returned by calling the :meth:`qsize` method.
.. versionchanged:: 3.10
Removed the *loop* parameter. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bbc2db9b-e2ab-440b-a8bb-1eee0ae76698 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,828 | supabase-export-v2 | 06d9190fc5ec5471 | # Wait until the queue is fully processed. started_at = time.monotonic() await queue.join() total_slept_for = time.monotonic() - started_at
# Cancel our worker tasks. for task in tasks:
task.cancel()
# Wait until all worker tasks are cancelled. await asyncio.gather(*tasks, return_exceptions=True) | trusted_official_docs | CPython Docs | # Wait until the queue is fully processed. started_at = time.monotonic() await queue.join() total_slept_for = time.monotonic() - started_at
# Cancel our worker tasks. for task in tasks:
task.cancel()
# Wait until all worker tasks are cancelled. await asyncio.gather(*tasks, return_exceptions=True) | # Wait until the queue is fully processed. started_at = time.monotonic() await queue.join() total_slept_for = time.monotonic() - started_at
# Cancel our worker tasks. for task in tasks:
task.cancel()
# Wait until all worker tasks are cancelled. await asyncio.gather(*tasks, return_exceptions=True) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d0f9856a-aa97-4ede-ad7a-d1699554f09b | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,766 | supabase-export-v2 | 788dc29f46a18798 | infinite. If it is an integer greater than ``0``, then ``await put()`` blocks when the queue reaches *maxsize* until an item is removed by :meth:`get`.
Unlike the standard library threading :mod:`queue`, the size of
the queue is always known and can be returned by calling the
:meth:`qsize` method. | trusted_official_docs | CPython Docs | infinite. If it is an integer greater than ``0``, then ``await put()`` blocks when the queue reaches *maxsize* until an item is removed by :meth:`get`.
Unlike the standard library threading :mod:`queue`, the size of
the queue is always known and can be returned by calling the
:meth:`qsize` method. | infinite. If it is an integer greater than ``0``, then ``await put()`` blocks when the queue reaches *maxsize* until an item is removed by :meth:`get`.
Unlike the standard library threading :mod:`queue`, the size of
the queue is always known and can be returned by calling the
:meth:`qsize` method. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e16d7ed1-5f66-475f-9988-8727f000097b | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,799 | supabase-export-v2 | b8bc1085ebfc7882 | unfinished tasks is zero, callers of :meth:`~Queue.join` are unblocked. Also, blocked callers of :meth:`~Queue.get` are unblocked and will raise :exc:`QueueShutDown` because the queue is empty.
Use caution when using :meth:`~Queue.join` with *immediate* set
to true. This unblocks the join even when no work has been do... | trusted_official_docs | CPython Docs | unfinished tasks is zero, callers of :meth:`~Queue.join` are unblocked. Also, blocked callers of :meth:`~Queue.get` are unblocked and will raise :exc:`QueueShutDown` because the queue is empty.
Use caution when using :meth:`~Queue.join` with *immediate* set
to true. This unblocks the join even when no work has been do... | unfinished tasks is zero, callers of :meth:`~Queue.join` are unblocked. Also, blocked callers of :meth:`~Queue.get` are unblocked and will raise :exc:`QueueShutDown` because the queue is empty.
Use caution when using :meth:`~Queue.join` with *immediate* set
to true. This unblocks the join even when no work has been do... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ee7be98f-05cf-4db9-b9ac-857732994100 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,825 | supabase-export-v2 | 9a37912fdc5ae0c7 | async def main(): # Create a queue that we will use to store our "workload". queue = asyncio.Queue()
# Generate random timings and put them into the queue. total_sleep_time = 0
for _ in range(20):
sleep_for = random.uniform(0.05, 1.0)
total_sleep_time += sleep_for
queue.put_nowait(sleep_for) | trusted_official_docs | CPython Docs | async def main(): # Create a queue that we will use to store our "workload". queue = asyncio.Queue()
# Generate random timings and put them into the queue. total_sleep_time = 0
for _ in range(20):
sleep_for = random.uniform(0.05, 1.0)
total_sleep_time += sleep_for
queue.put_nowait(sleep_for) | async def main(): # Create a queue that we will use to store our "workload". queue = asyncio.Queue()
# Generate random timings and put them into the queue. total_sleep_time = 0
for _ in range(20):
sleep_for = random.uniform(0.05, 1.0)
total_sleep_time += sleep_for
queue.put_nowait(sleep_for) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f188c1de-9ce9-499b-b5e7-45c92f5d83f1 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-queue.rst | unknown | e4e88cd0-a90c-492d-90ad-804d8683a9ab | 4,778 | supabase-export-v2 | b9a1db49dadbf89d | Remove and return an item from the queue. If queue is empty, wait until an item is available.
Raises :exc:`QueueShutDown` if the queue has been shut down and
is empty, or if the queue has been shut down immediately. | trusted_official_docs | CPython Docs | Remove and return an item from the queue. If queue is empty, wait until an item is available.
Raises :exc:`QueueShutDown` if the queue has been shut down and
is empty, or if the queue has been shut down immediately. | Remove and return an item from the queue. If queue is empty, wait until an item is available.
Raises :exc:`QueueShutDown` if the queue has been shut down and
is empty, or if the queue has been shut down immediately. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0af29ad3-60a8-41bd-947c-98dc1b5e9229 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,844 | supabase-export-v2 | 438e0049262a9fae | Unlike GNU :c:func:`!getopt`, after a non-option argument, all further arguments are considered also non-options. This is similar to the way non-GNU Unix systems work.
*longopts*, if specified, must be a list of strings with the names of the
long options which should be supported. The leading ``'--'`` characters
shou... | trusted_official_docs | CPython Docs | Unlike GNU :c:func:`!getopt`, after a non-option argument, all further arguments are considered also non-options. This is similar to the way non-GNU Unix systems work.
*longopts*, if specified, must be a list of strings with the names of the
long options which should be supported. The leading ``'--'`` characters
shou... | Unlike GNU :c:func:`!getopt`, after a non-option argument, all further arguments are considered also non-options. This is similar to the way non-GNU Unix systems work.
*longopts*, if specified, must be a list of strings with the names of the
long options which should be supported. The leading ``'--'`` characters
shou... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0c57510c-fd8e-4eaf-a3a5-493b9f58aef8 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,861 | supabase-export-v2 | 6bac3dc96491e941 | .. doctest::
>>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'
>>> args = s.split()
>>> args
['--condition=foo', '--testing', '--output-file', 'abc.def', '-x', 'a1', 'a2']
>>> optlist, args = getopt.getopt(args, 'x', [
... 'condition=', 'output-file=', 'testing'])
>>> optlist
[('--condition', 'f... | trusted_official_docs | CPython Docs | .. doctest::
>>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'
>>> args = s.split()
>>> args
['--condition=foo', '--testing', '--output-file', 'abc.def', '-x', 'a1', 'a2']
>>> optlist, args = getopt.getopt(args, 'x', [
... 'condition=', 'output-file=', 'testing'])
>>> optlist
[('--condition', 'f... | .. doctest::
>>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'
>>> args = s.split()
>>> args
['--condition=foo', '--testing', '--output-file', 'abc.def', '-x', 'a1', 'a2']
>>> optlist, args = getopt.getopt(args, 'x', [
... 'condition=', 'output-file=', 'testing'])
>>> optlist
[('--condition', 'f... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
135661c2-2db3-4c36-bae3-c31fb8724f41 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,845 | supabase-export-v2 | a063f804ee9f0585 | For example, if *longopts* is ``['foo', 'frob']``, the option ``--fo`` will match as ``--foo``, but ``--f`` will not match uniquely, so :exc:`GetoptError` will be raised.
The return value consists of two elements: the first is a list of ``(option,
value)`` pairs; the second is the list of program arguments left after ... | trusted_official_docs | CPython Docs | For example, if *longopts* is ``['foo', 'frob']``, the option ``--fo`` will match as ``--foo``, but ``--f`` will not match uniquely, so :exc:`GetoptError` will be raised.
The return value consists of two elements: the first is a list of ``(option,
value)`` pairs; the second is the list of program arguments left after ... | For example, if *longopts* is ``['foo', 'frob']``, the option ``--fo`` will match as ``--foo``, but ``--f`` will not match uniquely, so :exc:`GetoptError` will be raised.
The return value consists of two elements: the first is a list of ``(option,
value)`` pairs; the second is the list of program arguments left after ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2927d17a-b920-4e8e-bae7-302c29eee56d | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,862 | supabase-export-v2 | e3fcbd78524f4321 | >>> optlist, args = getopt.getopt(args, 'x', [ ... 'condition=', 'output-file=', 'testing']) >>> optlist [('--condition', 'foo'), ('--testing', ''), ('--output-file', 'abc.def'), ('-x', '')] >>> args ['a1', 'a2']
Optional arguments should be specified explicitly: | trusted_official_docs | CPython Docs | >>> optlist, args = getopt.getopt(args, 'x', [ ... 'condition=', 'output-file=', 'testing']) >>> optlist [('--condition', 'foo'), ('--testing', ''), ('--output-file', 'abc.def'), ('-x', '')] >>> args ['a1', 'a2']
Optional arguments should be specified explicitly: | >>> optlist, args = getopt.getopt(args, 'x', [ ... 'condition=', 'output-file=', 'testing']) >>> optlist [('--condition', 'foo'), ('--testing', ''), ('--output-file', 'abc.def'), ('-x', '')] >>> args ['a1', 'a2']
Optional arguments should be specified explicitly: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2bc4d79f-ac58-46cd-b5a0-b46326c20a6d | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,837 | supabase-export-v2 | 57ce83e928297b4d | --------------
This module helps scripts to parse the command line arguments in ``sys.argv``. It supports the same conventions as the Unix :c:func:`!getopt` function (including
the special meanings of arguments of the form '``-``' and '``--``'). Long
options similar to those supported by GNU software may be used as wel... | trusted_official_docs | CPython Docs | --------------
This module helps scripts to parse the command line arguments in ``sys.argv``. It supports the same conventions as the Unix :c:func:`!getopt` function (including
the special meanings of arguments of the form '``-``' and '``--``'). Long
options similar to those supported by GNU software may be used as wel... | --------------
This module helps scripts to parse the command line arguments in ``sys.argv``. It supports the same conventions as the Unix :c:func:`!getopt` function (including
the special meanings of arguments of the form '``-``' and '``--``'). Long
options similar to those supported by GNU software may be used as wel... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3f19abc2-573c-4321-aa99-a0ff370bb50a | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,841 | supabase-export-v2 | 779c111c9e457a68 | .. function:: getopt(args, shortopts, longopts=[])
Parses command line options and parameter list. *args* is the argument list to
be parsed, without the leading reference to the running program. Typically, this
means ``sys.argv[1:]``. *shortopts* is the string of option letters that the
script wants to recognize, wi... | trusted_official_docs | CPython Docs | .. function:: getopt(args, shortopts, longopts=[])
Parses command line options and parameter list. *args* is the argument list to
be parsed, without the leading reference to the running program. Typically, this
means ``sys.argv[1:]``. *shortopts* is the string of option letters that the
script wants to recognize, wi... | .. function:: getopt(args, shortopts, longopts=[])
Parses command line options and parameter list. *args* is the argument list to
be parsed, without the leading reference to the running program. Typically, this
means ``sys.argv[1:]``. *shortopts* is the string of option letters that the
script wants to recognize, wi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
44a2f56a-1303-4882-9eb8-c4778c920717 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,867 | supabase-export-v2 | 8eccc06a9df4ebb1 | .. doctest::
>>> s = 'a1 -x a2 a3 a4 --long a5 a6'
>>> args = s.split()
>>> args
['a1', '-x', 'a2', 'a3', 'a4', '--long', 'a5', 'a6']
>>> optlist, args = getopt.gnu_getopt(args, '-x:', ['long='])
>>> optlist
[(None, ['a1']), ('-x', 'a2'), (None, ['a3', 'a4']), ('--long', 'a5')]
>>> args
['a6'] | trusted_official_docs | CPython Docs | .. doctest::
>>> s = 'a1 -x a2 a3 a4 --long a5 a6'
>>> args = s.split()
>>> args
['a1', '-x', 'a2', 'a3', 'a4', '--long', 'a5', 'a6']
>>> optlist, args = getopt.gnu_getopt(args, '-x:', ['long='])
>>> optlist
[(None, ['a1']), ('-x', 'a2'), (None, ['a3', 'a4']), ('--long', 'a5')]
>>> args
['a6'] | .. doctest::
>>> s = 'a1 -x a2 a3 a4 --long a5 a6'
>>> args = s.split()
>>> args
['a1', '-x', 'a2', 'a3', 'a4', '--long', 'a5', 'a6']
>>> optlist, args = getopt.gnu_getopt(args, '-x:', ['long='])
>>> optlist
[(None, ['a1']), ('-x', 'a2'), (None, ['a3', 'a4']), ('--long', 'a5')]
>>> args
['a6'] | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
47e5a086-d344-4e39-8ea4-9c060d1e984d | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,853 | supabase-export-v2 | eaa92fb517790494 | .. exception:: GetoptError
This is raised when an unrecognized option is found in the argument list or when
an option requiring an argument is given none. The argument to the exception is
a string indicating the cause of the error. For long options, an argument given
to an option which does not require one will also... | trusted_official_docs | CPython Docs | .. exception:: GetoptError
This is raised when an unrecognized option is found in the argument list or when
an option requiring an argument is given none. The argument to the exception is
a string indicating the cause of the error. For long options, an argument given
to an option which does not require one will also... | .. exception:: GetoptError
This is raised when an unrecognized option is found in the argument list or when
an option requiring an argument is given none. The argument to the exception is
a string indicating the cause of the error. For long options, an argument given
to an option which does not require one will also... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
551363ad-4472-43cf-9a4f-58ca52baa711 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,849 | supabase-export-v2 | afc686bc5dedda78 | default. This means that option and non-option arguments may be intermixed. The :func:`getopt` function stops processing options as soon as a non-option argument is encountered.
If the first character of the option string is ``'+'``, or if the environment
variable :envvar:`!POSIXLY_CORRECT` is set, then option process... | trusted_official_docs | CPython Docs | default. This means that option and non-option arguments may be intermixed. The :func:`getopt` function stops processing options as soon as a non-option argument is encountered.
If the first character of the option string is ``'+'``, or if the environment
variable :envvar:`!POSIXLY_CORRECT` is set, then option process... | default. This means that option and non-option arguments may be intermixed. The :func:`getopt` function stops processing options as soon as a non-option argument is encountered.
If the first character of the option string is ``'+'``, or if the environment
variable :envvar:`!POSIXLY_CORRECT` is set, then option process... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5c7fb4df-ddc4-444a-95f1-6278335215bb | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,865 | supabase-export-v2 | df783283901d964e | '--color=off', '--color', 'a1', 'a2'] >>> optlist, args = getopt.getopt(args, 'C::', ['color=?']) >>> optlist [('-C', 'on'), ('-C', ''), ('--color', 'off'), ('--color', '')] >>> args ['a1', 'a2']
The order of options and non-option arguments can be preserved: | trusted_official_docs | CPython Docs | '--color=off', '--color', 'a1', 'a2'] >>> optlist, args = getopt.getopt(args, 'C::', ['color=?']) >>> optlist [('-C', 'on'), ('-C', ''), ('--color', 'off'), ('--color', '')] >>> args ['a1', 'a2']
The order of options and non-option arguments can be preserved: | '--color=off', '--color', 'a1', 'a2'] >>> optlist, args = getopt.getopt(args, 'C::', ['color=?']) >>> optlist [('-C', 'on'), ('-C', ''), ('--color', 'off'), ('--color', '')] >>> args ['a1', 'a2']
The order of options and non-option arguments can be preserved: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6d343adc-93b0-41e2-93ef-ba1602d0beed | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,846 | supabase-export-v2 | 3b36091fe4923a25 | options occur in the list in the same order in which they were found, thus allowing multiple occurrences. Long and short options may be mixed.
.. versionchanged:: 3.14
Optional arguments are supported. | trusted_official_docs | CPython Docs | options occur in the list in the same order in which they were found, thus allowing multiple occurrences. Long and short options may be mixed.
.. versionchanged:: 3.14
Optional arguments are supported. | options occur in the list in the same order in which they were found, thus allowing multiple occurrences. Long and short options may be mixed.
.. versionchanged:: 3.14
Optional arguments are supported. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
78e23315-352d-4937-9666-9c2598b6f898 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,848 | supabase-export-v2 | 379c9c05fdf83f6b | .. function:: gnu_getopt(args, shortopts, longopts=[])
This function works like :func:`getopt`, except that GNU style scanning mode is
used by default. This means that option and non-option arguments may be
intermixed. The :func:`getopt` function stops processing options as soon as a
non-option argument is encounter... | trusted_official_docs | CPython Docs | .. function:: gnu_getopt(args, shortopts, longopts=[])
This function works like :func:`getopt`, except that GNU style scanning mode is
used by default. This means that option and non-option arguments may be
intermixed. The :func:`getopt` function stops processing options as soon as a
non-option argument is encounter... | .. function:: gnu_getopt(args, shortopts, longopts=[])
This function works like :func:`getopt`, except that GNU style scanning mode is
used by default. This means that option and non-option arguments may be
intermixed. The :func:`getopt` function stops processing options as soon as a
non-option argument is encounter... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7aed730b-0794-490b-952a-ca4b43fbbb2a | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,854 | supabase-export-v2 | 44a234b9e762a56b | and :attr:`!opt` give the error message and related option; if there is no specific option to which the exception relates, :attr:`!opt` is an empty string.
.. XXX deprecated? .. exception:: error | trusted_official_docs | CPython Docs | and :attr:`!opt` give the error message and related option; if there is no specific option to which the exception relates, :attr:`!opt` is an empty string.
.. XXX deprecated? .. exception:: error | and :attr:`!opt` give the error message and related option; if there is no specific option to which the exception relates, :attr:`!opt` is an empty string.
.. XXX deprecated? .. exception:: error | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7cc9098c-0c67-4abf-8b6a-dee127331d5f | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,870 | supabase-export-v2 | 598e64ff96dbdf0e | import getopt, sys
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="])
except getopt.GetoptError as err:
# print help information and exit:
print(err) # will print something like "option -a not recognized"
usage()
sys.exit(2)
output = None
verbose = False
for o, a in opts:
... | trusted_official_docs | CPython Docs | import getopt, sys
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="])
except getopt.GetoptError as err:
# print help information and exit:
print(err) # will print something like "option -a not recognized"
usage()
sys.exit(2)
output = None
verbose = False
for o, a in opts:
... | import getopt, sys
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="])
except getopt.GetoptError as err:
# print help information and exit:
print(err) # will print something like "option -a not recognized"
usage()
sys.exit(2)
output = None
verbose = False
for o, a in opts:
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
83865db0-9b4f-4fc7-94ef-40e1df960ec7 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,850 | supabase-export-v2 | 9a13c7f3466417fc | the option string is ``'+'``, or if the environment variable :envvar:`!POSIXLY_CORRECT` is set, then option processing stops as soon as a non-option argument is encountered.
If the first character of the option string is ``'-'``, non-option arguments
that are followed by options are added to the list of option-and-val... | trusted_official_docs | CPython Docs | the option string is ``'+'``, or if the environment variable :envvar:`!POSIXLY_CORRECT` is set, then option processing stops as soon as a non-option argument is encountered.
If the first character of the option string is ``'-'``, non-option arguments
that are followed by options are added to the list of option-and-val... | the option string is ``'+'``, or if the environment variable :envvar:`!POSIXLY_CORRECT` is set, then option processing stops as soon as a non-option argument is encountered.
If the first character of the option string is ``'-'``, non-option arguments
that are followed by options are added to the list of option-and-val... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
91e7385a-7f27-4cb6-888f-12e0a675cce9 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,835 | supabase-export-v2 | 5df39116732f1665 | .. note::
This module is considered feature complete. A more declarative and
extensible alternative to this API is provided in the :mod:`optparse`
module. Further functional enhancements for command line parameter
processing are provided either as third party modules on PyPI,
or else as features in the :mod:`argpar... | trusted_official_docs | CPython Docs | .. note::
This module is considered feature complete. A more declarative and
extensible alternative to this API is provided in the :mod:`optparse`
module. Further functional enhancements for command line parameter
processing are provided either as third party modules on PyPI,
or else as features in the :mod:`argpar... | .. note::
This module is considered feature complete. A more declarative and
extensible alternative to this API is provided in the :mod:`optparse`
module. Further functional enhancements for command line parameter
processing are provided either as third party modules on PyPI,
or else as features in the :mod:`argpar... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
95298abc-e203-4b8a-af76-859ec9827361 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,858 | supabase-export-v2 | 01573ca28ca9b7a7 | .. doctest::
>>> import getopt
>>> args = '-a -b -cfoo -d bar a1 a2'.split()
>>> args
['-a', '-b', '-cfoo', '-d', 'bar', 'a1', 'a2']
>>> optlist, args = getopt.getopt(args, 'abc:d:')
>>> optlist
[('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')]
>>> args
['a1', 'a2'] | trusted_official_docs | CPython Docs | .. doctest::
>>> import getopt
>>> args = '-a -b -cfoo -d bar a1 a2'.split()
>>> args
['-a', '-b', '-cfoo', '-d', 'bar', 'a1', 'a2']
>>> optlist, args = getopt.getopt(args, 'abc:d:')
>>> optlist
[('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')]
>>> args
['a1', 'a2'] | .. doctest::
>>> import getopt
>>> args = '-a -b -cfoo -d bar a1 a2'.split()
>>> args
['-a', '-b', '-cfoo', '-d', 'bar', 'a1', 'a2']
>>> optlist, args = getopt.getopt(args, 'abc:d:')
>>> optlist
[('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')]
>>> args
['a1', 'a2'] | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
99e237e6-612c-49a2-9e1d-d1f8b536e094 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,872 | supabase-export-v2 | 3865a0ea4c528ddc | if __name__ == "__main__": main()
Note that an equivalent command line interface could be produced with less code
and more informative help and error messages by using the :mod:`optparse` module: | trusted_official_docs | CPython Docs | if __name__ == "__main__": main()
Note that an equivalent command line interface could be produced with less code
and more informative help and error messages by using the :mod:`optparse` module: | if __name__ == "__main__": main()
Note that an equivalent command line interface could be produced with less code
and more informative help and error messages by using the :mod:`optparse` module: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a01d2850-056b-4470-bf6b-ec64e354076c | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,851 | supabase-export-v2 | 3c16528d60908b7d | list of non-option arguments as its second element. The second element of the :func:`!gnu_getopt` result is a list of program arguments after the last option.
.. versionchanged:: 3.14
Support for returning intermixed options and non-option arguments in order. | trusted_official_docs | CPython Docs | list of non-option arguments as its second element. The second element of the :func:`!gnu_getopt` result is a list of program arguments after the last option.
.. versionchanged:: 3.14
Support for returning intermixed options and non-option arguments in order. | list of non-option arguments as its second element. The second element of the :func:`!gnu_getopt` result is a list of program arguments after the last option.
.. versionchanged:: 3.14
Support for returning intermixed options and non-option arguments in order. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a79a2c8d-9460-4234-9615-888ef64d9360 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,839 | supabase-export-v2 | e5602103da305c52 | get equivalent behavior while writing less code and getting better help and error messages should consider using the :mod:`optparse` module. See :ref:`choosing-an-argument-parser` for additional details.
This module provides two functions and an
exception: | trusted_official_docs | CPython Docs | get equivalent behavior while writing less code and getting better help and error messages should consider using the :mod:`optparse` module. See :ref:`choosing-an-argument-parser` for additional details.
This module provides two functions and an
exception: | get equivalent behavior while writing less code and getting better help and error messages should consider using the :mod:`optparse` module. See :ref:`choosing-an-argument-parser` for additional details.
This module provides two functions and an
exception: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b018fb8b-abfb-4eec-be9f-f872a9f95f17 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,838 | supabase-export-v2 | 50c93103d754203c | of the form '``-``' and '``--``'). Long options similar to those supported by GNU software may be used as well via an optional third argument.
Users who are unfamiliar with the Unix :c:func:`!getopt` function should consider
using the :mod:`argparse` module instead. Users who are familiar with the Unix
:c:func:`!getopt... | trusted_official_docs | CPython Docs | of the form '``-``' and '``--``'). Long options similar to those supported by GNU software may be used as well via an optional third argument.
Users who are unfamiliar with the Unix :c:func:`!getopt` function should consider
using the :mod:`argparse` module instead. Users who are familiar with the Unix
:c:func:`!getopt... | of the form '``-``' and '``--``'). Long options similar to those supported by GNU software may be used as well via an optional third argument.
Users who are unfamiliar with the Unix :c:func:`!getopt` function should consider
using the :mod:`argparse` module instead. Users who are familiar with the Unix
:c:func:`!getopt... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b305ec97-d588-4dfe-97cb-271436851a60 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,875 | supabase-export-v2 | 0679001fc87381c2 | if __name__ == '__main__': parser = optparse.OptionParser() parser.add_option('-o', '--output') parser.add_option('-v', dest='verbose', action='store_true') opts, args = parser.parse_args() process(args, output=opts.output, verbose=opts.verbose)
A roughly equivalent command line interface for this case can also be
prod... | trusted_official_docs | CPython Docs | if __name__ == '__main__': parser = optparse.OptionParser() parser.add_option('-o', '--output') parser.add_option('-v', dest='verbose', action='store_true') opts, args = parser.parse_args() process(args, output=opts.output, verbose=opts.verbose)
A roughly equivalent command line interface for this case can also be
prod... | if __name__ == '__main__': parser = optparse.OptionParser() parser.add_option('-o', '--output') parser.add_option('-v', dest='verbose', action='store_true') opts, args = parser.parse_args() process(args, output=opts.output, verbose=opts.verbose)
A roughly equivalent command line interface for this case can also be
prod... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c0f31fcb-c938-43cb-9dcc-717f033ba8fd | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,878 | supabase-export-v2 | 75110a6e3f9e234a | if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-o', '--output') parser.add_argument('-v', dest='verbose', action='store_true') parser.add_argument('rest', nargs='*') args = parser.parse_args() process(args.rest, output=args.output, verbose=args.verbose)
See :ref:`choosing-an-argument... | trusted_official_docs | CPython Docs | if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-o', '--output') parser.add_argument('-v', dest='verbose', action='store_true') parser.add_argument('rest', nargs='*') args = parser.parse_args() process(args.rest, output=args.output, verbose=args.verbose)
See :ref:`choosing-an-argument... | if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-o', '--output') parser.add_argument('-v', dest='verbose', action='store_true') parser.add_argument('rest', nargs='*') args = parser.parse_args() process(args.rest, output=args.output, verbose=args.verbose)
See :ref:`choosing-an-argument... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d5572d15-0edc-4c3a-b119-c7a9a41b1d79 | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,859 | supabase-export-v2 | c51fed181c3d9c93 | '-cfoo', '-d', 'bar', 'a1', 'a2'] >>> optlist, args = getopt.getopt(args, 'abc:d:') >>> optlist [('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')] >>> args ['a1', 'a2']
Using long option names is equally easy: | trusted_official_docs | CPython Docs | '-cfoo', '-d', 'bar', 'a1', 'a2'] >>> optlist, args = getopt.getopt(args, 'abc:d:') >>> optlist [('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')] >>> args ['a1', 'a2']
Using long option names is equally easy: | '-cfoo', '-d', 'bar', 'a1', 'a2'] >>> optlist, args = getopt.getopt(args, 'abc:d:') >>> optlist [('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')] >>> args ['a1', 'a2']
Using long option names is equally easy: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dc116370-9a8a-4365-8fc7-2180c3ebd0bb | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,868 | supabase-export-v2 | a8822dd90ac219c6 | 'a4', '--long', 'a5', 'a6'] >>> optlist, args = getopt.gnu_getopt(args, '-x:', ['long=']) >>> optlist [(None, ['a1']), ('-x', 'a2'), (None, ['a3', 'a4']), ('--long', 'a5')] >>> args ['a6']
In a script, typical usage is something like this: | trusted_official_docs | CPython Docs | 'a4', '--long', 'a5', 'a6'] >>> optlist, args = getopt.gnu_getopt(args, '-x:', ['long=']) >>> optlist [(None, ['a1']), ('-x', 'a2'), (None, ['a3', 'a4']), ('--long', 'a5')] >>> args ['a6']
In a script, typical usage is something like this: | 'a4', '--long', 'a5', 'a6'] >>> optlist, args = getopt.gnu_getopt(args, '-x:', ['long=']) >>> optlist [(None, ['a1']), ('-x', 'a2'), (None, ['a3', 'a4']), ('--long', 'a5')] >>> args ['a6']
In a script, typical usage is something like this: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f113b2da-c3c3-4885-a1c7-f61d6a7007ae | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,864 | supabase-export-v2 | 76ce05160018f2b9 | .. doctest::
>>> s = '-Con -C --color=off --color a1 a2'
>>> args = s.split()
>>> args
['-Con', '-C', '--color=off', '--color', 'a1', 'a2']
>>> optlist, args = getopt.getopt(args, 'C::', ['color=?'])
>>> optlist
[('-C', 'on'), ('-C', ''), ('--color', 'off'), ('--color', '')]
>>> args
['a1', 'a2'] | trusted_official_docs | CPython Docs | .. doctest::
>>> s = '-Con -C --color=off --color a1 a2'
>>> args = s.split()
>>> args
['-Con', '-C', '--color=off', '--color', 'a1', 'a2']
>>> optlist, args = getopt.getopt(args, 'C::', ['color=?'])
>>> optlist
[('-C', 'on'), ('-C', ''), ('--color', 'off'), ('--color', '')]
>>> args
['a1', 'a2'] | .. doctest::
>>> s = '-Con -C --color=off --color a1 a2'
>>> args = s.split()
>>> args
['-Con', '-C', '--color=off', '--color', 'a1', 'a2']
>>> optlist, args = getopt.getopt(args, 'C::', ['color=?'])
>>> optlist
[('-C', 'on'), ('-C', ''), ('--color', 'off'), ('--color', '')]
>>> args
['a1', 'a2'] | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fe983f3e-acc7-4305-bd0d-67a6e6634f5e | CPython Docs | file://datasets/cpython/Doc/library/getopt.rst | unknown | 810569cd-b17a-48aa-b575-a5694565865c | 4,871 | supabase-export-v2 | 182aa60605cf6b5b | = True elif o in ("-h", "--help"): usage() sys.exit() elif o in ("-o", "--output"): output = a else: assert False, "unhandled option" process(args, output=output, verbose=verbose)
if __name__ == "__main__":
main() | trusted_official_docs | CPython Docs | = True elif o in ("-h", "--help"): usage() sys.exit() elif o in ("-o", "--output"): output = a else: assert False, "unhandled option" process(args, output=output, verbose=verbose)
if __name__ == "__main__":
main() | = True elif o in ("-h", "--help"): usage() sys.exit() elif o in ("-o", "--output"): output = a else: assert False, "unhandled option" process(args, output=output, verbose=verbose)
if __name__ == "__main__":
main() | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
02724032-3027-4b83-b2fc-f098b989733e | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 5,010 | supabase-export-v2 | 69d6311c3a9cd0b3 | Start looking for candidate matches with the object on which the ``get_body`` method is called.
If ``related`` is not included in *preferencelist*, consider the root
part (or subpart of the root part) of any related encountered as a
candidate if the (sub-)part matches a preference. | trusted_official_docs | CPython Docs | Start looking for candidate matches with the object on which the ``get_body`` method is called.
If ``related`` is not included in *preferencelist*, consider the root
part (or subpart of the root part) of any related encountered as a
candidate if the (sub-)part matches a preference. | Start looking for candidate matches with the object on which the ``get_body`` method is called.
If ``related`` is not included in *preferencelist*, consider the root
part (or subpart of the root part) of any related encountered as a
candidate if the (sub-)part matches a preference. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
075e3a26-e319-43b5-a069-8f25f646a041 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,977 | supabase-export-v2 | 3ea8c6b7f50113c0 | .. method:: get_filename(failobj=None)
Return the value of the ``filename`` parameter of the
:mailheader:`Content-Disposition` header of the message. If the header
does not have a ``filename`` parameter, this method falls back to looking
for the ``name`` parameter on the :mailheader:`Content-Type` header. If
neithe... | trusted_official_docs | CPython Docs | .. method:: get_filename(failobj=None)
Return the value of the ``filename`` parameter of the
:mailheader:`Content-Disposition` header of the message. If the header
does not have a ``filename`` parameter, this method falls back to looking
for the ``name`` parameter on the :mailheader:`Content-Type` header. If
neithe... | .. method:: get_filename(failobj=None)
Return the value of the ``filename`` parameter of the
:mailheader:`Content-Disposition` header of the message. If the header
does not have a ``filename`` parameter, this method falls back to looking
for the ``name`` parameter on the :mailheader:`Content-Type` header. If
neithe... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0ce05bdd-5d66-41be-ba3e-7d1274e9235e | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,966 | supabase-export-v2 | d8b6f89269071eac | stored in the :mailheader:`Content-Type` header, so it only affects the return value of the ``get_content_type`` methods when no :mailheader:`Content-Type` header is present in the message.
.. method:: set_param(param, value, header='Content-Type', requote=True, \
charset=None, language='', replace=False) | trusted_official_docs | CPython Docs | stored in the :mailheader:`Content-Type` header, so it only affects the return value of the ``get_content_type`` methods when no :mailheader:`Content-Type` header is present in the message.
.. method:: set_param(param, value, header='Content-Type', requote=True, \
charset=None, language='', replace=False) | stored in the :mailheader:`Content-Type` header, so it only affects the return value of the ``get_content_type`` methods when no :mailheader:`Content-Type` header is present in the message.
.. method:: set_param(param, value, header='Content-Type', requote=True, \
charset=None, language='', replace=False) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
13e0fdc0-5ef7-46e7-9f65-372ce58a3407 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,990 | supabase-export-v2 | a7886ee8881123a2 | Return ``True`` if there is a :mailheader:`Content-Disposition` header and its (case insensitive) value is ``attachment``, ``False`` otherwise.
.. versionchanged:: 3.4.2
is_attachment is now a method instead of a property, for consistency
with :meth:`~email.message.Message.is_multipart`. | trusted_official_docs | CPython Docs | Return ``True`` if there is a :mailheader:`Content-Disposition` header and its (case insensitive) value is ``attachment``, ``False`` otherwise.
.. versionchanged:: 3.4.2
is_attachment is now a method instead of a property, for consistency
with :meth:`~email.message.Message.is_multipart`. | Return ``True`` if there is a :mailheader:`Content-Disposition` header and its (case insensitive) value is ``attachment``, ``False`` otherwise.
.. versionchanged:: 3.4.2
is_attachment is now a method instead of a property, for consistency
with :meth:`~email.message.Message.is_multipart`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
18382d41-5960-49c3-8a08-54bafe7ff407 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,969 | supabase-export-v2 | 2e6f08c1d99f1416 | defaulting to the empty string. Both *charset* and *language* should be strings. The default is to use the ``utf8`` *charset* and ``None`` for the *language*.
If *replace* is ``False`` (the default) the header is moved to the
end of the list of headers. If *replace* is ``True``, the header
will be updated in place. | trusted_official_docs | CPython Docs | defaulting to the empty string. Both *charset* and *language* should be strings. The default is to use the ``utf8`` *charset* and ``None`` for the *language*.
If *replace* is ``False`` (the default) the header is moved to the
end of the list of headers. If *replace* is ``True``, the header
will be updated in place. | defaulting to the empty string. Both *charset* and *language* should be strings. The default is to use the ``utf8`` *charset* and ``None`` for the *language*.
If *replace* is ``False`` (the default) the header is moved to the
end of the list of headers. If *replace* is ``True``, the header
will be updated in place. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1a1d356f-8e4b-4214-b4a8-7a5b6dfbb57e | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 5,004 | supabase-export-v2 | fe1026d5498ed311 | .. doctest::
>>> from email.iterators import _structure
>>> for part in msg.walk():
... print(part.get_content_maintype() == 'multipart',
... part.is_multipart())
True True
False False
False True
False False
False False
False True
False False
>>> _structure(msg)
multipart/report
text/plain
message/deliver... | trusted_official_docs | CPython Docs | .. doctest::
>>> from email.iterators import _structure
>>> for part in msg.walk():
... print(part.get_content_maintype() == 'multipart',
... part.is_multipart())
True True
False False
False True
False False
False False
False True
False False
>>> _structure(msg)
multipart/report
text/plain
message/deliver... | .. doctest::
>>> from email.iterators import _structure
>>> for part in msg.walk():
... print(part.get_content_maintype() == 'multipart',
... part.is_multipart())
True True
False False
False True
False False
False False
False True
False False
>>> _structure(msg)
multipart/report
text/plain
message/deliver... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1b525c62-8ad2-4c81-adb9-7a4eb94d39f7 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,892 | supabase-export-v2 | 4c256ac5c3f5f6f7 | .. class:: EmailMessage(policy=default)
If *policy* is specified use the rules it specifies to update and serialize
the representation of the message. If *policy* is not set, use the
:class:`~email.policy.default` policy, which follows the rules of the email
RFCs except for line endings (instead of the RFC mandated ... | trusted_official_docs | CPython Docs | .. class:: EmailMessage(policy=default)
If *policy* is specified use the rules it specifies to update and serialize
the representation of the message. If *policy* is not set, use the
:class:`~email.policy.default` policy, which follows the rules of the email
RFCs except for line endings (instead of the RFC mandated ... | .. class:: EmailMessage(policy=default)
If *policy* is specified use the rules it specifies to update and serialize
the representation of the message. If *policy* is not set, use the
:class:`~email.policy.default` policy, which follows the rules of the email
RFCs except for line endings (instead of the RFC mandated ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1dd9be7c-5661-432a-a98b-09c67302653e | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,944 | supabase-export-v2 | 059d677c5ef151f0 | .. method:: add_header(_name, _value, **_params)
Extended header setting. This method is similar to :meth:`__setitem__`
except that additional header parameters can be provided as keyword
arguments. *_name* is the header field to add and *_value* is the
*primary* value for the header. | trusted_official_docs | CPython Docs | .. method:: add_header(_name, _value, **_params)
Extended header setting. This method is similar to :meth:`__setitem__`
except that additional header parameters can be provided as keyword
arguments. *_name* is the header field to add and *_value* is the
*primary* value for the header. | .. method:: add_header(_name, _value, **_params)
Extended header setting. This method is similar to :meth:`__setitem__`
except that additional header parameters can be provided as keyword
arguments. *_name* is the header field to add and *_value* is the
*primary* value for the header. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
21bc917a-4500-41ca-a269-36cc2217a60d | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 5,049 | supabase-export-v2 | b7ada84509e20f59 | .. class:: MIMEPart(policy=default)
This class represents a subpart of a MIME message. It is identical to
:class:`EmailMessage`, except that no :mailheader:`MIME-Version` headers are
added when :meth:`~EmailMessage.set_content` is called, since sub-parts do
not need their own :mailheader:`MIME-Version` headers. | trusted_official_docs | CPython Docs | .. class:: MIMEPart(policy=default)
This class represents a subpart of a MIME message. It is identical to
:class:`EmailMessage`, except that no :mailheader:`MIME-Version` headers are
added when :meth:`~EmailMessage.set_content` is called, since sub-parts do
not need their own :mailheader:`MIME-Version` headers. | .. class:: MIMEPart(policy=default)
This class represents a subpart of a MIME message. It is identical to
:class:`EmailMessage`, except that no :mailheader:`MIME-Version` headers are
added when :meth:`~EmailMessage.set_content` is called, since sub-parts do
not need their own :mailheader:`MIME-Version` headers. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
266a6c82-e108-4075-abbf-a637490bdb0f | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,923 | supabase-export-v2 | bc913a885432cc15 | the named header field. *name* does not include the colon field separator. If the header is missing, ``None`` is returned; a :exc:`KeyError` is never raised.
Note that if the named field appears more than once in the message's
headers, exactly which of those field values will be returned is
undefined. Use the :meth:`... | trusted_official_docs | CPython Docs | the named header field. *name* does not include the colon field separator. If the header is missing, ``None`` is returned; a :exc:`KeyError` is never raised.
Note that if the named field appears more than once in the message's
headers, exactly which of those field values will be returned is
undefined. Use the :meth:`... | the named header field. *name* does not include the colon field separator. If the header is missing, ``None`` is returned; a :exc:`KeyError` is never raised.
Note that if the named field appears more than once in the message's
headers, exactly which of those field values will be returned is
undefined. Use the :meth:`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2684efe6-1aeb-4b58-bb43-9da61d353abe | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,928 | supabase-export-v2 | a05c51a5d86f8082 | you want to ensure that the new header is the only one present in the message with field name *name*, delete the field first, e.g.::
del msg['subject']
msg['subject'] = 'Python roolz!' | trusted_official_docs | CPython Docs | you want to ensure that the new header is the only one present in the message with field name *name*, delete the field first, e.g.::
del msg['subject']
msg['subject'] = 'Python roolz!' | you want to ensure that the new header is the only one present in the message with field name *name*, delete the field first, e.g.::
del msg['subject']
msg['subject'] = 'Python roolz!' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2bb2bc8f-74e4-4f8e-af10-921361676a79 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,922 | supabase-export-v2 | 7eb82a57d29bae60 | .. method:: __getitem__(name)
Return the value of the named header field. *name* does not include the
colon field separator. If the header is missing, ``None`` is returned; a
:exc:`KeyError` is never raised. | trusted_official_docs | CPython Docs | .. method:: __getitem__(name)
Return the value of the named header field. *name* does not include the
colon field separator. If the header is missing, ``None`` is returned; a
:exc:`KeyError` is never raised. | .. method:: __getitem__(name)
Return the value of the named header field. *name* does not include the
colon field separator. If the header is missing, ``None`` is returned; a
:exc:`KeyError` is never raised. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2c3ba173-ba59-4cf7-b0bf-02fd573f5333 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,939 | supabase-export-v2 | 4740ba346d6697eb | .. method:: get(name, failobj=None)
Return the value of the named header field. This is identical to
:meth:`~object.__getitem__` except that optional *failobj* is returned if the
named header is missing (*failobj* defaults to ``None``). | trusted_official_docs | CPython Docs | .. method:: get(name, failobj=None)
Return the value of the named header field. This is identical to
:meth:`~object.__getitem__` except that optional *failobj* is returned if the
named header is missing (*failobj* defaults to ``None``). | .. method:: get(name, failobj=None)
Return the value of the named header field. This is identical to
:meth:`~object.__getitem__` except that optional *failobj* is returned if the
named header is missing (*failobj* defaults to ``None``). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2f03865d-0801-4527-8d32-5240afac2243 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 5,013 | supabase-export-v2 | 724e22bfdfb26a4f | If a part has a :mailheader:`Content-Disposition` header, only consider the part a candidate match if the value of the header is ``inline``.
If none of the candidates matches any of the preferences in
*preferencelist*, return ``None``. | trusted_official_docs | CPython Docs | If a part has a :mailheader:`Content-Disposition` header, only consider the part a candidate match if the value of the header is ``inline``.
If none of the candidates matches any of the preferences in
*preferencelist*, return ``None``. | If a part has a :mailheader:`Content-Disposition` header, only consider the part a candidate match if the value of the header is ``inline``.
If none of the candidates matches any of the preferences in
*preferencelist*, return ``None``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2fee33f1-0bea-4962-a871-b966db7a96cd | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 5,030 | supabase-export-v2 | 408abe00415fad3d | .. method:: add_related(*args, content_manager=None, **kw)
If the message is a ``multipart/related``, create a new message
object, pass all of the arguments to its :meth:`set_content` method,
and :meth:`~email.message.Message.attach` it to the ``multipart``. If
the message is a non-``multipart``, call :meth:`make_re... | trusted_official_docs | CPython Docs | .. method:: add_related(*args, content_manager=None, **kw)
If the message is a ``multipart/related``, create a new message
object, pass all of the arguments to its :meth:`set_content` method,
and :meth:`~email.message.Message.attach` it to the ``multipart``. If
the message is a non-``multipart``, call :meth:`make_re... | .. method:: add_related(*args, content_manager=None, **kw)
If the message is a ``multipart/related``, create a new message
object, pass all of the arguments to its :meth:`set_content` method,
and :meth:`~email.message.Message.attach` it to the ``multipart``. If
the message is a non-``multipart``, call :meth:`make_re... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
31254455-d8c5-4770-868b-f81b4b623c10 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 5,034 | supabase-export-v2 | 3dfa59f172207697 | .. method:: add_attachment(*args, content_manager=None, **kw)
If the message is a ``multipart/mixed``, create a new message object,
pass all of the arguments to its :meth:`set_content` method, and
:meth:`~email.message.Message.attach` it to the ``multipart``. If the
message is a non-``multipart``, ``multipart/relate... | trusted_official_docs | CPython Docs | .. method:: add_attachment(*args, content_manager=None, **kw)
If the message is a ``multipart/mixed``, create a new message object,
pass all of the arguments to its :meth:`set_content` method, and
:meth:`~email.message.Message.attach` it to the ``multipart``. If the
message is a non-``multipart``, ``multipart/relate... | .. method:: add_attachment(*args, content_manager=None, **kw)
If the message is a ``multipart/mixed``, create a new message object,
pass all of the arguments to its :meth:`set_content` method, and
:meth:`~email.message.Message.attach` it to the ``multipart``. If the
message is a non-``multipart``, ``multipart/relate... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3143b335-b1cb-4b67-bf82-702eff457d25 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 5,032 | supabase-export-v2 | fa420a801445adbf | .. method:: add_alternative(*args, content_manager=None, **kw)
If the message is a ``multipart/alternative``, create a new message
object, pass all of the arguments to its :meth:`set_content` method, and
:meth:`~email.message.Message.attach` it to the ``multipart``. If the
message is a non-``multipart`` or ``multipa... | trusted_official_docs | CPython Docs | .. method:: add_alternative(*args, content_manager=None, **kw)
If the message is a ``multipart/alternative``, create a new message
object, pass all of the arguments to its :meth:`set_content` method, and
:meth:`~email.message.Message.attach` it to the ``multipart``. If the
message is a non-``multipart`` or ``multipa... | .. method:: add_alternative(*args, content_manager=None, **kw)
If the message is a ``multipart/alternative``, create a new message
object, pass all of the arguments to its :meth:`set_content` method, and
:meth:`~email.message.Message.attach` it to the ``multipart``. If the
message is a non-``multipart`` or ``multipa... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
399a6a4d-6108-4e43-9509-1436cc6ac0b1 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,895 | supabase-export-v2 | 96e449ccab0a945d | instance. This can be used to control some of the formatting produced by the method, since the specified *policy* will be passed to the :class:`~email.generator.Generator`.
Flattening the message may trigger changes to the :class:`EmailMessage`
if defaults need to be filled in to complete the transformation to a
stri... | trusted_official_docs | CPython Docs | instance. This can be used to control some of the formatting produced by the method, since the specified *policy* will be passed to the :class:`~email.generator.Generator`.
Flattening the message may trigger changes to the :class:`EmailMessage`
if defaults need to be filled in to complete the transformation to a
stri... | instance. This can be used to control some of the formatting produced by the method, since the specified *policy* will be passed to the :class:`~email.generator.Generator`.
Flattening the message may trigger changes to the :class:`EmailMessage`
if defaults need to be filled in to complete the transformation to a
stri... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3c55b812-5ecf-4e51-9f3b-2dbe1fae18ca | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,945 | supabase-export-v2 | bdcf810d97395eef | additional header parameters can be provided as keyword arguments. *_name* is the header field to add and *_value* is the *primary* value for the header.
For each item in the keyword argument dictionary *_params*, the key is
taken as the parameter name, with underscores converted to dashes (since
dashes are illegal i... | trusted_official_docs | CPython Docs | additional header parameters can be provided as keyword arguments. *_name* is the header field to add and *_value* is the *primary* value for the header.
For each item in the keyword argument dictionary *_params*, the key is
taken as the parameter name, with underscores converted to dashes (since
dashes are illegal i... | additional header parameters can be provided as keyword arguments. *_name* is the header field to add and *_value* is the *primary* value for the header.
For each item in the keyword argument dictionary *_params*, the key is
taken as the parameter name, with underscores converted to dashes (since
dashes are illegal i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3d720a2a-b4ad-4b10-851b-5a946203ed14 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,929 | supabase-export-v2 | 904327f9e0261564 | del msg['subject'] msg['subject'] = 'Python roolz!'
If the :mod:`policy <email.policy>` defines certain headers to be unique (as the standard
policies do), this method may raise a :exc:`ValueError` when an attempt
is made to assign a value to such a header when one already exists. This
behavior is intentional for co... | trusted_official_docs | CPython Docs | del msg['subject'] msg['subject'] = 'Python roolz!'
If the :mod:`policy <email.policy>` defines certain headers to be unique (as the standard
policies do), this method may raise a :exc:`ValueError` when an attempt
is made to assign a value to such a header when one already exists. This
behavior is intentional for co... | del msg['subject'] msg['subject'] = 'Python roolz!'
If the :mod:`policy <email.policy>` defines certain headers to be unique (as the standard
policies do), this method may raise a :exc:`ValueError` when an attempt
is made to assign a value to such a header when one already exists. This
behavior is intentional for co... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3ea8bd49-cccc-489c-8a38-922720e89435 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 4,982 | supabase-export-v2 | 7311acc60db9e603 | of the :mailheader:`Content-Type` header to *boundary*. :meth:`set_boundary` will always quote *boundary* if necessary. A :exc:`~email.errors.HeaderParseError` is raised if the message object has no :mailheader:`Content-Type` header.
Note that using this method is subtly different from deleting the old
:mailheader:`Co... | trusted_official_docs | CPython Docs | of the :mailheader:`Content-Type` header to *boundary*. :meth:`set_boundary` will always quote *boundary* if necessary. A :exc:`~email.errors.HeaderParseError` is raised if the message object has no :mailheader:`Content-Type` header.
Note that using this method is subtly different from deleting the old
:mailheader:`Co... | of the :mailheader:`Content-Type` header to *boundary*. :meth:`set_boundary` will always quote *boundary* if necessary. A :exc:`~email.errors.HeaderParseError` is raised if the message object has no :mailheader:`Content-Type` header.
Note that using this method is subtly different from deleting the old
:mailheader:`Co... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3f2f58bd-9779-4c31-8971-cf5d337d62fc | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 5,026 | supabase-export-v2 | c98a99631f25fb49 | .. method:: make_alternative(boundary=None)
Convert a non-``multipart`` or a ``multipart/related`` into a
``multipart/alternative``, moving any existing :mailheader:`Content-`
headers and payload into a (new) first part of the ``multipart``. If
*boundary* is specified, use it as the boundary string in the multipart,... | trusted_official_docs | CPython Docs | .. method:: make_alternative(boundary=None)
Convert a non-``multipart`` or a ``multipart/related`` into a
``multipart/alternative``, moving any existing :mailheader:`Content-`
headers and payload into a (new) first part of the ``multipart``. If
*boundary* is specified, use it as the boundary string in the multipart,... | .. method:: make_alternative(boundary=None)
Convert a non-``multipart`` or a ``multipart/related`` into a
``multipart/alternative``, moving any existing :mailheader:`Content-`
headers and payload into a (new) first part of the ``multipart``. If
*boundary* is specified, use it as the boundary string in the multipart,... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
44304ac3-fb26-4675-a4f5-ead599d44760 | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 5,043 | supabase-export-v2 | 437242aacbbbb6fb | has a *preamble* attribute, it will write this text in the area between the headers and the first boundary. See :mod:`email.parser` and :mod:`email.generator` for details.
Note that if the message object has no preamble, the *preamble* attribute
will be ``None``. | trusted_official_docs | CPython Docs | has a *preamble* attribute, it will write this text in the area between the headers and the first boundary. See :mod:`email.parser` and :mod:`email.generator` for details.
Note that if the message object has no preamble, the *preamble* attribute
will be ``None``. | has a *preamble* attribute, it will write this text in the area between the headers and the first boundary. See :mod:`email.parser` and :mod:`email.generator` for details.
Note that if the message object has no preamble, the *preamble* attribute
will be ``None``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
47a0a493-208f-43d5-a913-774e92760ede | CPython Docs | file://datasets/cpython/Doc/library/email.message.rst | unknown | 41ff365b-2463-49c8-9171-2a528ffea4cc | 5,008 | supabase-export-v2 | a2781a800f98b959 | Return the MIME part that is the best candidate to be the "body" of the message.
*preferencelist* must be a sequence of strings from the set ``related``,
``html``, and ``plain``, and indicates the order of preference for the
content type of the part returned. | trusted_official_docs | CPython Docs | Return the MIME part that is the best candidate to be the "body" of the message.
*preferencelist* must be a sequence of strings from the set ``related``,
``html``, and ``plain``, and indicates the order of preference for the
content type of the part returned. | Return the MIME part that is the best candidate to be the "body" of the message.
*preferencelist* must be a sequence of strings from the set ``related``,
``html``, and ``plain``, and indicates the order of preference for the
content type of the part returned. | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.