# numpy 2.5.4 (BSD-3-Clause), harvested by tools/harvest_corpus.py
=== input
Context manager for setting print options.

    Set print options for the scope of the `with` block, and restore the old
    options at the end. See `set_printoptions` for the full description of
    available options.

    Examples
    --------
    >>> import numpy as np

    >>> from numpy.testing import assert_equal
    >>> with np.printoptions(precision=2):
    ...     np.array([2.0]) / 3
    array([0.67])

    The `as`-clause of the `with`-statement gives the current print options:

    >>> with np.printoptions(precision=2) as opts:
    ...      assert_equal(opts, np.get_printoptions())

    See Also
    --------
    set_printoptions, get_printoptions

    Notes
    -----
    These print options apply only to NumPy ndarrays, not to scalars.

    **Concurrency note:** see :ref:`text_formatting_options`

    
=== parse numpydoc
short_description: 'Context manager for setting print options.'
long_description: |
  Set print options for the scope of the `with` block, and restore the old
  options at the end. See `set_printoptions` for the full description of
  available options.
blank_after_short_description: True
blank_after_long_description: True
style: numpydoc
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> import numpy as np'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> from numpy.testing import assert_equal'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
    >>> with np.printoptions(precision=2):
    ...     np.array([2.0]) / 3
    array([0.67])
- DocstringExample
  description: 'The `as`-clause of the `with`-statement gives the current print options:'
  kind: examples
  key: 'examples'
  snippet: |
    >>> with np.printoptions(precision=2) as opts:
    ...      assert_equal(opts, np.get_printoptions())
- DocstringMeta
  description: 'set_printoptions, get_printoptions'
  kind: text
  key: 'see_also'
  title: 'See Also'
- DocstringMeta
  description: |
    These print options apply only to NumPy ndarrays, not to scalars.
    
    **Concurrency note:** see :ref:`text_formatting_options`
  kind: text
  key: 'notes'
  title: 'Notes'
=== detect
numpydoc
=== compose numpydoc
Context manager for setting print options.

Set print options for the scope of the `with` block, and restore the old
options at the end. See `set_printoptions` for the full description of
available options.

Examples
--------
>>> import numpy as np
>>> from numpy.testing import assert_equal
>>> with np.printoptions(precision=2):
...     np.array([2.0]) / 3
array([0.67])

The `as`-clause of the `with`-statement gives the current print options:

>>> with np.printoptions(precision=2) as opts:
...      assert_equal(opts, np.get_printoptions())

See Also
--------
set_printoptions, get_printoptions

Notes
-----
These print options apply only to NumPy ndarrays, not to scalars.

**Concurrency note:** see :ref:`text_formatting_options`
