partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
test
get_token
Parse the next token in the stream. Returns a `LatexToken`. Raises `LatexWalkerEndOfStream` if end of stream reached. .. deprecated:: 1.0 Please use :py:meth:`LatexWalker.get_token()` instead.
pylatexenc/latexwalker.py
def get_token(s, pos, brackets_are_chars=True, environments=True, **parse_flags): """ Parse the next token in the stream. Returns a `LatexToken`. Raises `LatexWalkerEndOfStream` if end of stream reached. .. deprecated:: 1.0 Please use :py:meth:`LatexWalker.get_token()` instead. """ retu...
def get_token(s, pos, brackets_are_chars=True, environments=True, **parse_flags): """ Parse the next token in the stream. Returns a `LatexToken`. Raises `LatexWalkerEndOfStream` if end of stream reached. .. deprecated:: 1.0 Please use :py:meth:`LatexWalker.get_token()` instead. """ retu...
[ "Parse", "the", "next", "token", "in", "the", "stream", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexwalker.py#L1255-L1266
[ "def", "get_token", "(", "s", ",", "pos", ",", "brackets_are_chars", "=", "True", ",", "environments", "=", "True", ",", "*", "*", "parse_flags", ")", ":", "return", "LatexWalker", "(", "s", ",", "*", "*", "parse_flags", ")", ".", "get_token", "(", "po...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
get_latex_expression
Reads a latex expression, e.g. macro argument. This may be a single char, an escape sequence, or a expression placed in braces. Returns a tuple `(<LatexNode instance>, pos, len)`. `pos` is the first char of the expression, and `len` is its length. .. deprecated:: 1.0 Please use :py:meth:`LatexW...
pylatexenc/latexwalker.py
def get_latex_expression(s, pos, **parse_flags): """ Reads a latex expression, e.g. macro argument. This may be a single char, an escape sequence, or a expression placed in braces. Returns a tuple `(<LatexNode instance>, pos, len)`. `pos` is the first char of the expression, and `len` is its length...
def get_latex_expression(s, pos, **parse_flags): """ Reads a latex expression, e.g. macro argument. This may be a single char, an escape sequence, or a expression placed in braces. Returns a tuple `(<LatexNode instance>, pos, len)`. `pos` is the first char of the expression, and `len` is its length...
[ "Reads", "a", "latex", "expression", "e", ".", "g", ".", "macro", "argument", ".", "This", "may", "be", "a", "single", "char", "an", "escape", "sequence", "or", "a", "expression", "placed", "in", "braces", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexwalker.py#L1269-L1281
[ "def", "get_latex_expression", "(", "s", ",", "pos", ",", "*", "*", "parse_flags", ")", ":", "return", "LatexWalker", "(", "s", ",", "*", "*", "parse_flags", ")", ".", "get_latex_expression", "(", "pos", "=", "pos", ")" ]
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
get_latex_maybe_optional_arg
Attempts to parse an optional argument. Returns a tuple `(groupnode, pos, len)` if success, otherwise returns None. .. deprecated:: 1.0 Please use :py:meth:`LatexWalker.get_latex_maybe_optional_arg()` instead.
pylatexenc/latexwalker.py
def get_latex_maybe_optional_arg(s, pos, **parse_flags): """ Attempts to parse an optional argument. Returns a tuple `(groupnode, pos, len)` if success, otherwise returns None. .. deprecated:: 1.0 Please use :py:meth:`LatexWalker.get_latex_maybe_optional_arg()` instead. """ return Latex...
def get_latex_maybe_optional_arg(s, pos, **parse_flags): """ Attempts to parse an optional argument. Returns a tuple `(groupnode, pos, len)` if success, otherwise returns None. .. deprecated:: 1.0 Please use :py:meth:`LatexWalker.get_latex_maybe_optional_arg()` instead. """ return Latex...
[ "Attempts", "to", "parse", "an", "optional", "argument", ".", "Returns", "a", "tuple", "(", "groupnode", "pos", "len", ")", "if", "success", "otherwise", "returns", "None", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexwalker.py#L1284-L1293
[ "def", "get_latex_maybe_optional_arg", "(", "s", ",", "pos", ",", "*", "*", "parse_flags", ")", ":", "return", "LatexWalker", "(", "s", ",", "*", "*", "parse_flags", ")", ".", "get_latex_maybe_optional_arg", "(", "pos", "=", "pos", ")" ]
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
get_latex_braced_group
Reads a latex expression enclosed in braces {...}. The first token of `s[pos:]` must be an opening brace. Returns a tuple `(node, pos, len)`. `pos` is the first char of the expression (which has to be an opening brace), and `len` is its length, including the closing brace. .. deprecated:: 1.0 ...
pylatexenc/latexwalker.py
def get_latex_braced_group(s, pos, brace_type='{', **parse_flags): """ Reads a latex expression enclosed in braces {...}. The first token of `s[pos:]` must be an opening brace. Returns a tuple `(node, pos, len)`. `pos` is the first char of the expression (which has to be an opening brace), and `len...
def get_latex_braced_group(s, pos, brace_type='{', **parse_flags): """ Reads a latex expression enclosed in braces {...}. The first token of `s[pos:]` must be an opening brace. Returns a tuple `(node, pos, len)`. `pos` is the first char of the expression (which has to be an opening brace), and `len...
[ "Reads", "a", "latex", "expression", "enclosed", "in", "braces", "{", "...", "}", ".", "The", "first", "token", "of", "s", "[", "pos", ":", "]", "must", "be", "an", "opening", "brace", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexwalker.py#L1296-L1309
[ "def", "get_latex_braced_group", "(", "s", ",", "pos", ",", "brace_type", "=", "'{'", ",", "*", "*", "parse_flags", ")", ":", "return", "LatexWalker", "(", "s", ",", "*", "*", "parse_flags", ")", ".", "get_latex_braced_group", "(", "pos", "=", "pos", ","...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
get_latex_environment
Reads a latex expression enclosed in a \\begin{environment}...\\end{environment}. The first token in the stream must be the \\begin{environment}. Returns a tuple (node, pos, len) with node being a :py:class:`LatexEnvironmentNode`. .. deprecated:: 1.0 Please use :py:meth:`LatexWalker.get_latex_envir...
pylatexenc/latexwalker.py
def get_latex_environment(s, pos, environmentname=None, **parse_flags): """ Reads a latex expression enclosed in a \\begin{environment}...\\end{environment}. The first token in the stream must be the \\begin{environment}. Returns a tuple (node, pos, len) with node being a :py:class:`LatexEnvironmentNod...
def get_latex_environment(s, pos, environmentname=None, **parse_flags): """ Reads a latex expression enclosed in a \\begin{environment}...\\end{environment}. The first token in the stream must be the \\begin{environment}. Returns a tuple (node, pos, len) with node being a :py:class:`LatexEnvironmentNod...
[ "Reads", "a", "latex", "expression", "enclosed", "in", "a", "\\\\", "begin", "{", "environment", "}", "...", "\\\\", "end", "{", "environment", "}", ".", "The", "first", "token", "in", "the", "stream", "must", "be", "the", "\\\\", "begin", "{", "environm...
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexwalker.py#L1312-L1323
[ "def", "get_latex_environment", "(", "s", ",", "pos", ",", "environmentname", "=", "None", ",", "*", "*", "parse_flags", ")", ":", "return", "LatexWalker", "(", "s", ",", "*", "*", "parse_flags", ")", ".", "get_latex_environment", "(", "pos", "=", "pos", ...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
get_latex_nodes
Parses latex content `s`. Returns a tuple `(nodelist, pos, len)` where nodelist is a list of `LatexNode` 's. If `stop_upon_closing_brace` is given, then `len` includes the closing brace, but the closing brace is not included in any of the nodes in the `nodelist`. .. deprecated:: 1.0 Please use...
pylatexenc/latexwalker.py
def get_latex_nodes(s, pos=0, stop_upon_closing_brace=None, stop_upon_end_environment=None, stop_upon_closing_mathmode=None, **parse_flags): """ Parses latex content `s`. Returns a tuple `(nodelist, pos, len)` where nodelist is a list of `LatexNode` 's. If `stop_upon_closing_brace`...
def get_latex_nodes(s, pos=0, stop_upon_closing_brace=None, stop_upon_end_environment=None, stop_upon_closing_mathmode=None, **parse_flags): """ Parses latex content `s`. Returns a tuple `(nodelist, pos, len)` where nodelist is a list of `LatexNode` 's. If `stop_upon_closing_brace`...
[ "Parses", "latex", "content", "s", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexwalker.py#L1325-L1341
[ "def", "get_latex_nodes", "(", "s", ",", "pos", "=", "0", ",", "stop_upon_closing_brace", "=", "None", ",", "stop_upon_end_environment", "=", "None", ",", "stop_upon_closing_mathmode", "=", "None", ",", "*", "*", "parse_flags", ")", ":", "return", "LatexWalker",...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
LatexWalker.get_token
Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to parse a single "token", as defined by :py:class:`LatexToken`. Parse the token in the stream pointed to at position `pos`. Returns a :py:class:`LatexToken`. Raises :py:exc:`LatexWa...
pylatexenc/latexwalker.py
def get_token(self, pos, brackets_are_chars=True, environments=True, keep_inline_math=None): """ Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to parse a single "token", as defined by :py:class:`LatexToken`. Parse the tok...
def get_token(self, pos, brackets_are_chars=True, environments=True, keep_inline_math=None): """ Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to parse a single "token", as defined by :py:class:`LatexToken`. Parse the tok...
[ "Parses", "the", "latex", "content", "given", "to", "the", "constructor", "(", "and", "stored", "in", "self", ".", "s", ")", "starting", "at", "position", "pos", "to", "parse", "a", "single", "token", "as", "defined", "by", ":", "py", ":", "class", ":"...
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexwalker.py#L702-L821
[ "def", "get_token", "(", "self", ",", "pos", ",", "brackets_are_chars", "=", "True", ",", "environments", "=", "True", ",", "keep_inline_math", "=", "None", ")", ":", "s", "=", "self", ".", "s", "# shorthand", "with", "_PushPropOverride", "(", "self", ",",...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
LatexWalker.get_latex_expression
Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to parse a single LaTeX expression. Reads a latex expression, e.g. macro argument. This may be a single char, an escape sequence, or a expression placed in braces. This is what TeX calls a "...
pylatexenc/latexwalker.py
def get_latex_expression(self, pos, strict_braces=None): """ Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to parse a single LaTeX expression. Reads a latex expression, e.g. macro argument. This may be a single char, an escape ...
def get_latex_expression(self, pos, strict_braces=None): """ Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to parse a single LaTeX expression. Reads a latex expression, e.g. macro argument. This may be a single char, an escape ...
[ "Parses", "the", "latex", "content", "given", "to", "the", "constructor", "(", "and", "stored", "in", "self", ".", "s", ")", "starting", "at", "position", "pos", "to", "parse", "a", "single", "LaTeX", "expression", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexwalker.py#L824-L862
[ "def", "get_latex_expression", "(", "self", ",", "pos", ",", "strict_braces", "=", "None", ")", ":", "with", "_PushPropOverride", "(", "self", ",", "'strict_braces'", ",", "strict_braces", ")", ":", "tok", "=", "self", ".", "get_token", "(", "pos", ",", "e...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
LatexWalker.get_latex_maybe_optional_arg
Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to attempt to parse an optional argument. Attempts to parse an optional argument. If this is successful, we return a tuple `(node, pos, len)` if success where `node` is a :py:class:`L...
pylatexenc/latexwalker.py
def get_latex_maybe_optional_arg(self, pos): """ Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to attempt to parse an optional argument. Attempts to parse an optional argument. If this is successful, we return a tuple `(n...
def get_latex_maybe_optional_arg(self, pos): """ Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to attempt to parse an optional argument. Attempts to parse an optional argument. If this is successful, we return a tuple `(n...
[ "Parses", "the", "latex", "content", "given", "to", "the", "constructor", "(", "and", "stored", "in", "self", ".", "s", ")", "starting", "at", "position", "pos", "to", "attempt", "to", "parse", "an", "optional", "argument", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexwalker.py#L865-L879
[ "def", "get_latex_maybe_optional_arg", "(", "self", ",", "pos", ")", ":", "tok", "=", "self", ".", "get_token", "(", "pos", ",", "brackets_are_chars", "=", "False", ",", "environments", "=", "False", ")", "if", "(", "tok", ".", "tok", "==", "'brace_open'",...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
LatexWalker.get_latex_braced_group
Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to read a latex group delimited by braces. Reads a latex expression enclosed in braces ``{ ... }``. The first token of `s[pos:]` must be an opening brace. Returns a tuple `(node, pos...
pylatexenc/latexwalker.py
def get_latex_braced_group(self, pos, brace_type='{'): """ Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to read a latex group delimited by braces. Reads a latex expression enclosed in braces ``{ ... }``. The first token of ...
def get_latex_braced_group(self, pos, brace_type='{'): """ Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to read a latex group delimited by braces. Reads a latex expression enclosed in braces ``{ ... }``. The first token of ...
[ "Parses", "the", "latex", "content", "given", "to", "the", "constructor", "(", "and", "stored", "in", "self", ".", "s", ")", "starting", "at", "position", "pos", "to", "read", "a", "latex", "group", "delimited", "by", "braces", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexwalker.py#L882-L919
[ "def", "get_latex_braced_group", "(", "self", ",", "pos", ",", "brace_type", "=", "'{'", ")", ":", "closing_brace", "=", "None", "if", "(", "brace_type", "==", "'{'", ")", ":", "closing_brace", "=", "'}'", "elif", "(", "brace_type", "==", "'['", ")", ":"...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
LatexWalker.get_latex_environment
r""" Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to read a latex environment. Reads a latex expression enclosed in a ``\begin{environment}...\end{environment}``. The first token in the stream must be the ``\begin{envir...
pylatexenc/latexwalker.py
def get_latex_environment(self, pos, environmentname=None): r""" Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to read a latex environment. Reads a latex expression enclosed in a ``\begin{environment}...\end{environment}`...
def get_latex_environment(self, pos, environmentname=None): r""" Parses the latex content given to the constructor (and stored in `self.s`), starting at position `pos`, to read a latex environment. Reads a latex expression enclosed in a ``\begin{environment}...\end{environment}`...
[ "r", "Parses", "the", "latex", "content", "given", "to", "the", "constructor", "(", "and", "stored", "in", "self", ".", "s", ")", "starting", "at", "position", "pos", "to", "read", "a", "latex", "environment", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexwalker.py#L922-L987
[ "def", "get_latex_environment", "(", "self", ",", "pos", ",", "environmentname", "=", "None", ")", ":", "startpos", "=", "pos", "firsttok", "=", "self", ".", "get_token", "(", "pos", ")", "if", "(", "firsttok", ".", "tok", "!=", "'begin_environment'", "or"...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
LatexWalker.get_latex_nodes
Parses the latex content given to the constructor (and stored in `self.s`) into a list of nodes. Returns a tuple `(nodelist, pos, len)` where nodelist is a list of :py:class:`LatexNode`\ 's. If `stop_upon_closing_brace` is given and set to a character, then parsing stops ...
pylatexenc/latexwalker.py
def get_latex_nodes(self, pos=0, stop_upon_closing_brace=None, stop_upon_end_environment=None, stop_upon_closing_mathmode=None): """ Parses the latex content given to the constructor (and stored in `self.s`) into a list of nodes. Returns a tuple `(nodelist, pos, ...
def get_latex_nodes(self, pos=0, stop_upon_closing_brace=None, stop_upon_end_environment=None, stop_upon_closing_mathmode=None): """ Parses the latex content given to the constructor (and stored in `self.s`) into a list of nodes. Returns a tuple `(nodelist, pos, ...
[ "Parses", "the", "latex", "content", "given", "to", "the", "constructor", "(", "and", "stored", "in", "self", ".", "s", ")", "into", "a", "list", "of", "nodes", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexwalker.py#L992-L1218
[ "def", "get_latex_nodes", "(", "self", ",", "pos", "=", "0", ",", "stop_upon_closing_brace", "=", "None", ",", "stop_upon_end_environment", "=", "None", ",", "stop_upon_closing_mathmode", "=", "None", ")", ":", "nodelist", "=", "[", "]", "brackets_are_chars", "=...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
latex2text
Extracts text from `content` meant for database indexing. `content` is some LaTeX code. .. deprecated:: 1.0 Please use :py:class:`LatexNodes2Text` instead.
pylatexenc/latex2text.py
def latex2text(content, tolerant_parsing=False, keep_inline_math=False, keep_comments=False): """ Extracts text from `content` meant for database indexing. `content` is some LaTeX code. .. deprecated:: 1.0 Please use :py:class:`LatexNodes2Text` instead. """ (nodelist, tpos, tlen) = late...
def latex2text(content, tolerant_parsing=False, keep_inline_math=False, keep_comments=False): """ Extracts text from `content` meant for database indexing. `content` is some LaTeX code. .. deprecated:: 1.0 Please use :py:class:`LatexNodes2Text` instead. """ (nodelist, tpos, tlen) = late...
[ "Extracts", "text", "from", "content", "meant", "for", "database", "indexing", ".", "content", "is", "some", "LaTeX", "code", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latex2text.py#L961-L973
[ "def", "latex2text", "(", "content", ",", "tolerant_parsing", "=", "False", ",", "keep_inline_math", "=", "False", ",", "keep_comments", "=", "False", ")", ":", "(", "nodelist", ",", "tpos", ",", "tlen", ")", "=", "latexwalker", ".", "get_latex_nodes", "(", ...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
latexnodes2text
Extracts text from a node list. `nodelist` is a list of nodes as returned by :py:func:`pylatexenc.latexwalker.get_latex_nodes()`. .. deprecated:: 1.0 Please use :py:class:`LatexNodes2Text` instead.
pylatexenc/latex2text.py
def latexnodes2text(nodelist, keep_inline_math=False, keep_comments=False): """ Extracts text from a node list. `nodelist` is a list of nodes as returned by :py:func:`pylatexenc.latexwalker.get_latex_nodes()`. .. deprecated:: 1.0 Please use :py:class:`LatexNodes2Text` instead. """ retur...
def latexnodes2text(nodelist, keep_inline_math=False, keep_comments=False): """ Extracts text from a node list. `nodelist` is a list of nodes as returned by :py:func:`pylatexenc.latexwalker.get_latex_nodes()`. .. deprecated:: 1.0 Please use :py:class:`LatexNodes2Text` instead. """ retur...
[ "Extracts", "text", "from", "a", "node", "list", ".", "nodelist", "is", "a", "list", "of", "nodes", "as", "returned", "by", ":", "py", ":", "func", ":", "pylatexenc", ".", "latexwalker", ".", "get_latex_nodes", "()", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latex2text.py#L976-L988
[ "def", "latexnodes2text", "(", "nodelist", ",", "keep_inline_math", "=", "False", ",", "keep_comments", "=", "False", ")", ":", "return", "LatexNodes2Text", "(", "keep_inline_math", "=", "keep_inline_math", ",", "keep_comments", "=", "keep_comments", ")", ".", "no...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
LatexNodes2Text.set_tex_input_directory
Set where to look for input files when encountering the ``\\input`` or ``\\include`` macro. Alternatively, you may also override :py:meth:`read_input_file()` to implement a custom file lookup mechanism. The argument `tex_input_directory` is the directory relative to which to se...
pylatexenc/latex2text.py
def set_tex_input_directory(self, tex_input_directory, latex_walker_init_args=None, strict_input=True): """ Set where to look for input files when encountering the ``\\input`` or ``\\include`` macro. Alternatively, you may also override :py:meth:`read_input_file()` to implement ...
def set_tex_input_directory(self, tex_input_directory, latex_walker_init_args=None, strict_input=True): """ Set where to look for input files when encountering the ``\\input`` or ``\\include`` macro. Alternatively, you may also override :py:meth:`read_input_file()` to implement ...
[ "Set", "where", "to", "look", "for", "input", "files", "when", "encountering", "the", "\\\\", "input", "or", "\\\\", "include", "macro", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latex2text.py#L656-L686
[ "def", "set_tex_input_directory", "(", "self", ",", "tex_input_directory", ",", "latex_walker_init_args", "=", "None", ",", "strict_input", "=", "True", ")", ":", "self", ".", "tex_input_directory", "=", "tex_input_directory", "self", ".", "latex_walker_init_args", "=...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
LatexNodes2Text.read_input_file
This method may be overridden to implement a custom lookup mechanism when encountering ``\\input`` or ``\\include`` directives. The default implementation looks for a file of the given name relative to the directory set by :py:meth:`set_tex_input_directory()`. If `strict_input=True` wa...
pylatexenc/latex2text.py
def read_input_file(self, fn): """ This method may be overridden to implement a custom lookup mechanism when encountering ``\\input`` or ``\\include`` directives. The default implementation looks for a file of the given name relative to the directory set by :py:meth:`set_tex_inp...
def read_input_file(self, fn): """ This method may be overridden to implement a custom lookup mechanism when encountering ``\\input`` or ``\\include`` directives. The default implementation looks for a file of the given name relative to the directory set by :py:meth:`set_tex_inp...
[ "This", "method", "may", "be", "overridden", "to", "implement", "a", "custom", "lookup", "mechanism", "when", "encountering", "\\\\", "input", "or", "\\\\", "include", "directives", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latex2text.py#L689-L736
[ "def", "read_input_file", "(", "self", ",", "fn", ")", ":", "fnfull", "=", "os", ".", "path", ".", "realpath", "(", "os", ".", "path", ".", "join", "(", "self", ".", "tex_input_directory", ",", "fn", ")", ")", "if", "self", ".", "strict_input", ":", ...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
LatexNodes2Text.latex_to_text
Parses the given `latex` code and returns its textual representation. The `parse_flags` are the flags to give on to the :py:class:`pylatexenc.latexwalker.LatexWalker` constructor.
pylatexenc/latex2text.py
def latex_to_text(self, latex, **parse_flags): """ Parses the given `latex` code and returns its textual representation. The `parse_flags` are the flags to give on to the :py:class:`pylatexenc.latexwalker.LatexWalker` constructor. """ return self.nodelist_to_text(latexwa...
def latex_to_text(self, latex, **parse_flags): """ Parses the given `latex` code and returns its textual representation. The `parse_flags` are the flags to give on to the :py:class:`pylatexenc.latexwalker.LatexWalker` constructor. """ return self.nodelist_to_text(latexwa...
[ "Parses", "the", "given", "latex", "code", "and", "returns", "its", "textual", "representation", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latex2text.py#L755-L762
[ "def", "latex_to_text", "(", "self", ",", "latex", ",", "*", "*", "parse_flags", ")", ":", "return", "self", ".", "nodelist_to_text", "(", "latexwalker", ".", "LatexWalker", "(", "latex", ",", "*", "*", "parse_flags", ")", ".", "get_latex_nodes", "(", ")",...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
LatexNodes2Text.nodelist_to_text
Extracts text from a node list. `nodelist` is a list of nodes as returned by :py:meth:`pylatexenc.latexwalker.LatexWalker.get_latex_nodes()`. In addition to converting each node in the list to text using `node_to_text()`, we apply some global replacements and fine-tuning to the resultin...
pylatexenc/latex2text.py
def nodelist_to_text(self, nodelist): """ Extracts text from a node list. `nodelist` is a list of nodes as returned by :py:meth:`pylatexenc.latexwalker.LatexWalker.get_latex_nodes()`. In addition to converting each node in the list to text using `node_to_text()`, we apply some g...
def nodelist_to_text(self, nodelist): """ Extracts text from a node list. `nodelist` is a list of nodes as returned by :py:meth:`pylatexenc.latexwalker.LatexWalker.get_latex_nodes()`. In addition to converting each node in the list to text using `node_to_text()`, we apply some g...
[ "Extracts", "text", "from", "a", "node", "list", ".", "nodelist", "is", "a", "list", "of", "nodes", "as", "returned", "by", ":", "py", ":", "meth", ":", "pylatexenc", ".", "latexwalker", ".", "LatexWalker", ".", "get_latex_nodes", "()", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latex2text.py#L765-L788
[ "def", "nodelist_to_text", "(", "self", ",", "nodelist", ")", ":", "s", "=", "self", ".", "_nodelistcontents_to_text", "(", "nodelist", ")", "# now, perform suitable replacements", "for", "pattern", ",", "replacement", "in", "self", ".", "text_replacements", ":", ...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
LatexNodes2Text._nodelistcontents_to_text
Turn the node list to text representations of each node. Basically apply `node_to_text()` to each node. (But not quite actually, since we take some care as to where we add whitespace.)
pylatexenc/latex2text.py
def _nodelistcontents_to_text(self, nodelist): """ Turn the node list to text representations of each node. Basically apply `node_to_text()` to each node. (But not quite actually, since we take some care as to where we add whitespace.) """ s = '' prev_node = Non...
def _nodelistcontents_to_text(self, nodelist): """ Turn the node list to text representations of each node. Basically apply `node_to_text()` to each node. (But not quite actually, since we take some care as to where we add whitespace.) """ s = '' prev_node = Non...
[ "Turn", "the", "node", "list", "to", "text", "representations", "of", "each", "node", ".", "Basically", "apply", "node_to_text", "()", "to", "each", "node", ".", "(", "But", "not", "quite", "actually", "since", "we", "take", "some", "care", "as", "to", "...
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latex2text.py#L791-L811
[ "def", "_nodelistcontents_to_text", "(", "self", ",", "nodelist", ")", ":", "s", "=", "''", "prev_node", "=", "None", "for", "node", "in", "nodelist", ":", "if", "self", ".", "_is_bare_macro_node", "(", "prev_node", ")", "and", "node", ".", "isNodeType", "...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
LatexNodes2Text.node_to_text
Return the textual representation of the given `node`. If `prev_node_hint` is specified, then the current node is formatted suitably as following the node given in `prev_node_hint`. This might affect how much space we keep/discard, etc.
pylatexenc/latex2text.py
def node_to_text(self, node, prev_node_hint=None): """ Return the textual representation of the given `node`. If `prev_node_hint` is specified, then the current node is formatted suitably as following the node given in `prev_node_hint`. This might affect how much space we keep/...
def node_to_text(self, node, prev_node_hint=None): """ Return the textual representation of the given `node`. If `prev_node_hint` is specified, then the current node is formatted suitably as following the node given in `prev_node_hint`. This might affect how much space we keep/...
[ "Return", "the", "textual", "representation", "of", "the", "given", "node", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latex2text.py#L813-L924
[ "def", "node_to_text", "(", "self", ",", "node", ",", "prev_node_hint", "=", "None", ")", ":", "if", "node", "is", "None", ":", "return", "\"\"", "if", "node", ".", "isNodeType", "(", "latexwalker", ".", "LatexCharsNode", ")", ":", "# Unless in strict latex ...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
utf8tolatex
u""" Encode a UTF-8 string to a LaTeX snippet. If `non_ascii_only` is set to `True`, then usual (ascii) characters such as ``#``, ``{``, ``}`` etc. will not be escaped. If set to `False` (the default), they are escaped to their respective LaTeX escape sequences. If `brackets` is set to `True` (th...
pylatexenc/latexencode.py
def utf8tolatex(s, non_ascii_only=False, brackets=True, substitute_bad_chars=False, fail_bad_chars=False): u""" Encode a UTF-8 string to a LaTeX snippet. If `non_ascii_only` is set to `True`, then usual (ascii) characters such as ``#``, ``{``, ``}`` etc. will not be escaped. If set to `False` (the def...
def utf8tolatex(s, non_ascii_only=False, brackets=True, substitute_bad_chars=False, fail_bad_chars=False): u""" Encode a UTF-8 string to a LaTeX snippet. If `non_ascii_only` is set to `True`, then usual (ascii) characters such as ``#``, ``{``, ``}`` etc. will not be escaped. If set to `False` (the def...
[ "u", "Encode", "a", "UTF", "-", "8", "string", "to", "a", "LaTeX", "snippet", "." ]
phfaist/pylatexenc
python
https://github.com/phfaist/pylatexenc/blob/0c1788d1349e749501e67a6fba54d79e6e0d54f6/pylatexenc/latexencode.py#L53-L117
[ "def", "utf8tolatex", "(", "s", ",", "non_ascii_only", "=", "False", ",", "brackets", "=", "True", ",", "substitute_bad_chars", "=", "False", ",", "fail_bad_chars", "=", "False", ")", ":", "s", "=", "unicode", "(", "s", ")", "# make sure s is unicode", "s", ...
0c1788d1349e749501e67a6fba54d79e6e0d54f6
test
_unascii
Unpack `\\uNNNN` escapes in 's' and encode the result as UTF-8 This method takes the output of the JSONEncoder and expands any \\uNNNN escapes it finds (except for \\u0000 to \\u001F, which are converted to \\xNN escapes). For performance, it assumes that the input is valid JSON, and performs few ...
canonicaljson.py
def _unascii(s): """Unpack `\\uNNNN` escapes in 's' and encode the result as UTF-8 This method takes the output of the JSONEncoder and expands any \\uNNNN escapes it finds (except for \\u0000 to \\u001F, which are converted to \\xNN escapes). For performance, it assumes that the input is valid JSO...
def _unascii(s): """Unpack `\\uNNNN` escapes in 's' and encode the result as UTF-8 This method takes the output of the JSONEncoder and expands any \\uNNNN escapes it finds (except for \\u0000 to \\u001F, which are converted to \\xNN escapes). For performance, it assumes that the input is valid JSO...
[ "Unpack", "\\\\", "uNNNN", "escapes", "in", "s", "and", "encode", "the", "result", "as", "UTF", "-", "8" ]
matrix-org/python-canonicaljson
python
https://github.com/matrix-org/python-canonicaljson/blob/c508635e867ff11026b610c00ca906002d8fb9af/canonicaljson.py#L74-L147
[ "def", "_unascii", "(", "s", ")", ":", "# make the fast path fast: if there are no matches in the string, the", "# whole thing is ascii. On python 2, that means we're done. On python 3,", "# we have to turn it into a bytes, which is quickest with encode('utf-8')", "m", "=", "_U_ESCAPE", ".",...
c508635e867ff11026b610c00ca906002d8fb9af
test
Organisation.get_organisation_information
Get information fot this organisation. Returns a dictionary of values.
trolly/organisation.py
def get_organisation_information(self, query_params=None): ''' Get information fot this organisation. Returns a dictionary of values. ''' return self.fetch_json( uri_path=self.base_uri, query_params=query_params or {} )
def get_organisation_information(self, query_params=None): ''' Get information fot this organisation. Returns a dictionary of values. ''' return self.fetch_json( uri_path=self.base_uri, query_params=query_params or {} )
[ "Get", "information", "fot", "this", "organisation", ".", "Returns", "a", "dictionary", "of", "values", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/organisation.py#L14-L21
[ "def", "get_organisation_information", "(", "self", ",", "query_params", "=", "None", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", ",", "query_params", "=", "query_params", "or", "{", "}", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Organisation.get_boards
Get all the boards for this organisation. Returns a list of Board s. Returns: list(Board): The boards attached to this organisation
trolly/organisation.py
def get_boards(self, **query_params): ''' Get all the boards for this organisation. Returns a list of Board s. Returns: list(Board): The boards attached to this organisation ''' boards = self.get_boards_json(self.base_uri, query_params=query_params) boards_l...
def get_boards(self, **query_params): ''' Get all the boards for this organisation. Returns a list of Board s. Returns: list(Board): The boards attached to this organisation ''' boards = self.get_boards_json(self.base_uri, query_params=query_params) boards_l...
[ "Get", "all", "the", "boards", "for", "this", "organisation", ".", "Returns", "a", "list", "of", "Board", "s", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/organisation.py#L23-L36
[ "def", "get_boards", "(", "self", ",", "*", "*", "query_params", ")", ":", "boards", "=", "self", ".", "get_boards_json", "(", "self", ".", "base_uri", ",", "query_params", "=", "query_params", ")", "boards_list", "=", "[", "]", "for", "board_json", "in", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Organisation.get_members
Get all members attached to this organisation. Returns a list of Member objects Returns: list(Member): The members attached to this organisation
trolly/organisation.py
def get_members(self, **query_params): ''' Get all members attached to this organisation. Returns a list of Member objects Returns: list(Member): The members attached to this organisation ''' members = self.get_members_json(self.base_uri, ...
def get_members(self, **query_params): ''' Get all members attached to this organisation. Returns a list of Member objects Returns: list(Member): The members attached to this organisation ''' members = self.get_members_json(self.base_uri, ...
[ "Get", "all", "members", "attached", "to", "this", "organisation", ".", "Returns", "a", "list", "of", "Member", "objects" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/organisation.py#L38-L53
[ "def", "get_members", "(", "self", ",", "*", "*", "query_params", ")", ":", "members", "=", "self", ".", "get_members_json", "(", "self", ".", "base_uri", ",", "query_params", "=", "query_params", ")", "members_list", "=", "[", "]", "for", "member_json", "...
483dc94c352df40dc05ead31820b059b2545cf82
test
Organisation.update_organisation
Update this organisations information. Returns a new organisation object.
trolly/organisation.py
def update_organisation(self, query_params=None): ''' Update this organisations information. Returns a new organisation object. ''' organisation_json = self.fetch_json( uri_path=self.base_uri, http_method='PUT', query_params=query_params or {} ...
def update_organisation(self, query_params=None): ''' Update this organisations information. Returns a new organisation object. ''' organisation_json = self.fetch_json( uri_path=self.base_uri, http_method='PUT', query_params=query_params or {} ...
[ "Update", "this", "organisations", "information", ".", "Returns", "a", "new", "organisation", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/organisation.py#L55-L66
[ "def", "update_organisation", "(", "self", ",", "query_params", "=", "None", ")", ":", "organisation_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", ",", "http_method", "=", "'PUT'", ",", "query_params", "=", "query_params...
483dc94c352df40dc05ead31820b059b2545cf82
test
Organisation.remove_member
Remove a member from the organisation.Returns JSON of all members if successful or raises an Unauthorised exception if not.
trolly/organisation.py
def remove_member(self, member_id): ''' Remove a member from the organisation.Returns JSON of all members if successful or raises an Unauthorised exception if not. ''' return self.fetch_json( uri_path=self.base_uri + '/members/%s' % member_id, http_method=...
def remove_member(self, member_id): ''' Remove a member from the organisation.Returns JSON of all members if successful or raises an Unauthorised exception if not. ''' return self.fetch_json( uri_path=self.base_uri + '/members/%s' % member_id, http_method=...
[ "Remove", "a", "member", "from", "the", "organisation", ".", "Returns", "JSON", "of", "all", "members", "if", "successful", "or", "raises", "an", "Unauthorised", "exception", "if", "not", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/organisation.py#L68-L76
[ "def", "remove_member", "(", "self", ",", "member_id", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/members/%s'", "%", "member_id", ",", "http_method", "=", "'DELETE'", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Organisation.add_member_by_id
Add a member to the board using the id. Membership type can be normal or admin. Returns JSON of all members if successful or raises an Unauthorised exception if not.
trolly/organisation.py
def add_member_by_id(self, member_id, membership_type='normal'): ''' Add a member to the board using the id. Membership type can be normal or admin. Returns JSON of all members if successful or raises an Unauthorised exception if not. ''' return self.fetch_json( ...
def add_member_by_id(self, member_id, membership_type='normal'): ''' Add a member to the board using the id. Membership type can be normal or admin. Returns JSON of all members if successful or raises an Unauthorised exception if not. ''' return self.fetch_json( ...
[ "Add", "a", "member", "to", "the", "board", "using", "the", "id", ".", "Membership", "type", "can", "be", "normal", "or", "admin", ".", "Returns", "JSON", "of", "all", "members", "if", "successful", "or", "raises", "an", "Unauthorised", "exception", "if", ...
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/organisation.py#L78-L90
[ "def", "add_member_by_id", "(", "self", ",", "member_id", ",", "membership_type", "=", "'normal'", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/members/%s'", "%", "member_id", ",", "http_method", "=", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Organisation.add_member
Add a member to the board. Membership type can be normal or admin. Returns JSON of all members if successful or raises an Unauthorised exception if not.
trolly/organisation.py
def add_member(self, email, fullname, membership_type='normal'): ''' Add a member to the board. Membership type can be normal or admin. Returns JSON of all members if successful or raises an Unauthorised exception if not. ''' return self.fetch_json( uri_path=s...
def add_member(self, email, fullname, membership_type='normal'): ''' Add a member to the board. Membership type can be normal or admin. Returns JSON of all members if successful or raises an Unauthorised exception if not. ''' return self.fetch_json( uri_path=s...
[ "Add", "a", "member", "to", "the", "board", ".", "Membership", "type", "can", "be", "normal", "or", "admin", ".", "Returns", "JSON", "of", "all", "members", "if", "successful", "or", "raises", "an", "Unauthorised", "exception", "if", "not", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/organisation.py#L92-L106
[ "def", "add_member", "(", "self", ",", "email", ",", "fullname", ",", "membership_type", "=", "'normal'", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/members'", ",", "http_method", "=", "'PUT'", ","...
483dc94c352df40dc05ead31820b059b2545cf82
test
List.get_list_information
Get information for this list. Returns a dictionary of values.
trolly/list.py
def get_list_information(self, query_params=None): ''' Get information for this list. Returns a dictionary of values. ''' return self.fetch_json( uri_path=self.base_uri, query_params=query_params or {} )
def get_list_information(self, query_params=None): ''' Get information for this list. Returns a dictionary of values. ''' return self.fetch_json( uri_path=self.base_uri, query_params=query_params or {} )
[ "Get", "information", "for", "this", "list", ".", "Returns", "a", "dictionary", "of", "values", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/list.py#L18-L25
[ "def", "get_list_information", "(", "self", ",", "query_params", "=", "None", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", ",", "query_params", "=", "query_params", "or", "{", "}", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
List.add_card
Create a card for this list. Returns a Card object.
trolly/list.py
def add_card(self, query_params=None): ''' Create a card for this list. Returns a Card object. ''' card_json = self.fetch_json( uri_path=self.base_uri + '/cards', http_method='POST', query_params=query_params or {} ) return self.create...
def add_card(self, query_params=None): ''' Create a card for this list. Returns a Card object. ''' card_json = self.fetch_json( uri_path=self.base_uri + '/cards', http_method='POST', query_params=query_params or {} ) return self.create...
[ "Create", "a", "card", "for", "this", "list", ".", "Returns", "a", "Card", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/list.py#L64-L74
[ "def", "add_card", "(", "self", ",", "query_params", "=", "None", ")", ":", "card_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/cards'", ",", "http_method", "=", "'POST'", ",", "query_params", "=", "query_par...
483dc94c352df40dc05ead31820b059b2545cf82
test
Label.get_label_information
Get all information for this Label. Returns a dictionary of values.
trolly/label.py
def get_label_information(self, query_params=None): ''' Get all information for this Label. Returns a dictionary of values. ''' return self.fetch_json( uri_path=self.base_uri, query_params=query_params or {} )
def get_label_information(self, query_params=None): ''' Get all information for this Label. Returns a dictionary of values. ''' return self.fetch_json( uri_path=self.base_uri, query_params=query_params or {} )
[ "Get", "all", "information", "for", "this", "Label", ".", "Returns", "a", "dictionary", "of", "values", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/label.py#L20-L27
[ "def", "get_label_information", "(", "self", ",", "query_params", "=", "None", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", ",", "query_params", "=", "query_params", "or", "{", "}", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Label.get_items
Get all the items for this label. Returns a list of dictionaries. Each dictionary has the values for an item.
trolly/label.py
def get_items(self, query_params=None): ''' Get all the items for this label. Returns a list of dictionaries. Each dictionary has the values for an item. ''' return self.fetch_json( uri_path=self.base_uri + '/checkItems', query_params=query_params or {} ...
def get_items(self, query_params=None): ''' Get all the items for this label. Returns a list of dictionaries. Each dictionary has the values for an item. ''' return self.fetch_json( uri_path=self.base_uri + '/checkItems', query_params=query_params or {} ...
[ "Get", "all", "the", "items", "for", "this", "label", ".", "Returns", "a", "list", "of", "dictionaries", ".", "Each", "dictionary", "has", "the", "values", "for", "an", "item", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/label.py#L29-L37
[ "def", "get_items", "(", "self", ",", "query_params", "=", "None", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/checkItems'", ",", "query_params", "=", "query_params", "or", "{", "}", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Label._update_label_name
Update the current label's name. Returns a new Label object.
trolly/label.py
def _update_label_name(self, name): ''' Update the current label's name. Returns a new Label object. ''' label_json = self.fetch_json( uri_path=self.base_uri, http_method='PUT', query_params={'name': name} ) return self.create_label(la...
def _update_label_name(self, name): ''' Update the current label's name. Returns a new Label object. ''' label_json = self.fetch_json( uri_path=self.base_uri, http_method='PUT', query_params={'name': name} ) return self.create_label(la...
[ "Update", "the", "current", "label", "s", "name", ".", "Returns", "a", "new", "Label", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/label.py#L44-L54
[ "def", "_update_label_name", "(", "self", ",", "name", ")", ":", "label_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", ",", "http_method", "=", "'PUT'", ",", "query_params", "=", "{", "'name'", ":", "name", "}", ")"...
483dc94c352df40dc05ead31820b059b2545cf82
test
Label._update_label_dict
Update the current label. Returns a new Label object.
trolly/label.py
def _update_label_dict(self, query_params={}): ''' Update the current label. Returns a new Label object. ''' label_json = self.fetch_json( uri_path=self.base_uri, http_method='PUT', query_params=query_params ) return self.create_label(...
def _update_label_dict(self, query_params={}): ''' Update the current label. Returns a new Label object. ''' label_json = self.fetch_json( uri_path=self.base_uri, http_method='PUT', query_params=query_params ) return self.create_label(...
[ "Update", "the", "current", "label", ".", "Returns", "a", "new", "Label", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/label.py#L57-L67
[ "def", "_update_label_dict", "(", "self", ",", "query_params", "=", "{", "}", ")", ":", "label_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", ",", "http_method", "=", "'PUT'", ",", "query_params", "=", "query_params", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Authorise.get_authorisation_url
Returns a URL that needs to be opened in a browser to retrieve an access token.
trolly/authorise.py
def get_authorisation_url(self, application_name, token_expire='1day'): ''' Returns a URL that needs to be opened in a browser to retrieve an access token. ''' query_params = { 'name': application_name, 'expiration': token_expire, 'response_typ...
def get_authorisation_url(self, application_name, token_expire='1day'): ''' Returns a URL that needs to be opened in a browser to retrieve an access token. ''' query_params = { 'name': application_name, 'expiration': token_expire, 'response_typ...
[ "Returns", "a", "URL", "that", "needs", "to", "be", "opened", "in", "a", "browser", "to", "retrieve", "an", "access", "token", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/authorise.py#L14-L33
[ "def", "get_authorisation_url", "(", "self", ",", "application_name", ",", "token_expire", "=", "'1day'", ")", ":", "query_params", "=", "{", "'name'", ":", "application_name", ",", "'expiration'", ":", "token_expire", ",", "'response_type'", ":", "'token'", ",", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Card.get_card_information
Get information for this card. Returns a dictionary of values.
trolly/card.py
def get_card_information(self, query_params=None): ''' Get information for this card. Returns a dictionary of values. ''' return self.fetch_json( uri_path=self.base_uri, query_params=query_params or {} )
def get_card_information(self, query_params=None): ''' Get information for this card. Returns a dictionary of values. ''' return self.fetch_json( uri_path=self.base_uri, query_params=query_params or {} )
[ "Get", "information", "for", "this", "card", ".", "Returns", "a", "dictionary", "of", "values", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/card.py#L22-L29
[ "def", "get_card_information", "(", "self", ",", "query_params", "=", "None", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", ",", "query_params", "=", "query_params", "or", "{", "}", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Card.get_board
Get board information for this card. Returns a Board object. Returns: Board: The board this card is attached to
trolly/card.py
def get_board(self, **query_params): ''' Get board information for this card. Returns a Board object. Returns: Board: The board this card is attached to ''' board_json = self.get_board_json(self.base_uri, query_params=query_pa...
def get_board(self, **query_params): ''' Get board information for this card. Returns a Board object. Returns: Board: The board this card is attached to ''' board_json = self.get_board_json(self.base_uri, query_params=query_pa...
[ "Get", "board", "information", "for", "this", "card", ".", "Returns", "a", "Board", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/card.py#L31-L40
[ "def", "get_board", "(", "self", ",", "*", "*", "query_params", ")", ":", "board_json", "=", "self", ".", "get_board_json", "(", "self", ".", "base_uri", ",", "query_params", "=", "query_params", ")", "return", "self", ".", "create_board", "(", "board_json",...
483dc94c352df40dc05ead31820b059b2545cf82
test
Card.get_list
Get list information for this card. Returns a List object. Returns: List: The list this card is attached to
trolly/card.py
def get_list(self, **query_params): ''' Get list information for this card. Returns a List object. Returns: List: The list this card is attached to ''' list_json = self.get_list_json(self.base_uri, query_params=query_params) ...
def get_list(self, **query_params): ''' Get list information for this card. Returns a List object. Returns: List: The list this card is attached to ''' list_json = self.get_list_json(self.base_uri, query_params=query_params) ...
[ "Get", "list", "information", "for", "this", "card", ".", "Returns", "a", "List", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/card.py#L42-L51
[ "def", "get_list", "(", "self", ",", "*", "*", "query_params", ")", ":", "list_json", "=", "self", ".", "get_list_json", "(", "self", ".", "base_uri", ",", "query_params", "=", "query_params", ")", "return", "self", ".", "create_list", "(", "list_json", ")...
483dc94c352df40dc05ead31820b059b2545cf82
test
Card.get_checklists
Get the checklists for this card. Returns a list of Checklist objects. Returns: list(Checklist): The checklists attached to this card
trolly/card.py
def get_checklists(self, **query_params): ''' Get the checklists for this card. Returns a list of Checklist objects. Returns: list(Checklist): The checklists attached to this card ''' checklists = self.get_checklist_json(self.base_uri, ...
def get_checklists(self, **query_params): ''' Get the checklists for this card. Returns a list of Checklist objects. Returns: list(Checklist): The checklists attached to this card ''' checklists = self.get_checklist_json(self.base_uri, ...
[ "Get", "the", "checklists", "for", "this", "card", ".", "Returns", "a", "list", "of", "Checklist", "objects", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/card.py#L53-L67
[ "def", "get_checklists", "(", "self", ",", "*", "*", "query_params", ")", ":", "checklists", "=", "self", ".", "get_checklist_json", "(", "self", ".", "base_uri", ",", "query_params", "=", "query_params", ")", "checklists_list", "=", "[", "]", "for", "checkl...
483dc94c352df40dc05ead31820b059b2545cf82
test
Card.add_comment
Adds a comment to this card by the current user.
trolly/card.py
def add_comment(self, comment_text): ''' Adds a comment to this card by the current user. ''' return self.fetch_json( uri_path=self.base_uri + '/actions/comments', http_method='POST', query_params={'text': comment_text} )
def add_comment(self, comment_text): ''' Adds a comment to this card by the current user. ''' return self.fetch_json( uri_path=self.base_uri + '/actions/comments', http_method='POST', query_params={'text': comment_text} )
[ "Adds", "a", "comment", "to", "this", "card", "by", "the", "current", "user", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/card.py#L98-L106
[ "def", "add_comment", "(", "self", ",", "comment_text", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/actions/comments'", ",", "http_method", "=", "'POST'", ",", "query_params", "=", "{", "'text'", ":",...
483dc94c352df40dc05ead31820b059b2545cf82
test
Card.add_attachment
Adds an attachment to this card.
trolly/card.py
def add_attachment(self, filename, open_file): ''' Adds an attachment to this card. ''' fields = { 'api_key': self.client.api_key, 'token': self.client.user_auth_token } content_type, body = self.encode_multipart_formdata( fields=field...
def add_attachment(self, filename, open_file): ''' Adds an attachment to this card. ''' fields = { 'api_key': self.client.api_key, 'token': self.client.user_auth_token } content_type, body = self.encode_multipart_formdata( fields=field...
[ "Adds", "an", "attachment", "to", "this", "card", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/card.py#L108-L128
[ "def", "add_attachment", "(", "self", ",", "filename", ",", "open_file", ")", ":", "fields", "=", "{", "'api_key'", ":", "self", ".", "client", ".", "api_key", ",", "'token'", ":", "self", ".", "client", ".", "user_auth_token", "}", "content_type", ",", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Card.add_checklist
Add a checklist to this card. Returns a Checklist object.
trolly/card.py
def add_checklist(self, query_params=None): ''' Add a checklist to this card. Returns a Checklist object. ''' checklist_json = self.fetch_json( uri_path=self.base_uri + '/checklists', http_method='POST', query_params=query_params or {} ) ...
def add_checklist(self, query_params=None): ''' Add a checklist to this card. Returns a Checklist object. ''' checklist_json = self.fetch_json( uri_path=self.base_uri + '/checklists', http_method='POST', query_params=query_params or {} ) ...
[ "Add", "a", "checklist", "to", "this", "card", ".", "Returns", "a", "Checklist", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/card.py#L130-L140
[ "def", "add_checklist", "(", "self", ",", "query_params", "=", "None", ")", ":", "checklist_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/checklists'", ",", "http_method", "=", "'POST'", ",", "query_params", "=...
483dc94c352df40dc05ead31820b059b2545cf82
test
Card._add_label_from_dict
Add a label to this card, from a dictionary.
trolly/card.py
def _add_label_from_dict(self, query_params=None): ''' Add a label to this card, from a dictionary. ''' return self.fetch_json( uri_path=self.base_uri + '/labels', http_method='POST', query_params=query_params or {} )
def _add_label_from_dict(self, query_params=None): ''' Add a label to this card, from a dictionary. ''' return self.fetch_json( uri_path=self.base_uri + '/labels', http_method='POST', query_params=query_params or {} )
[ "Add", "a", "label", "to", "this", "card", "from", "a", "dictionary", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/card.py#L147-L155
[ "def", "_add_label_from_dict", "(", "self", ",", "query_params", "=", "None", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/labels'", ",", "http_method", "=", "'POST'", ",", "query_params", "=", "query_...
483dc94c352df40dc05ead31820b059b2545cf82
test
Card._add_label_from_class
Add an existing label to this card.
trolly/card.py
def _add_label_from_class(self, label=None): ''' Add an existing label to this card. ''' return self.fetch_json( uri_path=self.base_uri + '/idLabels', http_method='POST', query_params={'value': label.id} )
def _add_label_from_class(self, label=None): ''' Add an existing label to this card. ''' return self.fetch_json( uri_path=self.base_uri + '/idLabels', http_method='POST', query_params={'value': label.id} )
[ "Add", "an", "existing", "label", "to", "this", "card", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/card.py#L158-L166
[ "def", "_add_label_from_class", "(", "self", ",", "label", "=", "None", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/idLabels'", ",", "http_method", "=", "'POST'", ",", "query_params", "=", "{", "'va...
483dc94c352df40dc05ead31820b059b2545cf82
test
Card.add_member
Add a member to this card. Returns a list of Member objects.
trolly/card.py
def add_member(self, member_id): ''' Add a member to this card. Returns a list of Member objects. ''' members = self.fetch_json( uri_path=self.base_uri + '/idMembers', http_method='POST', query_params={'value': member_id} ) members_lis...
def add_member(self, member_id): ''' Add a member to this card. Returns a list of Member objects. ''' members = self.fetch_json( uri_path=self.base_uri + '/idMembers', http_method='POST', query_params={'value': member_id} ) members_lis...
[ "Add", "a", "member", "to", "this", "card", ".", "Returns", "a", "list", "of", "Member", "objects", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/card.py#L168-L182
[ "def", "add_member", "(", "self", ",", "member_id", ")", ":", "members", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/idMembers'", ",", "http_method", "=", "'POST'", ",", "query_params", "=", "{", "'value'", ":", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Card.encode_multipart_formdata
Encodes data to updload a file to Trello. Fields is a dictionary of api_key and token. Filename is the name of the file and file_values is the open(file).read() string.
trolly/card.py
def encode_multipart_formdata(self, fields, filename, file_values): ''' Encodes data to updload a file to Trello. Fields is a dictionary of api_key and token. Filename is the name of the file and file_values is the open(file).read() string. ''' boundary = '----------Trell...
def encode_multipart_formdata(self, fields, filename, file_values): ''' Encodes data to updload a file to Trello. Fields is a dictionary of api_key and token. Filename is the name of the file and file_values is the open(file).read() string. ''' boundary = '----------Trell...
[ "Encodes", "data", "to", "updload", "a", "file", "to", "Trello", ".", "Fields", "is", "a", "dictionary", "of", "api_key", "and", "token", ".", "Filename", "is", "the", "name", "of", "the", "file", "and", "file_values", "is", "the", "open", "(", "file", ...
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/card.py#L214-L248
[ "def", "encode_multipart_formdata", "(", "self", ",", "fields", ",", "filename", ",", "file_values", ")", ":", "boundary", "=", "'----------Trello_Boundary_$'", "crlf", "=", "'\\r\\n'", "data", "=", "[", "]", "for", "key", "in", "fields", ":", "data", ".", "...
483dc94c352df40dc05ead31820b059b2545cf82
test
Member.get_member_information
Get Information for a member. Returns a dictionary of values. Returns: dict
trolly/member.py
def get_member_information(self, query_params=None): ''' Get Information for a member. Returns a dictionary of values. Returns: dict ''' return self.fetch_json( uri_path=self.base_uri, query_params=query_params or {} )
def get_member_information(self, query_params=None): ''' Get Information for a member. Returns a dictionary of values. Returns: dict ''' return self.fetch_json( uri_path=self.base_uri, query_params=query_params or {} )
[ "Get", "Information", "for", "a", "member", ".", "Returns", "a", "dictionary", "of", "values", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/member.py#L17-L27
[ "def", "get_member_information", "(", "self", ",", "query_params", "=", "None", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", ",", "query_params", "=", "query_params", "or", "{", "}", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Member.get_cards
Get all cards this member is attached to. Return a list of Card objects. Returns: list(Card): Return all cards this member is attached to
trolly/member.py
def get_cards(self, **query_params): ''' Get all cards this member is attached to. Return a list of Card objects. Returns: list(Card): Return all cards this member is attached to ''' cards = self.get_cards_json(self.base_uri, query_params=query_params) ...
def get_cards(self, **query_params): ''' Get all cards this member is attached to. Return a list of Card objects. Returns: list(Card): Return all cards this member is attached to ''' cards = self.get_cards_json(self.base_uri, query_params=query_params) ...
[ "Get", "all", "cards", "this", "member", "is", "attached", "to", ".", "Return", "a", "list", "of", "Card", "objects", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/member.py#L45-L59
[ "def", "get_cards", "(", "self", ",", "*", "*", "query_params", ")", ":", "cards", "=", "self", ".", "get_cards_json", "(", "self", ".", "base_uri", ",", "query_params", "=", "query_params", ")", "cards_list", "=", "[", "]", "for", "card_json", "in", "ca...
483dc94c352df40dc05ead31820b059b2545cf82
test
Member.get_organisations
Get all organisations this member is attached to. Return a list of Organisation objects. Returns: list(Organisation): Return all organisations this member is attached to
trolly/member.py
def get_organisations(self, **query_params): ''' Get all organisations this member is attached to. Return a list of Organisation objects. Returns: list(Organisation): Return all organisations this member is attached to ''' organisations = self.get...
def get_organisations(self, **query_params): ''' Get all organisations this member is attached to. Return a list of Organisation objects. Returns: list(Organisation): Return all organisations this member is attached to ''' organisations = self.get...
[ "Get", "all", "organisations", "this", "member", "is", "attached", "to", ".", "Return", "a", "list", "of", "Organisation", "objects", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/member.py#L61-L78
[ "def", "get_organisations", "(", "self", ",", "*", "*", "query_params", ")", ":", "organisations", "=", "self", ".", "get_organisations_json", "(", "self", ".", "base_uri", ",", "query_params", "=", "query_params", ")", "organisations_list", "=", "[", "]", "fo...
483dc94c352df40dc05ead31820b059b2545cf82
test
Member.create_new_board
Create a new board. name is required in query_params. Returns a Board object. Returns: Board: Returns the created board
trolly/member.py
def create_new_board(self, query_params=None): ''' Create a new board. name is required in query_params. Returns a Board object. Returns: Board: Returns the created board ''' board_json = self.fetch_json( uri_path='/boards', http_metho...
def create_new_board(self, query_params=None): ''' Create a new board. name is required in query_params. Returns a Board object. Returns: Board: Returns the created board ''' board_json = self.fetch_json( uri_path='/boards', http_metho...
[ "Create", "a", "new", "board", ".", "name", "is", "required", "in", "query_params", ".", "Returns", "a", "Board", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/member.py#L80-L93
[ "def", "create_new_board", "(", "self", ",", "query_params", "=", "None", ")", ":", "board_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "'/boards'", ",", "http_method", "=", "'POST'", ",", "query_params", "=", "query_params", "or", "{", "}", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
singledispatchmethod
Enable singledispatch for class methods. See http://stackoverflow.com/a/24602374/274318
trolly/lib.py
def singledispatchmethod(method): ''' Enable singledispatch for class methods. See http://stackoverflow.com/a/24602374/274318 ''' dispatcher = singledispatch(method) def wrapper(*args, **kw): return dispatcher.dispatch(args[1].__class__)(*args, **kw) wrapper.register = dispatcher.re...
def singledispatchmethod(method): ''' Enable singledispatch for class methods. See http://stackoverflow.com/a/24602374/274318 ''' dispatcher = singledispatch(method) def wrapper(*args, **kw): return dispatcher.dispatch(args[1].__class__)(*args, **kw) wrapper.register = dispatcher.re...
[ "Enable", "singledispatch", "for", "class", "methods", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/lib.py#L5-L16
[ "def", "singledispatchmethod", "(", "method", ")", ":", "dispatcher", "=", "singledispatch", "(", "method", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kw", ")", ":", "return", "dispatcher", ".", "dispatch", "(", "args", "[", "1", "]", "."...
483dc94c352df40dc05ead31820b059b2545cf82
test
TrelloObject.create_checklist_item
Create a ChecklistItem object from JSON object
trolly/trelloobject.py
def create_checklist_item(self, card_id, checklist_id, checklistitem_json, **kwargs): ''' Create a ChecklistItem object from JSON object ''' return self.client.create_checklist_item(card_id, checklist_id, checklistitem_json, **kwargs)
def create_checklist_item(self, card_id, checklist_id, checklistitem_json, **kwargs): ''' Create a ChecklistItem object from JSON object ''' return self.client.create_checklist_item(card_id, checklist_id, checklistitem_json, **kwargs)
[ "Create", "a", "ChecklistItem", "object", "from", "JSON", "object" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/trelloobject.py#L130-L134
[ "def", "create_checklist_item", "(", "self", ",", "card_id", ",", "checklist_id", ",", "checklistitem_json", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "client", ".", "create_checklist_item", "(", "card_id", ",", "checklist_id", ",", "checklistite...
483dc94c352df40dc05ead31820b059b2545cf82
test
Board.get_board_information
Get all information for this board. Returns a dictionary of values.
trolly/board.py
def get_board_information(self, query_params=None): ''' Get all information for this board. Returns a dictionary of values. ''' return self.fetch_json( uri_path='/boards/' + self.id, query_params=query_params or {} )
def get_board_information(self, query_params=None): ''' Get all information for this board. Returns a dictionary of values. ''' return self.fetch_json( uri_path='/boards/' + self.id, query_params=query_params or {} )
[ "Get", "all", "information", "for", "this", "board", ".", "Returns", "a", "dictionary", "of", "values", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/board.py#L18-L25
[ "def", "get_board_information", "(", "self", ",", "query_params", "=", "None", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "'/boards/'", "+", "self", ".", "id", ",", "query_params", "=", "query_params", "or", "{", "}", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Board.get_lists
Get the lists attached to this board. Returns a list of List objects. Returns: list(List): The lists attached to this board
trolly/board.py
def get_lists(self, **query_params): ''' Get the lists attached to this board. Returns a list of List objects. Returns: list(List): The lists attached to this board ''' lists = self.get_lists_json(self.base_uri, query_params=query_params) lists_list = [] ...
def get_lists(self, **query_params): ''' Get the lists attached to this board. Returns a list of List objects. Returns: list(List): The lists attached to this board ''' lists = self.get_lists_json(self.base_uri, query_params=query_params) lists_list = [] ...
[ "Get", "the", "lists", "attached", "to", "this", "board", ".", "Returns", "a", "list", "of", "List", "objects", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/board.py#L27-L40
[ "def", "get_lists", "(", "self", ",", "*", "*", "query_params", ")", ":", "lists", "=", "self", ".", "get_lists_json", "(", "self", ".", "base_uri", ",", "query_params", "=", "query_params", ")", "lists_list", "=", "[", "]", "for", "list_json", "in", "li...
483dc94c352df40dc05ead31820b059b2545cf82
test
Board.get_labels
Get the labels attached to this board. Returns a label of Label objects. Returns: list(Label): The labels attached to this board
trolly/board.py
def get_labels(self, **query_params): ''' Get the labels attached to this board. Returns a label of Label objects. Returns: list(Label): The labels attached to this board ''' labels = self.get_labels_json(self.base_uri, query_params=query_params) lab...
def get_labels(self, **query_params): ''' Get the labels attached to this board. Returns a label of Label objects. Returns: list(Label): The labels attached to this board ''' labels = self.get_labels_json(self.base_uri, query_params=query_params) lab...
[ "Get", "the", "labels", "attached", "to", "this", "board", ".", "Returns", "a", "label", "of", "Label", "objects", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/board.py#L42-L56
[ "def", "get_labels", "(", "self", ",", "*", "*", "query_params", ")", ":", "labels", "=", "self", ".", "get_labels_json", "(", "self", ".", "base_uri", ",", "query_params", "=", "query_params", ")", "labels_list", "=", "[", "]", "for", "label_json", "in", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Board.get_card
Get a Card for a given card id. Returns a Card object. Returns: Card: The card with the given card_id
trolly/board.py
def get_card(self, card_id, **query_params): ''' Get a Card for a given card id. Returns a Card object. Returns: Card: The card with the given card_id ''' card_json = self.fetch_json( uri_path=self.base_uri + '/cards/' + card_id ) return ...
def get_card(self, card_id, **query_params): ''' Get a Card for a given card id. Returns a Card object. Returns: Card: The card with the given card_id ''' card_json = self.fetch_json( uri_path=self.base_uri + '/cards/' + card_id ) return ...
[ "Get", "a", "Card", "for", "a", "given", "card", "id", ".", "Returns", "a", "Card", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/board.py#L73-L84
[ "def", "get_card", "(", "self", ",", "card_id", ",", "*", "*", "query_params", ")", ":", "card_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/cards/'", "+", "card_id", ")", "return", "self", ".", "create_car...
483dc94c352df40dc05ead31820b059b2545cf82
test
Board.get_checklists
Get the checklists for this board. Returns a list of Checklist objects.
trolly/board.py
def get_checklists( self ): """ Get the checklists for this board. Returns a list of Checklist objects. """ checklists = self.getChecklistsJson( self.base_uri ) checklists_list = [] for checklist_json in checklists: checklists_list.append( self.createChecklis...
def get_checklists( self ): """ Get the checklists for this board. Returns a list of Checklist objects. """ checklists = self.getChecklistsJson( self.base_uri ) checklists_list = [] for checklist_json in checklists: checklists_list.append( self.createChecklis...
[ "Get", "the", "checklists", "for", "this", "board", ".", "Returns", "a", "list", "of", "Checklist", "objects", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/board.py#L86-L96
[ "def", "get_checklists", "(", "self", ")", ":", "checklists", "=", "self", ".", "getChecklistsJson", "(", "self", ".", "base_uri", ")", "checklists_list", "=", "[", "]", "for", "checklist_json", "in", "checklists", ":", "checklists_list", ".", "append", "(", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Board.get_organisation
Get the Organisation for this board. Returns Organisation object. Returns: list(Organisation): The organisation attached to this board
trolly/board.py
def get_organisation(self, **query_params): ''' Get the Organisation for this board. Returns Organisation object. Returns: list(Organisation): The organisation attached to this board ''' organisation_json = self.get_organisations_json( self.base_uri, quer...
def get_organisation(self, **query_params): ''' Get the Organisation for this board. Returns Organisation object. Returns: list(Organisation): The organisation attached to this board ''' organisation_json = self.get_organisations_json( self.base_uri, quer...
[ "Get", "the", "Organisation", "for", "this", "board", ".", "Returns", "Organisation", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/board.py#L115-L125
[ "def", "get_organisation", "(", "self", ",", "*", "*", "query_params", ")", ":", "organisation_json", "=", "self", ".", "get_organisations_json", "(", "self", ".", "base_uri", ",", "query_params", "=", "query_params", ")", "return", "self", ".", "create_organisa...
483dc94c352df40dc05ead31820b059b2545cf82
test
Board.update_board
Update this board's information. Returns a new board.
trolly/board.py
def update_board(self, query_params=None): ''' Update this board's information. Returns a new board. ''' board_json = self.fetch_json( uri_path=self.base_uri, http_method='PUT', query_params=query_params or {} ) return self.create_boar...
def update_board(self, query_params=None): ''' Update this board's information. Returns a new board. ''' board_json = self.fetch_json( uri_path=self.base_uri, http_method='PUT', query_params=query_params or {} ) return self.create_boar...
[ "Update", "this", "board", "s", "information", ".", "Returns", "a", "new", "board", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/board.py#L127-L137
[ "def", "update_board", "(", "self", ",", "query_params", "=", "None", ")", ":", "board_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", ",", "http_method", "=", "'PUT'", ",", "query_params", "=", "query_params", "or", "...
483dc94c352df40dc05ead31820b059b2545cf82
test
Board.add_list
Create a list for a board. Returns a new List object.
trolly/board.py
def add_list(self, query_params=None): ''' Create a list for a board. Returns a new List object. ''' list_json = self.fetch_json( uri_path=self.base_uri + '/lists', http_method='POST', query_params=query_params or {} ) return self.crea...
def add_list(self, query_params=None): ''' Create a list for a board. Returns a new List object. ''' list_json = self.fetch_json( uri_path=self.base_uri + '/lists', http_method='POST', query_params=query_params or {} ) return self.crea...
[ "Create", "a", "list", "for", "a", "board", ".", "Returns", "a", "new", "List", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/board.py#L139-L149
[ "def", "add_list", "(", "self", ",", "query_params", "=", "None", ")", ":", "list_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/lists'", ",", "http_method", "=", "'POST'", ",", "query_params", "=", "query_par...
483dc94c352df40dc05ead31820b059b2545cf82
test
Board.add_label
Create a label for a board. Returns a new Label object.
trolly/board.py
def add_label(self, query_params=None): ''' Create a label for a board. Returns a new Label object. ''' list_json = self.fetch_json( uri_path=self.base_uri + '/labels', http_method='POST', query_params=query_params or {} ) return self....
def add_label(self, query_params=None): ''' Create a label for a board. Returns a new Label object. ''' list_json = self.fetch_json( uri_path=self.base_uri + '/labels', http_method='POST', query_params=query_params or {} ) return self....
[ "Create", "a", "label", "for", "a", "board", ".", "Returns", "a", "new", "Label", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/board.py#L151-L161
[ "def", "add_label", "(", "self", ",", "query_params", "=", "None", ")", ":", "list_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/labels'", ",", "http_method", "=", "'POST'", ",", "query_params", "=", "query_p...
483dc94c352df40dc05ead31820b059b2545cf82
test
Checklist.get_checklist_information
Get all information for this Checklist. Returns a dictionary of values.
trolly/checklist.py
def get_checklist_information(self, query_params=None): ''' Get all information for this Checklist. Returns a dictionary of values. ''' # We don't use trelloobject.TrelloObject.get_checklist_json, because # that is meant to return lists of checklists. return self.fetch_js...
def get_checklist_information(self, query_params=None): ''' Get all information for this Checklist. Returns a dictionary of values. ''' # We don't use trelloobject.TrelloObject.get_checklist_json, because # that is meant to return lists of checklists. return self.fetch_js...
[ "Get", "all", "information", "for", "this", "Checklist", ".", "Returns", "a", "dictionary", "of", "values", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/checklist.py#L18-L27
[ "def", "get_checklist_information", "(", "self", ",", "query_params", "=", "None", ")", ":", "# We don't use trelloobject.TrelloObject.get_checklist_json, because", "# that is meant to return lists of checklists.", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "sel...
483dc94c352df40dc05ead31820b059b2545cf82
test
Checklist.get_card
Get card this checklist is on.
trolly/checklist.py
def get_card(self): ''' Get card this checklist is on. ''' card_id = self.get_checklist_information().get('idCard', None) if card_id: return self.client.get_card(card_id)
def get_card(self): ''' Get card this checklist is on. ''' card_id = self.get_checklist_information().get('idCard', None) if card_id: return self.client.get_card(card_id)
[ "Get", "card", "this", "checklist", "is", "on", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/checklist.py#L29-L35
[ "def", "get_card", "(", "self", ")", ":", "card_id", "=", "self", ".", "get_checklist_information", "(", ")", ".", "get", "(", "'idCard'", ",", "None", ")", "if", "card_id", ":", "return", "self", ".", "client", ".", "get_card", "(", "card_id", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Checklist.get_item_objects
Get the items for this checklist. Returns a list of ChecklistItem objects.
trolly/checklist.py
def get_item_objects(self, query_params=None): """ Get the items for this checklist. Returns a list of ChecklistItem objects. """ card = self.get_card() checklistitems_list = [] for checklistitem_json in self.get_items(query_params): checklistitems_list.append...
def get_item_objects(self, query_params=None): """ Get the items for this checklist. Returns a list of ChecklistItem objects. """ card = self.get_card() checklistitems_list = [] for checklistitem_json in self.get_items(query_params): checklistitems_list.append...
[ "Get", "the", "items", "for", "this", "checklist", ".", "Returns", "a", "list", "of", "ChecklistItem", "objects", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/checklist.py#L47-L56
[ "def", "get_item_objects", "(", "self", ",", "query_params", "=", "None", ")", ":", "card", "=", "self", ".", "get_card", "(", ")", "checklistitems_list", "=", "[", "]", "for", "checklistitem_json", "in", "self", ".", "get_items", "(", "query_params", ")", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Checklist.update_checklist
Update the current checklist. Returns a new Checklist object.
trolly/checklist.py
def update_checklist(self, name): ''' Update the current checklist. Returns a new Checklist object. ''' checklist_json = self.fetch_json( uri_path=self.base_uri, http_method='PUT', query_params={'name': name} ) return self.create_check...
def update_checklist(self, name): ''' Update the current checklist. Returns a new Checklist object. ''' checklist_json = self.fetch_json( uri_path=self.base_uri, http_method='PUT', query_params={'name': name} ) return self.create_check...
[ "Update", "the", "current", "checklist", ".", "Returns", "a", "new", "Checklist", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/checklist.py#L59-L69
[ "def", "update_checklist", "(", "self", ",", "name", ")", ":", "checklist_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", ",", "http_method", "=", "'PUT'", ",", "query_params", "=", "{", "'name'", ":", "name", "}", "...
483dc94c352df40dc05ead31820b059b2545cf82
test
Checklist.add_item
Add an item to this checklist. Returns a dictionary of values of new item.
trolly/checklist.py
def add_item(self, query_params=None): ''' Add an item to this checklist. Returns a dictionary of values of new item. ''' return self.fetch_json( uri_path=self.base_uri + '/checkItems', http_method='POST', query_params=query_params or {} ...
def add_item(self, query_params=None): ''' Add an item to this checklist. Returns a dictionary of values of new item. ''' return self.fetch_json( uri_path=self.base_uri + '/checkItems', http_method='POST', query_params=query_params or {} ...
[ "Add", "an", "item", "to", "this", "checklist", ".", "Returns", "a", "dictionary", "of", "values", "of", "new", "item", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/checklist.py#L71-L80
[ "def", "add_item", "(", "self", ",", "query_params", "=", "None", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/checkItems'", ",", "http_method", "=", "'POST'", ",", "query_params", "=", "query_params",...
483dc94c352df40dc05ead31820b059b2545cf82
test
Checklist.remove_item
Deletes an item from this checklist.
trolly/checklist.py
def remove_item(self, item_id): ''' Deletes an item from this checklist. ''' return self.fetch_json( uri_path=self.base_uri + '/checkItems/' + item_id, http_method='DELETE' )
def remove_item(self, item_id): ''' Deletes an item from this checklist. ''' return self.fetch_json( uri_path=self.base_uri + '/checkItems/' + item_id, http_method='DELETE' )
[ "Deletes", "an", "item", "from", "this", "checklist", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/checklist.py#L82-L89
[ "def", "remove_item", "(", "self", ",", "item_id", ")", ":", "return", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/checkItems/'", "+", "item_id", ",", "http_method", "=", "'DELETE'", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
ChecklistItem.update_name
Rename the current checklist item. Returns a new ChecklistItem object.
trolly/checklist.py
def update_name( self, name ): """ Rename the current checklist item. Returns a new ChecklistItem object. """ checklistitem_json = self.fetch_json( uri_path = self.base_uri + '/name', http_method = 'PUT', query_params = {'value': name} ) ...
def update_name( self, name ): """ Rename the current checklist item. Returns a new ChecklistItem object. """ checklistitem_json = self.fetch_json( uri_path = self.base_uri + '/name', http_method = 'PUT', query_params = {'value': name} ) ...
[ "Rename", "the", "current", "checklist", "item", ".", "Returns", "a", "new", "ChecklistItem", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/checklist.py#L108-L118
[ "def", "update_name", "(", "self", ",", "name", ")", ":", "checklistitem_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/name'", ",", "http_method", "=", "'PUT'", ",", "query_params", "=", "{", "'value'", ":", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
ChecklistItem.update_state
Set the state of the current checklist item. Returns a new ChecklistItem object.
trolly/checklist.py
def update_state(self, state): """ Set the state of the current checklist item. Returns a new ChecklistItem object. """ checklistitem_json = self.fetch_json( uri_path = self.base_uri + '/state', http_method = 'PUT', query_params = {'value': 'complete' ...
def update_state(self, state): """ Set the state of the current checklist item. Returns a new ChecklistItem object. """ checklistitem_json = self.fetch_json( uri_path = self.base_uri + '/state', http_method = 'PUT', query_params = {'value': 'complete' ...
[ "Set", "the", "state", "of", "the", "current", "checklist", "item", ".", "Returns", "a", "new", "ChecklistItem", "object", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/checklist.py#L121-L131
[ "def", "update_state", "(", "self", ",", "state", ")", ":", "checklistitem_json", "=", "self", ".", "fetch_json", "(", "uri_path", "=", "self", ".", "base_uri", "+", "'/state'", ",", "http_method", "=", "'PUT'", ",", "query_params", "=", "{", "'value'", ":...
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.add_authorisation
Adds the API key and user auth token to the query parameters
trolly/client.py
def add_authorisation(self, query_params): ''' Adds the API key and user auth token to the query parameters ''' query_params['key'] = self.api_key if self.user_auth_token: query_params['token'] = self.user_auth_token return query_params
def add_authorisation(self, query_params): ''' Adds the API key and user auth token to the query parameters ''' query_params['key'] = self.api_key if self.user_auth_token: query_params['token'] = self.user_auth_token return query_params
[ "Adds", "the", "API", "key", "and", "user", "auth", "token", "to", "the", "query", "parameters" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L29-L38
[ "def", "add_authorisation", "(", "self", ",", "query_params", ")", ":", "query_params", "[", "'key'", "]", "=", "self", ".", "api_key", "if", "self", ".", "user_auth_token", ":", "query_params", "[", "'token'", "]", "=", "self", ".", "user_auth_token", "retu...
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.check_errors
Check HTTP reponse for known errors
trolly/client.py
def check_errors(self, uri, response): ''' Check HTTP reponse for known errors ''' if response.status == 401: raise trolly.Unauthorised(uri, response) if response.status != 200: raise trolly.ResourceUnavailable(uri, response)
def check_errors(self, uri, response): ''' Check HTTP reponse for known errors ''' if response.status == 401: raise trolly.Unauthorised(uri, response) if response.status != 200: raise trolly.ResourceUnavailable(uri, response)
[ "Check", "HTTP", "reponse", "for", "known", "errors" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L48-L56
[ "def", "check_errors", "(", "self", ",", "uri", ",", "response", ")", ":", "if", "response", ".", "status", "==", "401", ":", "raise", "trolly", ".", "Unauthorised", "(", "uri", ",", "response", ")", "if", "response", ".", "status", "!=", "200", ":", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.build_uri
Build the URI for the API call.
trolly/client.py
def build_uri(self, path, query_params): ''' Build the URI for the API call. ''' url = 'https://api.trello.com/1' + self.clean_path(path) url += '?' + urlencode(query_params) return url
def build_uri(self, path, query_params): ''' Build the URI for the API call. ''' url = 'https://api.trello.com/1' + self.clean_path(path) url += '?' + urlencode(query_params) return url
[ "Build", "the", "URI", "for", "the", "API", "call", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L58-L65
[ "def", "build_uri", "(", "self", ",", "path", ",", "query_params", ")", ":", "url", "=", "'https://api.trello.com/1'", "+", "self", ".", "clean_path", "(", "path", ")", "url", "+=", "'?'", "+", "urlencode", "(", "query_params", ")", "return", "url" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.fetch_json
Make a call to Trello API and capture JSON response. Raises an error when it fails. Returns: dict: Dictionary with the JSON data
trolly/client.py
def fetch_json(self, uri_path, http_method='GET', query_params=None, body=None, headers=None): ''' Make a call to Trello API and capture JSON response. Raises an error when it fails. Returns: dict: Dictionary with the JSON data ''' query_pa...
def fetch_json(self, uri_path, http_method='GET', query_params=None, body=None, headers=None): ''' Make a call to Trello API and capture JSON response. Raises an error when it fails. Returns: dict: Dictionary with the JSON data ''' query_pa...
[ "Make", "a", "call", "to", "Trello", "API", "and", "capture", "JSON", "response", ".", "Raises", "an", "error", "when", "it", "fails", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L67-L96
[ "def", "fetch_json", "(", "self", ",", "uri_path", ",", "http_method", "=", "'GET'", ",", "query_params", "=", "None", ",", "body", "=", "None", ",", "headers", "=", "None", ")", ":", "query_params", "=", "query_params", "or", "{", "}", "headers", "=", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.create_organisation
Create an Organisation object from a JSON object Returns: Organisation: The organisation from the given `organisation_json`.
trolly/client.py
def create_organisation(self, organisation_json): ''' Create an Organisation object from a JSON object Returns: Organisation: The organisation from the given `organisation_json`. ''' return trolly.organisation.Organisation( trello_client=self, ...
def create_organisation(self, organisation_json): ''' Create an Organisation object from a JSON object Returns: Organisation: The organisation from the given `organisation_json`. ''' return trolly.organisation.Organisation( trello_client=self, ...
[ "Create", "an", "Organisation", "object", "from", "a", "JSON", "object" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L98-L110
[ "def", "create_organisation", "(", "self", ",", "organisation_json", ")", ":", "return", "trolly", ".", "organisation", ".", "Organisation", "(", "trello_client", "=", "self", ",", "organisation_id", "=", "organisation_json", "[", "'id'", "]", ",", "name", "=", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.create_board
Create Board object from a JSON object Returns: Board: The board from the given `board_json`.
trolly/client.py
def create_board(self, board_json): ''' Create Board object from a JSON object Returns: Board: The board from the given `board_json`. ''' return trolly.board.Board( trello_client=self, board_id=board_json['id'], name=board_json['na...
def create_board(self, board_json): ''' Create Board object from a JSON object Returns: Board: The board from the given `board_json`. ''' return trolly.board.Board( trello_client=self, board_id=board_json['id'], name=board_json['na...
[ "Create", "Board", "object", "from", "a", "JSON", "object" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L112-L124
[ "def", "create_board", "(", "self", ",", "board_json", ")", ":", "return", "trolly", ".", "board", ".", "Board", "(", "trello_client", "=", "self", ",", "board_id", "=", "board_json", "[", "'id'", "]", ",", "name", "=", "board_json", "[", "'name'", "]", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.create_label
Create Label object from JSON object Returns: Label: The label from the given `label_json`.
trolly/client.py
def create_label(self, label_json): ''' Create Label object from JSON object Returns: Label: The label from the given `label_json`. ''' return trolly.label.Label( trello_client=self, label_id=label_json['id'], name=label_json['name...
def create_label(self, label_json): ''' Create Label object from JSON object Returns: Label: The label from the given `label_json`. ''' return trolly.label.Label( trello_client=self, label_id=label_json['id'], name=label_json['name...
[ "Create", "Label", "object", "from", "JSON", "object" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L126-L138
[ "def", "create_label", "(", "self", ",", "label_json", ")", ":", "return", "trolly", ".", "label", ".", "Label", "(", "trello_client", "=", "self", ",", "label_id", "=", "label_json", "[", "'id'", "]", ",", "name", "=", "label_json", "[", "'name'", "]", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.create_list
Create List object from JSON object Returns: List: The list from the given `list_json`.
trolly/client.py
def create_list(self, list_json): ''' Create List object from JSON object Returns: List: The list from the given `list_json`. ''' return trolly.list.List( trello_client=self, list_id=list_json['id'], name=list_json['name'], ...
def create_list(self, list_json): ''' Create List object from JSON object Returns: List: The list from the given `list_json`. ''' return trolly.list.List( trello_client=self, list_id=list_json['id'], name=list_json['name'], ...
[ "Create", "List", "object", "from", "JSON", "object" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L140-L152
[ "def", "create_list", "(", "self", ",", "list_json", ")", ":", "return", "trolly", ".", "list", ".", "List", "(", "trello_client", "=", "self", ",", "list_id", "=", "list_json", "[", "'id'", "]", ",", "name", "=", "list_json", "[", "'name'", "]", ",", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.create_card
Create a Card object from JSON object Returns: Card: The card from the given `card_json`.
trolly/client.py
def create_card(self, card_json): ''' Create a Card object from JSON object Returns: Card: The card from the given `card_json`. ''' return trolly.card.Card( trello_client=self, card_id=card_json['id'], name=card_json['name'], ...
def create_card(self, card_json): ''' Create a Card object from JSON object Returns: Card: The card from the given `card_json`. ''' return trolly.card.Card( trello_client=self, card_id=card_json['id'], name=card_json['name'], ...
[ "Create", "a", "Card", "object", "from", "JSON", "object" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L154-L166
[ "def", "create_card", "(", "self", ",", "card_json", ")", ":", "return", "trolly", ".", "card", ".", "Card", "(", "trello_client", "=", "self", ",", "card_id", "=", "card_json", "[", "'id'", "]", ",", "name", "=", "card_json", "[", "'name'", "]", ",", ...
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.create_checklist
Create a Checklist object from JSON object Returns: Checklist: The checklist from the given `checklist_json`.
trolly/client.py
def create_checklist(self, checklist_json): ''' Create a Checklist object from JSON object Returns: Checklist: The checklist from the given `checklist_json`. ''' return trolly.checklist.Checklist( trello_client=self, checklist_id=checklist_jso...
def create_checklist(self, checklist_json): ''' Create a Checklist object from JSON object Returns: Checklist: The checklist from the given `checklist_json`. ''' return trolly.checklist.Checklist( trello_client=self, checklist_id=checklist_jso...
[ "Create", "a", "Checklist", "object", "from", "JSON", "object" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L168-L180
[ "def", "create_checklist", "(", "self", ",", "checklist_json", ")", ":", "return", "trolly", ".", "checklist", ".", "Checklist", "(", "trello_client", "=", "self", ",", "checklist_id", "=", "checklist_json", "[", "'id'", "]", ",", "name", "=", "checklist_json"...
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.create_checklist_item
Create a ChecklistItem object from JSON object
trolly/client.py
def create_checklist_item(self, card_id, checklist_id, checklistitem_json): """ Create a ChecklistItem object from JSON object """ return trolly.checklist.ChecklistItem( trello_client=self, card_id=card_id, checklist_id=checklist_id, checkl...
def create_checklist_item(self, card_id, checklist_id, checklistitem_json): """ Create a ChecklistItem object from JSON object """ return trolly.checklist.ChecklistItem( trello_client=self, card_id=card_id, checklist_id=checklist_id, checkl...
[ "Create", "a", "ChecklistItem", "object", "from", "JSON", "object" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L182-L193
[ "def", "create_checklist_item", "(", "self", ",", "card_id", ",", "checklist_id", ",", "checklistitem_json", ")", ":", "return", "trolly", ".", "checklist", ".", "ChecklistItem", "(", "trello_client", "=", "self", ",", "card_id", "=", "card_id", ",", "checklist_...
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.create_member
Create a Member object from JSON object Returns: Member: The member from the given `member_json`.
trolly/client.py
def create_member(self, member_json): ''' Create a Member object from JSON object Returns: Member: The member from the given `member_json`. ''' return trolly.member.Member( trello_client=self, member_id=member_json['id'], name=memb...
def create_member(self, member_json): ''' Create a Member object from JSON object Returns: Member: The member from the given `member_json`. ''' return trolly.member.Member( trello_client=self, member_id=member_json['id'], name=memb...
[ "Create", "a", "Member", "object", "from", "JSON", "object" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L195-L207
[ "def", "create_member", "(", "self", ",", "member_json", ")", ":", "return", "trolly", ".", "member", ".", "Member", "(", "trello_client", "=", "self", ",", "member_id", "=", "member_json", "[", "'id'", "]", ",", "name", "=", "member_json", "[", "'fullName...
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.get_organisation
Get an organisation Returns: Organisation: The organisation with the given `id`
trolly/client.py
def get_organisation(self, id, name=None): ''' Get an organisation Returns: Organisation: The organisation with the given `id` ''' return self.create_organisation(dict(id=id, name=name))
def get_organisation(self, id, name=None): ''' Get an organisation Returns: Organisation: The organisation with the given `id` ''' return self.create_organisation(dict(id=id, name=name))
[ "Get", "an", "organisation" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L209-L216
[ "def", "get_organisation", "(", "self", ",", "id", ",", "name", "=", "None", ")", ":", "return", "self", ".", "create_organisation", "(", "dict", "(", "id", "=", "id", ",", "name", "=", "name", ")", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.get_board
Get a board Returns: Board: The board with the given `id`
trolly/client.py
def get_board(self, id, name=None): ''' Get a board Returns: Board: The board with the given `id` ''' return self.create_board(dict(id=id, name=name))
def get_board(self, id, name=None): ''' Get a board Returns: Board: The board with the given `id` ''' return self.create_board(dict(id=id, name=name))
[ "Get", "a", "board" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L218-L225
[ "def", "get_board", "(", "self", ",", "id", ",", "name", "=", "None", ")", ":", "return", "self", ".", "create_board", "(", "dict", "(", "id", "=", "id", ",", "name", "=", "name", ")", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.get_list
Get a list Returns: List: The list with the given `id`
trolly/client.py
def get_list(self, id, name=None): ''' Get a list Returns: List: The list with the given `id` ''' return self.create_list(dict(id=id, name=name))
def get_list(self, id, name=None): ''' Get a list Returns: List: The list with the given `id` ''' return self.create_list(dict(id=id, name=name))
[ "Get", "a", "list" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L227-L234
[ "def", "get_list", "(", "self", ",", "id", ",", "name", "=", "None", ")", ":", "return", "self", ".", "create_list", "(", "dict", "(", "id", "=", "id", ",", "name", "=", "name", ")", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.get_card
Get a card Returns: Card: The card with the given `id`
trolly/client.py
def get_card(self, id, name=None): ''' Get a card Returns: Card: The card with the given `id` ''' return self.create_card(dict(id=id, name=name))
def get_card(self, id, name=None): ''' Get a card Returns: Card: The card with the given `id` ''' return self.create_card(dict(id=id, name=name))
[ "Get", "a", "card" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L236-L243
[ "def", "get_card", "(", "self", ",", "id", ",", "name", "=", "None", ")", ":", "return", "self", ".", "create_card", "(", "dict", "(", "id", "=", "id", ",", "name", "=", "name", ")", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.get_checklist
Get a checklist Returns: Checklist: The checklist with the given `id`
trolly/client.py
def get_checklist(self, id, name=None): ''' Get a checklist Returns: Checklist: The checklist with the given `id` ''' return self.create_checklist(dict(id=id, name=name))
def get_checklist(self, id, name=None): ''' Get a checklist Returns: Checklist: The checklist with the given `id` ''' return self.create_checklist(dict(id=id, name=name))
[ "Get", "a", "checklist" ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L245-L252
[ "def", "get_checklist", "(", "self", ",", "id", ",", "name", "=", "None", ")", ":", "return", "self", ".", "create_checklist", "(", "dict", "(", "id", "=", "id", ",", "name", "=", "name", ")", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
Client.get_member
Get a member or your current member if `id` wasn't given. Returns: Member: The member with the given `id`, defaults to the logged in member.
trolly/client.py
def get_member(self, id='me', name=None): ''' Get a member or your current member if `id` wasn't given. Returns: Member: The member with the given `id`, defaults to the logged in member. ''' return self.create_member(dict(id=id, fullName=name))
def get_member(self, id='me', name=None): ''' Get a member or your current member if `id` wasn't given. Returns: Member: The member with the given `id`, defaults to the logged in member. ''' return self.create_member(dict(id=id, fullName=name))
[ "Get", "a", "member", "or", "your", "current", "member", "if", "id", "wasn", "t", "given", "." ]
its-rigs/Trolly
python
https://github.com/its-rigs/Trolly/blob/483dc94c352df40dc05ead31820b059b2545cf82/trolly/client.py#L254-L262
[ "def", "get_member", "(", "self", ",", "id", "=", "'me'", ",", "name", "=", "None", ")", ":", "return", "self", ".", "create_member", "(", "dict", "(", "id", "=", "id", ",", "fullName", "=", "name", ")", ")" ]
483dc94c352df40dc05ead31820b059b2545cf82
test
domain_from_url
Get root domain from url. Will prune away query strings, url paths, protocol prefix and sub-domains Exceptions will be raised on invalid urls
similarweb/utils.py
def domain_from_url(url): """ Get root domain from url. Will prune away query strings, url paths, protocol prefix and sub-domains Exceptions will be raised on invalid urls """ ext = tldextract.extract(url) if not ext.suffix: raise InvalidURLException() new_url = ext.domain + "." ...
def domain_from_url(url): """ Get root domain from url. Will prune away query strings, url paths, protocol prefix and sub-domains Exceptions will be raised on invalid urls """ ext = tldextract.extract(url) if not ext.suffix: raise InvalidURLException() new_url = ext.domain + "." ...
[ "Get", "root", "domain", "from", "url", ".", "Will", "prune", "away", "query", "strings", "url", "paths", "protocol", "prefix", "and", "sub", "-", "domains", "Exceptions", "will", "be", "raised", "on", "invalid", "urls" ]
audiencepi/SimilarWeb-Python
python
https://github.com/audiencepi/SimilarWeb-Python/blob/4bf5e2315815cb622bd64714573f8df29339e615/similarweb/utils.py#L5-L15
[ "def", "domain_from_url", "(", "url", ")", ":", "ext", "=", "tldextract", ".", "extract", "(", "url", ")", "if", "not", "ext", ".", "suffix", ":", "raise", "InvalidURLException", "(", ")", "new_url", "=", "ext", ".", "domain", "+", "\".\"", "+", "ext",...
4bf5e2315815cb622bd64714573f8df29339e615
test
to_raw_text_markupless
A generator to convert raw text segments, without xml to a list of words without any markup. Additionally dates are replaced by `7777` for normalization. Arguments --------- text: str, input text to tokenize, strip of markup. keep_whitespace : bool, should the output retain the ...
ciseau/wiki_markup_processing.py
def to_raw_text_markupless(text, keep_whitespace=False, normalize_ascii=True): """ A generator to convert raw text segments, without xml to a list of words without any markup. Additionally dates are replaced by `7777` for normalization. Arguments --------- text: str, input text to token...
def to_raw_text_markupless(text, keep_whitespace=False, normalize_ascii=True): """ A generator to convert raw text segments, without xml to a list of words without any markup. Additionally dates are replaced by `7777` for normalization. Arguments --------- text: str, input text to token...
[ "A", "generator", "to", "convert", "raw", "text", "segments", "without", "xml", "to", "a", "list", "of", "words", "without", "any", "markup", ".", "Additionally", "dates", "are", "replaced", "by", "7777", "for", "normalization", "." ]
JonathanRaiman/ciseau
python
https://github.com/JonathanRaiman/ciseau/blob/f72d1c82d85eeb3d3ac9fac17690041725402175/ciseau/wiki_markup_processing.py#L118-L140
[ "def", "to_raw_text_markupless", "(", "text", ",", "keep_whitespace", "=", "False", ",", "normalize_ascii", "=", "True", ")", ":", "return", "sent_tokenize", "(", "remove_dates", "(", "_remove_urls", "(", "text", ")", ")", ",", "keep_whitespace", ",", "normalize...
f72d1c82d85eeb3d3ac9fac17690041725402175
test
to_raw_text
A generator to convert raw text segments, with xml, and other non-textual content to a list of words without any markup. Additionally dates are replaced by `7777` for normalization. Arguments --------- text: str, input text to tokenize, strip of markup. keep_whitespace : bool, should the ...
ciseau/wiki_markup_processing.py
def to_raw_text(text, keep_whitespace=False, normalize_ascii=True): """ A generator to convert raw text segments, with xml, and other non-textual content to a list of words without any markup. Additionally dates are replaced by `7777` for normalization. Arguments --------- text: str, inp...
def to_raw_text(text, keep_whitespace=False, normalize_ascii=True): """ A generator to convert raw text segments, with xml, and other non-textual content to a list of words without any markup. Additionally dates are replaced by `7777` for normalization. Arguments --------- text: str, inp...
[ "A", "generator", "to", "convert", "raw", "text", "segments", "with", "xml", "and", "other", "non", "-", "textual", "content", "to", "a", "list", "of", "words", "without", "any", "markup", ".", "Additionally", "dates", "are", "replaced", "by", "7777", "for...
JonathanRaiman/ciseau
python
https://github.com/JonathanRaiman/ciseau/blob/f72d1c82d85eeb3d3ac9fac17690041725402175/ciseau/wiki_markup_processing.py#L143-L175
[ "def", "to_raw_text", "(", "text", ",", "keep_whitespace", "=", "False", ",", "normalize_ascii", "=", "True", ")", ":", "out", "=", "text", "out", "=", "_remove_urls", "(", "text", ")", "out", "=", "_remove_mvar", "(", "out", ")", "out", "=", "_remove_sq...
f72d1c82d85eeb3d3ac9fac17690041725402175
test
to_raw_text_pairings
A generator to convert raw text segments, with xml, and other non-textual content to a list of words without any markup. Additionally dates are replaced by `7777` for normalization, along with wikipedia anchors kept. Arguments --------- text: str, input text to tokenize, strip of markup. ...
ciseau/wiki_markup_processing.py
def to_raw_text_pairings(text, keep_whitespace=False, normalize_ascii=True): """ A generator to convert raw text segments, with xml, and other non-textual content to a list of words without any markup. Additionally dates are replaced by `7777` for normalization, along with wikipedia anchors kept. ...
def to_raw_text_pairings(text, keep_whitespace=False, normalize_ascii=True): """ A generator to convert raw text segments, with xml, and other non-textual content to a list of words without any markup. Additionally dates are replaced by `7777` for normalization, along with wikipedia anchors kept. ...
[ "A", "generator", "to", "convert", "raw", "text", "segments", "with", "xml", "and", "other", "non", "-", "textual", "content", "to", "a", "list", "of", "words", "without", "any", "markup", ".", "Additionally", "dates", "are", "replaced", "by", "7777", "for...
JonathanRaiman/ciseau
python
https://github.com/JonathanRaiman/ciseau/blob/f72d1c82d85eeb3d3ac9fac17690041725402175/ciseau/wiki_markup_processing.py#L178-L207
[ "def", "to_raw_text_pairings", "(", "text", ",", "keep_whitespace", "=", "False", ",", "normalize_ascii", "=", "True", ")", ":", "out", "=", "text", "out", "=", "_remove_mvar", "(", "out", ")", "out", "=", "_remove_squiggly_bracket", "(", "out", ")", "out", ...
f72d1c82d85eeb3d3ac9fac17690041725402175
test
detect_sentence_boundaries
Subdivide an input list of strings (tokens) into multiple lists according to detected sentence boundaries. ``` detect_sentence_boundaries( ["Cat ", "sat ", "mat", ". ", "Cat ", "'s ", "named ", "Cool", "."] ) #=> [ ["Cat ", "sat ", "mat", ". "], ["Cat ", "'s ", "named ",...
ciseau/sentence_tokenizer.py
def detect_sentence_boundaries(tokens): """ Subdivide an input list of strings (tokens) into multiple lists according to detected sentence boundaries. ``` detect_sentence_boundaries( ["Cat ", "sat ", "mat", ". ", "Cat ", "'s ", "named ", "Cool", "."] ) #=> [ ["Cat ", "sa...
def detect_sentence_boundaries(tokens): """ Subdivide an input list of strings (tokens) into multiple lists according to detected sentence boundaries. ``` detect_sentence_boundaries( ["Cat ", "sat ", "mat", ". ", "Cat ", "'s ", "named ", "Cool", "."] ) #=> [ ["Cat ", "sa...
[ "Subdivide", "an", "input", "list", "of", "strings", "(", "tokens", ")", "into", "multiple", "lists", "according", "to", "detected", "sentence", "boundaries", "." ]
JonathanRaiman/ciseau
python
https://github.com/JonathanRaiman/ciseau/blob/f72d1c82d85eeb3d3ac9fac17690041725402175/ciseau/sentence_tokenizer.py#L15-L96
[ "def", "detect_sentence_boundaries", "(", "tokens", ")", ":", "tokenized", "=", "group_quoted_tokens", "(", "tokens", ")", "words", "=", "[", "]", "sentences", "=", "[", "]", "for", "i", "in", "range", "(", "len", "(", "tokenized", ")", ")", ":", "# this...
f72d1c82d85eeb3d3ac9fac17690041725402175
test
sent_tokenize
Perform sentence + word tokenization on the input text using regular expressions and english/french specific rules. Arguments: ---------- text : str, input string to tokenize keep_whitespace : bool, whether to strip out spaces and newlines. normalize_ascii : bool, pe...
ciseau/sentence_tokenizer.py
def sent_tokenize(text, keep_whitespace=False, normalize_ascii=True): """ Perform sentence + word tokenization on the input text using regular expressions and english/french specific rules. Arguments: ---------- text : str, input string to tokenize keep_whitespace : bool, whethe...
def sent_tokenize(text, keep_whitespace=False, normalize_ascii=True): """ Perform sentence + word tokenization on the input text using regular expressions and english/french specific rules. Arguments: ---------- text : str, input string to tokenize keep_whitespace : bool, whethe...
[ "Perform", "sentence", "+", "word", "tokenization", "on", "the", "input", "text", "using", "regular", "expressions", "and", "english", "/", "french", "specific", "rules", "." ]
JonathanRaiman/ciseau
python
https://github.com/JonathanRaiman/ciseau/blob/f72d1c82d85eeb3d3ac9fac17690041725402175/ciseau/sentence_tokenizer.py#L116-L144
[ "def", "sent_tokenize", "(", "text", ",", "keep_whitespace", "=", "False", ",", "normalize_ascii", "=", "True", ")", ":", "sentences", "=", "detect_sentence_boundaries", "(", "tokenize", "(", "text", ",", "normalize_ascii", ")", ")", "if", "not", "keep_whitespac...
f72d1c82d85eeb3d3ac9fac17690041725402175
test
verbatim_tags
Javascript templates (jquery, handlebars.js, mustache.js) use constructs like: :: {{if condition}} print something{{/if}} This, of course, completely screws up Django templates, because Django thinks {{ and }} means something. The following code preserves {{ }} tokens. This version of v...
templatetag_handlebars/templatetags/templatetag_handlebars.py
def verbatim_tags(parser, token, endtagname): """ Javascript templates (jquery, handlebars.js, mustache.js) use constructs like: :: {{if condition}} print something{{/if}} This, of course, completely screws up Django templates, because Django thinks {{ and }} means something. The fol...
def verbatim_tags(parser, token, endtagname): """ Javascript templates (jquery, handlebars.js, mustache.js) use constructs like: :: {{if condition}} print something{{/if}} This, of course, completely screws up Django templates, because Django thinks {{ and }} means something. The fol...
[ "Javascript", "templates", "(", "jquery", "handlebars", ".", "js", "mustache", ".", "js", ")", "use", "constructs", "like", ":" ]
makinacorpus/django-templatetag-handlebars
python
https://github.com/makinacorpus/django-templatetag-handlebars/blob/eed2d85dec8e9e36ad34137fb5fb97bf3e21396f/templatetag_handlebars/templatetags/templatetag_handlebars.py#L15-L64
[ "def", "verbatim_tags", "(", "parser", ",", "token", ",", "endtagname", ")", ":", "text_and_nodes", "=", "[", "]", "while", "1", ":", "token", "=", "parser", ".", "tokens", ".", "pop", "(", "0", ")", "if", "token", ".", "contents", "==", "endtagname", ...
eed2d85dec8e9e36ad34137fb5fb97bf3e21396f
test
Keyring.set_password
Write the password in the file.
keyrings/cryptfile/file_base.py
def set_password(self, service, username, password): """Write the password in the file. """ assoc = self._generate_assoc(service, username) # encrypt the password password_encrypted = self.encrypt(password.encode('utf-8'), assoc) # encode with base64 and add line break to...
def set_password(self, service, username, password): """Write the password in the file. """ assoc = self._generate_assoc(service, username) # encrypt the password password_encrypted = self.encrypt(password.encode('utf-8'), assoc) # encode with base64 and add line break to...
[ "Write", "the", "password", "in", "the", "file", "." ]
frispete/keyrings.cryptfile
python
https://github.com/frispete/keyrings.cryptfile/blob/cfa80d4848a5c3c0aeee41a954b2b120c80e69b2/keyrings/cryptfile/file_base.py#L124-L133
[ "def", "set_password", "(", "self", ",", "service", ",", "username", ",", "password", ")", ":", "assoc", "=", "self", ".", "_generate_assoc", "(", "service", ",", "username", ")", "# encrypt the password", "password_encrypted", "=", "self", ".", "encrypt", "("...
cfa80d4848a5c3c0aeee41a954b2b120c80e69b2
test
protect_shorthand
Annotate locations in a string that contain periods as being true periods or periods that are a part of shorthand (and thus should not be treated as punctuation marks). Arguments: ---------- text : str split_locations : list<int>, same length as text.
ciseau/word_tokenizer.py
def protect_shorthand(text, split_locations): """ Annotate locations in a string that contain periods as being true periods or periods that are a part of shorthand (and thus should not be treated as punctuation marks). Arguments: ---------- text : str split_locations : list<...
def protect_shorthand(text, split_locations): """ Annotate locations in a string that contain periods as being true periods or periods that are a part of shorthand (and thus should not be treated as punctuation marks). Arguments: ---------- text : str split_locations : list<...
[ "Annotate", "locations", "in", "a", "string", "that", "contain", "periods", "as", "being", "true", "periods", "or", "periods", "that", "are", "a", "part", "of", "shorthand", "(", "and", "thus", "should", "not", "be", "treated", "as", "punctuation", "marks", ...
JonathanRaiman/ciseau
python
https://github.com/JonathanRaiman/ciseau/blob/f72d1c82d85eeb3d3ac9fac17690041725402175/ciseau/word_tokenizer.py#L37-L109
[ "def", "protect_shorthand", "(", "text", ",", "split_locations", ")", ":", "word_matches", "=", "list", "(", "re", ".", "finditer", "(", "word_with_period", ",", "text", ")", ")", "total_words", "=", "len", "(", "word_matches", ")", "for", "i", ",", "match...
f72d1c82d85eeb3d3ac9fac17690041725402175
test
split_with_locations
Use an integer list to split the string contained in `text`. Arguments: ---------- text : str, same length as locations. locations : list<int>, contains values 'SHOULD_SPLIT', 'UNDECIDED', and 'SHOULD_NOT_SPLIT'. Will create strings between each 'SHOULD_S...
ciseau/word_tokenizer.py
def split_with_locations(text, locations): """ Use an integer list to split the string contained in `text`. Arguments: ---------- text : str, same length as locations. locations : list<int>, contains values 'SHOULD_SPLIT', 'UNDECIDED', and 'SHOULD_NOT_SPLIT'....
def split_with_locations(text, locations): """ Use an integer list to split the string contained in `text`. Arguments: ---------- text : str, same length as locations. locations : list<int>, contains values 'SHOULD_SPLIT', 'UNDECIDED', and 'SHOULD_NOT_SPLIT'....
[ "Use", "an", "integer", "list", "to", "split", "the", "string", "contained", "in", "text", "." ]
JonathanRaiman/ciseau
python
https://github.com/JonathanRaiman/ciseau/blob/f72d1c82d85eeb3d3ac9fac17690041725402175/ciseau/word_tokenizer.py#L112-L138
[ "def", "split_with_locations", "(", "text", ",", "locations", ")", ":", "start", "=", "0", "for", "pos", ",", "decision", "in", "enumerate", "(", "locations", ")", ":", "if", "decision", "==", "SHOULD_SPLIT", ":", "if", "start", "!=", "pos", ":", "yield"...
f72d1c82d85eeb3d3ac9fac17690041725402175
test
mark_regex
Regex that adds a 'SHOULD_SPLIT' marker at the end location of each matching group of the given regex. Arguments --------- regex : re.Expression text : str, same length as split_locations split_locations : list<int>, split decisions.
ciseau/word_tokenizer.py
def mark_regex(regex, text, split_locations): """ Regex that adds a 'SHOULD_SPLIT' marker at the end location of each matching group of the given regex. Arguments --------- regex : re.Expression text : str, same length as split_locations split_locations : list<int>, split de...
def mark_regex(regex, text, split_locations): """ Regex that adds a 'SHOULD_SPLIT' marker at the end location of each matching group of the given regex. Arguments --------- regex : re.Expression text : str, same length as split_locations split_locations : list<int>, split de...
[ "Regex", "that", "adds", "a", "SHOULD_SPLIT", "marker", "at", "the", "end", "location", "of", "each", "matching", "group", "of", "the", "given", "regex", "." ]
JonathanRaiman/ciseau
python
https://github.com/JonathanRaiman/ciseau/blob/f72d1c82d85eeb3d3ac9fac17690041725402175/ciseau/word_tokenizer.py#L141-L155
[ "def", "mark_regex", "(", "regex", ",", "text", ",", "split_locations", ")", ":", "for", "match", "in", "regex", ".", "finditer", "(", "text", ")", ":", "end_match", "=", "match", ".", "end", "(", ")", "if", "end_match", "<", "len", "(", "split_locatio...
f72d1c82d85eeb3d3ac9fac17690041725402175
test
mark_begin_end_regex
Regex that adds a 'SHOULD_SPLIT' marker at the end location of each matching group of the given regex, and adds a 'SHOULD_SPLIT' at the beginning of the matching group. Each character within the matching group will be marked as 'SHOULD_NOT_SPLIT'. Arguments --------- regex : re.Expressi...
ciseau/word_tokenizer.py
def mark_begin_end_regex(regex, text, split_locations): """ Regex that adds a 'SHOULD_SPLIT' marker at the end location of each matching group of the given regex, and adds a 'SHOULD_SPLIT' at the beginning of the matching group. Each character within the matching group will be marked as 'SHOULD_...
def mark_begin_end_regex(regex, text, split_locations): """ Regex that adds a 'SHOULD_SPLIT' marker at the end location of each matching group of the given regex, and adds a 'SHOULD_SPLIT' at the beginning of the matching group. Each character within the matching group will be marked as 'SHOULD_...
[ "Regex", "that", "adds", "a", "SHOULD_SPLIT", "marker", "at", "the", "end", "location", "of", "each", "matching", "group", "of", "the", "given", "regex", "and", "adds", "a", "SHOULD_SPLIT", "at", "the", "beginning", "of", "the", "matching", "group", ".", "...
JonathanRaiman/ciseau
python
https://github.com/JonathanRaiman/ciseau/blob/f72d1c82d85eeb3d3ac9fac17690041725402175/ciseau/word_tokenizer.py#L158-L182
[ "def", "mark_begin_end_regex", "(", "regex", ",", "text", ",", "split_locations", ")", ":", "for", "match", "in", "regex", ".", "finditer", "(", "text", ")", ":", "end_match", "=", "match", ".", "end", "(", ")", "begin_match", "=", "match", ".", "start",...
f72d1c82d85eeb3d3ac9fac17690041725402175