forked from dadadel/pyment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.py
103 lines (80 loc) · 2.2 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
def func1(param1, param2='default val'):
'''Description of func with docstring javadoc style.
@param param1: descr of param
@type param1: type
@return: some value
@raise KeyError: raises a key exception
'''
pass
def func2(param1, param2='default val2'):
'''Description of func with docstring reST style.
:param param1: descr of param
:type param1: type
:returns: some value
:raises keyError: raises exception
'''
pass
def func3(param1, param2='default val'):
'''Description of func with docstring groups style.
Params:
param1 - descr of param
Returns:
some value
Raises:
keyError: raises key exception
TypeError: raises type exception
'''
pass
class SomeClass(object):
'''My class.
'''
def method(self, prm):
'''description'''
pass
def method2(self, prm1, prm2='defaultprm'):
pass
def method_numpy(self):
"""
My numpydoc description of a kind
of very exhautive numpydoc format docstring.
Parameters
----------
first : array_like
the 1st param name `first`
second :
the 2nd param
third : {'value', 'other'}, optional
the 3rd param, by default 'value'
Returns
-------
string
a value in a string
Raises
------
KeyError
when a key error
OtherError
when an other error
See Also
--------
a_func : linked (optional), with things to say
on several lines
some blabla
Note
----
Some informations.
Some maths also:
.. math:: f(x) = e^{- x}
References
----------
Biblio with cited ref [1]_. The ref can be cited in Note section.
.. [1] Adel Daouzli, Sylvain Saïghi, Michelle Rudolph, Alain Destexhe,
Sylvie Renaud: Convergence in an Adaptive Neural Network:
The Influence of Noise Inputs Correlation. IWANN (1) 2009: 140-148
Examples
--------
This is example of use
>>> print "a"
a
"""
pass