晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
| DIR:/proc/self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/guppy3-3.1.3.dist-info/ |
| Current File : //proc/self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/guppy3-3.1.3.dist-info/METADATA |
Metadata-Version: 2.1
Name: guppy3
Version: 3.1.3
Summary: Guppy 3 -- Guppy-PE ported to Python 3
Home-page: https://github.com/zhuyifei1999/guppy3/
Author: YiFei Zhu
Author-email: zhuyifei1999@gmail.com
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: C
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Classifier: Topic :: Software Development :: Debuggers
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
# Guppy 3
[](https://github.com/zhuyifei1999/guppy3/actions/workflows/workflow.yml) [](https://codecov.io/gh/zhuyifei1999/guppy3) [](https://pypi.org/project/guppy3/) [](https://repology.org/project/python:guppy3/versions)
[](https://pypi.org/project/guppy3/) [](https://pypi.org/project/guppy3/) [](https://pypistats.org/packages/guppy3) [](https://github.com/zhuyifei1999/guppy3/blob/master/LICENSE)
A Python Programming Environment & Heap analysis toolset.
This package contains the following subpackages:
* etc - Support modules. Contains especially the Glue protocol module.
* gsl - The Guppy Specification Language implementation. This can be used
to create documents and tests from a common source.
* heapy - The heap analysis toolset. It can be used to find information about
the objects in the heap and display the information in various ways.
* sets - Bitsets and 'nodesets' implemented in C.
Guppy 3 is a fork of Guppy-PE, created by Sverker Nilsson for Python 2.
## Requirements
You should have Python 3.7, 3.8, 3.9, 3.10, or 3.11. This package is CPython
only; PyPy and other Python implementations are not supported. Python 2 support
can be obtained from [guppy-pe](http://guppy-pe.sourceforge.net/) by
Sverker Nilsson, from which this package is forked.
To use the graphical browser, Tkinter is needed.
To use the remote monitor, threading must be available.
## Installation
Install with pip by:
```
pip install guppy3
```
Install with conda by:
```
conda install -c conda-forge guppy3
```
## Usage
The following example shows
1. How to create the session context: `h=hpy()`
2. How to show the reachable objects in the heap: `h.heap()`
4. How to show the shortest paths from the root to the single largest object: `h.heap().byid[0].sp`
3. How to create and show a set of objects: `h.iso(1,[],{})`
```python
>>> from guppy import hpy; h=hpy()
>>> h.heap()
Partition of a set of 30976 objects. Total size = 3544220 bytes.
Index Count % Size % Cumulative % Kind (class / dict of class)
0 8292 27 739022 21 739022 21 str
1 7834 25 625624 18 1364646 39 tuple
2 2079 7 300624 8 1665270 47 types.CodeType
3 400 1 297088 8 1962358 55 type
4 4168 13 279278 8 2241636 63 bytes
5 1869 6 269136 8 2510772 71 function
6 400 1 228464 6 2739236 77 dict of type
7 79 0 139704 4 2878940 81 dict of module
8 1061 3 93368 3 2972308 84 types.WrapperDescriptorType
9 172 1 81712 2 3054020 86 dict (no owner)
<89 more rows. Type e.g. '_.more' to view.>
>>> h.heap().byid[0].sp
0: h.Root.i0_modules['os'].__dict__
>>> h.iso(1,[],{})
Partition of a set of 3 objects. Total size = 348 bytes.
Index Count % Size % Cumulative % Kind (class / dict of class)
0 1 33 248 71 248 71 dict (no owner)
1 1 33 72 21 320 92 list
2 1 33 28 8 348 100 int
>>>
```
People have written awesome posts on how to use this toolset, including:
* [How to use guppy/heapy for tracking down memory usage](https://smira.ru/wp-content/uploads/2011/08/heapy.html)
* [Debugging Django memory leak with TrackRefs and Guppy](https://opensourcehacker.com/2008/03/07/debugging-django-memory-leak-with-trackrefs-and-guppy/)
* [Diagnosing Memory "Leaks" in Python](https://chase-seibert.github.io/blog/2013/08/03/diagnosing-memory-leaks-python.html)
* [Digging into python memory issues in ckan with heapy](https://leastsignificant.blogspot.com/2015/06/digging-into-python-memory-issues-in.html)
Formal and API documentation are [also available](https://zhuyifei1999.github.io/guppy3/).
## Contributing
Issues and pull requests are welcome. You may also ask for help on using this
toolset; however, in such cases, we will only provide guidance, and not profile
your code for you.
Please make sure to update tests as appropriate.
### Testing
To test if the heapy build and installation was ok, you can do:
```python
>>> from guppy import hpy
>>> hpy().test()
Testing sets
Test #0
Test #1
Test #2
...
```
There will be several more tests. Some tests may take a while.
## License
Copyright (C) 2005-2013 Sverker Nilsson, S. Nilsson Computer System AB
Copyright (C) 2019-2021 YiFei Zhu
Copyright (C) 2021-2023 YiFei Zhu, Google LLC
The right is granted to copy, use, modify and redistribute this code
according to the rules in what is commonly referred to as an MIT
license.
This is not an official Google product.
*** USE AT YOUR OWN RISK AND BE AWARE THAT THIS IS AN EARLY RELEASE ***
|