repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
franciscogarate/pyliferisk
pyliferisk/__init__.py
Mx
def Mx(mt, x): """ Return the Mx """ n = len(mt.Cx) sum1 = 0 for j in range(x, n): k = mt.Cx[j] sum1 += k return sum1
python
def Mx(mt, x): """ Return the Mx """ n = len(mt.Cx) sum1 = 0 for j in range(x, n): k = mt.Cx[j] sum1 += k return sum1
[ "def", "Mx", "(", "mt", ",", "x", ")", ":", "n", "=", "len", "(", "mt", ".", "Cx", ")", "sum1", "=", "0", "for", "j", "in", "range", "(", "x", ",", "n", ")", ":", "k", "=", "mt", ".", "Cx", "[", "j", "]", "sum1", "+=", "k", "return", ...
Return the Mx
[ "Return", "the", "Mx" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L272-L279
franciscogarate/pyliferisk
pyliferisk/__init__.py
nEx
def nEx(mt, x, n): """ nEx : Returns the EPV of a pure endowment (deferred capital). Pure endowment benefits are conditional on the survival of the policyholder. (v^n * npx) """ return mt.Dx[x + n] / mt.Dx[x]
python
def nEx(mt, x, n): """ nEx : Returns the EPV of a pure endowment (deferred capital). Pure endowment benefits are conditional on the survival of the policyholder. (v^n * npx) """ return mt.Dx[x + n] / mt.Dx[x]
[ "def", "nEx", "(", "mt", ",", "x", ",", "n", ")", ":", "return", "mt", ".", "Dx", "[", "x", "+", "n", "]", "/", "mt", ".", "Dx", "[", "x", "]" ]
nEx : Returns the EPV of a pure endowment (deferred capital). Pure endowment benefits are conditional on the survival of the policyholder. (v^n * npx)
[ "nEx", ":", "Returns", "the", "EPV", "of", "a", "pure", "endowment", "(", "deferred", "capital", ")", ".", "Pure", "endowment", "benefits", "are", "conditional", "on", "the", "survival", "of", "the", "policyholder", ".", "(", "v^n", "*", "npx", ")" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L291-L294
franciscogarate/pyliferisk
pyliferisk/__init__.py
Axn
def Axn(mt, x, n): """ (A^1)x:n : Returns the EPV (net single premium) of a term insurance. """ return (mt.Mx[x] - mt.Mx[x + n]) / mt.Dx[x]
python
def Axn(mt, x, n): """ (A^1)x:n : Returns the EPV (net single premium) of a term insurance. """ return (mt.Mx[x] - mt.Mx[x + n]) / mt.Dx[x]
[ "def", "Axn", "(", "mt", ",", "x", ",", "n", ")", ":", "return", "(", "mt", ".", "Mx", "[", "x", "]", "-", "mt", ".", "Mx", "[", "x", "+", "n", "]", ")", "/", "mt", ".", "Dx", "[", "x", "]" ]
(A^1)x:n : Returns the EPV (net single premium) of a term insurance.
[ "(", "A^1", ")", "x", ":", "n", ":", "Returns", "the", "EPV", "(", "net", "single", "premium", ")", "of", "a", "term", "insurance", "." ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L305-L307
franciscogarate/pyliferisk
pyliferisk/__init__.py
AExn
def AExn(mt, x, n): """ AExn : Returns the EPV of a endowment insurance. An endowment insurance provides a combination of a term insurance and a pure endowment """ return (mt.Mx[x] - mt.Mx[x + n]) / mt.Dx[x] + mt.Dx[x + n] / mt.Dx[x]
python
def AExn(mt, x, n): """ AExn : Returns the EPV of a endowment insurance. An endowment insurance provides a combination of a term insurance and a pure endowment """ return (mt.Mx[x] - mt.Mx[x + n]) / mt.Dx[x] + mt.Dx[x + n] / mt.Dx[x]
[ "def", "AExn", "(", "mt", ",", "x", ",", "n", ")", ":", "return", "(", "mt", ".", "Mx", "[", "x", "]", "-", "mt", ".", "Mx", "[", "x", "+", "n", "]", ")", "/", "mt", ".", "Dx", "[", "x", "]", "+", "mt", ".", "Dx", "[", "x", "+", "n"...
AExn : Returns the EPV of a endowment insurance. An endowment insurance provides a combination of a term insurance and a pure endowment
[ "AExn", ":", "Returns", "the", "EPV", "of", "a", "endowment", "insurance", ".", "An", "endowment", "insurance", "provides", "a", "combination", "of", "a", "term", "insurance", "and", "a", "pure", "endowment" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L310-L314
franciscogarate/pyliferisk
pyliferisk/__init__.py
tAx
def tAx(mt, x, t): """ n/Ax : Returns the EPV (net single premium) of a deferred whole life insurance. """ return mt.Mx[x + t] / mt.Dx[x]
python
def tAx(mt, x, t): """ n/Ax : Returns the EPV (net single premium) of a deferred whole life insurance. """ return mt.Mx[x + t] / mt.Dx[x]
[ "def", "tAx", "(", "mt", ",", "x", ",", "t", ")", ":", "return", "mt", ".", "Mx", "[", "x", "+", "t", "]", "/", "mt", ".", "Dx", "[", "x", "]" ]
n/Ax : Returns the EPV (net single premium) of a deferred whole life insurance.
[ "n", "/", "Ax", ":", "Returns", "the", "EPV", "(", "net", "single", "premium", ")", "of", "a", "deferred", "whole", "life", "insurance", "." ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L317-L319
franciscogarate/pyliferisk
pyliferisk/__init__.py
qAx
def qAx(mt, x, q): """ This function evaluates the APV of a geometrically increasing annual annuity-due """ q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return Ax(mtj, x)
python
def qAx(mt, x, q): """ This function evaluates the APV of a geometrically increasing annual annuity-due """ q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return Ax(mtj, x)
[ "def", "qAx", "(", "mt", ",", "x", ",", "q", ")", ":", "q", "=", "float", "(", "q", ")", "j", "=", "(", "mt", ".", "i", "-", "q", ")", "/", "(", "1", "+", "q", ")", "mtj", "=", "Actuarial", "(", "nt", "=", "mt", ".", "nt", ",", "i", ...
This function evaluates the APV of a geometrically increasing annual annuity-due
[ "This", "function", "evaluates", "the", "APV", "of", "a", "geometrically", "increasing", "annual", "annuity", "-", "due" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L333-L338
franciscogarate/pyliferisk
pyliferisk/__init__.py
aaxn
def aaxn(mt, x, n, m=1): """ äxn : Return the actuarial present value of a (immediate) temporal (term certain) annuity: n-year temporary life annuity-anticipatory. Payable 'm' per year at the beginning of the period """ if m == 1: return (mt.Nx[x] - mt.Nx[x + n]) / mt.Dx[x] else: r...
python
def aaxn(mt, x, n, m=1): """ äxn : Return the actuarial present value of a (immediate) temporal (term certain) annuity: n-year temporary life annuity-anticipatory. Payable 'm' per year at the beginning of the period """ if m == 1: return (mt.Nx[x] - mt.Nx[x + n]) / mt.Dx[x] else: r...
[ "def", "aaxn", "(", "mt", ",", "x", ",", "n", ",", "m", "=", "1", ")", ":", "if", "m", "==", "1", ":", "return", "(", "mt", ".", "Nx", "[", "x", "]", "-", "mt", ".", "Nx", "[", "x", "+", "n", "]", ")", "/", "mt", ".", "Dx", "[", "x"...
äxn : Return the actuarial present value of a (immediate) temporal (term certain) annuity: n-year temporary life annuity-anticipatory. Payable 'm' per year at the beginning of the period
[ "äxn", ":", "Return", "the", "actuarial", "present", "value", "of", "a", "(", "immediate", ")", "temporal", "(", "term", "certain", ")", "annuity", ":", "n", "-", "year", "temporary", "life", "annuity", "-", "anticipatory", ".", "Payable", "m", "per", "y...
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L357-L364
franciscogarate/pyliferisk
pyliferisk/__init__.py
aax
def aax(mt, x, m=1): """ äx : Returns the actuarial present value of an (immediate) annuity of 1 per time period (whole life annuity-anticipatory). Payable 'm' per year at the beginning of the period """ return mt.Nx[x] / mt.Dx[x] - (float(m - 1) / float(m * 2))
python
def aax(mt, x, m=1): """ äx : Returns the actuarial present value of an (immediate) annuity of 1 per time period (whole life annuity-anticipatory). Payable 'm' per year at the beginning of the period """ return mt.Nx[x] / mt.Dx[x] - (float(m - 1) / float(m * 2))
[ "def", "aax", "(", "mt", ",", "x", ",", "m", "=", "1", ")", ":", "return", "mt", ".", "Nx", "[", "x", "]", "/", "mt", ".", "Dx", "[", "x", "]", "-", "(", "float", "(", "m", "-", "1", ")", "/", "float", "(", "m", "*", "2", ")", ")" ]
äx : Returns the actuarial present value of an (immediate) annuity of 1 per time period (whole life annuity-anticipatory). Payable 'm' per year at the beginning of the period
[ "äx", ":", "Returns", "the", "actuarial", "present", "value", "of", "an", "(", "immediate", ")", "annuity", "of", "1", "per", "time", "period", "(", "whole", "life", "annuity", "-", "anticipatory", ")", ".", "Payable", "m", "per", "year", "at", "the", ...
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L375-L379
franciscogarate/pyliferisk
pyliferisk/__init__.py
ax
def ax(mt, x, m=1): """ ax : Returns the actuarial present value of an (immediate) annuity of 1 per time period (whole life annuity-late). Payable 'm' per year at the ends of the period """ return (mt.Nx[x] / mt.Dx[x] - 1) + (float(m - 1) / float(m * 2))
python
def ax(mt, x, m=1): """ ax : Returns the actuarial present value of an (immediate) annuity of 1 per time period (whole life annuity-late). Payable 'm' per year at the ends of the period """ return (mt.Nx[x] / mt.Dx[x] - 1) + (float(m - 1) / float(m * 2))
[ "def", "ax", "(", "mt", ",", "x", ",", "m", "=", "1", ")", ":", "return", "(", "mt", ".", "Nx", "[", "x", "]", "/", "mt", ".", "Dx", "[", "x", "]", "-", "1", ")", "+", "(", "float", "(", "m", "-", "1", ")", "/", "float", "(", "m", "...
ax : Returns the actuarial present value of an (immediate) annuity of 1 per time period (whole life annuity-late). Payable 'm' per year at the ends of the period
[ "ax", ":", "Returns", "the", "actuarial", "present", "value", "of", "an", "(", "immediate", ")", "annuity", "of", "1", "per", "time", "period", "(", "whole", "life", "annuity", "-", "late", ")", ".", "Payable", "m", "per", "year", "at", "the", "ends", ...
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L381-L385
franciscogarate/pyliferisk
pyliferisk/__init__.py
taax
def taax(mt, x, t, m=1): """ n/äx : Return the actuarial present value of a deferred annuity (deferred n years): n-year deferred whole life annuity-anticipatory. Payable 'm' per year at the beginning of the period """ return mt.Nx[x + t] / mt.Dx[x] - ((float(m - 1) / float(m * 2)) * (1 - nEx(mt, x, t)...
python
def taax(mt, x, t, m=1): """ n/äx : Return the actuarial present value of a deferred annuity (deferred n years): n-year deferred whole life annuity-anticipatory. Payable 'm' per year at the beginning of the period """ return mt.Nx[x + t] / mt.Dx[x] - ((float(m - 1) / float(m * 2)) * (1 - nEx(mt, x, t)...
[ "def", "taax", "(", "mt", ",", "x", ",", "t", ",", "m", "=", "1", ")", ":", "return", "mt", ".", "Nx", "[", "x", "+", "t", "]", "/", "mt", ".", "Dx", "[", "x", "]", "-", "(", "(", "float", "(", "m", "-", "1", ")", "/", "float", "(", ...
n/äx : Return the actuarial present value of a deferred annuity (deferred n years): n-year deferred whole life annuity-anticipatory. Payable 'm' per year at the beginning of the period
[ "n", "/", "äx", ":", "Return", "the", "actuarial", "present", "value", "of", "a", "deferred", "annuity", "(", "deferred", "n", "years", ")", ":", "n", "-", "year", "deferred", "whole", "life", "annuity", "-", "anticipatory", ".", "Payable", "m", "per", ...
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L393-L397
franciscogarate/pyliferisk
pyliferisk/__init__.py
Iaaxn
def Iaaxn(mt, x, n, *args): """ during a term certain, IAn """ return (Sx(mt, x) - Sx(nt, x + n) - n * Nx(nt, x + n)) / Dx(nt, x)
python
def Iaaxn(mt, x, n, *args): """ during a term certain, IAn """ return (Sx(mt, x) - Sx(nt, x + n) - n * Nx(nt, x + n)) / Dx(nt, x)
[ "def", "Iaaxn", "(", "mt", ",", "x", ",", "n", ",", "*", "args", ")", ":", "return", "(", "Sx", "(", "mt", ",", "x", ")", "-", "Sx", "(", "nt", ",", "x", "+", "n", ")", "-", "n", "*", "Nx", "(", "nt", ",", "x", "+", "n", ")", ")", "...
during a term certain, IAn
[ "during", "a", "term", "certain", "IAn" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L408-L410
franciscogarate/pyliferisk
pyliferisk/__init__.py
Iaxn
def Iaxn(mt, x, n, *args): """ during a term certain, IAn """ return (Sx(mt, x + 1) - Sx(mt, x + n + 1) - n * Nx(mt, x + n + 1)) / Dx(mt, x)
python
def Iaxn(mt, x, n, *args): """ during a term certain, IAn """ return (Sx(mt, x + 1) - Sx(mt, x + n + 1) - n * Nx(mt, x + n + 1)) / Dx(mt, x)
[ "def", "Iaxn", "(", "mt", ",", "x", ",", "n", ",", "*", "args", ")", ":", "return", "(", "Sx", "(", "mt", ",", "x", "+", "1", ")", "-", "Sx", "(", "mt", ",", "x", "+", "n", "+", "1", ")", "-", "n", "*", "Nx", "(", "mt", ",", "x", "+...
during a term certain, IAn
[ "during", "a", "term", "certain", "IAn" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L412-L414
franciscogarate/pyliferisk
pyliferisk/__init__.py
Iaax
def Iaax(mt, x, *args): """ (Iä)x : Returns the present value of annuity-certain at the beginning of the first year and increasing linerly. Arithmetically increasing annuity-anticipatory """ return Sx(mt, x) / Dx(mt, x)
python
def Iaax(mt, x, *args): """ (Iä)x : Returns the present value of annuity-certain at the beginning of the first year and increasing linerly. Arithmetically increasing annuity-anticipatory """ return Sx(mt, x) / Dx(mt, x)
[ "def", "Iaax", "(", "mt", ",", "x", ",", "*", "args", ")", ":", "return", "Sx", "(", "mt", ",", "x", ")", "/", "Dx", "(", "mt", ",", "x", ")" ]
(Iä)x : Returns the present value of annuity-certain at the beginning of the first year and increasing linerly. Arithmetically increasing annuity-anticipatory
[ "(", "Iä", ")", "x", ":", "Returns", "the", "present", "value", "of", "annuity", "-", "certain", "at", "the", "beginning", "of", "the", "first", "year", "and", "increasing", "linerly", ".", "Arithmetically", "increasing", "annuity", "-", "anticipatory" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L416-L420
franciscogarate/pyliferisk
pyliferisk/__init__.py
Iax
def Iax(mt, x, *args): """ (Ia)x : Returns the present value of annuity-certain at the end of the first year and increasing linerly. Arithmetically increasing annuity-late """ return Sx(mt, x + 1) / Dx(mt, x)
python
def Iax(mt, x, *args): """ (Ia)x : Returns the present value of annuity-certain at the end of the first year and increasing linerly. Arithmetically increasing annuity-late """ return Sx(mt, x + 1) / Dx(mt, x)
[ "def", "Iax", "(", "mt", ",", "x", ",", "*", "args", ")", ":", "return", "Sx", "(", "mt", ",", "x", "+", "1", ")", "/", "Dx", "(", "mt", ",", "x", ")" ]
(Ia)x : Returns the present value of annuity-certain at the end of the first year and increasing linerly. Arithmetically increasing annuity-late
[ "(", "Ia", ")", "x", ":", "Returns", "the", "present", "value", "of", "annuity", "-", "certain", "at", "the", "end", "of", "the", "first", "year", "and", "increasing", "linerly", ".", "Arithmetically", "increasing", "annuity", "-", "late" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L422-L426
franciscogarate/pyliferisk
pyliferisk/__init__.py
Itaax
def Itaax(mt, x, t): """ deffered t years """ return (Sx(mt, x) - Sx(mt, x + t)) / Dx(mt, x)
python
def Itaax(mt, x, t): """ deffered t years """ return (Sx(mt, x) - Sx(mt, x + t)) / Dx(mt, x)
[ "def", "Itaax", "(", "mt", ",", "x", ",", "t", ")", ":", "return", "(", "Sx", "(", "mt", ",", "x", ")", "-", "Sx", "(", "mt", ",", "x", "+", "t", ")", ")", "/", "Dx", "(", "mt", ",", "x", ")" ]
deffered t years
[ "deffered", "t", "years" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L434-L436
franciscogarate/pyliferisk
pyliferisk/__init__.py
Itax
def Itax(mt, x, t): """ deffered t years """ return (Sx(mt, x + 1) - Sx(mt, x + t + 1)) / Dx(mt, x)
python
def Itax(mt, x, t): """ deffered t years """ return (Sx(mt, x + 1) - Sx(mt, x + t + 1)) / Dx(mt, x)
[ "def", "Itax", "(", "mt", ",", "x", ",", "t", ")", ":", "return", "(", "Sx", "(", "mt", ",", "x", "+", "1", ")", "-", "Sx", "(", "mt", ",", "x", "+", "t", "+", "1", ")", ")", "/", "Dx", "(", "mt", ",", "x", ")" ]
deffered t years
[ "deffered", "t", "years" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L438-L440
franciscogarate/pyliferisk
pyliferisk/__init__.py
qax
def qax(mt, x, q, m=1): """ geometrica """ q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return ax(mtj, x, m)
python
def qax(mt, x, q, m=1): """ geometrica """ q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return ax(mtj, x, m)
[ "def", "qax", "(", "mt", ",", "x", ",", "q", ",", "m", "=", "1", ")", ":", "q", "=", "float", "(", "q", ")", "j", "=", "(", "mt", ".", "i", "-", "q", ")", "/", "(", "1", "+", "q", ")", "mtj", "=", "Actuarial", "(", "nt", "=", "mt", ...
geometrica
[ "geometrica" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L443-L448
franciscogarate/pyliferisk
pyliferisk/__init__.py
qaax
def qaax(mt, x, q, m=1): """ geometrica """ q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return aax(mtj, x, m)
python
def qaax(mt, x, q, m=1): """ geometrica """ q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return aax(mtj, x, m)
[ "def", "qaax", "(", "mt", ",", "x", ",", "q", ",", "m", "=", "1", ")", ":", "q", "=", "float", "(", "q", ")", "j", "=", "(", "mt", ".", "i", "-", "q", ")", "/", "(", "1", "+", "q", ")", "mtj", "=", "Actuarial", "(", "nt", "=", "mt", ...
geometrica
[ "geometrica" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L450-L455
franciscogarate/pyliferisk
pyliferisk/__init__.py
qaxn
def qaxn(mt, x, n, q, m=1): """ geometrica """ q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return axn(mtj, x, n, m)
python
def qaxn(mt, x, n, q, m=1): """ geometrica """ q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return axn(mtj, x, n, m)
[ "def", "qaxn", "(", "mt", ",", "x", ",", "n", ",", "q", ",", "m", "=", "1", ")", ":", "q", "=", "float", "(", "q", ")", "j", "=", "(", "mt", ".", "i", "-", "q", ")", "/", "(", "1", "+", "q", ")", "mtj", "=", "Actuarial", "(", "nt", ...
geometrica
[ "geometrica" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L457-L462
franciscogarate/pyliferisk
pyliferisk/__init__.py
qaaxn
def qaaxn(mt, x, n, q, m = 1): """ geometrica """ #i = float(nt[1]) q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return aaxn(mtj, x, n, m)
python
def qaaxn(mt, x, n, q, m = 1): """ geometrica """ #i = float(nt[1]) q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return aaxn(mtj, x, n, m)
[ "def", "qaaxn", "(", "mt", ",", "x", ",", "n", ",", "q", ",", "m", "=", "1", ")", ":", "#i = float(nt[1])", "q", "=", "float", "(", "q", ")", "j", "=", "(", "mt", ".", "i", "-", "q", ")", "/", "(", "1", "+", "q", ")", "mtj", "=", "Actua...
geometrica
[ "geometrica" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L464-L470
franciscogarate/pyliferisk
pyliferisk/__init__.py
qtax
def qtax(mt, x, t, q, m=1): """ geometrica """ q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return tax(mtj, x, t) + ((float(m - 1) / float(m * 2)) * (1 - nEx(mt, x, t)))
python
def qtax(mt, x, t, q, m=1): """ geometrica """ q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return tax(mtj, x, t) + ((float(m - 1) / float(m * 2)) * (1 - nEx(mt, x, t)))
[ "def", "qtax", "(", "mt", ",", "x", ",", "t", ",", "q", ",", "m", "=", "1", ")", ":", "q", "=", "float", "(", "q", ")", "j", "=", "(", "mt", ".", "i", "-", "q", ")", "/", "(", "1", "+", "q", ")", "mtj", "=", "Actuarial", "(", "nt", ...
geometrica
[ "geometrica" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L472-L477
franciscogarate/pyliferisk
pyliferisk/__init__.py
qtaax
def qtaax(mt, x, t, q, m=1): """ geometrica """ q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return taax(mtj, x, t) - ((float(m - 1) / float(m * 2)) * (1 - nEx(mt, x, t)))
python
def qtaax(mt, x, t, q, m=1): """ geometrica """ q = float(q) j = (mt.i - q) / (1 + q) mtj = Actuarial(nt=mt.nt, i=j) return taax(mtj, x, t) - ((float(m - 1) / float(m * 2)) * (1 - nEx(mt, x, t)))
[ "def", "qtaax", "(", "mt", ",", "x", ",", "t", ",", "q", ",", "m", "=", "1", ")", ":", "q", "=", "float", "(", "q", ")", "j", "=", "(", "mt", ".", "i", "-", "q", ")", "/", "(", "1", "+", "q", ")", "mtj", "=", "Actuarial", "(", "nt", ...
geometrica
[ "geometrica" ]
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L479-L484
franciscogarate/pyliferisk
pyliferisk/__init__.py
annuity
def annuity(mt, x, n, p, m=1 , *args): """Syntax: annuity(nt, x, n, p, m, ['a/g', q], -d) Args: mt = the mortality table x = the age as integer number. n = A integer number (term of insurance in years) or 'w' = whole-life. (Also, 99 years is defined to be whole-life). ...
python
def annuity(mt, x, n, p, m=1 , *args): """Syntax: annuity(nt, x, n, p, m, ['a/g', q], -d) Args: mt = the mortality table x = the age as integer number. n = A integer number (term of insurance in years) or 'w' = whole-life. (Also, 99 years is defined to be whole-life). ...
[ "def", "annuity", "(", "mt", ",", "x", ",", "n", ",", "p", ",", "m", "=", "1", ",", "*", "args", ")", ":", "l", "=", "len", "(", "args", ")", "post", "=", "False", "incr", "=", "False", "deff", "=", "False", "arit", "=", "False", "wh_l", "=...
Syntax: annuity(nt, x, n, p, m, ['a/g', q], -d) Args: mt = the mortality table x = the age as integer number. n = A integer number (term of insurance in years) or 'w' = whole-life. (Also, 99 years is defined to be whole-life). p = Moment of payment. Syntaxis: 0 = begi...
[ "Syntax", ":", "annuity", "(", "nt", "x", "n", "p", "m", "[", "a", "/", "g", "q", "]", "-", "d", ")", "Args", ":", "mt", "=", "the", "mortality", "table", "x", "=", "the", "age", "as", "integer", "number", ".", "n", "=", "A", "integer", "numb...
train
https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L489-L609
bdcht/grandalf
grandalf/layouts.py
Layer._meanvalueattr
def _meanvalueattr(self,v): """ find new position of vertex v according to adjacency in prevlayer. position is given by the mean value of adjacent positions. experiments show that meanvalue heuristic performs better than median. """ sug = self.layout if not self.p...
python
def _meanvalueattr(self,v): """ find new position of vertex v according to adjacency in prevlayer. position is given by the mean value of adjacent positions. experiments show that meanvalue heuristic performs better than median. """ sug = self.layout if not self.p...
[ "def", "_meanvalueattr", "(", "self", ",", "v", ")", ":", "sug", "=", "self", ".", "layout", "if", "not", "self", ".", "prevlayer", "(", ")", ":", "return", "sug", ".", "grx", "[", "v", "]", ".", "bar", "bars", "=", "[", "sug", ".", "grx", "[",...
find new position of vertex v according to adjacency in prevlayer. position is given by the mean value of adjacent positions. experiments show that meanvalue heuristic performs better than median.
[ "find", "new", "position", "of", "vertex", "v", "according", "to", "adjacency", "in", "prevlayer", ".", "position", "is", "given", "by", "the", "mean", "value", "of", "adjacent", "positions", ".", "experiments", "show", "that", "meanvalue", "heuristic", "perfo...
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L211-L220
bdcht/grandalf
grandalf/layouts.py
Layer._medianindex
def _medianindex(self,v): """ find new position of vertex v according to adjacency in layer l+dir. position is given by the median value of adjacent positions. median heuristic is proven to achieve at most 3 times the minimum of crossings (while barycenter achieve in theory the o...
python
def _medianindex(self,v): """ find new position of vertex v according to adjacency in layer l+dir. position is given by the median value of adjacent positions. median heuristic is proven to achieve at most 3 times the minimum of crossings (while barycenter achieve in theory the o...
[ "def", "_medianindex", "(", "self", ",", "v", ")", ":", "assert", "self", ".", "prevlayer", "(", ")", "!=", "None", "N", "=", "self", ".", "_neighbors", "(", "v", ")", "g", "=", "self", ".", "layout", ".", "grx", "pos", "=", "[", "g", "[", "x",...
find new position of vertex v according to adjacency in layer l+dir. position is given by the median value of adjacent positions. median heuristic is proven to achieve at most 3 times the minimum of crossings (while barycenter achieve in theory the order of |V|)
[ "find", "new", "position", "of", "vertex", "v", "according", "to", "adjacency", "in", "layer", "l", "+", "dir", ".", "position", "is", "given", "by", "the", "median", "value", "of", "adjacent", "positions", ".", "median", "heuristic", "is", "proven", "to",...
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L222-L238
bdcht/grandalf
grandalf/layouts.py
Layer._neighbors
def _neighbors(self,v): """ neighbors refer to upper/lower adjacent nodes. Note that v.N() provides neighbors of v in the graph, while this method provides the Vertex and DummyVertex adjacent to v in the upper or lower layer (depending on layout.dirv state). """ a...
python
def _neighbors(self,v): """ neighbors refer to upper/lower adjacent nodes. Note that v.N() provides neighbors of v in the graph, while this method provides the Vertex and DummyVertex adjacent to v in the upper or lower layer (depending on layout.dirv state). """ a...
[ "def", "_neighbors", "(", "self", ",", "v", ")", ":", "assert", "self", ".", "layout", ".", "dag", "dirv", "=", "self", ".", "layout", ".", "dirv", "grxv", "=", "self", ".", "layout", ".", "grx", "[", "v", "]", "try", ":", "#(cache)", "return", "...
neighbors refer to upper/lower adjacent nodes. Note that v.N() provides neighbors of v in the graph, while this method provides the Vertex and DummyVertex adjacent to v in the upper or lower layer (depending on layout.dirv state).
[ "neighbors", "refer", "to", "upper", "/", "lower", "adjacent", "nodes", ".", "Note", "that", "v", ".", "N", "()", "provides", "neighbors", "of", "v", "in", "the", "graph", "while", "this", "method", "provides", "the", "Vertex", "and", "DummyVertex", "adjac...
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L240-L263
bdcht/grandalf
grandalf/layouts.py
Layer._crossings
def _crossings(self): """ counts (inefficently but at least accurately) the number of crossing edges between layer l and l+dirv. P[i][j] counts the number of crossings from j-th edge of vertex i. The total count of crossings is the sum of flattened P: x = sum(sum(P,[])) ...
python
def _crossings(self): """ counts (inefficently but at least accurately) the number of crossing edges between layer l and l+dirv. P[i][j] counts the number of crossings from j-th edge of vertex i. The total count of crossings is the sum of flattened P: x = sum(sum(P,[])) ...
[ "def", "_crossings", "(", "self", ")", ":", "g", "=", "self", ".", "layout", ".", "grx", "P", "=", "[", "]", "for", "v", "in", "self", ":", "P", ".", "append", "(", "[", "g", "[", "x", "]", ".", "pos", "for", "x", "in", "self", ".", "_neigh...
counts (inefficently but at least accurately) the number of crossing edges between layer l and l+dirv. P[i][j] counts the number of crossings from j-th edge of vertex i. The total count of crossings is the sum of flattened P: x = sum(sum(P,[]))
[ "counts", "(", "inefficently", "but", "at", "least", "accurately", ")", "the", "number", "of", "crossing", "edges", "between", "layer", "l", "and", "l", "+", "dirv", ".", "P", "[", "i", "]", "[", "j", "]", "counts", "the", "number", "of", "crossings", ...
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L265-L282
bdcht/grandalf
grandalf/layouts.py
Layer._cc
def _cc(self): """ implementation of the efficient bilayer cross counting by insert-sort (see Barth & Mutzel paper "Simple and Efficient Bilayer Cross Counting") """ g=self.layout.grx P=[] for v in self: P.extend(sorted([g[x].pos for x in self._neighbo...
python
def _cc(self): """ implementation of the efficient bilayer cross counting by insert-sort (see Barth & Mutzel paper "Simple and Efficient Bilayer Cross Counting") """ g=self.layout.grx P=[] for v in self: P.extend(sorted([g[x].pos for x in self._neighbo...
[ "def", "_cc", "(", "self", ")", ":", "g", "=", "self", ".", "layout", ".", "grx", "P", "=", "[", "]", "for", "v", "in", "self", ":", "P", ".", "extend", "(", "sorted", "(", "[", "g", "[", "x", "]", ".", "pos", "for", "x", "in", "self", "....
implementation of the efficient bilayer cross counting by insert-sort (see Barth & Mutzel paper "Simple and Efficient Bilayer Cross Counting")
[ "implementation", "of", "the", "efficient", "bilayer", "cross", "counting", "by", "insert", "-", "sort", "(", "see", "Barth", "&", "Mutzel", "paper", "Simple", "and", "Efficient", "Bilayer", "Cross", "Counting", ")" ]
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L284-L300
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout.init_all
def init_all(self,roots=None,inverted_edges=None,optimize=False): """initializes the layout algorithm by computing roots (unless provided), inverted edges (unless provided), vertices ranks and creates all dummy vertices and layers. Parameters: ro...
python
def init_all(self,roots=None,inverted_edges=None,optimize=False): """initializes the layout algorithm by computing roots (unless provided), inverted edges (unless provided), vertices ranks and creates all dummy vertices and layers. Parameters: ro...
[ "def", "init_all", "(", "self", ",", "roots", "=", "None", ",", "inverted_edges", "=", "None", ",", "optimize", "=", "False", ")", ":", "if", "self", ".", "initdone", ":", "return", "# For layered sugiyama algorithm, the input graph must be acyclic,", "# so we must ...
initializes the layout algorithm by computing roots (unless provided), inverted edges (unless provided), vertices ranks and creates all dummy vertices and layers. Parameters: roots (list[Vertex]): set *root* vertices (layer 0) inverted_ed...
[ "initializes", "the", "layout", "algorithm", "by", "computing", "roots", "(", "unless", "provided", ")", "inverted", "edges", "(", "unless", "provided", ")", "vertices", "ranks", "and", "creates", "all", "dummy", "vertices", "and", "layers", ".", "Parameters", ...
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L378-L404
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout.draw
def draw(self,N=1.5): """compute every node coordinates after converging to optimal ordering by N rounds, and finally perform the edge routing. """ while N>0.5: for (l,mvmt) in self.ordering_step(): pass N = N-1 if N>0: for (...
python
def draw(self,N=1.5): """compute every node coordinates after converging to optimal ordering by N rounds, and finally perform the edge routing. """ while N>0.5: for (l,mvmt) in self.ordering_step(): pass N = N-1 if N>0: for (...
[ "def", "draw", "(", "self", ",", "N", "=", "1.5", ")", ":", "while", "N", ">", "0.5", ":", "for", "(", "l", ",", "mvmt", ")", "in", "self", ".", "ordering_step", "(", ")", ":", "pass", "N", "=", "N", "-", "1", "if", "N", ">", "0", ":", "f...
compute every node coordinates after converging to optimal ordering by N rounds, and finally perform the edge routing.
[ "compute", "every", "node", "coordinates", "after", "converging", "to", "optimal", "ordering", "by", "N", "rounds", "and", "finally", "perform", "the", "edge", "routing", "." ]
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L406-L418
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout.rank_all
def rank_all(self,roots,optimize=False): """Computes rank of all vertices. add provided roots to rank 0 vertices, otherwise update ranking from provided roots. The initial rank is based on precedence relationships, optimal ranking may be derived from network flow (simplex). ...
python
def rank_all(self,roots,optimize=False): """Computes rank of all vertices. add provided roots to rank 0 vertices, otherwise update ranking from provided roots. The initial rank is based on precedence relationships, optimal ranking may be derived from network flow (simplex). ...
[ "def", "rank_all", "(", "self", ",", "roots", ",", "optimize", "=", "False", ")", ":", "self", ".", "_edge_inverter", "(", ")", "r", "=", "[", "x", "for", "x", "in", "self", ".", "g", ".", "sV", "if", "(", "len", "(", "x", ".", "e_in", "(", "...
Computes rank of all vertices. add provided roots to rank 0 vertices, otherwise update ranking from provided roots. The initial rank is based on precedence relationships, optimal ranking may be derived from network flow (simplex).
[ "Computes", "rank", "of", "all", "vertices", ".", "add", "provided", "roots", "to", "rank", "0", "vertices", "otherwise", "update", "ranking", "from", "provided", "roots", ".", "The", "initial", "rank", "is", "based", "on", "precedence", "relationships", "opti...
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L461-L472
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout._rank_init
def _rank_init(self,unranked): """Computes rank of provided unranked list of vertices and all their children. A vertex will be asign a rank when all its inward edges have been *scanned*. When a vertex is asigned a rank, its outward edges are marked *scanned*. """ ...
python
def _rank_init(self,unranked): """Computes rank of provided unranked list of vertices and all their children. A vertex will be asign a rank when all its inward edges have been *scanned*. When a vertex is asigned a rank, its outward edges are marked *scanned*. """ ...
[ "def", "_rank_init", "(", "self", ",", "unranked", ")", ":", "assert", "self", ".", "dag", "scan", "=", "{", "}", "# set rank of unranked based on its in-edges vertices ranks:", "while", "len", "(", "unranked", ")", ">", "0", ":", "l", "=", "[", "]", "for", ...
Computes rank of provided unranked list of vertices and all their children. A vertex will be asign a rank when all its inward edges have been *scanned*. When a vertex is asigned a rank, its outward edges are marked *scanned*.
[ "Computes", "rank", "of", "provided", "unranked", "list", "of", "vertices", "and", "all", "their", "children", ".", "A", "vertex", "will", "be", "asign", "a", "rank", "when", "all", "its", "inward", "edges", "have", "been", "*", "scanned", "*", ".", "Whe...
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L474-L493
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout._rank_optimize
def _rank_optimize(self): """optimize ranking by pushing long edges toward lower layers as much as possible. see other interersting network flow solver to minimize total edge length (http://jgaa.info/accepted/2005/EiglspergerSiebenhallerKaufmann2005.9.3.pdf) """ assert self.dag ...
python
def _rank_optimize(self): """optimize ranking by pushing long edges toward lower layers as much as possible. see other interersting network flow solver to minimize total edge length (http://jgaa.info/accepted/2005/EiglspergerSiebenhallerKaufmann2005.9.3.pdf) """ assert self.dag ...
[ "def", "_rank_optimize", "(", "self", ")", ":", "assert", "self", ".", "dag", "for", "l", "in", "reversed", "(", "self", ".", "layers", ")", ":", "for", "v", "in", "l", ":", "gv", "=", "self", ".", "grx", "[", "v", "]", "for", "x", "in", "v", ...
optimize ranking by pushing long edges toward lower layers as much as possible. see other interersting network flow solver to minimize total edge length (http://jgaa.info/accepted/2005/EiglspergerSiebenhallerKaufmann2005.9.3.pdf)
[ "optimize", "ranking", "by", "pushing", "long", "edges", "toward", "lower", "layers", "as", "much", "as", "possible", ".", "see", "other", "interersting", "network", "flow", "solver", "to", "minimize", "total", "edge", "length", "(", "http", ":", "//", "jgaa...
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L495-L509
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout.setrank
def setrank(self,v): """set rank value for vertex v and add it to the corresponding layer. The Layer is created if it is the first vertex with this rank. """ assert self.dag r=max([self.grx[x].rank for x in v.N(-1)]+[-1])+1 self.grx[v].rank=r # add it to its la...
python
def setrank(self,v): """set rank value for vertex v and add it to the corresponding layer. The Layer is created if it is the first vertex with this rank. """ assert self.dag r=max([self.grx[x].rank for x in v.N(-1)]+[-1])+1 self.grx[v].rank=r # add it to its la...
[ "def", "setrank", "(", "self", ",", "v", ")", ":", "assert", "self", ".", "dag", "r", "=", "max", "(", "[", "self", ".", "grx", "[", "x", "]", ".", "rank", "for", "x", "in", "v", ".", "N", "(", "-", "1", ")", "]", "+", "[", "-", "1", "]...
set rank value for vertex v and add it to the corresponding layer. The Layer is created if it is the first vertex with this rank.
[ "set", "rank", "value", "for", "vertex", "v", "and", "add", "it", "to", "the", "corresponding", "layer", ".", "The", "Layer", "is", "created", "if", "it", "is", "the", "first", "vertex", "with", "this", "rank", "." ]
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L512-L524
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout.dummyctrl
def dummyctrl(self,r,ctrl): """creates a DummyVertex at rank r inserted in the ctrl dict of the associated edge and layer. Arguments: r (int): rank value ctrl (dict): the edge's control vertices Returns: DummyVertex : the cr...
python
def dummyctrl(self,r,ctrl): """creates a DummyVertex at rank r inserted in the ctrl dict of the associated edge and layer. Arguments: r (int): rank value ctrl (dict): the edge's control vertices Returns: DummyVertex : the cr...
[ "def", "dummyctrl", "(", "self", ",", "r", ",", "ctrl", ")", ":", "dv", "=", "DummyVertex", "(", "r", ")", "dv", ".", "view", ".", "w", ",", "dv", ".", "view", ".", "h", "=", "self", ".", "dw", ",", "self", ".", "dh", "self", ".", "grx", "[...
creates a DummyVertex at rank r inserted in the ctrl dict of the associated edge and layer. Arguments: r (int): rank value ctrl (dict): the edge's control vertices Returns: DummyVertex : the created DummyVertex.
[ "creates", "a", "DummyVertex", "at", "rank", "r", "inserted", "in", "the", "ctrl", "dict", "of", "the", "associated", "edge", "and", "layer", "." ]
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L526-L543
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout.setdummies
def setdummies(self,e): """creates and defines all needed dummy vertices for edge e. """ v0,v1 = e.v r0,r1 = self.grx[v0].rank,self.grx[v1].rank if r0>r1: assert e in self.alt_e v0,v1 = v1,v0 r0,r1 = r1,r0 if (r1-r0)>1: # "d...
python
def setdummies(self,e): """creates and defines all needed dummy vertices for edge e. """ v0,v1 = e.v r0,r1 = self.grx[v0].rank,self.grx[v1].rank if r0>r1: assert e in self.alt_e v0,v1 = v1,v0 r0,r1 = r1,r0 if (r1-r0)>1: # "d...
[ "def", "setdummies", "(", "self", ",", "e", ")", ":", "v0", ",", "v1", "=", "e", ".", "v", "r0", ",", "r1", "=", "self", ".", "grx", "[", "v0", "]", ".", "rank", ",", "self", ".", "grx", "[", "v1", "]", ".", "rank", "if", "r0", ">", "r1",...
creates and defines all needed dummy vertices for edge e.
[ "creates", "and", "defines", "all", "needed", "dummy", "vertices", "for", "edge", "e", "." ]
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L545-L561
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout.draw_step
def draw_step(self): """iterator that computes all vertices coordinates and edge routing after just one step (one layer after the other from top to bottom to top). Purely inefficient ! Use it only for "animation" or debugging purpose. """ ostep = self.ordering_step() ...
python
def draw_step(self): """iterator that computes all vertices coordinates and edge routing after just one step (one layer after the other from top to bottom to top). Purely inefficient ! Use it only for "animation" or debugging purpose. """ ostep = self.ordering_step() ...
[ "def", "draw_step", "(", "self", ")", ":", "ostep", "=", "self", ".", "ordering_step", "(", ")", "for", "s", "in", "ostep", ":", "self", ".", "setxy", "(", ")", "self", ".", "draw_edges", "(", ")", "yield", "s" ]
iterator that computes all vertices coordinates and edge routing after just one step (one layer after the other from top to bottom to top). Purely inefficient ! Use it only for "animation" or debugging purpose.
[ "iterator", "that", "computes", "all", "vertices", "coordinates", "and", "edge", "routing", "after", "just", "one", "step", "(", "one", "layer", "after", "the", "other", "from", "top", "to", "bottom", "to", "top", ")", ".", "Purely", "inefficient", "!", "U...
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L563-L572
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout.ordering_step
def ordering_step(self,oneway=False): """iterator that computes all vertices ordering in their layers (one layer after the other from top to bottom, to top again unless oneway is True). """ self.dirv=-1 crossings = 0 for l in self.layers: mvmt = ...
python
def ordering_step(self,oneway=False): """iterator that computes all vertices ordering in their layers (one layer after the other from top to bottom, to top again unless oneway is True). """ self.dirv=-1 crossings = 0 for l in self.layers: mvmt = ...
[ "def", "ordering_step", "(", "self", ",", "oneway", "=", "False", ")", ":", "self", ".", "dirv", "=", "-", "1", "crossings", "=", "0", "for", "l", "in", "self", ".", "layers", ":", "mvmt", "=", "l", ".", "order", "(", ")", "crossings", "+=", "mvm...
iterator that computes all vertices ordering in their layers (one layer after the other from top to bottom, to top again unless oneway is True).
[ "iterator", "that", "computes", "all", "vertices", "ordering", "in", "their", "layers", "(", "one", "layer", "after", "the", "other", "from", "top", "to", "bottom", "to", "top", "again", "unless", "oneway", "is", "True", ")", "." ]
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L574-L591
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout.setxy
def setxy(self): """computes all vertex coordinates (x,y) using an algorithm by Brandes & Kopf. """ self._edge_inverter() self._detect_alignment_conflicts() inf = float('infinity') # initialize vertex coordinates attributes: for l in self.layers: ...
python
def setxy(self): """computes all vertex coordinates (x,y) using an algorithm by Brandes & Kopf. """ self._edge_inverter() self._detect_alignment_conflicts() inf = float('infinity') # initialize vertex coordinates attributes: for l in self.layers: ...
[ "def", "setxy", "(", "self", ")", ":", "self", ".", "_edge_inverter", "(", ")", "self", ".", "_detect_alignment_conflicts", "(", ")", "inf", "=", "float", "(", "'infinity'", ")", "# initialize vertex coordinates attributes:", "for", "l", "in", "self", ".", "la...
computes all vertex coordinates (x,y) using an algorithm by Brandes & Kopf.
[ "computes", "all", "vertex", "coordinates", "(", "x", "y", ")", "using", "an", "algorithm", "by", "Brandes", "&", "Kopf", "." ]
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L593-L626
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout._detect_alignment_conflicts
def _detect_alignment_conflicts(self): """mark conflicts between edges: inner edges are edges between dummy nodes type 0 is regular crossing regular (or sharing vertex) type 1 is inner crossing regular (targeted crossings) type 2 is inner crossing inner (avoided by reduce_crossin...
python
def _detect_alignment_conflicts(self): """mark conflicts between edges: inner edges are edges between dummy nodes type 0 is regular crossing regular (or sharing vertex) type 1 is inner crossing regular (targeted crossings) type 2 is inner crossing inner (avoided by reduce_crossin...
[ "def", "_detect_alignment_conflicts", "(", "self", ")", ":", "curvh", "=", "self", ".", "dirvh", "# save current dirvh value", "self", ".", "dirvh", "=", "0", "self", ".", "conflicts", "=", "[", "]", "for", "L", "in", "self", ".", "layers", ":", "last", ...
mark conflicts between edges: inner edges are edges between dummy nodes type 0 is regular crossing regular (or sharing vertex) type 1 is inner crossing regular (targeted crossings) type 2 is inner crossing inner (avoided by reduce_crossings phase)
[ "mark", "conflicts", "between", "edges", ":", "inner", "edges", "are", "edges", "between", "dummy", "nodes", "type", "0", "is", "regular", "crossing", "regular", "(", "or", "sharing", "vertex", ")", "type", "1", "is", "inner", "crossing", "regular", "(", "...
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L628-L658
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout._coord_vertical_alignment
def _coord_vertical_alignment(self): """performs vertical alignment according to current dirvh internal state. """ dirh,dirv = self.dirh,self.dirv g = self.grx for l in self.layers[::-dirv]: if not l.prevlayer(): continue r=None for vk in l[::d...
python
def _coord_vertical_alignment(self): """performs vertical alignment according to current dirvh internal state. """ dirh,dirv = self.dirh,self.dirv g = self.grx for l in self.layers[::-dirv]: if not l.prevlayer(): continue r=None for vk in l[::d...
[ "def", "_coord_vertical_alignment", "(", "self", ")", ":", "dirh", ",", "dirv", "=", "self", ".", "dirh", ",", "self", ".", "dirv", "g", "=", "self", ".", "grx", "for", "l", "in", "self", ".", "layers", "[", ":", ":", "-", "dirv", "]", ":", "if",...
performs vertical alignment according to current dirvh internal state.
[ "performs", "vertical", "alignment", "according", "to", "current", "dirvh", "internal", "state", "." ]
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L660-L682
bdcht/grandalf
grandalf/layouts.py
SugiyamaLayout.draw_edges
def draw_edges(self): """Basic edge routing applied only for edges with dummy points. Enhanced edge routing can be performed by using the apropriate *route_with_xxx* functions from :ref:routing_ in the edges' view. """ for e in self.g.E(): if hasattr(e,'view'): ...
python
def draw_edges(self): """Basic edge routing applied only for edges with dummy points. Enhanced edge routing can be performed by using the apropriate *route_with_xxx* functions from :ref:routing_ in the edges' view. """ for e in self.g.E(): if hasattr(e,'view'): ...
[ "def", "draw_edges", "(", "self", ")", ":", "for", "e", "in", "self", ".", "g", ".", "E", "(", ")", ":", "if", "hasattr", "(", "e", ",", "'view'", ")", ":", "l", "=", "[", "]", "r0", ",", "r1", "=", "None", ",", "None", "if", "e", "in", "...
Basic edge routing applied only for edges with dummy points. Enhanced edge routing can be performed by using the apropriate *route_with_xxx* functions from :ref:routing_ in the edges' view.
[ "Basic", "edge", "routing", "applied", "only", "for", "edges", "with", "dummy", "points", ".", "Enhanced", "edge", "routing", "can", "be", "performed", "by", "using", "the", "apropriate", "*", "route_with_xxx", "*", "functions", "from", ":", "ref", ":", "rou...
train
https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L755-L778
MSchnei/pyprf_feature
pyprf_feature/analysis/pyprf_main.py
pyprf
def pyprf(strCsvCnfg, lgcTest=False, varRat=None, strPathHrf=None): """ Main function for pRF mapping. Parameters ---------- strCsvCnfg : str Absolute file path of config file. lgcTest : Boolean Whether this is a test (pytest). If yes, absolute path of pyprf libary will ...
python
def pyprf(strCsvCnfg, lgcTest=False, varRat=None, strPathHrf=None): """ Main function for pRF mapping. Parameters ---------- strCsvCnfg : str Absolute file path of config file. lgcTest : Boolean Whether this is a test (pytest). If yes, absolute path of pyprf libary will ...
[ "def", "pyprf", "(", "strCsvCnfg", ",", "lgcTest", "=", "False", ",", "varRat", "=", "None", ",", "strPathHrf", "=", "None", ")", ":", "# *************************************************************************", "# *** Check time", "print", "(", "'---pRF analysis'", "...
Main function for pRF mapping. Parameters ---------- strCsvCnfg : str Absolute file path of config file. lgcTest : Boolean Whether this is a test (pytest). If yes, absolute path of pyprf libary will be prepended to config file paths. varRat : float, default None Rati...
[ "Main", "function", "for", "pRF", "mapping", "." ]
train
https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/pyprf_main.py#L37-L366
osilkin98/PyBRY
pybry/base_api.py
BaseApi.make_request
def make_request(cls, url, method, params=None, basic_auth=None, timeout=600): """ Makes a cURL POST request to the given URL, specifying the data to be passed in as {"method": method, "params": parameters} :param str url: URL to connect to. :param str method: The API method to call. ...
python
def make_request(cls, url, method, params=None, basic_auth=None, timeout=600): """ Makes a cURL POST request to the given URL, specifying the data to be passed in as {"method": method, "params": parameters} :param str url: URL to connect to. :param str method: The API method to call. ...
[ "def", "make_request", "(", "cls", ",", "url", ",", "method", ",", "params", "=", "None", ",", "basic_auth", "=", "None", ",", "timeout", "=", "600", ")", ":", "# Default parameters", "params", "=", "{", "}", "if", "params", "is", "None", "else", "para...
Makes a cURL POST request to the given URL, specifying the data to be passed in as {"method": method, "params": parameters} :param str url: URL to connect to. :param str method: The API method to call. :param dict params: Dictionary object of the parameters associated with the `method`...
[ "Makes", "a", "cURL", "POST", "request", "to", "the", "given", "URL", "specifying", "the", "data", "to", "be", "passed", "in", "as", "{", "method", ":", "method", "params", ":", "parameters", "}" ]
train
https://github.com/osilkin98/PyBRY/blob/af86805a8077916f72f3fe980943d4cd741e61f0/pybry/base_api.py#L29-L99
MSchnei/pyprf_feature
pyprf_feature/analysis/prepro/prepro_conv_load.py
load_png
def load_png(varNumVol, strPathPng, tplVslSpcSze=(200, 200), varStrtIdx=0, varZfill=3): """ Load PNGs with stimulus information for pRF model creation. Parameters ---------- varNumVol : int Number of PNG files. strPathPng : str Parent directory of PNG files. PNG fil...
python
def load_png(varNumVol, strPathPng, tplVslSpcSze=(200, 200), varStrtIdx=0, varZfill=3): """ Load PNGs with stimulus information for pRF model creation. Parameters ---------- varNumVol : int Number of PNG files. strPathPng : str Parent directory of PNG files. PNG fil...
[ "def", "load_png", "(", "varNumVol", ",", "strPathPng", ",", "tplVslSpcSze", "=", "(", "200", ",", "200", ")", ",", "varStrtIdx", "=", "0", ",", "varZfill", "=", "3", ")", ":", "# Create list of png files to load:", "lstPngPaths", "=", "[", "None", "]", "*...
Load PNGs with stimulus information for pRF model creation. Parameters ---------- varNumVol : int Number of PNG files. strPathPng : str Parent directory of PNG files. PNG files need to be organsied in numerical order (e.g. `file_001.png`, `file_002.png`, etc.). tplVslSpcSze ...
[ "Load", "PNGs", "with", "stimulus", "information", "for", "pRF", "model", "creation", "." ]
train
https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/prepro/prepro_conv_load.py#L34-L119
MSchnei/pyprf_feature
pyprf_feature/analysis/prepro/prepro_conv_load.py
load_ev_txt
def load_ev_txt(strPthEv): """Load information from event text file. Parameters ---------- input1 : str Path to event text file Returns ------- aryEvTxt : 2d numpy array, shape [n_measurements, 3] Array with info about conditions: type, onset, duration Notes ----- ...
python
def load_ev_txt(strPthEv): """Load information from event text file. Parameters ---------- input1 : str Path to event text file Returns ------- aryEvTxt : 2d numpy array, shape [n_measurements, 3] Array with info about conditions: type, onset, duration Notes ----- ...
[ "def", "load_ev_txt", "(", "strPthEv", ")", ":", "aryEvTxt", "=", "np", ".", "loadtxt", "(", "strPthEv", ",", "dtype", "=", "'float'", ",", "comments", "=", "'#'", ",", "delimiter", "=", "' '", ",", "skiprows", "=", "0", ",", "usecols", "=", "(", "0"...
Load information from event text file. Parameters ---------- input1 : str Path to event text file Returns ------- aryEvTxt : 2d numpy array, shape [n_measurements, 3] Array with info about conditions: type, onset, duration Notes ----- Part of py_pRF_mapping library.
[ "Load", "information", "from", "event", "text", "file", "." ]
train
https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/prepro/prepro_conv_load.py#L122-L139
bachya/pyflunearyou
pyflunearyou/cdc.py
adjust_status
def adjust_status(info: dict) -> dict: """Apply status mapping to a raw API result.""" modified_info = deepcopy(info) modified_info.update({ 'level': get_nearest_by_numeric_key(STATUS_MAP, int(info['level'])), 'level2': STATUS_MAP[99] if info['level2'] is None else ...
python
def adjust_status(info: dict) -> dict: """Apply status mapping to a raw API result.""" modified_info = deepcopy(info) modified_info.update({ 'level': get_nearest_by_numeric_key(STATUS_MAP, int(info['level'])), 'level2': STATUS_MAP[99] if info['level2'] is None else ...
[ "def", "adjust_status", "(", "info", ":", "dict", ")", "->", "dict", ":", "modified_info", "=", "deepcopy", "(", "info", ")", "modified_info", ".", "update", "(", "{", "'level'", ":", "get_nearest_by_numeric_key", "(", "STATUS_MAP", ",", "int", "(", "info", ...
Apply status mapping to a raw API result.
[ "Apply", "status", "mapping", "to", "a", "raw", "API", "result", "." ]
train
https://github.com/bachya/pyflunearyou/blob/16a2f839c8df851e925e010a6b5c5708386febac/pyflunearyou/cdc.py#L23-L34
bachya/pyflunearyou
pyflunearyou/cdc.py
CdcReport.status_by_coordinates
async def status_by_coordinates( self, latitude: float, longitude: float) -> dict: """Return the CDC status for the provided latitude/longitude.""" cdc_data = await self.raw_cdc_data() nearest = await self.nearest_by_coordinates(latitude, longitude) return adjust_status(cdc_d...
python
async def status_by_coordinates( self, latitude: float, longitude: float) -> dict: """Return the CDC status for the provided latitude/longitude.""" cdc_data = await self.raw_cdc_data() nearest = await self.nearest_by_coordinates(latitude, longitude) return adjust_status(cdc_d...
[ "async", "def", "status_by_coordinates", "(", "self", ",", "latitude", ":", "float", ",", "longitude", ":", "float", ")", "->", "dict", ":", "cdc_data", "=", "await", "self", ".", "raw_cdc_data", "(", ")", "nearest", "=", "await", "self", ".", "nearest_by_...
Return the CDC status for the provided latitude/longitude.
[ "Return", "the", "CDC", "status", "for", "the", "provided", "latitude", "/", "longitude", "." ]
train
https://github.com/bachya/pyflunearyou/blob/16a2f839c8df851e925e010a6b5c5708386febac/pyflunearyou/cdc.py#L51-L56
bachya/pyflunearyou
pyflunearyou/cdc.py
CdcReport.status_by_state
async def status_by_state(self, state: str) -> dict: """Return the CDC status for the specified state.""" data = await self.raw_cdc_data() try: info = next((v for k, v in data.items() if state in k)) except StopIteration: return {} return adjust_status(i...
python
async def status_by_state(self, state: str) -> dict: """Return the CDC status for the specified state.""" data = await self.raw_cdc_data() try: info = next((v for k, v in data.items() if state in k)) except StopIteration: return {} return adjust_status(i...
[ "async", "def", "status_by_state", "(", "self", ",", "state", ":", "str", ")", "->", "dict", ":", "data", "=", "await", "self", ".", "raw_cdc_data", "(", ")", "try", ":", "info", "=", "next", "(", "(", "v", "for", "k", ",", "v", "in", "data", "."...
Return the CDC status for the specified state.
[ "Return", "the", "CDC", "status", "for", "the", "specified", "state", "." ]
train
https://github.com/bachya/pyflunearyou/blob/16a2f839c8df851e925e010a6b5c5708386febac/pyflunearyou/cdc.py#L58-L67
curious-containers/cc-core
cc_core/commons/exceptions.py
brief_exception_text
def brief_exception_text(exception, secret_values): """ Returns the Exception class and the message of the exception as string. :param exception: The exception to format :param secret_values: Values to hide in output """ exception_text = _hide_secret_values(str(exception), secret_values) re...
python
def brief_exception_text(exception, secret_values): """ Returns the Exception class and the message of the exception as string. :param exception: The exception to format :param secret_values: Values to hide in output """ exception_text = _hide_secret_values(str(exception), secret_values) re...
[ "def", "brief_exception_text", "(", "exception", ",", "secret_values", ")", ":", "exception_text", "=", "_hide_secret_values", "(", "str", "(", "exception", ")", ",", "secret_values", ")", "return", "'[{}]\\n{}'", ".", "format", "(", "type", "(", "exception", ")...
Returns the Exception class and the message of the exception as string. :param exception: The exception to format :param secret_values: Values to hide in output
[ "Returns", "the", "Exception", "class", "and", "the", "message", "of", "the", "exception", "as", "string", "." ]
train
https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/exceptions.py#L27-L35
curious-containers/cc-core
cc_core/commons/exceptions.py
print_exception
def print_exception(exception, secret_values=None): """ Prints the exception message and the name of the exception class to stderr. :param exception: The exception to print :param secret_values: Values to hide in output """ print(brief_exception_text(exception, secret_values), file=sys.stderr)
python
def print_exception(exception, secret_values=None): """ Prints the exception message and the name of the exception class to stderr. :param exception: The exception to print :param secret_values: Values to hide in output """ print(brief_exception_text(exception, secret_values), file=sys.stderr)
[ "def", "print_exception", "(", "exception", ",", "secret_values", "=", "None", ")", ":", "print", "(", "brief_exception_text", "(", "exception", ",", "secret_values", ")", ",", "file", "=", "sys", ".", "stderr", ")" ]
Prints the exception message and the name of the exception class to stderr. :param exception: The exception to print :param secret_values: Values to hide in output
[ "Prints", "the", "exception", "message", "and", "the", "name", "of", "the", "exception", "class", "to", "stderr", "." ]
train
https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/exceptions.py#L38-L45
lvieirajr/mongorest
mongorest/collection.py
Collection.insert
def insert(self, **kwargs): """ Saves the Document to the database if it is valid. Returns errors otherwise. """ if self.is_valid: before = self.before_insert() if before: return before try: self._document['_id'...
python
def insert(self, **kwargs): """ Saves the Document to the database if it is valid. Returns errors otherwise. """ if self.is_valid: before = self.before_insert() if before: return before try: self._document['_id'...
[ "def", "insert", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "is_valid", ":", "before", "=", "self", ".", "before_insert", "(", ")", "if", "before", ":", "return", "before", "try", ":", "self", ".", "_document", "[", "'_id'", ...
Saves the Document to the database if it is valid. Returns errors otherwise.
[ "Saves", "the", "Document", "to", "the", "database", "if", "it", "is", "valid", ".", "Returns", "errors", "otherwise", "." ]
train
https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L159-L184
lvieirajr/mongorest
mongorest/collection.py
Collection.update
def update(self, **kwargs): """ Updates the document with the given _id saved in the collection if it is valid. Returns errors otherwise. """ if self.is_valid: if '_id' in self._document: to_update = self.find_one({'_id': self._id}) ...
python
def update(self, **kwargs): """ Updates the document with the given _id saved in the collection if it is valid. Returns errors otherwise. """ if self.is_valid: if '_id' in self._document: to_update = self.find_one({'_id': self._id}) ...
[ "def", "update", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "is_valid", ":", "if", "'_id'", "in", "self", ".", "_document", ":", "to_update", "=", "self", ".", "find_one", "(", "{", "'_id'", ":", "self", ".", "_id", "}", "...
Updates the document with the given _id saved in the collection if it is valid. Returns errors otherwise.
[ "Updates", "the", "document", "with", "the", "given", "_id", "saved", "in", "the", "collection", "if", "it", "is", "valid", ".", "Returns", "errors", "otherwise", "." ]
train
https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L187-L225
lvieirajr/mongorest
mongorest/collection.py
Collection.delete
def delete(self, **kwargs): """ Deletes the document if it is saved in the collection. """ if self.is_valid: if '_id' in self._document: to_delete = self.find_one({'_id': self._id}) if to_delete: before = self.before_delete...
python
def delete(self, **kwargs): """ Deletes the document if it is saved in the collection. """ if self.is_valid: if '_id' in self._document: to_delete = self.find_one({'_id': self._id}) if to_delete: before = self.before_delete...
[ "def", "delete", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "is_valid", ":", "if", "'_id'", "in", "self", ".", "_document", ":", "to_delete", "=", "self", ".", "find_one", "(", "{", "'_id'", ":", "self", ".", "_id", "}", "...
Deletes the document if it is saved in the collection.
[ "Deletes", "the", "document", "if", "it", "is", "saved", "in", "the", "collection", "." ]
train
https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L228-L262
lvieirajr/mongorest
mongorest/collection.py
Collection.find_one
def find_one(cls, filter=None, *args, **kwargs): """ Returns one document dict if one passes the filter. Returns None otherwise. """ return cls.collection.find_one(filter, *args, **kwargs)
python
def find_one(cls, filter=None, *args, **kwargs): """ Returns one document dict if one passes the filter. Returns None otherwise. """ return cls.collection.find_one(filter, *args, **kwargs)
[ "def", "find_one", "(", "cls", ",", "filter", "=", "None", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "cls", ".", "collection", ".", "find_one", "(", "filter", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Returns one document dict if one passes the filter. Returns None otherwise.
[ "Returns", "one", "document", "dict", "if", "one", "passes", "the", "filter", ".", "Returns", "None", "otherwise", "." ]
train
https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L266-L271
lvieirajr/mongorest
mongorest/collection.py
Collection.find
def find(cls, *args, **kwargs): """ Returns all document dicts that pass the filter """ return list(cls.collection.find(*args, **kwargs))
python
def find(cls, *args, **kwargs): """ Returns all document dicts that pass the filter """ return list(cls.collection.find(*args, **kwargs))
[ "def", "find", "(", "cls", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "list", "(", "cls", ".", "collection", ".", "find", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
Returns all document dicts that pass the filter
[ "Returns", "all", "document", "dicts", "that", "pass", "the", "filter" ]
train
https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L275-L279
lvieirajr/mongorest
mongorest/collection.py
Collection.aggregate
def aggregate(cls, pipeline=None, **kwargs): """ Returns the document dicts returned from the Aggregation Pipeline """ return list(cls.collection.aggregate(pipeline or [], **kwargs))
python
def aggregate(cls, pipeline=None, **kwargs): """ Returns the document dicts returned from the Aggregation Pipeline """ return list(cls.collection.aggregate(pipeline or [], **kwargs))
[ "def", "aggregate", "(", "cls", ",", "pipeline", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "list", "(", "cls", ".", "collection", ".", "aggregate", "(", "pipeline", "or", "[", "]", ",", "*", "*", "kwargs", ")", ")" ]
Returns the document dicts returned from the Aggregation Pipeline
[ "Returns", "the", "document", "dicts", "returned", "from", "the", "Aggregation", "Pipeline" ]
train
https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L283-L287
lvieirajr/mongorest
mongorest/collection.py
Collection.insert_many
def insert_many(cls, documents, ordered=True): """ Inserts a list of documents into the Collection and returns their _ids """ return cls.collection.insert_many(documents, ordered).inserted_ids
python
def insert_many(cls, documents, ordered=True): """ Inserts a list of documents into the Collection and returns their _ids """ return cls.collection.insert_many(documents, ordered).inserted_ids
[ "def", "insert_many", "(", "cls", ",", "documents", ",", "ordered", "=", "True", ")", ":", "return", "cls", ".", "collection", ".", "insert_many", "(", "documents", ",", "ordered", ")", ".", "inserted_ids" ]
Inserts a list of documents into the Collection and returns their _ids
[ "Inserts", "a", "list", "of", "documents", "into", "the", "Collection", "and", "returns", "their", "_ids" ]
train
https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L299-L303
lvieirajr/mongorest
mongorest/collection.py
Collection.update_one
def update_one(cls, filter, update, upsert=False): """ Updates a document that passes the filter with the update value Will upsert a new document if upsert=True and no document is filtered """ return cls.collection.update_one(filter, update, upsert).raw_result
python
def update_one(cls, filter, update, upsert=False): """ Updates a document that passes the filter with the update value Will upsert a new document if upsert=True and no document is filtered """ return cls.collection.update_one(filter, update, upsert).raw_result
[ "def", "update_one", "(", "cls", ",", "filter", ",", "update", ",", "upsert", "=", "False", ")", ":", "return", "cls", ".", "collection", ".", "update_one", "(", "filter", ",", "update", ",", "upsert", ")", ".", "raw_result" ]
Updates a document that passes the filter with the update value Will upsert a new document if upsert=True and no document is filtered
[ "Updates", "a", "document", "that", "passes", "the", "filter", "with", "the", "update", "value", "Will", "upsert", "a", "new", "document", "if", "upsert", "=", "True", "and", "no", "document", "is", "filtered" ]
train
https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L307-L312
lvieirajr/mongorest
mongorest/collection.py
Collection.update_many
def update_many(cls, filter, update, upsert=False): """ Updates all documents that pass the filter with the update value Will upsert a new document if upsert=True and no document is filtered """ return cls.collection.update_many(filter, update, upsert).raw_result
python
def update_many(cls, filter, update, upsert=False): """ Updates all documents that pass the filter with the update value Will upsert a new document if upsert=True and no document is filtered """ return cls.collection.update_many(filter, update, upsert).raw_result
[ "def", "update_many", "(", "cls", ",", "filter", ",", "update", ",", "upsert", "=", "False", ")", ":", "return", "cls", ".", "collection", ".", "update_many", "(", "filter", ",", "update", ",", "upsert", ")", ".", "raw_result" ]
Updates all documents that pass the filter with the update value Will upsert a new document if upsert=True and no document is filtered
[ "Updates", "all", "documents", "that", "pass", "the", "filter", "with", "the", "update", "value", "Will", "upsert", "a", "new", "document", "if", "upsert", "=", "True", "and", "no", "document", "is", "filtered" ]
train
https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L316-L321
lvieirajr/mongorest
mongorest/collection.py
Collection.replace_one
def replace_one(cls, filter, replacement, upsert=False): """ Replaces a document that passes the filter. Will upsert a new document if upsert=True and no document is filtered """ return cls.collection.replace_one( filter, replacement, upsert ).raw_result
python
def replace_one(cls, filter, replacement, upsert=False): """ Replaces a document that passes the filter. Will upsert a new document if upsert=True and no document is filtered """ return cls.collection.replace_one( filter, replacement, upsert ).raw_result
[ "def", "replace_one", "(", "cls", ",", "filter", ",", "replacement", ",", "upsert", "=", "False", ")", ":", "return", "cls", ".", "collection", ".", "replace_one", "(", "filter", ",", "replacement", ",", "upsert", ")", ".", "raw_result" ]
Replaces a document that passes the filter. Will upsert a new document if upsert=True and no document is filtered
[ "Replaces", "a", "document", "that", "passes", "the", "filter", ".", "Will", "upsert", "a", "new", "document", "if", "upsert", "=", "True", "and", "no", "document", "is", "filtered" ]
train
https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L325-L332
lvieirajr/mongorest
mongorest/collection.py
Collection.get
def get(cls, filter=None, **kwargs): """ Returns a Document if any document is filtered, returns None otherwise """ document = cls(cls.find_one(filter, **kwargs)) return document if document.document else None
python
def get(cls, filter=None, **kwargs): """ Returns a Document if any document is filtered, returns None otherwise """ document = cls(cls.find_one(filter, **kwargs)) return document if document.document else None
[ "def", "get", "(", "cls", ",", "filter", "=", "None", ",", "*", "*", "kwargs", ")", ":", "document", "=", "cls", "(", "cls", ".", "find_one", "(", "filter", ",", "*", "*", "kwargs", ")", ")", "return", "document", "if", "document", ".", "document",...
Returns a Document if any document is filtered, returns None otherwise
[ "Returns", "a", "Document", "if", "any", "document", "is", "filtered", "returns", "None", "otherwise" ]
train
https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L359-L364
lvieirajr/mongorest
mongorest/collection.py
Collection.documents
def documents(cls, filter=None, **kwargs): """ Returns a list of Documents if any document is filtered """ documents = [cls(document) for document in cls.find(filter, **kwargs)] return [document for document in documents if document.document]
python
def documents(cls, filter=None, **kwargs): """ Returns a list of Documents if any document is filtered """ documents = [cls(document) for document in cls.find(filter, **kwargs)] return [document for document in documents if document.document]
[ "def", "documents", "(", "cls", ",", "filter", "=", "None", ",", "*", "*", "kwargs", ")", ":", "documents", "=", "[", "cls", "(", "document", ")", "for", "document", "in", "cls", ".", "find", "(", "filter", ",", "*", "*", "kwargs", ")", "]", "ret...
Returns a list of Documents if any document is filtered
[ "Returns", "a", "list", "of", "Documents", "if", "any", "document", "is", "filtered" ]
train
https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L367-L372
ChrisTimperley/Kaskara
python/kaskara/statements.py
StatementDB.in_file
def in_file(self, fn: str) -> Iterator[Statement]: """ Returns an iterator over all of the statements belonging to a file. """ yield from self.__file_to_statements.get(fn, [])
python
def in_file(self, fn: str) -> Iterator[Statement]: """ Returns an iterator over all of the statements belonging to a file. """ yield from self.__file_to_statements.get(fn, [])
[ "def", "in_file", "(", "self", ",", "fn", ":", "str", ")", "->", "Iterator", "[", "Statement", "]", ":", "yield", "from", "self", ".", "__file_to_statements", ".", "get", "(", "fn", ",", "[", "]", ")" ]
Returns an iterator over all of the statements belonging to a file.
[ "Returns", "an", "iterator", "over", "all", "of", "the", "statements", "belonging", "to", "a", "file", "." ]
train
https://github.com/ChrisTimperley/Kaskara/blob/3d182d95b2938508e5990eddd30321be15e2f2ef/python/kaskara/statements.py#L128-L132
ChrisTimperley/Kaskara
python/kaskara/statements.py
StatementDB.at_line
def at_line(self, line: FileLine) -> Iterator[Statement]: """ Returns an iterator over all of the statements located at a given line. """ num = line.num for stmt in self.in_file(line.filename): if stmt.location.start.line == num: yield stmt
python
def at_line(self, line: FileLine) -> Iterator[Statement]: """ Returns an iterator over all of the statements located at a given line. """ num = line.num for stmt in self.in_file(line.filename): if stmt.location.start.line == num: yield stmt
[ "def", "at_line", "(", "self", ",", "line", ":", "FileLine", ")", "->", "Iterator", "[", "Statement", "]", ":", "num", "=", "line", ".", "num", "for", "stmt", "in", "self", ".", "in_file", "(", "line", ".", "filename", ")", ":", "if", "stmt", ".", ...
Returns an iterator over all of the statements located at a given line.
[ "Returns", "an", "iterator", "over", "all", "of", "the", "statements", "located", "at", "a", "given", "line", "." ]
train
https://github.com/ChrisTimperley/Kaskara/blob/3d182d95b2938508e5990eddd30321be15e2f2ef/python/kaskara/statements.py#L134-L141
MSchnei/pyprf_feature
pyprf_feature/analysis/find_prf_gpu.py
funcFindPrfGpu
def funcFindPrfGpu(idxPrc, vecMdlXpos, vecMdlYpos, vecMdlSd, aryFunc, # noqa aryPrfTc, varL2reg, queOut, lgcPrint=True): """ Find best pRF model for voxel time course. Parameters ---------- idxPrc : int Process ID of the process calling this function (for CPU mul...
python
def funcFindPrfGpu(idxPrc, vecMdlXpos, vecMdlYpos, vecMdlSd, aryFunc, # noqa aryPrfTc, varL2reg, queOut, lgcPrint=True): """ Find best pRF model for voxel time course. Parameters ---------- idxPrc : int Process ID of the process calling this function (for CPU mul...
[ "def", "funcFindPrfGpu", "(", "idxPrc", ",", "vecMdlXpos", ",", "vecMdlYpos", ",", "vecMdlSd", ",", "aryFunc", ",", "# noqa", "aryPrfTc", ",", "varL2reg", ",", "queOut", ",", "lgcPrint", "=", "True", ")", ":", "# -----------------------------------------------------...
Find best pRF model for voxel time course. Parameters ---------- idxPrc : int Process ID of the process calling this function (for CPU multi-threading). In GPU version, this parameter is 0 (just one thread on CPU). vecMdlXpos : np.array 1D array with pRF model x position...
[ "Find", "best", "pRF", "model", "for", "voxel", "time", "course", "." ]
train
https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/find_prf_gpu.py#L30-L586
ecometrica/parawrap
parawrap.py
wrap
def wrap(text, width=70, **kwargs): """Wrap multiple paragraphs of text, returning a list of wrapped lines. Reformat the multiple paragraphs 'text' so they fit in lines of no more than 'width' columns, and return a list of wrapped lines. By default, tabs in 'text' are expanded with string.expandtabs(...
python
def wrap(text, width=70, **kwargs): """Wrap multiple paragraphs of text, returning a list of wrapped lines. Reformat the multiple paragraphs 'text' so they fit in lines of no more than 'width' columns, and return a list of wrapped lines. By default, tabs in 'text' are expanded with string.expandtabs(...
[ "def", "wrap", "(", "text", ",", "width", "=", "70", ",", "*", "*", "kwargs", ")", ":", "w", "=", "ParagraphWrapper", "(", "width", "=", "width", ",", "*", "*", "kwargs", ")", "return", "w", ".", "wrap", "(", "text", ")" ]
Wrap multiple paragraphs of text, returning a list of wrapped lines. Reformat the multiple paragraphs 'text' so they fit in lines of no more than 'width' columns, and return a list of wrapped lines. By default, tabs in 'text' are expanded with string.expandtabs(), and all other whitespace characters ...
[ "Wrap", "multiple", "paragraphs", "of", "text", "returning", "a", "list", "of", "wrapped", "lines", "." ]
train
https://github.com/ecometrica/parawrap/blob/6523763f58045b8a98bac24a9438062ea856e5ae/parawrap.py#L62-L73
ecometrica/parawrap
parawrap.py
fill
def fill(text, width=70, **kwargs): """Fill multiple paragraphs of text, returning a new string. Reformat multiple paragraphs in 'text' to fit in lines of no more than 'width' columns, and return a new string containing the entire wrapped text. As with wrap(), tabs are expanded and other whitespac...
python
def fill(text, width=70, **kwargs): """Fill multiple paragraphs of text, returning a new string. Reformat multiple paragraphs in 'text' to fit in lines of no more than 'width' columns, and return a new string containing the entire wrapped text. As with wrap(), tabs are expanded and other whitespac...
[ "def", "fill", "(", "text", ",", "width", "=", "70", ",", "*", "*", "kwargs", ")", ":", "w", "=", "ParagraphWrapper", "(", "width", "=", "width", ",", "*", "*", "kwargs", ")", "return", "w", ".", "fill", "(", "text", ")" ]
Fill multiple paragraphs of text, returning a new string. Reformat multiple paragraphs in 'text' to fit in lines of no more than 'width' columns, and return a new string containing the entire wrapped text. As with wrap(), tabs are expanded and other whitespace characters converted to space. See Parag...
[ "Fill", "multiple", "paragraphs", "of", "text", "returning", "a", "new", "string", "." ]
train
https://github.com/ecometrica/parawrap/blob/6523763f58045b8a98bac24a9438062ea856e5ae/parawrap.py#L76-L86
ecometrica/parawrap
parawrap.py
ParagraphWrapper.split
def split(cls, text): """split(text : string) -> [string] Splits 'text' into multiple paragraphs and return a list of each paragraph. """ result = [line.strip('\n') for line in cls.parasep_re.split(text)] if result == ['', '']: result = [''] return re...
python
def split(cls, text): """split(text : string) -> [string] Splits 'text' into multiple paragraphs and return a list of each paragraph. """ result = [line.strip('\n') for line in cls.parasep_re.split(text)] if result == ['', '']: result = [''] return re...
[ "def", "split", "(", "cls", ",", "text", ")", ":", "result", "=", "[", "line", ".", "strip", "(", "'\\n'", ")", "for", "line", "in", "cls", ".", "parasep_re", ".", "split", "(", "text", ")", "]", "if", "result", "==", "[", "''", ",", "''", "]",...
split(text : string) -> [string] Splits 'text' into multiple paragraphs and return a list of each paragraph.
[ "split", "(", "text", ":", "string", ")", "-", ">", "[", "string", "]" ]
train
https://github.com/ecometrica/parawrap/blob/6523763f58045b8a98bac24a9438062ea856e5ae/parawrap.py#L21-L30
ecometrica/parawrap
parawrap.py
ParagraphWrapper.wrap
def wrap(self, text): """wrap(text : string) -> [string] Reformat the multiple paragraphs in 'text' so they fit in lines of no more than 'self.width' columns, and return a list of wrapped lines. Tabs in 'text' are expanded with string.expandtabs(), and all other whitespace char...
python
def wrap(self, text): """wrap(text : string) -> [string] Reformat the multiple paragraphs in 'text' so they fit in lines of no more than 'self.width' columns, and return a list of wrapped lines. Tabs in 'text' are expanded with string.expandtabs(), and all other whitespace char...
[ "def", "wrap", "(", "self", ",", "text", ")", ":", "lines", "=", "[", "]", "linewrap", "=", "partial", "(", "textwrap", ".", "TextWrapper", ".", "wrap", ",", "self", ")", "for", "para", "in", "self", ".", "split", "(", "text", ")", ":", "lines", ...
wrap(text : string) -> [string] Reformat the multiple paragraphs in 'text' so they fit in lines of no more than 'self.width' columns, and return a list of wrapped lines. Tabs in 'text' are expanded with string.expandtabs(), and all other whitespace characters (including newline) are ...
[ "wrap", "(", "text", ":", "string", ")", "-", ">", "[", "string", "]" ]
train
https://github.com/ecometrica/parawrap/blob/6523763f58045b8a98bac24a9438062ea856e5ae/parawrap.py#L32-L51
linkhub-sdk/popbill.py
popbill/faxService.py
FaxService.getSenderNumberMgtURL
def getSenderNumberMgtURL(self, CorpNum, UserID): """ 팩스 전송내역 팝업 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException """ result = self._httpget('/FAX/?T...
python
def getSenderNumberMgtURL(self, CorpNum, UserID): """ 팩스 전송내역 팝업 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException """ result = self._httpget('/FAX/?T...
[ "def", "getSenderNumberMgtURL", "(", "self", ",", "CorpNum", ",", "UserID", ")", ":", "result", "=", "self", ".", "_httpget", "(", "'/FAX/?TG=SENDER'", ",", "CorpNum", ",", "UserID", ")", "return", "result", ".", "url" ]
팩스 전송내역 팝업 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException
[ "팩스", "전송내역", "팝업", "URL", "args", "CorpNum", ":", "회원", "사업자번호", "UserID", ":", "회원", "팝빌아이디", "return", "30초", "보안", "토큰을", "포함한", "url", "raise", "PopbillException" ]
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L70-L81
linkhub-sdk/popbill.py
popbill/faxService.py
FaxService.getUnitCost
def getUnitCost(self, CorpNum): """ 팩스 전송 단가 확인 args CorpNum : 팝빌회원 사업자번호 return 전송 단가 by float raise PopbillException """ result = self._httpget('/FAX/UnitCost', CorpNum) return int(result.unitCost)
python
def getUnitCost(self, CorpNum): """ 팩스 전송 단가 확인 args CorpNum : 팝빌회원 사업자번호 return 전송 단가 by float raise PopbillException """ result = self._httpget('/FAX/UnitCost', CorpNum) return int(result.unitCost)
[ "def", "getUnitCost", "(", "self", ",", "CorpNum", ")", ":", "result", "=", "self", ".", "_httpget", "(", "'/FAX/UnitCost'", ",", "CorpNum", ")", "return", "int", "(", "result", ".", "unitCost", ")" ]
팩스 전송 단가 확인 args CorpNum : 팝빌회원 사업자번호 return 전송 단가 by float raise PopbillException
[ "팩스", "전송", "단가", "확인", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "return", "전송", "단가", "by", "float", "raise", "PopbillException" ]
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L83-L94
linkhub-sdk/popbill.py
popbill/faxService.py
FaxService.getFaxResult
def getFaxResult(self, CorpNum, ReceiptNum, UserID=None): """ 팩스 전송결과 조회 args CorpNum : 팝빌회원 사업자번호 ReceiptNum : 전송요청시 발급받은 접수번호 UserID : 팝빌회원 아이디 return 팩스전송정보 as list raise PopbillException ...
python
def getFaxResult(self, CorpNum, ReceiptNum, UserID=None): """ 팩스 전송결과 조회 args CorpNum : 팝빌회원 사업자번호 ReceiptNum : 전송요청시 발급받은 접수번호 UserID : 팝빌회원 아이디 return 팩스전송정보 as list raise PopbillException ...
[ "def", "getFaxResult", "(", "self", ",", "CorpNum", ",", "ReceiptNum", ",", "UserID", "=", "None", ")", ":", "if", "ReceiptNum", "==", "None", "or", "len", "(", "ReceiptNum", ")", "!=", "18", ":", "raise", "PopbillException", "(", "-", "99999999", ",", ...
팩스 전송결과 조회 args CorpNum : 팝빌회원 사업자번호 ReceiptNum : 전송요청시 발급받은 접수번호 UserID : 팝빌회원 아이디 return 팩스전송정보 as list raise PopbillException
[ "팩스", "전송결과", "조회", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "ReceiptNum", ":", "전송요청시", "발급받은", "접수번호", "UserID", ":", "팝빌회원", "아이디", "return", "팩스전송정보", "as", "list", "raise", "PopbillException" ]
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L138-L153
linkhub-sdk/popbill.py
popbill/faxService.py
FaxService.getFaxResultRN
def getFaxResultRN(self, CorpNum, RequestNum, UserID=None): """ 팩스 전송결과 조회 args CorpNum : 팝빌회원 사업자번호 RequestNum : 전송요청시 할당한 전송요청번호 UserID : 팝빌회원 아이디 return 팩스전송정보 as list raise PopbillException ...
python
def getFaxResultRN(self, CorpNum, RequestNum, UserID=None): """ 팩스 전송결과 조회 args CorpNum : 팝빌회원 사업자번호 RequestNum : 전송요청시 할당한 전송요청번호 UserID : 팝빌회원 아이디 return 팩스전송정보 as list raise PopbillException ...
[ "def", "getFaxResultRN", "(", "self", ",", "CorpNum", ",", "RequestNum", ",", "UserID", "=", "None", ")", ":", "if", "RequestNum", "==", "None", "or", "RequestNum", "==", "''", ":", "raise", "PopbillException", "(", "-", "99999999", ",", "\"요청번호가 입력되지 않았습니다....
팩스 전송결과 조회 args CorpNum : 팝빌회원 사업자번호 RequestNum : 전송요청시 할당한 전송요청번호 UserID : 팝빌회원 아이디 return 팩스전송정보 as list raise PopbillException
[ "팩스", "전송결과", "조회", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "RequestNum", ":", "전송요청시", "할당한", "전송요청번호", "UserID", ":", "팝빌회원", "아이디", "return", "팩스전송정보", "as", "list", "raise", "PopbillException" ]
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L155-L170
linkhub-sdk/popbill.py
popbill/faxService.py
FaxService.sendFax
def sendFax(self, CorpNum, SenderNum, ReceiverNum, ReceiverName, FilePath, ReserveDT=None, UserID=None, SenderName=None, adsYN=False, title=None, RequestNum=None): """ 팩스 단건 전송 args CorpNum : 팝빌회원 사업자번호 SenderNum : 발신자 번호 ReceiverNum : ...
python
def sendFax(self, CorpNum, SenderNum, ReceiverNum, ReceiverName, FilePath, ReserveDT=None, UserID=None, SenderName=None, adsYN=False, title=None, RequestNum=None): """ 팩스 단건 전송 args CorpNum : 팝빌회원 사업자번호 SenderNum : 발신자 번호 ReceiverNum : ...
[ "def", "sendFax", "(", "self", ",", "CorpNum", ",", "SenderNum", ",", "ReceiverNum", ",", "ReceiverName", ",", "FilePath", ",", "ReserveDT", "=", "None", ",", "UserID", "=", "None", ",", "SenderName", "=", "None", ",", "adsYN", "=", "False", ",", "title"...
팩스 단건 전송 args CorpNum : 팝빌회원 사업자번호 SenderNum : 발신자 번호 ReceiverNum : 수신자 번호 ReceiverName : 수신자 명 FilePath : 발신 파일경로 ReserveDT : 예약시간(형식 yyyyMMddHHmmss) UserID : 팝빌회원 아이디 SenderName ...
[ "팩스", "단건", "전송", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "SenderNum", ":", "발신자", "번호", "ReceiverNum", ":", "수신자", "번호", "ReceiverName", ":", "수신자", "명", "FilePath", ":", "발신", "파일경로", "ReserveDT", ":", "예약시간", "(", "형식", "yyyyMMddHHmmss", ")", "UserID...
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L206-L232
linkhub-sdk/popbill.py
popbill/faxService.py
FaxService.sendFax_multi
def sendFax_multi(self, CorpNum, SenderNum, Receiver, FilePath, ReserveDT=None, UserID=None, SenderName=None, adsYN=False, title=None, RequestNum=None): """ 팩스 전송 args CorpNum : 팝빌회원 사업자번호 SenderNum : 발신자 번호 (동보전송용) Receiver : 수신자...
python
def sendFax_multi(self, CorpNum, SenderNum, Receiver, FilePath, ReserveDT=None, UserID=None, SenderName=None, adsYN=False, title=None, RequestNum=None): """ 팩스 전송 args CorpNum : 팝빌회원 사업자번호 SenderNum : 발신자 번호 (동보전송용) Receiver : 수신자...
[ "def", "sendFax_multi", "(", "self", ",", "CorpNum", ",", "SenderNum", ",", "Receiver", ",", "FilePath", ",", "ReserveDT", "=", "None", ",", "UserID", "=", "None", ",", "SenderName", "=", "None", ",", "adsYN", "=", "False", ",", "title", "=", "None", "...
팩스 전송 args CorpNum : 팝빌회원 사업자번호 SenderNum : 발신자 번호 (동보전송용) Receiver : 수신자 번호(동보전송용) FilePath : 발신 파일경로 ReserveDT : 예약시간(형식 yyyyMMddHHmmss) UserID : 팝빌회원 아이디 SenderName : 발신자명 (동보전송용) ...
[ "팩스", "전송", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "SenderNum", ":", "발신자", "번호", "(", "동보전송용", ")", "Receiver", ":", "수신자", "번호", "(", "동보전송용", ")", "FilePath", ":", "발신", "파일경로", "ReserveDT", ":", "예약시간", "(", "형식", "yyyyMMddHHmmss", ")", "UserID",...
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L234-L306
linkhub-sdk/popbill.py
popbill/faxService.py
FaxService.resendFax
def resendFax(self, CorpNum, ReceiptNum, SenderNum, SenderName, ReceiverNum, ReceiverName, ReserveDT=None, UserID=None, title=None, RequestNum=None): """ 팩스 단건 전송 args CorpNum : 팝빌회원 사업자번호 ReceiptNum : 팩스 접수번호 SenderNum : 발신자 번호 ...
python
def resendFax(self, CorpNum, ReceiptNum, SenderNum, SenderName, ReceiverNum, ReceiverName, ReserveDT=None, UserID=None, title=None, RequestNum=None): """ 팩스 단건 전송 args CorpNum : 팝빌회원 사업자번호 ReceiptNum : 팩스 접수번호 SenderNum : 발신자 번호 ...
[ "def", "resendFax", "(", "self", ",", "CorpNum", ",", "ReceiptNum", ",", "SenderNum", ",", "SenderName", ",", "ReceiverNum", ",", "ReceiverName", ",", "ReserveDT", "=", "None", ",", "UserID", "=", "None", ",", "title", "=", "None", ",", "RequestNum", "=", ...
팩스 단건 전송 args CorpNum : 팝빌회원 사업자번호 ReceiptNum : 팩스 접수번호 SenderNum : 발신자 번호 SenderName : 발신자명 ReceiverNum : 수신번호 ReceiverName : 수신자명 ReserveDT : 예약시간(형식 yyyyMMddHHmmss) UserID : 팝빌회...
[ "팩스", "단건", "전송", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "ReceiptNum", ":", "팩스", "접수번호", "SenderNum", ":", "발신자", "번호", "SenderName", ":", "발신자명", "ReceiverNum", ":", "수신번호", "ReceiverName", ":", "수신자명", "ReserveDT", ":", "예약시간", "(", "형식", "yyyyMMddHHm...
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L308-L335
linkhub-sdk/popbill.py
popbill/faxService.py
FaxService.resendFaxRN
def resendFaxRN(self, CorpNum, OrgRequestNum, SenderNum, SenderName, ReceiverNum, ReceiverName, ReserveDT=None, UserID=None, title=None, RequestNum=None): """ 팩스 단건 전송 args CorpNum : 팝빌회원 사업자번호 OrgRequestNum : 원본 팩스 전송시 할당한 전송요청번호 R...
python
def resendFaxRN(self, CorpNum, OrgRequestNum, SenderNum, SenderName, ReceiverNum, ReceiverName, ReserveDT=None, UserID=None, title=None, RequestNum=None): """ 팩스 단건 전송 args CorpNum : 팝빌회원 사업자번호 OrgRequestNum : 원본 팩스 전송시 할당한 전송요청번호 R...
[ "def", "resendFaxRN", "(", "self", ",", "CorpNum", ",", "OrgRequestNum", ",", "SenderNum", ",", "SenderName", ",", "ReceiverNum", ",", "ReceiverName", ",", "ReserveDT", "=", "None", ",", "UserID", "=", "None", ",", "title", "=", "None", ",", "RequestNum", ...
팩스 단건 전송 args CorpNum : 팝빌회원 사업자번호 OrgRequestNum : 원본 팩스 전송시 할당한 전송요청번호 ReceiptNum : 팩스 접수번호 SenderNum : 발신자 번호 SenderName : 발신자명 ReceiverNum : 수신번호 ReceiverName : 수신자명 ReserveDT :...
[ "팩스", "단건", "전송", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "OrgRequestNum", ":", "원본", "팩스", "전송시", "할당한", "전송요청번호", "ReceiptNum", ":", "팩스", "접수번호", "SenderNum", ":", "발신자", "번호", "SenderName", ":", "발신자명", "ReceiverNum", ":", "수신번호", "ReceiverName", ":",...
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L389-L417
linkhub-sdk/popbill.py
popbill/faxService.py
FaxService.resendFaxRN_multi
def resendFaxRN_multi(self, CorpNum, OrgRequestNum, SenderNum, SenderName, Receiver, ReserveDT=None, UserID=None, title=None, RequestNum=None): """ 팩스 전송 args CorpNum : 팝빌회원 사업자번호 OrgRequestNum : 원본 팩스 전송시 할당한 전송요청번호 SenderNum...
python
def resendFaxRN_multi(self, CorpNum, OrgRequestNum, SenderNum, SenderName, Receiver, ReserveDT=None, UserID=None, title=None, RequestNum=None): """ 팩스 전송 args CorpNum : 팝빌회원 사업자번호 OrgRequestNum : 원본 팩스 전송시 할당한 전송요청번호 SenderNum...
[ "def", "resendFaxRN_multi", "(", "self", ",", "CorpNum", ",", "OrgRequestNum", ",", "SenderNum", ",", "SenderName", ",", "Receiver", ",", "ReserveDT", "=", "None", ",", "UserID", "=", "None", ",", "title", "=", "None", ",", "RequestNum", "=", "None", ")", ...
팩스 전송 args CorpNum : 팝빌회원 사업자번호 OrgRequestNum : 원본 팩스 전송시 할당한 전송요청번호 SenderNum : 발신자 번호 SenderName : 발신자명 Receiver : 수신자정보 배열 ReserveDT : 예약시간(형식 yyyyMMddHHmmss) UserID : 팝빌회원 아이디 ...
[ "팩스", "전송", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "OrgRequestNum", ":", "원본", "팩스", "전송시", "할당한", "전송요청번호", "SenderNum", ":", "발신자", "번호", "SenderName", ":", "발신자명", "Receiver", ":", "수신자정보", "배열", "ReserveDT", ":", "예약시간", "(", "형식", "yyyyMMddHHmmss", ...
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L419-L469
linkhub-sdk/popbill.py
popbill/faxService.py
FaxService.getPreviewURL
def getPreviewURL(self, CorpNum, ReceiptNum, UserID): """ 팩스 발신번호 목록 확인 args CorpNum : 팝빌회원 사업자번호 UserID : 팝빌회원 아이디 return 처리결과. list of SenderNumber raise PopbillException """ return self._httpge...
python
def getPreviewURL(self, CorpNum, ReceiptNum, UserID): """ 팩스 발신번호 목록 확인 args CorpNum : 팝빌회원 사업자번호 UserID : 팝빌회원 아이디 return 처리결과. list of SenderNumber raise PopbillException """ return self._httpge...
[ "def", "getPreviewURL", "(", "self", ",", "CorpNum", ",", "ReceiptNum", ",", "UserID", ")", ":", "return", "self", ".", "_httpget", "(", "'/FAX/Preview/'", "+", "ReceiptNum", ",", "CorpNum", ",", "UserID", ")", ".", "url" ]
팩스 발신번호 목록 확인 args CorpNum : 팝빌회원 사업자번호 UserID : 팝빌회원 아이디 return 처리결과. list of SenderNumber raise PopbillException
[ "팩스", "발신번호", "목록", "확인", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "UserID", ":", "팝빌회원", "아이디", "return", "처리결과", ".", "list", "of", "SenderNumber", "raise", "PopbillException" ]
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L483-L493
curious-containers/cc-core
cc_core/commons/shell.py
prepare_outdir
def prepare_outdir(outdir): """ Creates the output directory if not existing. If outdir is None or if no output_files are provided nothing happens. :param outdir: The output directory to create. """ if outdir: outdir = os.path.expanduser(outdir) if not os.path.isdir(outdir): ...
python
def prepare_outdir(outdir): """ Creates the output directory if not existing. If outdir is None or if no output_files are provided nothing happens. :param outdir: The output directory to create. """ if outdir: outdir = os.path.expanduser(outdir) if not os.path.isdir(outdir): ...
[ "def", "prepare_outdir", "(", "outdir", ")", ":", "if", "outdir", ":", "outdir", "=", "os", ".", "path", ".", "expanduser", "(", "outdir", ")", "if", "not", "os", ".", "path", ".", "isdir", "(", "outdir", ")", ":", "try", ":", "os", ".", "makedirs"...
Creates the output directory if not existing. If outdir is None or if no output_files are provided nothing happens. :param outdir: The output directory to create.
[ "Creates", "the", "output", "directory", "if", "not", "existing", ".", "If", "outdir", "is", "None", "or", "if", "no", "output_files", "are", "provided", "nothing", "happens", "." ]
train
https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/shell.py#L15-L28
linkhub-sdk/popbill.py
popbill/htCashbillService.py
HTCashbillService.requestJob
def requestJob(self, CorpNum, Type, SDate, EDate, UserID=None): """ 수집 요청 args CorpNum : 팝빌회원 사업자번호 Type : 문서형태, SELL-매출, BUY-매입, SDate : 시작일자, 표시형식(yyyyMMdd) EDate : 종료일자, 표시형식(yyyyMMdd) UserID : 팝빌회원 아이디 re...
python
def requestJob(self, CorpNum, Type, SDate, EDate, UserID=None): """ 수집 요청 args CorpNum : 팝빌회원 사업자번호 Type : 문서형태, SELL-매출, BUY-매입, SDate : 시작일자, 표시형식(yyyyMMdd) EDate : 종료일자, 표시형식(yyyyMMdd) UserID : 팝빌회원 아이디 re...
[ "def", "requestJob", "(", "self", ",", "CorpNum", ",", "Type", ",", "SDate", ",", "EDate", ",", "UserID", "=", "None", ")", ":", "if", "Type", "==", "None", "or", "Type", "==", "''", ":", "raise", "PopbillException", "(", "-", "99999999", ",", "\"문서형...
수집 요청 args CorpNum : 팝빌회원 사업자번호 Type : 문서형태, SELL-매출, BUY-매입, SDate : 시작일자, 표시형식(yyyyMMdd) EDate : 종료일자, 표시형식(yyyyMMdd) UserID : 팝빌회원 아이디 return 작업아이디 (jobID) raise Popbill...
[ "수집", "요청", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "Type", ":", "문서형태", "SELL", "-", "매출", "BUY", "-", "매입", "SDate", ":", "시작일자", "표시형식", "(", "yyyyMMdd", ")", "EDate", ":", "종료일자", "표시형식", "(", "yyyyMMdd", ")", "UserID", ":", "팝빌회원", "아이디", "re...
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/htCashbillService.py#L41-L68
linkhub-sdk/popbill.py
popbill/htCashbillService.py
HTCashbillService.search
def search(self, CorpNum, JobID, TradeType, TradeUsage, Page, PerPage, Order, UserID=None): """ 수집 결과 조회 args CorpNum : 팝빌회원 사업자번호 JobID : 작업아이디 TradeType : 문서형태 배열, N-일반 현금영수증, C-취소 현금영수증 TradeUsage : 거래구분 배열, P-소등공제용, C-지출증빙용 ...
python
def search(self, CorpNum, JobID, TradeType, TradeUsage, Page, PerPage, Order, UserID=None): """ 수집 결과 조회 args CorpNum : 팝빌회원 사업자번호 JobID : 작업아이디 TradeType : 문서형태 배열, N-일반 현금영수증, C-취소 현금영수증 TradeUsage : 거래구분 배열, P-소등공제용, C-지출증빙용 ...
[ "def", "search", "(", "self", ",", "CorpNum", ",", "JobID", ",", "TradeType", ",", "TradeUsage", ",", "Page", ",", "PerPage", ",", "Order", ",", "UserID", "=", "None", ")", ":", "if", "JobID", "==", "None", "or", "len", "(", "JobID", ")", "!=", "18...
수집 결과 조회 args CorpNum : 팝빌회원 사업자번호 JobID : 작업아이디 TradeType : 문서형태 배열, N-일반 현금영수증, C-취소 현금영수증 TradeUsage : 거래구분 배열, P-소등공제용, C-지출증빙용 Page : 페이지 번호 PerPage : 페이지당 목록 개수, 최대 1000개 Order : 정렬 방향, D-내림...
[ "수집", "결과", "조회", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "JobID", ":", "작업아이디", "TradeType", ":", "문서형태", "배열", "N", "-", "일반", "현금영수증", "C", "-", "취소", "현금영수증", "TradeUsage", ":", "거래구분", "배열", "P", "-", "소등공제용", "C", "-", "지출증빙용", "Page", ":", ...
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/htCashbillService.py#L99-L125
linkhub-sdk/popbill.py
popbill/htCashbillService.py
HTCashbillService.summary
def summary(self, CorpNum, JobID, TradeType, TradeUsage, UserID=None): """ 수집 결과 요약정보 조회 args CorpNum : 팝빌회원 사업자번호 JobID : 작업아이디 TradeType : 문서형태 배열, N-일반 현금영수증, C-취소 현금영수증 TradeUsage : 거래구분 배열, P-소등공제용, C-지출증빙용 UserID :...
python
def summary(self, CorpNum, JobID, TradeType, TradeUsage, UserID=None): """ 수집 결과 요약정보 조회 args CorpNum : 팝빌회원 사업자번호 JobID : 작업아이디 TradeType : 문서형태 배열, N-일반 현금영수증, C-취소 현금영수증 TradeUsage : 거래구분 배열, P-소등공제용, C-지출증빙용 UserID :...
[ "def", "summary", "(", "self", ",", "CorpNum", ",", "JobID", ",", "TradeType", ",", "TradeUsage", ",", "UserID", "=", "None", ")", ":", "if", "JobID", "==", "None", "or", "len", "(", "JobID", ")", "!=", "18", ":", "raise", "PopbillException", "(", "-...
수집 결과 요약정보 조회 args CorpNum : 팝빌회원 사업자번호 JobID : 작업아이디 TradeType : 문서형태 배열, N-일반 현금영수증, C-취소 현금영수증 TradeUsage : 거래구분 배열, P-소등공제용, C-지출증빙용 UserID : 팝빌회원 아이디 return 수집 결과 요약정보 raise ...
[ "수집", "결과", "요약정보", "조회", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "JobID", ":", "작업아이디", "TradeType", ":", "문서형태", "배열", "N", "-", "일반", "현금영수증", "C", "-", "취소", "현금영수증", "TradeUsage", ":", "거래구분", "배열", "P", "-", "소등공제용", "C", "-", "지출증빙용", "User...
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/htCashbillService.py#L127-L147
linkhub-sdk/popbill.py
popbill/htCashbillService.py
HTCashbillService.registDeptUser
def registDeptUser(self, CorpNum, DeptUserID, DeptUserPWD, UserID=None): """ 홈택스 현금영수증 부서사용자 계정 등록 args CorpNum : 팝빌회원 사업자번호 DeptUserID : 홈택스 부서사용자 계정아이디 DeptUserPWD : 홈택스 부서사용자 계정비밀번호 UserID : 팝빌회원 아이디 return ...
python
def registDeptUser(self, CorpNum, DeptUserID, DeptUserPWD, UserID=None): """ 홈택스 현금영수증 부서사용자 계정 등록 args CorpNum : 팝빌회원 사업자번호 DeptUserID : 홈택스 부서사용자 계정아이디 DeptUserPWD : 홈택스 부서사용자 계정비밀번호 UserID : 팝빌회원 아이디 return ...
[ "def", "registDeptUser", "(", "self", ",", "CorpNum", ",", "DeptUserID", ",", "DeptUserPWD", ",", "UserID", "=", "None", ")", ":", "if", "DeptUserID", "==", "None", "or", "len", "(", "DeptUserID", ")", "==", "0", ":", "raise", "PopbillException", "(", "-...
홈택스 현금영수증 부서사용자 계정 등록 args CorpNum : 팝빌회원 사업자번호 DeptUserID : 홈택스 부서사용자 계정아이디 DeptUserPWD : 홈택스 부서사용자 계정비밀번호 UserID : 팝빌회원 아이디 return 처리결과. consist of code and message raise PopbillExceptio...
[ "홈택스", "현금영수증", "부서사용자", "계정", "등록", "args", "CorpNum", ":", "팝빌회원", "사업자번호", "DeptUserID", ":", "홈택스", "부서사용자", "계정아이디", "DeptUserPWD", ":", "홈택스", "부서사용자", "계정비밀번호", "UserID", ":", "팝빌회원", "아이디", "return", "처리결과", ".", "consist", "of", "code", "and", "...
train
https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/htCashbillService.py#L211-L235
olivier-m/rafter
rafter/contrib/schematics/helpers.py
model_node
def model_node(**kwargs): """ Decorates a ``schematics.Model`` class to add it as a field of type ``schematic.types.ModelType``. Keyword arguments are passed to ``schematic.types.ModelType``. Example: .. code-block:: python :emphasize-lines: 8,13 from schematics import Model,...
python
def model_node(**kwargs): """ Decorates a ``schematics.Model`` class to add it as a field of type ``schematic.types.ModelType``. Keyword arguments are passed to ``schematic.types.ModelType``. Example: .. code-block:: python :emphasize-lines: 8,13 from schematics import Model,...
[ "def", "model_node", "(", "*", "*", "kwargs", ")", ":", "kwargs", ".", "setdefault", "(", "'default'", ",", "{", "}", ")", "def", "decorator", "(", "model", ")", ":", "return", "types", ".", "ModelType", "(", "model", ",", "*", "*", "kwargs", ")", ...
Decorates a ``schematics.Model`` class to add it as a field of type ``schematic.types.ModelType``. Keyword arguments are passed to ``schematic.types.ModelType``. Example: .. code-block:: python :emphasize-lines: 8,13 from schematics import Model, types from rafter.contrib.sch...
[ "Decorates", "a", "schematics", ".", "Model", "class", "to", "add", "it", "as", "a", "field", "of", "type", "schematic", ".", "types", ".", "ModelType", "." ]
train
https://github.com/olivier-m/rafter/blob/aafcf8fd019f24abcf519307c4484cc6b4697c04/rafter/contrib/schematics/helpers.py#L11-L44
curious-containers/cc-core
cc_core/commons/files.py
for_each_file
def for_each_file(base_dir, func): """ Calls func(filename) for every file under base_dir. :param base_dir: A directory containing files :param func: The function to call with every file. """ for dir_path, _, file_names in os.walk(base_dir): for filename in file_names: func...
python
def for_each_file(base_dir, func): """ Calls func(filename) for every file under base_dir. :param base_dir: A directory containing files :param func: The function to call with every file. """ for dir_path, _, file_names in os.walk(base_dir): for filename in file_names: func...
[ "def", "for_each_file", "(", "base_dir", ",", "func", ")", ":", "for", "dir_path", ",", "_", ",", "file_names", "in", "os", ".", "walk", "(", "base_dir", ")", ":", "for", "filename", "in", "file_names", ":", "func", "(", "os", ".", "path", ".", "join...
Calls func(filename) for every file under base_dir. :param base_dir: A directory containing files :param func: The function to call with every file.
[ "Calls", "func", "(", "filename", ")", "for", "every", "file", "under", "base_dir", "." ]
train
https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/files.py#L142-L152
curious-containers/cc-core
cc_core/commons/files.py
make_file_read_only
def make_file_read_only(file_path): """ Removes the write permissions for the given file for owner, groups and others. :param file_path: The file whose privileges are revoked. :raise FileNotFoundError: If the given file does not exist. """ old_permissions = os.stat(file_path).st_mode os.chm...
python
def make_file_read_only(file_path): """ Removes the write permissions for the given file for owner, groups and others. :param file_path: The file whose privileges are revoked. :raise FileNotFoundError: If the given file does not exist. """ old_permissions = os.stat(file_path).st_mode os.chm...
[ "def", "make_file_read_only", "(", "file_path", ")", ":", "old_permissions", "=", "os", ".", "stat", "(", "file_path", ")", ".", "st_mode", "os", ".", "chmod", "(", "file_path", ",", "old_permissions", "&", "~", "WRITE_PERMISSIONS", ")" ]
Removes the write permissions for the given file for owner, groups and others. :param file_path: The file whose privileges are revoked. :raise FileNotFoundError: If the given file does not exist.
[ "Removes", "the", "write", "permissions", "for", "the", "given", "file", "for", "owner", "groups", "and", "others", "." ]
train
https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/files.py#L155-L163
MSchnei/pyprf_feature
pyprf_feature/analysis/load_config.py
load_config
def load_config(strCsvCnfg, lgcTest=False, lgcPrint=True): """ Load py_pRF_mapping config file. Parameters ---------- strCsvCnfg : string Absolute file path of config file. lgcTest : Boolean Whether this is a test (pytest). If yes, absolute path of this function will be ...
python
def load_config(strCsvCnfg, lgcTest=False, lgcPrint=True): """ Load py_pRF_mapping config file. Parameters ---------- strCsvCnfg : string Absolute file path of config file. lgcTest : Boolean Whether this is a test (pytest). If yes, absolute path of this function will be ...
[ "def", "load_config", "(", "strCsvCnfg", ",", "lgcTest", "=", "False", ",", "lgcPrint", "=", "True", ")", ":", "# Dictionary with config information:", "dicCnfg", "=", "{", "}", "# Open file with parameter configuration:", "# fleConfig = open(strCsvCnfg, 'r')", "with", "o...
Load py_pRF_mapping config file. Parameters ---------- strCsvCnfg : string Absolute file path of config file. lgcTest : Boolean Whether this is a test (pytest). If yes, absolute path of this function will be prepended to config file paths. lgcPrint : Boolean Print co...
[ "Load", "py_pRF_mapping", "config", "file", "." ]
train
https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/load_config.py#L12-L277
bachya/pyflunearyou
pyflunearyou/user.py
UserReport.status_by_coordinates
async def status_by_coordinates( self, latitude: float, longitude: float) -> dict: """Get symptom data for the location nearest to the user's lat/lon.""" return await self.nearest_by_coordinates(latitude, longitude)
python
async def status_by_coordinates( self, latitude: float, longitude: float) -> dict: """Get symptom data for the location nearest to the user's lat/lon.""" return await self.nearest_by_coordinates(latitude, longitude)
[ "async", "def", "status_by_coordinates", "(", "self", ",", "latitude", ":", "float", ",", "longitude", ":", "float", ")", "->", "dict", ":", "return", "await", "self", ".", "nearest_by_coordinates", "(", "latitude", ",", "longitude", ")" ]
Get symptom data for the location nearest to the user's lat/lon.
[ "Get", "symptom", "data", "for", "the", "location", "nearest", "to", "the", "user", "s", "lat", "/", "lon", "." ]
train
https://github.com/bachya/pyflunearyou/blob/16a2f839c8df851e925e010a6b5c5708386febac/pyflunearyou/user.py#L12-L15
bachya/pyflunearyou
pyflunearyou/user.py
UserReport.status_by_zip
async def status_by_zip(self, zip_code: str) -> dict: """Get symptom data for the provided ZIP code.""" try: location = next(( d for d in await self.user_reports() if d['zip'] == zip_code)) except StopIteration: return {} return aw...
python
async def status_by_zip(self, zip_code: str) -> dict: """Get symptom data for the provided ZIP code.""" try: location = next(( d for d in await self.user_reports() if d['zip'] == zip_code)) except StopIteration: return {} return aw...
[ "async", "def", "status_by_zip", "(", "self", ",", "zip_code", ":", "str", ")", "->", "dict", ":", "try", ":", "location", "=", "next", "(", "(", "d", "for", "d", "in", "await", "self", ".", "user_reports", "(", ")", "if", "d", "[", "'zip'", "]", ...
Get symptom data for the provided ZIP code.
[ "Get", "symptom", "data", "for", "the", "provided", "ZIP", "code", "." ]
train
https://github.com/bachya/pyflunearyou/blob/16a2f839c8df851e925e010a6b5c5708386febac/pyflunearyou/user.py#L17-L27
osilkin98/PyBRY
pybry/LBRYException.py
print_request
def print_request(request): """ Prints a prepared request to give the user info as to what they're sending :param request.PreparedRequest request: PreparedRequest object to be printed :return: Nothing """ print('{}\n{}\n{}\n\n{}'.format( '-----------START-----------', request.method...
python
def print_request(request): """ Prints a prepared request to give the user info as to what they're sending :param request.PreparedRequest request: PreparedRequest object to be printed :return: Nothing """ print('{}\n{}\n{}\n\n{}'.format( '-----------START-----------', request.method...
[ "def", "print_request", "(", "request", ")", ":", "print", "(", "'{}\\n{}\\n{}\\n\\n{}'", ".", "format", "(", "'-----------START-----------'", ",", "request", ".", "method", "+", "' '", "+", "request", ".", "url", ",", "'\\n'", ".", "join", "(", "'{}: {}'", ...
Prints a prepared request to give the user info as to what they're sending :param request.PreparedRequest request: PreparedRequest object to be printed :return: Nothing
[ "Prints", "a", "prepared", "request", "to", "give", "the", "user", "info", "as", "to", "what", "they", "re", "sending" ]
train
https://github.com/osilkin98/PyBRY/blob/af86805a8077916f72f3fe980943d4cd741e61f0/pybry/LBRYException.py#L3-L14
olivier-m/rafter
rafter/contrib/schematics/filters.py
filter_validate_schemas
def filter_validate_schemas(get_response, params): """ This filter validates input data against the resource's ``request_schema`` and fill the request's ``validated`` dict. Data from ``request.params`` and ``request.body`` (when the request body is of a form type) will be converted using the schema...
python
def filter_validate_schemas(get_response, params): """ This filter validates input data against the resource's ``request_schema`` and fill the request's ``validated`` dict. Data from ``request.params`` and ``request.body`` (when the request body is of a form type) will be converted using the schema...
[ "def", "filter_validate_schemas", "(", "get_response", ",", "params", ")", ":", "request_schema", "=", "params", ".", "get", "(", "'request_schema'", ")", "if", "request_schema", "is", "None", ":", "return", "get_response", "def", "_convert_params", "(", "schema",...
This filter validates input data against the resource's ``request_schema`` and fill the request's ``validated`` dict. Data from ``request.params`` and ``request.body`` (when the request body is of a form type) will be converted using the schema in order to get proper lists or unique values. .. imp...
[ "This", "filter", "validates", "input", "data", "against", "the", "resource", "s", "request_schema", "and", "fill", "the", "request", "s", "validated", "dict", "." ]
train
https://github.com/olivier-m/rafter/blob/aafcf8fd019f24abcf519307c4484cc6b4697c04/rafter/contrib/schematics/filters.py#L25-L88
olivier-m/rafter
rafter/contrib/schematics/filters.py
filter_validate_response
def filter_validate_response(get_response, params): """ This filter process the returned response. It does 2 things: - If the response is a ``sanic.response.HTTPResponse`` and not a :class:`rafter.http.Response`, return it immediately. - It processes, validates and serializes this response when a...
python
def filter_validate_response(get_response, params): """ This filter process the returned response. It does 2 things: - If the response is a ``sanic.response.HTTPResponse`` and not a :class:`rafter.http.Response`, return it immediately. - It processes, validates and serializes this response when a...
[ "def", "filter_validate_response", "(", "get_response", ",", "params", ")", ":", "schema", "=", "params", ".", "get", "(", "'response_schema'", ")", "async", "def", "decorated_filter", "(", "request", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "r...
This filter process the returned response. It does 2 things: - If the response is a ``sanic.response.HTTPResponse`` and not a :class:`rafter.http.Response`, return it immediately. - It processes, validates and serializes this response when a schema is provided. That means that you can always r...
[ "This", "filter", "process", "the", "returned", "response", ".", "It", "does", "2", "things", ":" ]
train
https://github.com/olivier-m/rafter/blob/aafcf8fd019f24abcf519307c4484cc6b4697c04/rafter/contrib/schematics/filters.py#L91-L142
SavinaRoja/OpenAccess_EPUB
src/openaccess_epub/utils/epub.py
make_EPUB
def make_EPUB(parsed_article, output_directory, input_path, image_directory, config_module=None, epub_version=None, batch=False): """ Standard workflow for creating an EPUB document. make_EPUB is used to produce an EPUB fil...
python
def make_EPUB(parsed_article, output_directory, input_path, image_directory, config_module=None, epub_version=None, batch=False): """ Standard workflow for creating an EPUB document. make_EPUB is used to produce an EPUB fil...
[ "def", "make_EPUB", "(", "parsed_article", ",", "output_directory", ",", "input_path", ",", "image_directory", ",", "config_module", "=", "None", ",", "epub_version", "=", "None", ",", "batch", "=", "False", ")", ":", "#command_log.info('Creating {0}.epub'.format(outp...
Standard workflow for creating an EPUB document. make_EPUB is used to produce an EPUB file from a parsed article. In addition to the article it also requires a path to the appropriate image directory which it will insert into the EPUB file, as well the output directory location for the EPUB file. ...
[ "Standard", "workflow", "for", "creating", "an", "EPUB", "document", "." ]
train
https://github.com/SavinaRoja/OpenAccess_EPUB/blob/6b77ba30b7394fd003920e7a7957bca963a90656/src/openaccess_epub/utils/epub.py#L21-L126
SavinaRoja/OpenAccess_EPUB
src/openaccess_epub/utils/epub.py
make_epub_base
def make_epub_base(location): """ Creates the base structure for an EPUB file in a specified location. This function creates constant components for the structure of the EPUB in a specified directory location. Parameters ---------- location : str A path string to a local directory ...
python
def make_epub_base(location): """ Creates the base structure for an EPUB file in a specified location. This function creates constant components for the structure of the EPUB in a specified directory location. Parameters ---------- location : str A path string to a local directory ...
[ "def", "make_epub_base", "(", "location", ")", ":", "log", ".", "info", "(", "'Making EPUB base files in {0}'", ".", "format", "(", "location", ")", ")", "with", "open", "(", "os", ".", "path", ".", "join", "(", "location", ",", "'mimetype'", ")", ",", "...
Creates the base structure for an EPUB file in a specified location. This function creates constant components for the structure of the EPUB in a specified directory location. Parameters ---------- location : str A path string to a local directory in which the EPUB is to be built
[ "Creates", "the", "base", "structure", "for", "an", "EPUB", "file", "in", "a", "specified", "location", "." ]
train
https://github.com/SavinaRoja/OpenAccess_EPUB/blob/6b77ba30b7394fd003920e7a7957bca963a90656/src/openaccess_epub/utils/epub.py#L129-L160
SavinaRoja/OpenAccess_EPUB
src/openaccess_epub/utils/epub.py
epub_zip
def epub_zip(outdirect): """ Zips up the input file directory into an EPUB file. """ def recursive_zip(zipf, directory, folder=None): if folder is None: folder = '' for item in os.listdir(directory): if os.path.isfile(os.path.join(directory, item)): ...
python
def epub_zip(outdirect): """ Zips up the input file directory into an EPUB file. """ def recursive_zip(zipf, directory, folder=None): if folder is None: folder = '' for item in os.listdir(directory): if os.path.isfile(os.path.join(directory, item)): ...
[ "def", "epub_zip", "(", "outdirect", ")", ":", "def", "recursive_zip", "(", "zipf", ",", "directory", ",", "folder", "=", "None", ")", ":", "if", "folder", "is", "None", ":", "folder", "=", "''", "for", "item", "in", "os", ".", "listdir", "(", "direc...
Zips up the input file directory into an EPUB file.
[ "Zips", "up", "the", "input", "file", "directory", "into", "an", "EPUB", "file", "." ]
train
https://github.com/SavinaRoja/OpenAccess_EPUB/blob/6b77ba30b7394fd003920e7a7957bca963a90656/src/openaccess_epub/utils/epub.py#L163-L191
pmacosta/pcsv
pcsv/write.py
_write_int
def _write_int(fname, data, append=True): """Write data to CSV file with validation.""" # pylint: disable=W0705 data_ex = pexdoc.exh.addex(ValueError, "There is no data to save to file") fos_ex = pexdoc.exh.addex( OSError, "File *[fname]* could not be created: *[reason]*" ) data_ex((len(...
python
def _write_int(fname, data, append=True): """Write data to CSV file with validation.""" # pylint: disable=W0705 data_ex = pexdoc.exh.addex(ValueError, "There is no data to save to file") fos_ex = pexdoc.exh.addex( OSError, "File *[fname]* could not be created: *[reason]*" ) data_ex((len(...
[ "def", "_write_int", "(", "fname", ",", "data", ",", "append", "=", "True", ")", ":", "# pylint: disable=W0705", "data_ex", "=", "pexdoc", ".", "exh", ".", "addex", "(", "ValueError", ",", "\"There is no data to save to file\"", ")", "fos_ex", "=", "pexdoc", "...
Write data to CSV file with validation.
[ "Write", "data", "to", "CSV", "file", "with", "validation", "." ]
train
https://github.com/pmacosta/pcsv/blob/cd1588c19b0cd58c38bc672e396db940f88ffbd7/pcsv/write.py#L37-L55
curious-containers/cc-core
cc_core/commons/cwl.py
_input_directory_description
def _input_directory_description(input_identifier, arg_item, input_dir): """ Produces a directory description. A directory description is a dictionary containing the following information. - 'path': An array containing the paths to the specified directories. - 'debugInfo': A field to possibly provid...
python
def _input_directory_description(input_identifier, arg_item, input_dir): """ Produces a directory description. A directory description is a dictionary containing the following information. - 'path': An array containing the paths to the specified directories. - 'debugInfo': A field to possibly provid...
[ "def", "_input_directory_description", "(", "input_identifier", ",", "arg_item", ",", "input_dir", ")", ":", "description", "=", "{", "'path'", ":", "None", ",", "'found'", ":", "False", ",", "'debugInfo'", ":", "None", ",", "'listing'", ":", "None", ",", "'...
Produces a directory description. A directory description is a dictionary containing the following information. - 'path': An array containing the paths to the specified directories. - 'debugInfo': A field to possibly provide debug information. - 'found': A boolean that indicates, if the directory exists...
[ "Produces", "a", "directory", "description", ".", "A", "directory", "description", "is", "a", "dictionary", "containing", "the", "following", "information", "." ]
train
https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/cwl.py#L98-L140
curious-containers/cc-core
cc_core/commons/cwl.py
_check_input_directory_listing
def _check_input_directory_listing(base_directory, listing): """ Raises an DirectoryError if files or directories, given in the listing, could not be found in the local filesystem. :param base_directory: The path to the directory to check :param listing: A listing given as dictionary :raise Directo...
python
def _check_input_directory_listing(base_directory, listing): """ Raises an DirectoryError if files or directories, given in the listing, could not be found in the local filesystem. :param base_directory: The path to the directory to check :param listing: A listing given as dictionary :raise Directo...
[ "def", "_check_input_directory_listing", "(", "base_directory", ",", "listing", ")", ":", "for", "sub", "in", "listing", ":", "path", "=", "os", ".", "path", ".", "join", "(", "base_directory", ",", "sub", "[", "'basename'", "]", ")", "if", "sub", "[", "...
Raises an DirectoryError if files or directories, given in the listing, could not be found in the local filesystem. :param base_directory: The path to the directory to check :param listing: A listing given as dictionary :raise DirectoryError: If the given base directory does not contain all of the subdirec...
[ "Raises", "an", "DirectoryError", "if", "files", "or", "directories", "given", "in", "the", "listing", "could", "not", "be", "found", "in", "the", "local", "filesystem", "." ]
train
https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/cwl.py#L160-L180