repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
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... | 8d906bed04df1ba00fa1cacc6f31030ce5ab6233 | https://github.com/franciscogarate/pyliferisk/blob/8d906bed04df1ba00fa1cacc6f31030ce5ab6233/pyliferisk/__init__.py#L489-L609 | train |
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... | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L211-L220 | train |
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",... | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L222-L238 | train |
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... | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L240-L263 | train |
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",
... | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L265-L282 | train |
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",
")"
] | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L284-L300 | train |
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",
... | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L378-L404 | train |
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",
"."
] | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L406-L418 | train |
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... | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L461-L472 | train |
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... | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L474-L493 | train |
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... | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L495-L509 | train |
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",
"."
] | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L512-L524 | train |
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",
"."
] | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L526-L543 | train |
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",
"."
] | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L545-L561 | train |
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... | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L563-L572 | train |
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",
")",
"."
] | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L574-L591 | train |
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",
"."
] | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L593-L626 | train |
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",
"(",
"... | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L628-L658 | train |
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",
"."
] | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L660-L682 | train |
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... | b0a604afa79e5201eebe5feb56ae5ec7afc07b95 | https://github.com/bdcht/grandalf/blob/b0a604afa79e5201eebe5feb56ae5ec7afc07b95/grandalf/layouts.py#L755-L778 | train |
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",
"."
] | 49004ede7ae1ddee07a30afe9ce3e2776750805c | https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/pyprf_main.py#L37-L366 | train |
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",
"}"
] | af86805a8077916f72f3fe980943d4cd741e61f0 | https://github.com/osilkin98/PyBRY/blob/af86805a8077916f72f3fe980943d4cd741e61f0/pybry/base_api.py#L29-L99 | train |
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",
"."
] | 49004ede7ae1ddee07a30afe9ce3e2776750805c | https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/prepro/prepro_conv_load.py#L34-L119 | train |
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",
"."
] | 49004ede7ae1ddee07a30afe9ce3e2776750805c | https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/prepro/prepro_conv_load.py#L122-L139 | train |
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",
"."
] | 16a2f839c8df851e925e010a6b5c5708386febac | https://github.com/bachya/pyflunearyou/blob/16a2f839c8df851e925e010a6b5c5708386febac/pyflunearyou/cdc.py#L23-L34 | train |
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",
"."
] | 16a2f839c8df851e925e010a6b5c5708386febac | https://github.com/bachya/pyflunearyou/blob/16a2f839c8df851e925e010a6b5c5708386febac/pyflunearyou/cdc.py#L51-L56 | train |
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",
"."
] | 16a2f839c8df851e925e010a6b5c5708386febac | https://github.com/bachya/pyflunearyou/blob/16a2f839c8df851e925e010a6b5c5708386febac/pyflunearyou/cdc.py#L58-L67 | train |
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",
"."
] | eaeb03a4366016aff54fcc6953d052ae12ed599b | https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/exceptions.py#L27-L35 | train |
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",
"."
] | eaeb03a4366016aff54fcc6953d052ae12ed599b | https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/exceptions.py#L38-L45 | train |
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",
"."
] | 00f4487ded33254434bc51ff09d48c7a936bd465 | https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L159-L184 | train |
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",
"."
] | 00f4487ded33254434bc51ff09d48c7a936bd465 | https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L187-L225 | train |
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",
"."
] | 00f4487ded33254434bc51ff09d48c7a936bd465 | https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L228-L262 | train |
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",
"."
] | 00f4487ded33254434bc51ff09d48c7a936bd465 | https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L266-L271 | train |
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"
] | 00f4487ded33254434bc51ff09d48c7a936bd465 | https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L275-L279 | train |
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"
] | 00f4487ded33254434bc51ff09d48c7a936bd465 | https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L283-L287 | train |
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"
] | 00f4487ded33254434bc51ff09d48c7a936bd465 | https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L299-L303 | train |
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"
] | 00f4487ded33254434bc51ff09d48c7a936bd465 | https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L307-L312 | train |
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"
] | 00f4487ded33254434bc51ff09d48c7a936bd465 | https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L316-L321 | train |
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"
] | 00f4487ded33254434bc51ff09d48c7a936bd465 | https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L325-L332 | train |
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"
] | 00f4487ded33254434bc51ff09d48c7a936bd465 | https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L359-L364 | train |
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"
] | 00f4487ded33254434bc51ff09d48c7a936bd465 | https://github.com/lvieirajr/mongorest/blob/00f4487ded33254434bc51ff09d48c7a936bd465/mongorest/collection.py#L367-L372 | train |
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",
"."
] | 3d182d95b2938508e5990eddd30321be15e2f2ef | https://github.com/ChrisTimperley/Kaskara/blob/3d182d95b2938508e5990eddd30321be15e2f2ef/python/kaskara/statements.py#L128-L132 | train |
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",
"."
] | 3d182d95b2938508e5990eddd30321be15e2f2ef | https://github.com/ChrisTimperley/Kaskara/blob/3d182d95b2938508e5990eddd30321be15e2f2ef/python/kaskara/statements.py#L134-L141 | train |
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",
"."
] | 49004ede7ae1ddee07a30afe9ce3e2776750805c | https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/find_prf_gpu.py#L30-L586 | train |
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",
"."
] | 6523763f58045b8a98bac24a9438062ea856e5ae | https://github.com/ecometrica/parawrap/blob/6523763f58045b8a98bac24a9438062ea856e5ae/parawrap.py#L62-L73 | train |
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",
"."
] | 6523763f58045b8a98bac24a9438062ea856e5ae | https://github.com/ecometrica/parawrap/blob/6523763f58045b8a98bac24a9438062ea856e5ae/parawrap.py#L76-L86 | train |
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",
"]"
] | 6523763f58045b8a98bac24a9438062ea856e5ae | https://github.com/ecometrica/parawrap/blob/6523763f58045b8a98bac24a9438062ea856e5ae/parawrap.py#L21-L30 | train |
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",
"]"
] | 6523763f58045b8a98bac24a9438062ea856e5ae | https://github.com/ecometrica/parawrap/blob/6523763f58045b8a98bac24a9438062ea856e5ae/parawrap.py#L32-L51 | train |
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"
] | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L70-L81 | train |
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"
] | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L83-L94 | train |
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"
] | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L138-L153 | train |
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"
] | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L155-L170 | train |
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... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L206-L232 | train |
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",... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L234-L306 | train |
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... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L308-L335 | train |
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",
":",... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L389-L417 | train |
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",
... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L419-L469 | train |
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"
] | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/faxService.py#L483-L493 | train |
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",
"."
] | eaeb03a4366016aff54fcc6953d052ae12ed599b | https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/shell.py#L15-L28 | train |
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... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/htCashbillService.py#L41-L68 | train |
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",
":",
... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/htCashbillService.py#L99-L125 | train |
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... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/htCashbillService.py#L127-L147 | train |
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",
"... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/htCashbillService.py#L211-L235 | train |
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",
"."
] | aafcf8fd019f24abcf519307c4484cc6b4697c04 | https://github.com/olivier-m/rafter/blob/aafcf8fd019f24abcf519307c4484cc6b4697c04/rafter/contrib/schematics/helpers.py#L11-L44 | train |
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",
"."
] | eaeb03a4366016aff54fcc6953d052ae12ed599b | https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/files.py#L142-L152 | train |
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",
"."
] | eaeb03a4366016aff54fcc6953d052ae12ed599b | https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/files.py#L155-L163 | train |
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",
"."
] | 49004ede7ae1ddee07a30afe9ce3e2776750805c | https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/load_config.py#L12-L277 | train |
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",
"."
] | 16a2f839c8df851e925e010a6b5c5708386febac | https://github.com/bachya/pyflunearyou/blob/16a2f839c8df851e925e010a6b5c5708386febac/pyflunearyou/user.py#L12-L15 | train |
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",
"."
] | 16a2f839c8df851e925e010a6b5c5708386febac | https://github.com/bachya/pyflunearyou/blob/16a2f839c8df851e925e010a6b5c5708386febac/pyflunearyou/user.py#L17-L27 | train |
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"
] | af86805a8077916f72f3fe980943d4cd741e61f0 | https://github.com/osilkin98/PyBRY/blob/af86805a8077916f72f3fe980943d4cd741e61f0/pybry/LBRYException.py#L3-L14 | train |
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",
"."
] | aafcf8fd019f24abcf519307c4484cc6b4697c04 | https://github.com/olivier-m/rafter/blob/aafcf8fd019f24abcf519307c4484cc6b4697c04/rafter/contrib/schematics/filters.py#L25-L88 | train |
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",
":"
] | aafcf8fd019f24abcf519307c4484cc6b4697c04 | https://github.com/olivier-m/rafter/blob/aafcf8fd019f24abcf519307c4484cc6b4697c04/rafter/contrib/schematics/filters.py#L91-L142 | train |
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",
"."
] | 6b77ba30b7394fd003920e7a7957bca963a90656 | https://github.com/SavinaRoja/OpenAccess_EPUB/blob/6b77ba30b7394fd003920e7a7957bca963a90656/src/openaccess_epub/utils/epub.py#L21-L126 | train |
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",
"."
] | 6b77ba30b7394fd003920e7a7957bca963a90656 | https://github.com/SavinaRoja/OpenAccess_EPUB/blob/6b77ba30b7394fd003920e7a7957bca963a90656/src/openaccess_epub/utils/epub.py#L129-L160 | train |
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",
"."
] | 6b77ba30b7394fd003920e7a7957bca963a90656 | https://github.com/SavinaRoja/OpenAccess_EPUB/blob/6b77ba30b7394fd003920e7a7957bca963a90656/src/openaccess_epub/utils/epub.py#L163-L191 | train |
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",
"."
] | cd1588c19b0cd58c38bc672e396db940f88ffbd7 | https://github.com/pmacosta/pcsv/blob/cd1588c19b0cd58c38bc672e396db940f88ffbd7/pcsv/write.py#L37-L55 | train |
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",
"."
] | eaeb03a4366016aff54fcc6953d052ae12ed599b | https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/cwl.py#L98-L140 | train |
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",
"."
] | eaeb03a4366016aff54fcc6953d052ae12ed599b | https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/cwl.py#L160-L180 | train |
curious-containers/cc-core | cc_core/commons/cwl.py | parse_cwl_type | def parse_cwl_type(cwl_type_string):
"""
Parses cwl type information from a cwl type string.
Examples:
- "File[]" -> {'type': 'File', 'isArray': True, 'isOptional': False}
- "int?" -> {'type': 'int', 'isArray': False, 'isOptional': True}
:param cwl_type_string: The cwl type string to extract ... | python | def parse_cwl_type(cwl_type_string):
"""
Parses cwl type information from a cwl type string.
Examples:
- "File[]" -> {'type': 'File', 'isArray': True, 'isOptional': False}
- "int?" -> {'type': 'int', 'isArray': False, 'isOptional': True}
:param cwl_type_string: The cwl type string to extract ... | [
"def",
"parse_cwl_type",
"(",
"cwl_type_string",
")",
":",
"is_optional",
"=",
"cwl_type_string",
".",
"endswith",
"(",
"'?'",
")",
"if",
"is_optional",
":",
"cwl_type_string",
"=",
"cwl_type_string",
"[",
":",
"-",
"1",
"]",
"is_array",
"=",
"cwl_type_string",
... | Parses cwl type information from a cwl type string.
Examples:
- "File[]" -> {'type': 'File', 'isArray': True, 'isOptional': False}
- "int?" -> {'type': 'int', 'isArray': False, 'isOptional': True}
:param cwl_type_string: The cwl type string to extract information from
:return: A dictionary contai... | [
"Parses",
"cwl",
"type",
"information",
"from",
"a",
"cwl",
"type",
"string",
"."
] | eaeb03a4366016aff54fcc6953d052ae12ed599b | https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/cwl.py#L223-L244 | train |
curious-containers/cc-core | cc_core/commons/cwl.py | cwl_input_directories | def cwl_input_directories(cwl_data, job_data, input_dir=None):
"""
Searches for Directories and in the cwl data and produces a dictionary containing input file information.
:param cwl_data: The cwl data as dictionary
:param job_data: The job data as dictionary
:param input_dir: TODO
:return: Re... | python | def cwl_input_directories(cwl_data, job_data, input_dir=None):
"""
Searches for Directories and in the cwl data and produces a dictionary containing input file information.
:param cwl_data: The cwl data as dictionary
:param job_data: The job data as dictionary
:param input_dir: TODO
:return: Re... | [
"def",
"cwl_input_directories",
"(",
"cwl_data",
",",
"job_data",
",",
"input_dir",
"=",
"None",
")",
":",
"results",
"=",
"{",
"}",
"for",
"input_identifier",
",",
"input_data",
"in",
"cwl_data",
"[",
"'inputs'",
"]",
".",
"items",
"(",
")",
":",
"cwl_typ... | Searches for Directories and in the cwl data and produces a dictionary containing input file information.
:param cwl_data: The cwl data as dictionary
:param job_data: The job data as dictionary
:param input_dir: TODO
:return: Returns the a dictionary containing information about input files.
... | [
"Searches",
"for",
"Directories",
"and",
"in",
"the",
"cwl",
"data",
"and",
"produces",
"a",
"dictionary",
"containing",
"input",
"file",
"information",
"."
] | eaeb03a4366016aff54fcc6953d052ae12ed599b | https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/cwl.py#L275-L318 | train |
curious-containers/cc-core | cc_core/commons/cwl.py | cwl_output_files | def cwl_output_files(cwl_data, inputs_to_reference, output_dir=None):
"""
Returns a dictionary containing information about the output files given in cwl_data.
:param cwl_data: The cwl data from where to extract the output file information.
:param inputs_to_reference: Inputs which are used to resolve i... | python | def cwl_output_files(cwl_data, inputs_to_reference, output_dir=None):
"""
Returns a dictionary containing information about the output files given in cwl_data.
:param cwl_data: The cwl data from where to extract the output file information.
:param inputs_to_reference: Inputs which are used to resolve i... | [
"def",
"cwl_output_files",
"(",
"cwl_data",
",",
"inputs_to_reference",
",",
"output_dir",
"=",
"None",
")",
":",
"results",
"=",
"{",
"}",
"for",
"key",
",",
"val",
"in",
"cwl_data",
"[",
"'outputs'",
"]",
".",
"items",
"(",
")",
":",
"cwl_type",
"=",
... | Returns a dictionary containing information about the output files given in cwl_data.
:param cwl_data: The cwl data from where to extract the output file information.
:param inputs_to_reference: Inputs which are used to resolve input references.
:param output_dir: Path to the directory where output files a... | [
"Returns",
"a",
"dictionary",
"containing",
"information",
"about",
"the",
"output",
"files",
"given",
"in",
"cwl_data",
"."
] | eaeb03a4366016aff54fcc6953d052ae12ed599b | https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/cwl.py#L321-L368 | train |
greenbender/python-fifo | fifo/__init__.py | Fifo.read | def read(self, length=-1):
"""
Reads from the FIFO.
Reads as much data as possible from the FIFO up to the specified
length. If the length argument is negative or ommited all data
currently available in the FIFO will be read. If there is no data
available in the FIFO an ... | python | def read(self, length=-1):
"""
Reads from the FIFO.
Reads as much data as possible from the FIFO up to the specified
length. If the length argument is negative or ommited all data
currently available in the FIFO will be read. If there is no data
available in the FIFO an ... | [
"def",
"read",
"(",
"self",
",",
"length",
"=",
"-",
"1",
")",
":",
"if",
"0",
"<=",
"length",
"<",
"len",
"(",
"self",
")",
":",
"newpos",
"=",
"self",
".",
"pos",
"+",
"length",
"data",
"=",
"self",
".",
"buf",
"[",
"self",
".",
"pos",
":",... | Reads from the FIFO.
Reads as much data as possible from the FIFO up to the specified
length. If the length argument is negative or ommited all data
currently available in the FIFO will be read. If there is no data
available in the FIFO an empty string is returned.
Args:
... | [
"Reads",
"from",
"the",
"FIFO",
"."
] | ffabb6c8b844086dd3a490d0b42bbb5aa8fbb932 | https://github.com/greenbender/python-fifo/blob/ffabb6c8b844086dd3a490d0b42bbb5aa8fbb932/fifo/__init__.py#L76-L97 | train |
greenbender/python-fifo | fifo/__init__.py | Fifo.readuntil | def readuntil(self, token, size=0):
"""
Reads data from the FIFO until a token is encountered.
If no token is encountered as much data is read from the FIFO as
possible keeping in mind that the FIFO must retain enough data to
perform matches for the token across writes.
... | python | def readuntil(self, token, size=0):
"""
Reads data from the FIFO until a token is encountered.
If no token is encountered as much data is read from the FIFO as
possible keeping in mind that the FIFO must retain enough data to
perform matches for the token across writes.
... | [
"def",
"readuntil",
"(",
"self",
",",
"token",
",",
"size",
"=",
"0",
")",
":",
"self",
".",
"__append",
"(",
")",
"i",
"=",
"self",
".",
"buf",
".",
"find",
"(",
"token",
",",
"self",
".",
"pos",
")",
"if",
"i",
"<",
"0",
":",
"index",
"=",
... | Reads data from the FIFO until a token is encountered.
If no token is encountered as much data is read from the FIFO as
possible keeping in mind that the FIFO must retain enough data to
perform matches for the token across writes.
Args:
token: The token to read until.
... | [
"Reads",
"data",
"from",
"the",
"FIFO",
"until",
"a",
"token",
"is",
"encountered",
"."
] | ffabb6c8b844086dd3a490d0b42bbb5aa8fbb932 | https://github.com/greenbender/python-fifo/blob/ffabb6c8b844086dd3a490d0b42bbb5aa8fbb932/fifo/__init__.py#L136-L173 | train |
greenbender/python-fifo | fifo/__init__.py | Fifo.peekline | def peekline(self):
"""
Peeks a line into the FIFO.
Perfroms the same function as readline() without removing data from the
FIFO. See readline() for further information.
"""
self.__append()
i = self.buf.find(self.eol, self.pos)
if i < 0:
retu... | python | def peekline(self):
"""
Peeks a line into the FIFO.
Perfroms the same function as readline() without removing data from the
FIFO. See readline() for further information.
"""
self.__append()
i = self.buf.find(self.eol, self.pos)
if i < 0:
retu... | [
"def",
"peekline",
"(",
"self",
")",
":",
"self",
".",
"__append",
"(",
")",
"i",
"=",
"self",
".",
"buf",
".",
"find",
"(",
"self",
".",
"eol",
",",
"self",
".",
"pos",
")",
"if",
"i",
"<",
"0",
":",
"return",
"''",
"newpos",
"=",
"i",
"+",
... | Peeks a line into the FIFO.
Perfroms the same function as readline() without removing data from the
FIFO. See readline() for further information. | [
"Peeks",
"a",
"line",
"into",
"the",
"FIFO",
"."
] | ffabb6c8b844086dd3a490d0b42bbb5aa8fbb932 | https://github.com/greenbender/python-fifo/blob/ffabb6c8b844086dd3a490d0b42bbb5aa8fbb932/fifo/__init__.py#L200-L214 | train |
greenbender/python-fifo | fifo/__init__.py | Fifo.peekuntil | def peekuntil(self, token, size=0):
"""
Peeks for token into the FIFO.
Performs the same function as readuntil() without removing data from the
FIFO. See readuntil() for further information.
"""
self.__append()
i = self.buf.find(token, self.pos)
if i < 0... | python | def peekuntil(self, token, size=0):
"""
Peeks for token into the FIFO.
Performs the same function as readuntil() without removing data from the
FIFO. See readuntil() for further information.
"""
self.__append()
i = self.buf.find(token, self.pos)
if i < 0... | [
"def",
"peekuntil",
"(",
"self",
",",
"token",
",",
"size",
"=",
"0",
")",
":",
"self",
".",
"__append",
"(",
")",
"i",
"=",
"self",
".",
"buf",
".",
"find",
"(",
"token",
",",
"self",
".",
"pos",
")",
"if",
"i",
"<",
"0",
":",
"index",
"=",
... | Peeks for token into the FIFO.
Performs the same function as readuntil() without removing data from the
FIFO. See readuntil() for further information. | [
"Peeks",
"for",
"token",
"into",
"the",
"FIFO",
"."
] | ffabb6c8b844086dd3a490d0b42bbb5aa8fbb932 | https://github.com/greenbender/python-fifo/blob/ffabb6c8b844086dd3a490d0b42bbb5aa8fbb932/fifo/__init__.py#L216-L232 | train |
linkhub-sdk/popbill.py | popbill/kakaoService.py | KakaoService.getURL | def getURL(self, CorpNum, UserID, ToGo):
"""
:param CorpNum: 팝빌회원 사업자번호
:param UserID: 팝빌회원 아이디
:param ToGo: [PLUSFRIEND-플러스친구계정관리, SENDER-발신번호관리, TEMPLATE-알림톡템플릿관리, BOX-카카오톡전송내용]
:return: 팝빌 URL
"""
if ToGo == None or ToGo == '':
raise PopbillExceptio... | python | def getURL(self, CorpNum, UserID, ToGo):
"""
:param CorpNum: 팝빌회원 사업자번호
:param UserID: 팝빌회원 아이디
:param ToGo: [PLUSFRIEND-플러스친구계정관리, SENDER-발신번호관리, TEMPLATE-알림톡템플릿관리, BOX-카카오톡전송내용]
:return: 팝빌 URL
"""
if ToGo == None or ToGo == '':
raise PopbillExceptio... | [
"def",
"getURL",
"(",
"self",
",",
"CorpNum",
",",
"UserID",
",",
"ToGo",
")",
":",
"if",
"ToGo",
"==",
"None",
"or",
"ToGo",
"==",
"''",
":",
"raise",
"PopbillException",
"(",
"-",
"99999999",
",",
"\"TOGO값이 입력되지 않았습니다.\")",
"",
"if",
"ToGo",
"==",
"'... | :param CorpNum: 팝빌회원 사업자번호
:param UserID: 팝빌회원 아이디
:param ToGo: [PLUSFRIEND-플러스친구계정관리, SENDER-발신번호관리, TEMPLATE-알림톡템플릿관리, BOX-카카오톡전송내용]
:return: 팝빌 URL | [
":",
"param",
"CorpNum",
":",
"팝빌회원",
"사업자번호",
":",
"param",
"UserID",
":",
"팝빌회원",
"아이디",
":",
"param",
"ToGo",
":",
"[",
"PLUSFRIEND",
"-",
"플러스친구계정관리",
"SENDER",
"-",
"발신번호관리",
"TEMPLATE",
"-",
"알림톡템플릿관리",
"BOX",
"-",
"카카오톡전송내용",
"]",
":",
"return",
... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/kakaoService.py#L28-L42 | train |
linkhub-sdk/popbill.py | popbill/kakaoService.py | KakaoService.getPlusFriendMgtURL | def getPlusFriendMgtURL(self, CorpNum, UserID):
"""
플러스친구 계정관리 팝업 URL
:param CorpNum: 팝빌회원 사업자번호
:param UserID: 팝빌회원 아이디
:return: 팝빌 URL
"""
result = self._httpget('/KakaoTalk/?TG=PLUSFRIEND', CorpNum, UserID)
return result.url | python | def getPlusFriendMgtURL(self, CorpNum, UserID):
"""
플러스친구 계정관리 팝업 URL
:param CorpNum: 팝빌회원 사업자번호
:param UserID: 팝빌회원 아이디
:return: 팝빌 URL
"""
result = self._httpget('/KakaoTalk/?TG=PLUSFRIEND', CorpNum, UserID)
return result.url | [
"def",
"getPlusFriendMgtURL",
"(",
"self",
",",
"CorpNum",
",",
"UserID",
")",
":",
"result",
"=",
"self",
".",
"_httpget",
"(",
"'/KakaoTalk/?TG=PLUSFRIEND'",
",",
"CorpNum",
",",
"UserID",
")",
"return",
"result",
".",
"url"
] | 플러스친구 계정관리 팝업 URL
:param CorpNum: 팝빌회원 사업자번호
:param UserID: 팝빌회원 아이디
:return: 팝빌 URL | [
"플러스친구",
"계정관리",
"팝업",
"URL",
":",
"param",
"CorpNum",
":",
"팝빌회원",
"사업자번호",
":",
"param",
"UserID",
":",
"팝빌회원",
"아이디",
":",
"return",
":",
"팝빌",
"URL"
] | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/kakaoService.py#L44-L52 | train |
linkhub-sdk/popbill.py | popbill/kakaoService.py | KakaoService.getATSTemplateMgtURL | def getATSTemplateMgtURL(self, CorpNum, UserID):
"""
알림톡 템플릿관리 팝업 URL
:param CorpNum: 팝빌회원 사업자번호
:param UserID: 팝빌회원 아이디
:return: 팝빌 URL
"""
result = self._httpget('/KakaoTalk/?TG=TEMPLATE', CorpNum, UserID)
return result.url | python | def getATSTemplateMgtURL(self, CorpNum, UserID):
"""
알림톡 템플릿관리 팝업 URL
:param CorpNum: 팝빌회원 사업자번호
:param UserID: 팝빌회원 아이디
:return: 팝빌 URL
"""
result = self._httpget('/KakaoTalk/?TG=TEMPLATE', CorpNum, UserID)
return result.url | [
"def",
"getATSTemplateMgtURL",
"(",
"self",
",",
"CorpNum",
",",
"UserID",
")",
":",
"result",
"=",
"self",
".",
"_httpget",
"(",
"'/KakaoTalk/?TG=TEMPLATE'",
",",
"CorpNum",
",",
"UserID",
")",
"return",
"result",
".",
"url"
] | 알림톡 템플릿관리 팝업 URL
:param CorpNum: 팝빌회원 사업자번호
:param UserID: 팝빌회원 아이디
:return: 팝빌 URL | [
"알림톡",
"템플릿관리",
"팝업",
"URL",
":",
"param",
"CorpNum",
":",
"팝빌회원",
"사업자번호",
":",
"param",
"UserID",
":",
"팝빌회원",
"아이디",
":",
"return",
":",
"팝빌",
"URL"
] | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/kakaoService.py#L64-L72 | train |
linkhub-sdk/popbill.py | popbill/kakaoService.py | KakaoService.getSentListURL | def getSentListURL(self, CorpNum, UserID):
"""
카카오톡 전송내역 팝업 URL
:param CorpNum: 팝빌회원 사업자번호
:param UserID: 팝빌회원 아이디
:return: 팝빌 URL
"""
result = self._httpget('/KakaoTalk/?TG=BOX', CorpNum, UserID)
return result.url | python | def getSentListURL(self, CorpNum, UserID):
"""
카카오톡 전송내역 팝업 URL
:param CorpNum: 팝빌회원 사업자번호
:param UserID: 팝빌회원 아이디
:return: 팝빌 URL
"""
result = self._httpget('/KakaoTalk/?TG=BOX', CorpNum, UserID)
return result.url | [
"def",
"getSentListURL",
"(",
"self",
",",
"CorpNum",
",",
"UserID",
")",
":",
"result",
"=",
"self",
".",
"_httpget",
"(",
"'/KakaoTalk/?TG=BOX'",
",",
"CorpNum",
",",
"UserID",
")",
"return",
"result",
".",
"url"
] | 카카오톡 전송내역 팝업 URL
:param CorpNum: 팝빌회원 사업자번호
:param UserID: 팝빌회원 아이디
:return: 팝빌 URL | [
"카카오톡",
"전송내역",
"팝업",
"URL",
":",
"param",
"CorpNum",
":",
"팝빌회원",
"사업자번호",
":",
"param",
"UserID",
":",
"팝빌회원",
"아이디",
":",
"return",
":",
"팝빌",
"URL"
] | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/kakaoService.py#L74-L82 | train |
linkhub-sdk/popbill.py | popbill/kakaoService.py | KakaoService.sendATS_same | def sendATS_same(self, CorpNum, TemplateCode, Sender, Content, AltContent, AltSendType, SndDT, KakaoMessages,
UserID=None, RequestNum=None, ButtonList=None):
"""
알림톡 대량 전송
:param CorpNum: 팝빌회원 사업자번호
:param TemplateCode: 템플릿코드
:param Sender: 발신번호
:param Con... | python | def sendATS_same(self, CorpNum, TemplateCode, Sender, Content, AltContent, AltSendType, SndDT, KakaoMessages,
UserID=None, RequestNum=None, ButtonList=None):
"""
알림톡 대량 전송
:param CorpNum: 팝빌회원 사업자번호
:param TemplateCode: 템플릿코드
:param Sender: 발신번호
:param Con... | [
"def",
"sendATS_same",
"(",
"self",
",",
"CorpNum",
",",
"TemplateCode",
",",
"Sender",
",",
"Content",
",",
"AltContent",
",",
"AltSendType",
",",
"SndDT",
",",
"KakaoMessages",
",",
"UserID",
"=",
"None",
",",
"RequestNum",
"=",
"None",
",",
"ButtonList",
... | 알림톡 대량 전송
:param CorpNum: 팝빌회원 사업자번호
:param TemplateCode: 템플릿코드
:param Sender: 발신번호
:param Content: [동보] 알림톡 내용
:param AltContent: [동보] 대체문자 내용
:param AltSendType: 대체문자 유형 [공백-미전송, C-알림톡내용, A-대체문자내용]
:param SndDT: 예약일시 [작성형식 : yyyyMMddHHmmss]
:param KakaoMessages:... | [
"알림톡",
"대량",
"전송",
":",
"param",
"CorpNum",
":",
"팝빌회원",
"사업자번호",
":",
"param",
"TemplateCode",
":",
"템플릿코드",
":",
"param",
"Sender",
":",
"발신번호",
":",
"param",
"Content",
":",
"[",
"동보",
"]",
"알림톡",
"내용",
":",
"param",
"AltContent",
":",
"[",
"동보",
... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/kakaoService.py#L153-L199 | train |
linkhub-sdk/popbill.py | popbill/kakaoService.py | KakaoService.sendFTS_same | def sendFTS_same(self, CorpNum, PlusFriendID, Sender, Content, AltContent, AltSendType, SndDT,
KakaoMessages, KakaoButtons, AdsYN=False, UserID=None, RequestNum=None):
"""
친구톡 텍스트 대량 전송
:param CorpNum: 팝빌회원 사업자번호
:param PlusFriendID: 플러스친구 아이디
:param Sender: ... | python | def sendFTS_same(self, CorpNum, PlusFriendID, Sender, Content, AltContent, AltSendType, SndDT,
KakaoMessages, KakaoButtons, AdsYN=False, UserID=None, RequestNum=None):
"""
친구톡 텍스트 대량 전송
:param CorpNum: 팝빌회원 사업자번호
:param PlusFriendID: 플러스친구 아이디
:param Sender: ... | [
"def",
"sendFTS_same",
"(",
"self",
",",
"CorpNum",
",",
"PlusFriendID",
",",
"Sender",
",",
"Content",
",",
"AltContent",
",",
"AltSendType",
",",
"SndDT",
",",
"KakaoMessages",
",",
"KakaoButtons",
",",
"AdsYN",
"=",
"False",
",",
"UserID",
"=",
"None",
... | 친구톡 텍스트 대량 전송
:param CorpNum: 팝빌회원 사업자번호
:param PlusFriendID: 플러스친구 아이디
:param Sender: 발신번호
:param Content: [동보] 친구톡 내용
:param AltContent: [동보] 대체문자 내용
:param AltSendType: 대체문자 유형 [공백-미전송, C-알림톡내용, A-대체문자내용]
:param SndDT: 예약일시 [작성형식 : yyyyMMddHHmmss]
:para... | [
"친구톡",
"텍스트",
"대량",
"전송",
":",
"param",
"CorpNum",
":",
"팝빌회원",
"사업자번호",
":",
"param",
"PlusFriendID",
":",
"플러스친구",
"아이디",
":",
"param",
"Sender",
":",
"발신번호",
":",
"param",
"Content",
":",
"[",
"동보",
"]",
"친구톡",
"내용",
":",
"param",
"AltContent",
":... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/kakaoService.py#L219-L268 | train |
linkhub-sdk/popbill.py | popbill/kakaoService.py | KakaoService.sendFMS_same | def sendFMS_same(self, CorpNum, PlusFriendID, Sender, Content, AltContent, AltSendType, SndDT, FilePath, ImageURL,
KakaoMessages, KakaoButtons, AdsYN=False, UserID=None, RequestNum=None):
"""
친구톡 이미지 대량 전송
:param CorpNum: 팝빌회원 사업자번호
:param PlusFriendID: 플러스친구 아이디
... | python | def sendFMS_same(self, CorpNum, PlusFriendID, Sender, Content, AltContent, AltSendType, SndDT, FilePath, ImageURL,
KakaoMessages, KakaoButtons, AdsYN=False, UserID=None, RequestNum=None):
"""
친구톡 이미지 대량 전송
:param CorpNum: 팝빌회원 사업자번호
:param PlusFriendID: 플러스친구 아이디
... | [
"def",
"sendFMS_same",
"(",
"self",
",",
"CorpNum",
",",
"PlusFriendID",
",",
"Sender",
",",
"Content",
",",
"AltContent",
",",
"AltSendType",
",",
"SndDT",
",",
"FilePath",
",",
"ImageURL",
",",
"KakaoMessages",
",",
"KakaoButtons",
",",
"AdsYN",
"=",
"Fals... | 친구톡 이미지 대량 전송
:param CorpNum: 팝빌회원 사업자번호
:param PlusFriendID: 플러스친구 아이디
:param Sender: 발신번호
:param Content: [동보] 친구톡 내용
:param AltContent: [동보] 대체문자 내용
:param AltSendType: 대체문자 유형 [공백-미전송, C-알림톡내용, A-대체문자내용]
:param SndDT: 예약일시 [작성형식 : yyyyMMddHHmmss]
:para... | [
"친구톡",
"이미지",
"대량",
"전송",
":",
"param",
"CorpNum",
":",
"팝빌회원",
"사업자번호",
":",
"param",
"PlusFriendID",
":",
"플러스친구",
"아이디",
":",
"param",
"Sender",
":",
"발신번호",
":",
"param",
"Content",
":",
"[",
"동보",
"]",
"친구톡",
"내용",
":",
"param",
"AltContent",
":... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/kakaoService.py#L289-L351 | train |
linkhub-sdk/popbill.py | popbill/kakaoService.py | KakaoService.cancelReserve | def cancelReserve(self, CorpNum, ReceiptNum, UserID=None):
"""
예약전송 취소
:param CorpNum: 팝빌회원 사업자번호
:param ReceiptNum: 접수번호
:param UserID: 팝빌회원 아이디
:return: code (요청에 대한 상태 응답코드), message (요청에 대한 응답 메시지)
"""
if ReceiptNum == None or len(ReceiptNum) != 18:
... | python | def cancelReserve(self, CorpNum, ReceiptNum, UserID=None):
"""
예약전송 취소
:param CorpNum: 팝빌회원 사업자번호
:param ReceiptNum: 접수번호
:param UserID: 팝빌회원 아이디
:return: code (요청에 대한 상태 응답코드), message (요청에 대한 응답 메시지)
"""
if ReceiptNum == None or len(ReceiptNum) != 18:
... | [
"def",
"cancelReserve",
"(",
"self",
",",
"CorpNum",
",",
"ReceiptNum",
",",
"UserID",
"=",
"None",
")",
":",
"if",
"ReceiptNum",
"==",
"None",
"or",
"len",
"(",
"ReceiptNum",
")",
"!=",
"18",
":",
"raise",
"PopbillException",
"(",
"-",
"99999999",
",",
... | 예약전송 취소
:param CorpNum: 팝빌회원 사업자번호
:param ReceiptNum: 접수번호
:param UserID: 팝빌회원 아이디
:return: code (요청에 대한 상태 응답코드), message (요청에 대한 응답 메시지) | [
"예약전송",
"취소",
":",
"param",
"CorpNum",
":",
"팝빌회원",
"사업자번호",
":",
"param",
"ReceiptNum",
":",
"접수번호",
":",
"param",
"UserID",
":",
"팝빌회원",
"아이디",
":",
"return",
":",
"code",
"(",
"요청에",
"대한",
"상태",
"응답코드",
")",
"message",
"(",
"요청에",
"대한",
"응답",
"메... | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/kakaoService.py#L353-L364 | train |
linkhub-sdk/popbill.py | popbill/kakaoService.py | KakaoService.getUnitCost | def getUnitCost(self, CorpNum, MsgType, UserID=None):
"""
전송단가 확인
:param CorpNum: 팝빌회원 사업자번호
:param MsgType: 카카오톡 유형
:param UserID: 팝빌 회원아이디
:return: unitCost
"""
if MsgType is None or MsgType == "":
raise PopbillException(-99999999, "전송유형이 입력되... | python | def getUnitCost(self, CorpNum, MsgType, UserID=None):
"""
전송단가 확인
:param CorpNum: 팝빌회원 사업자번호
:param MsgType: 카카오톡 유형
:param UserID: 팝빌 회원아이디
:return: unitCost
"""
if MsgType is None or MsgType == "":
raise PopbillException(-99999999, "전송유형이 입력되... | [
"def",
"getUnitCost",
"(",
"self",
",",
"CorpNum",
",",
"MsgType",
",",
"UserID",
"=",
"None",
")",
":",
"if",
"MsgType",
"is",
"None",
"or",
"MsgType",
"==",
"\"\"",
":",
"raise",
"PopbillException",
"(",
"-",
"99999999",
",",
"\"전송유형이 입력되지 않았습니다.\")",
""... | 전송단가 확인
:param CorpNum: 팝빌회원 사업자번호
:param MsgType: 카카오톡 유형
:param UserID: 팝빌 회원아이디
:return: unitCost | [
"전송단가",
"확인",
":",
"param",
"CorpNum",
":",
"팝빌회원",
"사업자번호",
":",
"param",
"MsgType",
":",
"카카오톡",
"유형",
":",
"param",
"UserID",
":",
"팝빌",
"회원아이디",
":",
"return",
":",
"unitCost"
] | 68a0dd7f7a937603318e93be321fde73c50b96cc | https://github.com/linkhub-sdk/popbill.py/blob/68a0dd7f7a937603318e93be321fde73c50b96cc/popbill/kakaoService.py#L448-L460 | train |
mediawiki-utilities/python-mwreverts | mwreverts/utilities/revdocs2reverts.py | revdocs2reverts | def revdocs2reverts(rev_docs, radius=defaults.RADIUS, use_sha1=False,
resort=False, verbose=False):
"""
Converts a sequence of page-partitioned revision documents into a sequence
of reverts.
:Params:
rev_docs : `iterable` ( `dict` )
a page-partitioned sequence of... | python | def revdocs2reverts(rev_docs, radius=defaults.RADIUS, use_sha1=False,
resort=False, verbose=False):
"""
Converts a sequence of page-partitioned revision documents into a sequence
of reverts.
:Params:
rev_docs : `iterable` ( `dict` )
a page-partitioned sequence of... | [
"def",
"revdocs2reverts",
"(",
"rev_docs",
",",
"radius",
"=",
"defaults",
".",
"RADIUS",
",",
"use_sha1",
"=",
"False",
",",
"resort",
"=",
"False",
",",
"verbose",
"=",
"False",
")",
":",
"page_rev_docs",
"=",
"groupby",
"(",
"rev_docs",
",",
"lambda",
... | Converts a sequence of page-partitioned revision documents into a sequence
of reverts.
:Params:
rev_docs : `iterable` ( `dict` )
a page-partitioned sequence of revision documents
radius : `int`
The maximum number of revisions that a revert can reference.
use_sha1... | [
"Converts",
"a",
"sequence",
"of",
"page",
"-",
"partitioned",
"revision",
"documents",
"into",
"a",
"sequence",
"of",
"reverts",
"."
] | d379ac941e14e235ad82a48bd445a3dfa6cc022e | https://github.com/mediawiki-utilities/python-mwreverts/blob/d379ac941e14e235ad82a48bd445a3dfa6cc022e/mwreverts/utilities/revdocs2reverts.py#L54-L114 | train |
MSchnei/pyprf_feature | pyprf_feature/analysis/old/pRF_hrfutils.py | spm_hrf_compat | def spm_hrf_compat(t,
peak_delay=6,
under_delay=16,
peak_disp=1,
under_disp=1,
p_u_ratio=6,
normalize=True,
):
""" SPM HRF function from sum of two gamma PDFs
This function is de... | python | def spm_hrf_compat(t,
peak_delay=6,
under_delay=16,
peak_disp=1,
under_disp=1,
p_u_ratio=6,
normalize=True,
):
""" SPM HRF function from sum of two gamma PDFs
This function is de... | [
"def",
"spm_hrf_compat",
"(",
"t",
",",
"peak_delay",
"=",
"6",
",",
"under_delay",
"=",
"16",
",",
"peak_disp",
"=",
"1",
",",
"under_disp",
"=",
"1",
",",
"p_u_ratio",
"=",
"6",
",",
"normalize",
"=",
"True",
",",
")",
":",
"if",
"len",
"(",
"[",... | SPM HRF function from sum of two gamma PDFs
This function is designed to be partially compatible with SPMs `spm_hrf.m`
function.
The SPN HRF is a *peak* gamma PDF (with location `peak_delay` and
dispersion `peak_disp`), minus an *undershoot* gamma PDF (with location
`under_delay` and dispersion `u... | [
"SPM",
"HRF",
"function",
"from",
"sum",
"of",
"two",
"gamma",
"PDFs"
] | 49004ede7ae1ddee07a30afe9ce3e2776750805c | https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/old/pRF_hrfutils.py#L32-L94 | train |
MSchnei/pyprf_feature | pyprf_feature/analysis/old/pRF_hrfutils.py | dspmt | def dspmt(t):
""" SPM canonical HRF derivative, HRF derivative values for time values `t`
This is the canonical HRF derivative function as used in SPM.
It is the numerical difference of the HRF sampled at time `t` minus the
values sampled at time `t` -1
"""
t = np.asarray(t)
return spmt(t)... | python | def dspmt(t):
""" SPM canonical HRF derivative, HRF derivative values for time values `t`
This is the canonical HRF derivative function as used in SPM.
It is the numerical difference of the HRF sampled at time `t` minus the
values sampled at time `t` -1
"""
t = np.asarray(t)
return spmt(t)... | [
"def",
"dspmt",
"(",
"t",
")",
":",
"t",
"=",
"np",
".",
"asarray",
"(",
"t",
")",
"return",
"spmt",
"(",
"t",
")",
"-",
"spmt",
"(",
"t",
"-",
"1",
")"
] | SPM canonical HRF derivative, HRF derivative values for time values `t`
This is the canonical HRF derivative function as used in SPM.
It is the numerical difference of the HRF sampled at time `t` minus the
values sampled at time `t` -1 | [
"SPM",
"canonical",
"HRF",
"derivative",
"HRF",
"derivative",
"values",
"for",
"time",
"values",
"t"
] | 49004ede7ae1ddee07a30afe9ce3e2776750805c | https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/old/pRF_hrfutils.py#L115-L124 | train |
MSchnei/pyprf_feature | pyprf_feature/analysis/old/pRF_hrfutils.py | cnvlTc | def cnvlTc(idxPrc,
aryPrfTcChunk,
lstHrf,
varTr,
varNumVol,
queOut,
varOvsmpl=10,
varHrfLen=32,
):
"""
Convolution of time courses with HRF model.
"""
# *** prepare hrf time courses for convolution
print("------... | python | def cnvlTc(idxPrc,
aryPrfTcChunk,
lstHrf,
varTr,
varNumVol,
queOut,
varOvsmpl=10,
varHrfLen=32,
):
"""
Convolution of time courses with HRF model.
"""
# *** prepare hrf time courses for convolution
print("------... | [
"def",
"cnvlTc",
"(",
"idxPrc",
",",
"aryPrfTcChunk",
",",
"lstHrf",
",",
"varTr",
",",
"varNumVol",
",",
"queOut",
",",
"varOvsmpl",
"=",
"10",
",",
"varHrfLen",
"=",
"32",
",",
")",
":",
"# *** prepare hrf time courses for convolution",
"print",
"(",
"\"----... | Convolution of time courses with HRF model. | [
"Convolution",
"of",
"time",
"courses",
"with",
"HRF",
"model",
"."
] | 49004ede7ae1ddee07a30afe9ce3e2776750805c | https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/old/pRF_hrfutils.py#L143-L219 | train |
MSchnei/pyprf_feature | pyprf_feature/analysis/old/pRF_hrfutils.py | funcHrf | def funcHrf(varNumVol, varTr):
"""Create double gamma function.
Source:
http://www.jarrodmillman.com/rcsds/lectures/convolution_background.html
"""
vecX = np.arange(0, varNumVol, 1)
# Expected time of peak of HRF [s]:
varHrfPeak = 6.0 / varTr
# Expected time of undershoot of HRF [s]:
... | python | def funcHrf(varNumVol, varTr):
"""Create double gamma function.
Source:
http://www.jarrodmillman.com/rcsds/lectures/convolution_background.html
"""
vecX = np.arange(0, varNumVol, 1)
# Expected time of peak of HRF [s]:
varHrfPeak = 6.0 / varTr
# Expected time of undershoot of HRF [s]:
... | [
"def",
"funcHrf",
"(",
"varNumVol",
",",
"varTr",
")",
":",
"vecX",
"=",
"np",
".",
"arange",
"(",
"0",
",",
"varNumVol",
",",
"1",
")",
"# Expected time of peak of HRF [s]:",
"varHrfPeak",
"=",
"6.0",
"/",
"varTr",
"# Expected time of undershoot of HRF [s]:",
"... | Create double gamma function.
Source:
http://www.jarrodmillman.com/rcsds/lectures/convolution_background.html | [
"Create",
"double",
"gamma",
"function",
"."
] | 49004ede7ae1ddee07a30afe9ce3e2776750805c | https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/old/pRF_hrfutils.py#L226-L251 | train |
MSchnei/pyprf_feature | pyprf_feature/analysis/old/pRF_hrfutils.py | cnvlTcOld | def cnvlTcOld(idxPrc,
aryPrfTcChunk,
varTr,
varNumVol,
queOut):
"""
Old version:
Convolution of time courses with one canonical HRF model.
"""
# Create 'canonical' HRF time course model:
vecHrf = funcHrf(varNumVol, varTr)
# adjust the ... | python | def cnvlTcOld(idxPrc,
aryPrfTcChunk,
varTr,
varNumVol,
queOut):
"""
Old version:
Convolution of time courses with one canonical HRF model.
"""
# Create 'canonical' HRF time course model:
vecHrf = funcHrf(varNumVol, varTr)
# adjust the ... | [
"def",
"cnvlTcOld",
"(",
"idxPrc",
",",
"aryPrfTcChunk",
",",
"varTr",
",",
"varNumVol",
",",
"queOut",
")",
":",
"# Create 'canonical' HRF time course model:",
"vecHrf",
"=",
"funcHrf",
"(",
"varNumVol",
",",
"varTr",
")",
"# adjust the input, if necessary, such that i... | Old version:
Convolution of time courses with one canonical HRF model. | [
"Old",
"version",
":",
"Convolution",
"of",
"time",
"courses",
"with",
"one",
"canonical",
"HRF",
"model",
"."
] | 49004ede7ae1ddee07a30afe9ce3e2776750805c | https://github.com/MSchnei/pyprf_feature/blob/49004ede7ae1ddee07a30afe9ce3e2776750805c/pyprf_feature/analysis/old/pRF_hrfutils.py#L254-L296 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.