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
valid
Expression.parse
Parse Node args: scope (Scope): Scope object raises: SyntaxError returns: str
lesscpy/plib/expression.py
def parse(self, scope): """ Parse Node args: scope (Scope): Scope object raises: SyntaxError returns: str """ assert (len(self.tokens) == 3) expr = self.process(self.tokens, scope) A, O, B = [ e[0] if isinsta...
def parse(self, scope): """ Parse Node args: scope (Scope): Scope object raises: SyntaxError returns: str """ assert (len(self.tokens) == 3) expr = self.process(self.tokens, scope) A, O, B = [ e[0] if isinsta...
[ "Parse", "Node", "args", ":", "scope", "(", "Scope", ")", ":", "Scope", "object", "raises", ":", "SyntaxError", "returns", ":", "str" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/plib/expression.py#L24-L54
[ "def", "parse", "(", "self", ",", "scope", ")", ":", "assert", "(", "len", "(", "self", ".", "tokens", ")", "==", "3", ")", "expr", "=", "self", ".", "process", "(", "self", ".", "tokens", ",", "scope", ")", "A", ",", "O", ",", "B", "=", "[",...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
Expression.with_units
Return value with unit. args: val (mixed): result ua (str): 1st unit ub (str): 2nd unit raises: SyntaxError returns: str
lesscpy/plib/expression.py
def with_units(self, val, ua, ub): """Return value with unit. args: val (mixed): result ua (str): 1st unit ub (str): 2nd unit raises: SyntaxError returns: str """ if not val: return str(val) i...
def with_units(self, val, ua, ub): """Return value with unit. args: val (mixed): result ua (str): 1st unit ub (str): 2nd unit raises: SyntaxError returns: str """ if not val: return str(val) i...
[ "Return", "value", "with", "unit", ".", "args", ":", "val", "(", "mixed", ")", ":", "result", "ua", "(", "str", ")", ":", "1st", "unit", "ub", "(", "str", ")", ":", "2nd", "unit", "raises", ":", "SyntaxError", "returns", ":", "str" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/plib/expression.py#L56-L83
[ "def", "with_units", "(", "self", ",", "val", ",", "ua", ",", "ub", ")", ":", "if", "not", "val", ":", "return", "str", "(", "val", ")", "if", "ua", "or", "ub", ":", "if", "ua", "and", "ub", ":", "if", "ua", "==", "ub", ":", "return", "str", ...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
Expression.operate
Perform operation args: vala (mixed): 1st value valb (mixed): 2nd value oper (str): operation returns: mixed
lesscpy/plib/expression.py
def operate(self, vala, valb, oper): """Perform operation args: vala (mixed): 1st value valb (mixed): 2nd value oper (str): operation returns: mixed """ operation = { '+': operator.add, '-': operator.sub, ...
def operate(self, vala, valb, oper): """Perform operation args: vala (mixed): 1st value valb (mixed): 2nd value oper (str): operation returns: mixed """ operation = { '+': operator.add, '-': operator.sub, ...
[ "Perform", "operation", "args", ":", "vala", "(", "mixed", ")", ":", "1st", "value", "valb", "(", "mixed", ")", ":", "2nd", "value", "oper", "(", "str", ")", ":", "operation", "returns", ":", "mixed" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/plib/expression.py#L85-L110
[ "def", "operate", "(", "self", ",", "vala", ",", "valb", ",", "oper", ")", ":", "operation", "=", "{", "'+'", ":", "operator", ".", "add", ",", "'-'", ":", "operator", ".", "sub", ",", "'*'", ":", "operator", ".", "mul", ",", "'/'", ":", "operato...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.parse
Parse file. kwargs: filename (str): File to parse debuglevel (int): Parser debuglevel
lesscpy/lessc/parser.py
def parse(self, filename=None, file=None, debuglevel=0): """ Parse file. kwargs: filename (str): File to parse debuglevel (int): Parser debuglevel """ self.scope.push() if not file: # We use a path. file = filename else: ...
def parse(self, filename=None, file=None, debuglevel=0): """ Parse file. kwargs: filename (str): File to parse debuglevel (int): Parser debuglevel """ self.scope.push() if not file: # We use a path. file = filename else: ...
[ "Parse", "file", ".", "kwargs", ":", "filename", "(", "str", ")", ":", "File", "to", "parse", "debuglevel", "(", "int", ")", ":", "Parser", "debuglevel" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L128-L155
[ "def", "parse", "(", "self", ",", "filename", "=", "None", ",", "file", "=", "None", ",", "debuglevel", "=", "0", ")", ":", "self", ".", "scope", ".", "push", "(", ")", "if", "not", "file", ":", "# We use a path.", "file", "=", "filename", "else", ...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.post_parse
Post parse cycle. nodejs version allows calls to mixins not yet defined or known to the parser. We defer all calls to mixins until after first cycle when all names are known.
lesscpy/lessc/parser.py
def post_parse(self): """ Post parse cycle. nodejs version allows calls to mixins not yet defined or known to the parser. We defer all calls to mixins until after first cycle when all names are known. """ if self.result: out = [] for pu in self.result: ...
def post_parse(self): """ Post parse cycle. nodejs version allows calls to mixins not yet defined or known to the parser. We defer all calls to mixins until after first cycle when all names are known. """ if self.result: out = [] for pu in self.result: ...
[ "Post", "parse", "cycle", ".", "nodejs", "version", "allows", "calls", "to", "mixins", "not", "yet", "defined", "or", "known", "to", "the", "parser", ".", "We", "defer", "all", "calls", "to", "mixins", "until", "after", "first", "cycle", "when", "all", "...
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L157-L169
[ "def", "post_parse", "(", "self", ")", ":", "if", "self", ".", "result", ":", "out", "=", "[", "]", "for", "pu", "in", "self", ".", "result", ":", "try", ":", "out", ".", "append", "(", "pu", ".", "parse", "(", "self", ".", "scope", ")", ")", ...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_unit_list
unit_list : unit_list unit | unit
lesscpy/lessc/parser.py
def p_unit_list(self, p): """ unit_list : unit_list unit | unit """ if isinstance(p[1], list): if len(p) >= 3: if isinstance(p[2], list): p[1].extend(p[2]) else: ...
def p_unit_list(self, p): """ unit_list : unit_list unit | unit """ if isinstance(p[1], list): if len(p) >= 3: if isinstance(p[2], list): p[1].extend(p[2]) else: ...
[ "unit_list", ":", "unit_list", "unit", "|", "unit" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L185-L197
[ "def", "p_unit_list", "(", "self", ",", "p", ")", ":", "if", "isinstance", "(", "p", "[", "1", "]", ",", "list", ")", ":", "if", "len", "(", "p", ")", ">=", "3", ":", "if", "isinstance", "(", "p", "[", "2", "]", ",", "list", ")", ":", "p", ...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_statement_aux
statement : css_charset t_ws css_string t_semicolon | css_namespace t_ws css_string t_semicolon
lesscpy/lessc/parser.py
def p_statement_aux(self, p): """ statement : css_charset t_ws css_string t_semicolon | css_namespace t_ws css_string t_semicolon """ p[0] = Statement(list(p)[1:], p.lineno(1)) p[0].parse(None)
def p_statement_aux(self, p): """ statement : css_charset t_ws css_string t_semicolon | css_namespace t_ws css_string t_semicolon """ p[0] = Statement(list(p)[1:], p.lineno(1)) p[0].parse(None)
[ "statement", ":", "css_charset", "t_ws", "css_string", "t_semicolon", "|", "css_namespace", "t_ws", "css_string", "t_semicolon" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L213-L218
[ "def", "p_statement_aux", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "Statement", "(", "list", "(", "p", ")", "[", "1", ":", "]", ",", "p", ".", "lineno", "(", "1", ")", ")", "p", "[", "0", "]", ".", "parse", "(", "None", "...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_statement_namespace
statement : css_namespace t_ws word css_string t_semicolon
lesscpy/lessc/parser.py
def p_statement_namespace(self, p): """ statement : css_namespace t_ws word css_string t_semicolon """ p[0] = Statement(list(p)[1:], p.lineno(1)) p[0].parse(None)
def p_statement_namespace(self, p): """ statement : css_namespace t_ws word css_string t_semicolon """ p[0] = Statement(list(p)[1:], p.lineno(1)) p[0].parse(None)
[ "statement", ":", "css_namespace", "t_ws", "word", "css_string", "t_semicolon" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L220-L224
[ "def", "p_statement_namespace", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "Statement", "(", "list", "(", "p", ")", "[", "1", ":", "]", ",", "p", ".", "lineno", "(", "1", ")", ")", "p", "[", "0", "]", ".", "parse", "(", "None...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_statement_import
import_statement : css_import t_ws string t_semicolon | css_import t_ws css_string t_semicolon | css_import t_ws css_string media_query_list t_semicolon | css_import t_ws fcall t_semicolon ...
lesscpy/lessc/parser.py
def p_statement_import(self, p): """ import_statement : css_import t_ws string t_semicolon | css_import t_ws css_string t_semicolon | css_import t_ws css_string media_query_list t_semicolon | css_import t_ws f...
def p_statement_import(self, p): """ import_statement : css_import t_ws string t_semicolon | css_import t_ws css_string t_semicolon | css_import t_ws css_string media_query_list t_semicolon | css_import t_ws f...
[ "import_statement", ":", "css_import", "t_ws", "string", "t_semicolon", "|", "css_import", "t_ws", "css_string", "t_semicolon", "|", "css_import", "t_ws", "css_string", "media_query_list", "t_semicolon", "|", "css_import", "t_ws", "fcall", "t_semicolon", "|", "css_impor...
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L226-L271
[ "def", "p_statement_import", "(", "self", ",", "p", ")", ":", "#import pdb; pdb.set_trace()", "if", "self", ".", "importlvl", ">", "8", ":", "raise", "ImportError", "(", "'Recrusive import level too deep > 8 (circular import ?)'", ")", "if", "isinstance", "(", "p", ...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_block
block_decl : block_open declaration_list brace_close
lesscpy/lessc/parser.py
def p_block(self, p): """ block_decl : block_open declaration_list brace_close """ p[0] = Block(list(p)[1:-1], p.lineno(3)) self.scope.pop() self.scope.add_block(p[0])
def p_block(self, p): """ block_decl : block_open declaration_list brace_close """ p[0] = Block(list(p)[1:-1], p.lineno(3)) self.scope.pop() self.scope.add_block(p[0])
[ "block_decl", ":", "block_open", "declaration_list", "brace_close" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L277-L282
[ "def", "p_block", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "Block", "(", "list", "(", "p", ")", "[", "1", ":", "-", "1", "]", ",", "p", ".", "lineno", "(", "3", ")", ")", "self", ".", "scope", ".", "pop", "(", ")", "sel...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_block_replace
block_decl : identifier t_semicolon
lesscpy/lessc/parser.py
def p_block_replace(self, p): """ block_decl : identifier t_semicolon """ m = p[1].parse(None) block = self.scope.blocks(m.raw()) if block: p[0] = block.copy_inner(self.scope) else: # fallback to mixin. Allow calls to mixins without p...
def p_block_replace(self, p): """ block_decl : identifier t_semicolon """ m = p[1].parse(None) block = self.scope.blocks(m.raw()) if block: p[0] = block.copy_inner(self.scope) else: # fallback to mixin. Allow calls to mixins without p...
[ "block_decl", ":", "identifier", "t_semicolon" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L284-L293
[ "def", "p_block_replace", "(", "self", ",", "p", ")", ":", "m", "=", "p", "[", "1", "]", ".", "parse", "(", "None", ")", "block", "=", "self", ".", "scope", ".", "blocks", "(", "m", ".", "raw", "(", ")", ")", "if", "block", ":", "p", "[", "...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_block_open
block_open : identifier brace_open
lesscpy/lessc/parser.py
def p_block_open(self, p): """ block_open : identifier brace_open """ try: p[1].parse(self.scope) except SyntaxError: pass p[0] = p[1] self.scope.current = p[1]
def p_block_open(self, p): """ block_open : identifier brace_open """ try: p[1].parse(self.scope) except SyntaxError: pass p[0] = p[1] self.scope.current = p[1]
[ "block_open", ":", "identifier", "brace_open" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L295-L303
[ "def", "p_block_open", "(", "self", ",", "p", ")", ":", "try", ":", "p", "[", "1", "]", ".", "parse", "(", "self", ".", "scope", ")", "except", "SyntaxError", ":", "pass", "p", "[", "0", "]", "=", "p", "[", "1", "]", "self", ".", "scope", "."...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_font_face_open
block_open : css_font_face t_ws brace_open
lesscpy/lessc/parser.py
def p_font_face_open(self, p): """ block_open : css_font_face t_ws brace_open """ p[0] = Identifier([p[1], p[2]]).parse(self.scope)
def p_font_face_open(self, p): """ block_open : css_font_face t_ws brace_open """ p[0] = Identifier([p[1], p[2]]).parse(self.scope)
[ "block_open", ":", "css_font_face", "t_ws", "brace_open" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L310-L313
[ "def", "p_font_face_open", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "Identifier", "(", "[", "p", "[", "1", "]", ",", "p", "[", "2", "]", "]", ")", ".", "parse", "(", "self", ".", "scope", ")" ]
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_mixin
mixin_decl : open_mixin declaration_list brace_close
lesscpy/lessc/parser.py
def p_mixin(self, p): """ mixin_decl : open_mixin declaration_list brace_close """ self.scope.add_mixin(Mixin(list(p)[1:], p.lineno(3)).parse(self.scope)) self.scope.pop() p[0] = None
def p_mixin(self, p): """ mixin_decl : open_mixin declaration_list brace_close """ self.scope.add_mixin(Mixin(list(p)[1:], p.lineno(3)).parse(self.scope)) self.scope.pop() p[0] = None
[ "mixin_decl", ":", "open_mixin", "declaration_list", "brace_close" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L325-L330
[ "def", "p_mixin", "(", "self", ",", "p", ")", ":", "self", ".", "scope", ".", "add_mixin", "(", "Mixin", "(", "list", "(", "p", ")", "[", "1", ":", "]", ",", "p", ".", "lineno", "(", "3", ")", ")", ".", "parse", "(", "self", ".", "scope", "...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_open_mixin
open_mixin : identifier t_popen mixin_args_list t_pclose brace_open | identifier t_popen mixin_args_list t_pclose mixin_guard brace_open
lesscpy/lessc/parser.py
def p_open_mixin(self, p): """ open_mixin : identifier t_popen mixin_args_list t_pclose brace_open | identifier t_popen mixin_args_list t_pclose mixin_guard brace_open """ p[1].parse(self.scope) self.scope.current = p[1] p[0] =...
def p_open_mixin(self, p): """ open_mixin : identifier t_popen mixin_args_list t_pclose brace_open | identifier t_popen mixin_args_list t_pclose mixin_guard brace_open """ p[1].parse(self.scope) self.scope.current = p[1] p[0] =...
[ "open_mixin", ":", "identifier", "t_popen", "mixin_args_list", "t_pclose", "brace_open", "|", "identifier", "t_popen", "mixin_args_list", "t_pclose", "mixin_guard", "brace_open" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L332-L342
[ "def", "p_open_mixin", "(", "self", ",", "p", ")", ":", "p", "[", "1", "]", ".", "parse", "(", "self", ".", "scope", ")", "self", ".", "scope", ".", "current", "=", "p", "[", "1", "]", "p", "[", "0", "]", "=", "[", "p", "[", "1", "]", ","...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_mixin_guard_cond_list_aux
mixin_guard_cond_list : mixin_guard_cond_list t_comma mixin_guard_cond | mixin_guard_cond_list less_and mixin_guard_cond
lesscpy/lessc/parser.py
def p_mixin_guard_cond_list_aux(self, p): """ mixin_guard_cond_list : mixin_guard_cond_list t_comma mixin_guard_cond | mixin_guard_cond_list less_and mixin_guard_cond """ p[1].append(p[2]) p[1].append(p[3]) p[0] = p[1]
def p_mixin_guard_cond_list_aux(self, p): """ mixin_guard_cond_list : mixin_guard_cond_list t_comma mixin_guard_cond | mixin_guard_cond_list less_and mixin_guard_cond """ p[1].append(p[2]) p[1].append(p[3]) p[0] = p[1]
[ "mixin_guard_cond_list", ":", "mixin_guard_cond_list", "t_comma", "mixin_guard_cond", "|", "mixin_guard_cond_list", "less_and", "mixin_guard_cond" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L349-L355
[ "def", "p_mixin_guard_cond_list_aux", "(", "self", ",", "p", ")", ":", "p", "[", "1", "]", ".", "append", "(", "p", "[", "2", "]", ")", "p", "[", "1", "]", ".", "append", "(", "p", "[", "3", "]", ")", "p", "[", "0", "]", "=", "p", "[", "1...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_call_mixin
call_mixin : identifier t_popen mixin_args_list t_pclose t_semicolon
lesscpy/lessc/parser.py
def p_call_mixin(self, p): """ call_mixin : identifier t_popen mixin_args_list t_pclose t_semicolon """ p[1].parse(None) p[0] = Deferred(p[1], p[3], p.lineno(4))
def p_call_mixin(self, p): """ call_mixin : identifier t_popen mixin_args_list t_pclose t_semicolon """ p[1].parse(None) p[0] = Deferred(p[1], p[3], p.lineno(4))
[ "call_mixin", ":", "identifier", "t_popen", "mixin_args_list", "t_pclose", "t_semicolon" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L383-L387
[ "def", "p_call_mixin", "(", "self", ",", "p", ")", ":", "p", "[", "1", "]", ".", "parse", "(", "None", ")", "p", "[", "0", "]", "=", "Deferred", "(", "p", "[", "1", "]", ",", "p", "[", "3", "]", ",", "p", ".", "lineno", "(", "4", ")", "...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_declaration_list
declaration_list : declaration_list declaration | declaration | empty
lesscpy/lessc/parser.py
def p_declaration_list(self, p): """ declaration_list : declaration_list declaration | declaration | empty """ if len(p) > 2: p[1].extend(p[2]) p[0] = p[1]
def p_declaration_list(self, p): """ declaration_list : declaration_list declaration | declaration | empty """ if len(p) > 2: p[1].extend(p[2]) p[0] = p[1]
[ "declaration_list", ":", "declaration_list", "declaration", "|", "declaration", "|", "empty" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L443-L450
[ "def", "p_declaration_list", "(", "self", ",", "p", ")", ":", "if", "len", "(", "p", ")", ">", "2", ":", "p", "[", "1", "]", ".", "extend", "(", "p", "[", "2", "]", ")", "p", "[", "0", "]", "=", "p", "[", "1", "]" ]
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_variable_decl
variable_decl : variable t_colon style_list t_semicolon
lesscpy/lessc/parser.py
def p_variable_decl(self, p): """ variable_decl : variable t_colon style_list t_semicolon """ p[0] = Variable(list(p)[1:-1], p.lineno(4)) p[0].parse(self.scope)
def p_variable_decl(self, p): """ variable_decl : variable t_colon style_list t_semicolon """ p[0] = Variable(list(p)[1:-1], p.lineno(4)) p[0].parse(self.scope)
[ "variable_decl", ":", "variable", "t_colon", "style_list", "t_semicolon" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L466-L470
[ "def", "p_variable_decl", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "Variable", "(", "list", "(", "p", ")", "[", "1", ":", "-", "1", "]", ",", "p", ".", "lineno", "(", "4", ")", ")", "p", "[", "0", "]", ".", "parse", "(", ...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_property_decl
property_decl : prop_open style_list t_semicolon | prop_open style_list css_important t_semicolon | prop_open empty t_semicolon
lesscpy/lessc/parser.py
def p_property_decl(self, p): """ property_decl : prop_open style_list t_semicolon | prop_open style_list css_important t_semicolon | prop_open empty t_semicolon """ l = len(p) p[0] = Property(list(p)[1:-1]...
def p_property_decl(self, p): """ property_decl : prop_open style_list t_semicolon | prop_open style_list css_important t_semicolon | prop_open empty t_semicolon """ l = len(p) p[0] = Property(list(p)[1:-1]...
[ "property_decl", ":", "prop_open", "style_list", "t_semicolon", "|", "prop_open", "style_list", "css_important", "t_semicolon", "|", "prop_open", "empty", "t_semicolon" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L476-L482
[ "def", "p_property_decl", "(", "self", ",", "p", ")", ":", "l", "=", "len", "(", "p", ")", "p", "[", "0", "]", "=", "Property", "(", "list", "(", "p", ")", "[", "1", ":", "-", "1", "]", ",", "p", ".", "lineno", "(", "l", "-", "1", ")", ...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_identifier_list_aux
identifier_list : identifier_list t_comma identifier_group
lesscpy/lessc/parser.py
def p_identifier_list_aux(self, p): """ identifier_list : identifier_list t_comma identifier_group """ p[1].extend([p[2]]) p[1].extend(p[3]) p[0] = p[1]
def p_identifier_list_aux(self, p): """ identifier_list : identifier_list t_comma identifier_group """ p[1].extend([p[2]]) p[1].extend(p[3]) p[0] = p[1]
[ "identifier_list", ":", "identifier_list", "t_comma", "identifier_group" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L544-L549
[ "def", "p_identifier_list_aux", "(", "self", ",", "p", ")", ":", "p", "[", "1", "]", ".", "extend", "(", "[", "p", "[", "2", "]", "]", ")", "p", "[", "1", "]", ".", "extend", "(", "p", "[", "3", "]", ")", "p", "[", "0", "]", "=", "p", "...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_identifier_group_op
identifier_group : identifier_group child_selector ident_parts | identifier_group '+' ident_parts | identifier_group general_sibling_selector ident_parts | identifier_group '*'
lesscpy/lessc/parser.py
def p_identifier_group_op(self, p): """ identifier_group : identifier_group child_selector ident_parts | identifier_group '+' ident_parts | identifier_group general_sibling_selector ident_parts ...
def p_identifier_group_op(self, p): """ identifier_group : identifier_group child_selector ident_parts | identifier_group '+' ident_parts | identifier_group general_sibling_selector ident_parts ...
[ "identifier_group", ":", "identifier_group", "child_selector", "ident_parts", "|", "identifier_group", "+", "ident_parts", "|", "identifier_group", "general_sibling_selector", "ident_parts", "|", "identifier_group", "*" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L568-L577
[ "def", "p_identifier_group_op", "(", "self", ",", "p", ")", ":", "p", "[", "1", "]", ".", "extend", "(", "[", "p", "[", "2", "]", "]", ")", "if", "len", "(", "p", ")", ">", "3", ":", "p", "[", "1", "]", ".", "extend", "(", "p", "[", "3", ...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_ident_parts_aux
ident_parts : ident_parts ident_part | ident_parts filter_group
lesscpy/lessc/parser.py
def p_ident_parts_aux(self, p): """ ident_parts : ident_parts ident_part | ident_parts filter_group """ if isinstance(p[2], list): p[1].extend(p[2]) else: p[1].append(p[2]) p[0] = p[1]
def p_ident_parts_aux(self, p): """ ident_parts : ident_parts ident_part | ident_parts filter_group """ if isinstance(p[2], list): p[1].extend(p[2]) else: p[1].append(p[2]) p[0] = p[1]
[ "ident_parts", ":", "ident_parts", "ident_part", "|", "ident_parts", "filter_group" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L584-L592
[ "def", "p_ident_parts_aux", "(", "self", ",", "p", ")", ":", "if", "isinstance", "(", "p", "[", "2", "]", ",", "list", ")", ":", "p", "[", "1", "]", ".", "extend", "(", "p", "[", "2", "]", ")", "else", ":", "p", "[", "1", "]", ".", "append"...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_ident_parts
ident_parts : ident_part | selector | filter_group
lesscpy/lessc/parser.py
def p_ident_parts(self, p): """ ident_parts : ident_part | selector | filter_group """ if not isinstance(p[1], list): p[1] = [p[1]] p[0] = p[1]
def p_ident_parts(self, p): """ ident_parts : ident_part | selector | filter_group """ if not isinstance(p[1], list): p[1] = [p[1]] p[0] = p[1]
[ "ident_parts", ":", "ident_part", "|", "selector", "|", "filter_group" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L594-L601
[ "def", "p_ident_parts", "(", "self", ",", "p", ")", ":", "if", "not", "isinstance", "(", "p", "[", "1", "]", ",", "list", ")", ":", "p", "[", "1", "]", "=", "[", "p", "[", "1", "]", "]", "p", "[", "0", "]", "=", "p", "[", "1", "]" ]
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_media_query_value
media_query_value : number | variable | word | color | expression
lesscpy/lessc/parser.py
def p_media_query_value(self, p): """ media_query_value : number | variable | word | color | expression """ if utility.is_vari...
def p_media_query_value(self, p): """ media_query_value : number | variable | word | color | expression """ if utility.is_vari...
[ "media_query_value", ":", "number", "|", "variable", "|", "word", "|", "color", "|", "expression" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L651-L669
[ "def", "p_media_query_value", "(", "self", ",", "p", ")", ":", "if", "utility", ".", "is_variable", "(", "p", "[", "1", "]", ")", ":", "var", "=", "self", ".", "scope", ".", "variables", "(", "''", ".", "join", "(", "p", "[", "1", "]", ")", ")"...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_color
color : css_color | css_color t_ws
lesscpy/lessc/parser.py
def p_color(self, p): """ color : css_color | css_color t_ws """ try: p[0] = Color().fmt(p[1]) if len(p) > 2: p[0] = [p[0], p[2]] except ValueError: self.handle_error('Illegal color ...
def p_color(self, p): """ color : css_color | css_color t_ws """ try: p[0] = Color().fmt(p[1]) if len(p) > 2: p[0] = [p[0], p[2]] except ValueError: self.handle_error('Illegal color ...
[ "color", ":", "css_color", "|", "css_color", "t_ws" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L878-L889
[ "def", "p_color", "(", "self", ",", "p", ")", ":", "try", ":", "p", "[", "0", "]", "=", "Color", "(", ")", ".", "fmt", "(", "p", "[", "1", "]", ")", "if", "len", "(", "p", ")", ">", "2", ":", "p", "[", "0", "]", "=", "[", "p", "[", ...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.p_error
Internal error handler args: t (Lex token): Error token
lesscpy/lessc/parser.py
def p_error(self, t): """ Internal error handler args: t (Lex token): Error token """ if t: error_msg = "E: %s line: %d, Syntax Error, token: `%s`, `%s`" % \ (self.target, t.lineno, t.type, t.value) self.register.register(error_ms...
def p_error(self, t): """ Internal error handler args: t (Lex token): Error token """ if t: error_msg = "E: %s line: %d, Syntax Error, token: `%s`, `%s`" % \ (self.target, t.lineno, t.type, t.value) self.register.register(error_ms...
[ "Internal", "error", "handler", "args", ":", "t", "(", "Lex", "token", ")", ":", "Error", "token" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L1032-L1048
[ "def", "p_error", "(", "self", ",", "t", ")", ":", "if", "t", ":", "error_msg", "=", "\"E: %s line: %d, Syntax Error, token: `%s`, `%s`\"", "%", "(", "self", ".", "target", ",", "t", ".", "lineno", ",", "t", ".", "type", ",", "t", ".", "value", ")", "s...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
LessParser.handle_error
Custom error handler args: e (Mixed): Exception or str line (int): line number t(str): Error type
lesscpy/lessc/parser.py
def handle_error(self, e, line, t='E'): """ Custom error handler args: e (Mixed): Exception or str line (int): line number t(str): Error type """ self.register.register("%s: line: %d: %s\n" % (t, line, e))
def handle_error(self, e, line, t='E'): """ Custom error handler args: e (Mixed): Exception or str line (int): line number t(str): Error type """ self.register.register("%s: line: %d: %s\n" % (t, line, e))
[ "Custom", "error", "handler", "args", ":", "e", "(", "Mixed", ")", ":", "Exception", "or", "str", "line", "(", "int", ")", ":", "line", "number", "t", "(", "str", ")", ":", "Error", "type" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/parser.py#L1050-L1057
[ "def", "handle_error", "(", "self", ",", "e", ",", "line", ",", "t", "=", "'E'", ")", ":", "self", ".", "register", ".", "register", "(", "\"%s: line: %d: %s\\n\"", "%", "(", "t", ",", "line", ",", "e", ")", ")" ]
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
Import.parse
Parse node args: scope (Scope): current scope raises: SyntaxError returns: parsed
lesscpy/plib/import_.py
def parse(self, scope): """Parse node args: scope (Scope): current scope raises: SyntaxError returns: parsed """ if not self.parsed: self.parsed = ''.join(self.process(self.tokens, scope)) return self.parsed
def parse(self, scope): """Parse node args: scope (Scope): current scope raises: SyntaxError returns: parsed """ if not self.parsed: self.parsed = ''.join(self.process(self.tokens, scope)) return self.parsed
[ "Parse", "node", "args", ":", "scope", "(", "Scope", ")", ":", "current", "scope", "raises", ":", "SyntaxError", "returns", ":", "parsed" ]
lesscpy/lesscpy
python
https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/plib/import_.py#L17-L28
[ "def", "parse", "(", "self", ",", "scope", ")", ":", "if", "not", "self", ".", "parsed", ":", "self", ".", "parsed", "=", "''", ".", "join", "(", "self", ".", "process", "(", "self", ".", "tokens", ",", "scope", ")", ")", "return", "self", ".", ...
51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126
valid
NextPage
Checks if a GitHub call returned multiple pages of data. :param gh: GitHub() instance :rtype: int :return: number of next page or 0 if no next page
pygcgen/fetcher.py
def NextPage(gh): """ Checks if a GitHub call returned multiple pages of data. :param gh: GitHub() instance :rtype: int :return: number of next page or 0 if no next page """ header = dict(gh.getheaders()) if 'Link' in header: parts = header['Link'].split(',') for part in...
def NextPage(gh): """ Checks if a GitHub call returned multiple pages of data. :param gh: GitHub() instance :rtype: int :return: number of next page or 0 if no next page """ header = dict(gh.getheaders()) if 'Link' in header: parts = header['Link'].split(',') for part in...
[ "Checks", "if", "a", "GitHub", "call", "returned", "multiple", "pages", "of", "data", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/fetcher.py#L337-L360
[ "def", "NextPage", "(", "gh", ")", ":", "header", "=", "dict", "(", "gh", ".", "getheaders", "(", ")", ")", "if", "'Link'", "in", "header", ":", "parts", "=", "header", "[", "'Link'", "]", ".", "split", "(", "','", ")", "for", "part", "in", "part...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Fetcher.fetch_github_token
Fetch GitHub token. First try to use variable provided by --token option, otherwise try to fetch it from git config and last CHANGELOG_GITHUB_TOKEN env variable. :returns: Nothing
pygcgen/fetcher.py
def fetch_github_token(self): """ Fetch GitHub token. First try to use variable provided by --token option, otherwise try to fetch it from git config and last CHANGELOG_GITHUB_TOKEN env variable. :returns: Nothing """ if not self.options.token: try: ...
def fetch_github_token(self): """ Fetch GitHub token. First try to use variable provided by --token option, otherwise try to fetch it from git config and last CHANGELOG_GITHUB_TOKEN env variable. :returns: Nothing """ if not self.options.token: try: ...
[ "Fetch", "GitHub", "token", ".", "First", "try", "to", "use", "variable", "provided", "by", "--", "token", "option", "otherwise", "try", "to", "fetch", "it", "from", "git", "config", "and", "last", "CHANGELOG_GITHUB_TOKEN", "env", "variable", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/fetcher.py#L56-L78
[ "def", "fetch_github_token", "(", "self", ")", ":", "if", "not", "self", ".", "options", ".", "token", ":", "try", ":", "for", "v", "in", "GH_CFG_VARS", ":", "cmd", "=", "[", "'git'", ",", "'config'", ",", "'--get'", ",", "'{0}'", ".", "format", "(",...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Fetcher.get_all_tags
Fetch all tags for repository from Github. :return: tags in repository :rtype: list
pygcgen/fetcher.py
def get_all_tags(self): """ Fetch all tags for repository from Github. :return: tags in repository :rtype: list """ verbose = self.options.verbose gh = self.github user = self.options.user repo = self.options.project if verbose: ...
def get_all_tags(self): """ Fetch all tags for repository from Github. :return: tags in repository :rtype: list """ verbose = self.options.verbose gh = self.github user = self.options.user repo = self.options.project if verbose: ...
[ "Fetch", "all", "tags", "for", "repository", "from", "Github", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/fetcher.py#L80-L117
[ "def", "get_all_tags", "(", "self", ")", ":", "verbose", "=", "self", ".", "options", ".", "verbose", "gh", "=", "self", ".", "github", "user", "=", "self", ".", "options", ".", "user", "repo", "=", "self", ".", "options", ".", "project", "if", "verb...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Fetcher.fetch_closed_issues_and_pr
This method fetches all closed issues and separate them to pull requests and pure issues (pull request is kind of issue in term of GitHub). :rtype: list, list :return: issues, pull-requests
pygcgen/fetcher.py
def fetch_closed_issues_and_pr(self): """ This method fetches all closed issues and separate them to pull requests and pure issues (pull request is kind of issue in term of GitHub). :rtype: list, list :return: issues, pull-requests """ verbose = self.opt...
def fetch_closed_issues_and_pr(self): """ This method fetches all closed issues and separate them to pull requests and pure issues (pull request is kind of issue in term of GitHub). :rtype: list, list :return: issues, pull-requests """ verbose = self.opt...
[ "This", "method", "fetches", "all", "closed", "issues", "and", "separate", "them", "to", "pull", "requests", "and", "pure", "issues", "(", "pull", "request", "is", "kind", "of", "issue", "in", "term", "of", "GitHub", ")", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/fetcher.py#L119-L170
[ "def", "fetch_closed_issues_and_pr", "(", "self", ")", ":", "verbose", "=", "self", ".", "options", ".", "verbose", "gh", "=", "self", ".", "github", "user", "=", "self", ".", "options", ".", "user", "repo", "=", "self", ".", "options", ".", "project", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Fetcher.fetch_closed_pull_requests
Fetch all pull requests. We need them to detect "merged_at" parameter :rtype: list :return: all pull requests
pygcgen/fetcher.py
def fetch_closed_pull_requests(self): """ Fetch all pull requests. We need them to detect "merged_at" parameter :rtype: list :return: all pull requests """ pull_requests = [] verbose = self.options.verbose gh = self.github user = self.options.use...
def fetch_closed_pull_requests(self): """ Fetch all pull requests. We need them to detect "merged_at" parameter :rtype: list :return: all pull requests """ pull_requests = [] verbose = self.options.verbose gh = self.github user = self.options.use...
[ "Fetch", "all", "pull", "requests", ".", "We", "need", "them", "to", "detect", "merged_at", "parameter" ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/fetcher.py#L172-L213
[ "def", "fetch_closed_pull_requests", "(", "self", ")", ":", "pull_requests", "=", "[", "]", "verbose", "=", "self", ".", "options", ".", "verbose", "gh", "=", "self", ".", "github", "user", "=", "self", ".", "options", ".", "user", "repo", "=", "self", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Fetcher.fetch_repo_creation_date
Get the creation date of the repository from GitHub. :rtype: str, str :return: special tag name, creation date as ISO date string
pygcgen/fetcher.py
def fetch_repo_creation_date(self): """ Get the creation date of the repository from GitHub. :rtype: str, str :return: special tag name, creation date as ISO date string """ gh = self.github user = self.options.user repo = self.options.project rc,...
def fetch_repo_creation_date(self): """ Get the creation date of the repository from GitHub. :rtype: str, str :return: special tag name, creation date as ISO date string """ gh = self.github user = self.options.user repo = self.options.project rc,...
[ "Get", "the", "creation", "date", "of", "the", "repository", "from", "GitHub", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/fetcher.py#L215-L230
[ "def", "fetch_repo_creation_date", "(", "self", ")", ":", "gh", "=", "self", ".", "github", "user", "=", "self", ".", "options", ".", "user", "repo", "=", "self", ".", "options", ".", "project", "rc", ",", "data", "=", "gh", ".", "repos", "[", "user"...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Fetcher.fetch_events_async
Fetch events for all issues and add them to self.events :param list issues: all issues :param str tag_name: name of the tag to fetch events for :returns: Nothing
pygcgen/fetcher.py
def fetch_events_async(self, issues, tag_name): """ Fetch events for all issues and add them to self.events :param list issues: all issues :param str tag_name: name of the tag to fetch events for :returns: Nothing """ if not issues: return issues ...
def fetch_events_async(self, issues, tag_name): """ Fetch events for all issues and add them to self.events :param list issues: all issues :param str tag_name: name of the tag to fetch events for :returns: Nothing """ if not issues: return issues ...
[ "Fetch", "events", "for", "all", "issues", "and", "add", "them", "to", "self", ".", "events" ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/fetcher.py#L232-L286
[ "def", "fetch_events_async", "(", "self", ",", "issues", ",", "tag_name", ")", ":", "if", "not", "issues", ":", "return", "issues", "max_simultaneous_requests", "=", "self", ".", "options", ".", "max_simultaneous_requests", "verbose", "=", "self", ".", "options"...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Fetcher.fetch_date_of_tag
Fetch time for tag from repository. :param dict tag: dictionary with tag information :rtype: str :return: time of specified tag as ISO date string
pygcgen/fetcher.py
def fetch_date_of_tag(self, tag): """ Fetch time for tag from repository. :param dict tag: dictionary with tag information :rtype: str :return: time of specified tag as ISO date string """ if self.options.verbose > 1: print("\tFetching date for tag {...
def fetch_date_of_tag(self, tag): """ Fetch time for tag from repository. :param dict tag: dictionary with tag information :rtype: str :return: time of specified tag as ISO date string """ if self.options.verbose > 1: print("\tFetching date for tag {...
[ "Fetch", "time", "for", "tag", "from", "repository", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/fetcher.py#L288-L307
[ "def", "fetch_date_of_tag", "(", "self", ",", "tag", ")", ":", "if", "self", ".", "options", ".", "verbose", ">", "1", ":", "print", "(", "\"\\tFetching date for tag {}\"", ".", "format", "(", "tag", "[", "\"name\"", "]", ")", ")", "gh", "=", "self", "...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Fetcher.fetch_commit
Fetch commit data for specified event. :param dict event: dictionary with event information :rtype: dict :return: dictionary with commit data
pygcgen/fetcher.py
def fetch_commit(self, event): """ Fetch commit data for specified event. :param dict event: dictionary with event information :rtype: dict :return: dictionary with commit data """ gh = self.github user = self.options.user repo = self.options.pro...
def fetch_commit(self, event): """ Fetch commit data for specified event. :param dict event: dictionary with event information :rtype: dict :return: dictionary with commit data """ gh = self.github user = self.options.user repo = self.options.pro...
[ "Fetch", "commit", "data", "for", "specified", "event", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/fetcher.py#L309-L326
[ "def", "fetch_commit", "(", "self", ",", "event", ")", ":", "gh", "=", "self", ".", "github", "user", "=", "self", ".", "options", ".", "user", "repo", "=", "self", ".", "options", ".", "project", "rc", ",", "data", "=", "gh", ".", "repos", "[", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
ChangelogGenerator.run
The entry point of this script to generate change log 'ChangelogGeneratorError' Is thrown when one of the specified tags was not found in list of tags.
pygcgen/main.py
def run(self): """ The entry point of this script to generate change log 'ChangelogGeneratorError' Is thrown when one of the specified tags was not found in list of tags. """ if not self.options.project or not self.options.user: print("Project and/or user miss...
def run(self): """ The entry point of this script to generate change log 'ChangelogGeneratorError' Is thrown when one of the specified tags was not found in list of tags. """ if not self.options.project or not self.options.user: print("Project and/or user miss...
[ "The", "entry", "point", "of", "this", "script", "to", "generate", "change", "log", "ChangelogGeneratorError", "Is", "thrown", "when", "one", "of", "the", "specified", "tags", "was", "not", "found", "in", "list", "of", "tags", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/main.py#L49-L86
[ "def", "run", "(", "self", ")", ":", "if", "not", "self", ".", "options", ".", "project", "or", "not", "self", ".", "options", ".", "user", ":", "print", "(", "\"Project and/or user missing. \"", "\"For help run:\\n pygcgen --help\"", ")", "return", "if", "no...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
parse_heading
Parse a single heading and return a Hash The following heading structures are currently valid: - ## [v1.0.2](https://github.com/zanui/chef-thumbor/tree/v1.0.1) (2015-03-24) - ## [v1.0.2](https://github.com/zanui/chef-thumbor/tree/v1.0.1) - ## v1.0.2 (2015-03-24) - ## v1.0.2 @param [String] head...
pygcgen/reader.py
def parse_heading(heading): """ Parse a single heading and return a Hash The following heading structures are currently valid: - ## [v1.0.2](https://github.com/zanui/chef-thumbor/tree/v1.0.1) (2015-03-24) - ## [v1.0.2](https://github.com/zanui/chef-thumbor/tree/v1.0.1) - ## v1.0.2 (2015-03-24) ...
def parse_heading(heading): """ Parse a single heading and return a Hash The following heading structures are currently valid: - ## [v1.0.2](https://github.com/zanui/chef-thumbor/tree/v1.0.1) (2015-03-24) - ## [v1.0.2](https://github.com/zanui/chef-thumbor/tree/v1.0.1) - ## v1.0.2 (2015-03-24) ...
[ "Parse", "a", "single", "heading", "and", "return", "a", "Hash", "The", "following", "heading", "structures", "are", "currently", "valid", ":", "-", "##", "[", "v1", ".", "0", ".", "2", "]", "(", "https", ":", "//", "github", ".", "com", "/", "zanui"...
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/reader.py#L36-L60
[ "def", "parse_heading", "(", "heading", ")", ":", "heading_structures", "=", "[", "r\"^## \\[(?P<version>.+?)\\]\\((?P<url>.+?)\\)( \\((?P<date>.+?)\\))?$\"", ",", "r\"^## (?P<version>.+?)( \\((?P<date>.+?)\\))?$\"", ",", "]", "captures", "=", "{", "\"version\"", ":", "None", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
parse
Parse the given ChangeLog data into a list of Hashes. @param [String] data File data from the ChangeLog.md @return [Array<Hash>] Parsed data, e.g. [{ 'version' => ..., 'url' => ..., 'date' => ..., 'content' => ...}, ...]
pygcgen/reader.py
def parse(data): """ Parse the given ChangeLog data into a list of Hashes. @param [String] data File data from the ChangeLog.md @return [Array<Hash>] Parsed data, e.g. [{ 'version' => ..., 'url' => ..., 'date' => ..., 'content' => ...}, ...] """ sections = re.compile("^## .+$", re.MULTILINE).s...
def parse(data): """ Parse the given ChangeLog data into a list of Hashes. @param [String] data File data from the ChangeLog.md @return [Array<Hash>] Parsed data, e.g. [{ 'version' => ..., 'url' => ..., 'date' => ..., 'content' => ...}, ...] """ sections = re.compile("^## .+$", re.MULTILINE).s...
[ "Parse", "the", "given", "ChangeLog", "data", "into", "a", "list", "of", "Hashes", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/reader.py#L63-L82
[ "def", "parse", "(", "data", ")", ":", "sections", "=", "re", ".", "compile", "(", "\"^## .+$\"", ",", "re", ".", "MULTILINE", ")", ".", "split", "(", "data", ")", "headings", "=", "re", ".", "findall", "(", "\"^## .+?$\"", ",", "data", ",", "re", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
DaemonContext._signal_handler_map
Create the signal handler map create a dictionary with signal:handler mapping based on self.signal_map :return: dict
pep3143daemon/daemon.py
def _signal_handler_map(self): """ Create the signal handler map create a dictionary with signal:handler mapping based on self.signal_map :return: dict """ result = {} for signum, handler in self.signal_map.items(): result[signum] = self._get_signal_...
def _signal_handler_map(self): """ Create the signal handler map create a dictionary with signal:handler mapping based on self.signal_map :return: dict """ result = {} for signum, handler in self.signal_map.items(): result[signum] = self._get_signal_...
[ "Create", "the", "signal", "handler", "map" ]
schlitzered/pep3143daemon
python
https://github.com/schlitzered/pep3143daemon/blob/de392a5fd046a88d13ace21b8053ff558a27ff90/pep3143daemon/daemon.py#L184-L195
[ "def", "_signal_handler_map", "(", "self", ")", ":", "result", "=", "{", "}", "for", "signum", ",", "handler", "in", "self", ".", "signal_map", ".", "items", "(", ")", ":", "result", "[", "signum", "]", "=", "self", ".", "_get_signal_handler", "(", "ha...
de392a5fd046a88d13ace21b8053ff558a27ff90
valid
DaemonContext.open
Daemonize this process Do everything that is needed to become a Unix daemon. :return: None :raise: DaemonError
pep3143daemon/daemon.py
def open(self): """ Daemonize this process Do everything that is needed to become a Unix daemon. :return: None :raise: DaemonError """ if self.is_open: return try: os.chdir(self.working_directory) if self.chroot_directory: ...
def open(self): """ Daemonize this process Do everything that is needed to become a Unix daemon. :return: None :raise: DaemonError """ if self.is_open: return try: os.chdir(self.working_directory) if self.chroot_directory: ...
[ "Daemonize", "this", "process" ]
schlitzered/pep3143daemon
python
https://github.com/schlitzered/pep3143daemon/blob/de392a5fd046a88d13ace21b8053ff558a27ff90/pep3143daemon/daemon.py#L232-L285
[ "def", "open", "(", "self", ")", ":", "if", "self", ".", "is_open", ":", "return", "try", ":", "os", ".", "chdir", "(", "self", ".", "working_directory", ")", "if", "self", ".", "chroot_directory", ":", "os", ".", "chroot", "(", "self", ".", "chroot_...
de392a5fd046a88d13ace21b8053ff558a27ff90
valid
OptionsParser.user_and_project_from_git
Detects user and project from git.
pygcgen/options_parser.py
def user_and_project_from_git(self, options, arg0=None, arg1=None): """ Detects user and project from git. """ user, project = self.user_project_from_option(options, arg0, arg1) if user and project: return user, project try: remote = subprocess.check_output( ...
def user_and_project_from_git(self, options, arg0=None, arg1=None): """ Detects user and project from git. """ user, project = self.user_project_from_option(options, arg0, arg1) if user and project: return user, project try: remote = subprocess.check_output( ...
[ "Detects", "user", "and", "project", "from", "git", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/options_parser.py#L317-L336
[ "def", "user_and_project_from_git", "(", "self", ",", "options", ",", "arg0", "=", "None", ",", "arg1", "=", "None", ")", ":", "user", ",", "project", "=", "self", ".", "user_project_from_option", "(", "options", ",", "arg0", ",", "arg1", ")", "if", "use...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
OptionsParser.user_project_from_option
Try to find user and project name from git remote output @param [String] output of git remote command @return [Array] user and project
pygcgen/options_parser.py
def user_project_from_option(options, arg0, arg1): """ Try to find user and project name from git remote output @param [String] output of git remote command @return [Array] user and project """ site = options.github_site if arg0 and not arg1: # this ...
def user_project_from_option(options, arg0, arg1): """ Try to find user and project name from git remote output @param [String] output of git remote command @return [Array] user and project """ site = options.github_site if arg0 and not arg1: # this ...
[ "Try", "to", "find", "user", "and", "project", "name", "from", "git", "remote", "output" ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/options_parser.py#L339-L363
[ "def", "user_project_from_option", "(", "options", ",", "arg0", ",", "arg1", ")", ":", "site", "=", "options", ".", "github_site", "if", "arg0", "and", "not", "arg1", ":", "# this match should parse strings such as", "# \"https://github.com/skywinder/Github-Changelog-Ge...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
OptionsParser.user_project_from_remote
Try to find user and project name from git remote output @param [String] output of git remote command @return [Array] user and project
pygcgen/options_parser.py
def user_project_from_remote(remote): """ Try to find user and project name from git remote output @param [String] output of git remote command @return [Array] user and project """ # try to find repo in format: # origin git@github.com:skywinder/Github-Changelog-...
def user_project_from_remote(remote): """ Try to find user and project name from git remote output @param [String] output of git remote command @return [Array] user and project """ # try to find repo in format: # origin git@github.com:skywinder/Github-Changelog-...
[ "Try", "to", "find", "user", "and", "project", "name", "from", "git", "remote", "output" ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/options_parser.py#L366-L391
[ "def", "user_project_from_remote", "(", "remote", ")", ":", "# try to find repo in format:", "# origin\tgit@github.com:skywinder/Github-Changelog-Generator.git (fetch)", "# git@github.com:skywinder/Github-Changelog-Generator.git", "regex1", "=", "br\".*(?:[:/])(?P<user>(-|\\w|\\.)*)/\"", "br...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
timestring_to_datetime
Convert an ISO formated date and time string to a datetime object. :param str timestring: String with date and time in ISO format. :rtype: datetime :return: datetime object
pygcgen/generator.py
def timestring_to_datetime(timestring): """ Convert an ISO formated date and time string to a datetime object. :param str timestring: String with date and time in ISO format. :rtype: datetime :return: datetime object """ with warnings.catch_warnings(): warnings.filterwarnings("ignor...
def timestring_to_datetime(timestring): """ Convert an ISO formated date and time string to a datetime object. :param str timestring: String with date and time in ISO format. :rtype: datetime :return: datetime object """ with warnings.catch_warnings(): warnings.filterwarnings("ignor...
[ "Convert", "an", "ISO", "formated", "date", "and", "time", "string", "to", "a", "datetime", "object", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L26-L38
[ "def", "timestring_to_datetime", "(", "timestring", ")", ":", "with", "warnings", ".", "catch_warnings", "(", ")", ":", "warnings", ".", "filterwarnings", "(", "\"ignore\"", ",", "category", "=", "UnicodeWarning", ")", "result", "=", "dateutil_parser", "(", "tim...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.fetch_events_for_issues_and_pr
Fetch event for issues and pull requests @return [Array] array of fetched issues
pygcgen/generator.py
def fetch_events_for_issues_and_pr(self): """ Fetch event for issues and pull requests @return [Array] array of fetched issues """ # Async fetching events: self.fetcher.fetch_events_async(self.issues, "issues") self.fetcher.fetch_events_async(self.pull_requests,...
def fetch_events_for_issues_and_pr(self): """ Fetch event for issues and pull requests @return [Array] array of fetched issues """ # Async fetching events: self.fetcher.fetch_events_async(self.issues, "issues") self.fetcher.fetch_events_async(self.pull_requests,...
[ "Fetch", "event", "for", "issues", "and", "pull", "requests" ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L77-L86
[ "def", "fetch_events_for_issues_and_pr", "(", "self", ")", ":", "# Async fetching events:", "self", ".", "fetcher", ".", "fetch_events_async", "(", "self", ".", "issues", ",", "\"issues\"", ")", "self", ".", "fetcher", ".", "fetch_events_async", "(", "self", ".", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.fetch_tags_dates
Async fetching of all tags dates.
pygcgen/generator.py
def fetch_tags_dates(self): """ Async fetching of all tags dates. """ if self.options.verbose: print( "Fetching dates for {} tags...".format(len(self.filtered_tags)) ) def worker(tag): self.get_time_of_tag(tag) # Async fetching tags:...
def fetch_tags_dates(self): """ Async fetching of all tags dates. """ if self.options.verbose: print( "Fetching dates for {} tags...".format(len(self.filtered_tags)) ) def worker(tag): self.get_time_of_tag(tag) # Async fetching tags:...
[ "Async", "fetching", "of", "all", "tags", "dates", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L88-L121
[ "def", "fetch_tags_dates", "(", "self", ")", ":", "if", "self", ".", "options", ".", "verbose", ":", "print", "(", "\"Fetching dates for {} tags...\"", ".", "format", "(", "len", "(", "self", ".", "filtered_tags", ")", ")", ")", "def", "worker", "(", "tag"...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.detect_actual_closed_dates
Find correct closed dates, if issues was closed by commits. :param list issues: issues to check :param str kind: either "issues" or "pull requests" :rtype: list :return: issues with updated closed dates
pygcgen/generator.py
def detect_actual_closed_dates(self, issues, kind): """ Find correct closed dates, if issues was closed by commits. :param list issues: issues to check :param str kind: either "issues" or "pull requests" :rtype: list :return: issues with updated closed dates """ ...
def detect_actual_closed_dates(self, issues, kind): """ Find correct closed dates, if issues was closed by commits. :param list issues: issues to check :param str kind: either "issues" or "pull requests" :rtype: list :return: issues with updated closed dates """ ...
[ "Find", "correct", "closed", "dates", "if", "issues", "was", "closed", "by", "commits", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L123-L154
[ "def", "detect_actual_closed_dates", "(", "self", ",", "issues", ",", "kind", ")", ":", "if", "self", ".", "options", ".", "verbose", ":", "print", "(", "\"Fetching closed dates for {} {}...\"", ".", "format", "(", "len", "(", "issues", ")", ",", "kind", ")"...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.find_closed_date_by_commit
Fill "actual_date" parameter of specified issue by closed date of the commit, if it was closed by commit. :param dict issue: issue to edit
pygcgen/generator.py
def find_closed_date_by_commit(self, issue): """ Fill "actual_date" parameter of specified issue by closed date of the commit, if it was closed by commit. :param dict issue: issue to edit """ if not issue.get('events'): return # if it's PR -> then fi...
def find_closed_date_by_commit(self, issue): """ Fill "actual_date" parameter of specified issue by closed date of the commit, if it was closed by commit. :param dict issue: issue to edit """ if not issue.get('events'): return # if it's PR -> then fi...
[ "Fill", "actual_date", "parameter", "of", "specified", "issue", "by", "closed", "date", "of", "the", "commit", "if", "it", "was", "closed", "by", "commit", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L156-L182
[ "def", "find_closed_date_by_commit", "(", "self", ",", "issue", ")", ":", "if", "not", "issue", ".", "get", "(", "'events'", ")", ":", "return", "# if it's PR -> then find \"merged event\", in case", "# of usual issue -> find closed date", "compare_string", "=", "\"merged...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.set_date_from_event
Set closed date from this issue. :param dict event: event data :param dict issue: issue data
pygcgen/generator.py
def set_date_from_event(self, event, issue): """ Set closed date from this issue. :param dict event: event data :param dict issue: issue data """ if not event.get('commit_id', None): issue['actual_date'] = timestring_to_datetime(issue['closed_at']) ...
def set_date_from_event(self, event, issue): """ Set closed date from this issue. :param dict event: event data :param dict issue: issue data """ if not event.get('commit_id', None): issue['actual_date'] = timestring_to_datetime(issue['closed_at']) ...
[ "Set", "closed", "date", "from", "this", "issue", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L184-L204
[ "def", "set_date_from_event", "(", "self", ",", "event", ",", "issue", ")", ":", "if", "not", "event", ".", "get", "(", "'commit_id'", ",", "None", ")", ":", "issue", "[", "'actual_date'", "]", "=", "timestring_to_datetime", "(", "issue", "[", "'closed_at'...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.encapsulate_string
Encapsulate characters to make markdown look as expected. :param str raw_string: string to encapsulate :rtype: str :return: encapsulated input string
pygcgen/generator.py
def encapsulate_string(raw_string): """ Encapsulate characters to make markdown look as expected. :param str raw_string: string to encapsulate :rtype: str :return: encapsulated input string """ raw_string.replace('\\', '\\\\') enc_string = re.sub("([<>*_...
def encapsulate_string(raw_string): """ Encapsulate characters to make markdown look as expected. :param str raw_string: string to encapsulate :rtype: str :return: encapsulated input string """ raw_string.replace('\\', '\\\\') enc_string = re.sub("([<>*_...
[ "Encapsulate", "characters", "to", "make", "markdown", "look", "as", "expected", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L207-L218
[ "def", "encapsulate_string", "(", "raw_string", ")", ":", "raw_string", ".", "replace", "(", "'\\\\'", ",", "'\\\\\\\\'", ")", "enc_string", "=", "re", ".", "sub", "(", "\"([<>*_()\\[\\]#])\"", ",", "r\"\\\\\\1\"", ",", "raw_string", ")", "return", "enc_string" ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.compound_changelog
Main function to start change log generation :rtype: str :return: Generated change log file
pygcgen/generator.py
def compound_changelog(self): """ Main function to start change log generation :rtype: str :return: Generated change log file """ self.fetch_and_filter_tags() tags_sorted = self.sort_tags_by_date(self.filtered_tags) self.filtered_tags = tags_sorted ...
def compound_changelog(self): """ Main function to start change log generation :rtype: str :return: Generated change log file """ self.fetch_and_filter_tags() tags_sorted = self.sort_tags_by_date(self.filtered_tags) self.filtered_tags = tags_sorted ...
[ "Main", "function", "to", "start", "change", "log", "generation" ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L220-L247
[ "def", "compound_changelog", "(", "self", ")", ":", "self", ".", "fetch_and_filter_tags", "(", ")", "tags_sorted", "=", "self", ".", "sort_tags_by_date", "(", "self", ".", "filtered_tags", ")", "self", ".", "filtered_tags", "=", "tags_sorted", "self", ".", "fe...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.generate_sub_section
Generate formated list of issues for changelog. :param list issues: Issues to put in sub-section. :param str prefix: Title of sub-section. :rtype: str :return: Generated ready-to-add sub-section.
pygcgen/generator.py
def generate_sub_section(self, issues, prefix): """ Generate formated list of issues for changelog. :param list issues: Issues to put in sub-section. :param str prefix: Title of sub-section. :rtype: str :return: Generated ready-to-add sub-section. """ lo...
def generate_sub_section(self, issues, prefix): """ Generate formated list of issues for changelog. :param list issues: Issues to put in sub-section. :param str prefix: Title of sub-section. :rtype: str :return: Generated ready-to-add sub-section. """ lo...
[ "Generate", "formated", "list", "of", "issues", "for", "changelog", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L249-L267
[ "def", "generate_sub_section", "(", "self", ",", "issues", ",", "prefix", ")", ":", "log", "=", "\"\"", "if", "issues", ":", "if", "not", "self", ".", "options", ".", "simple_list", ":", "log", "+=", "u\"{0}\\n\\n\"", ".", "format", "(", "prefix", ")", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.generate_header
Generate a header for a tag section with specific parameters. :param str newer_tag_name: Name (title) of newer tag. :param str newer_tag_link: Tag name of newer tag, used for links. Could be same as **newer_tag_name** or some specific value,...
pygcgen/generator.py
def generate_header(self, newer_tag_name, newer_tag_link, newer_tag_time, older_tag_link, project_url): """ Generate a header for a tag section with specific parameters. :param str newer_tag_name: Name (title) of newer tag. :param str newe...
def generate_header(self, newer_tag_name, newer_tag_link, newer_tag_time, older_tag_link, project_url): """ Generate a header for a tag section with specific parameters. :param str newer_tag_name: Name (title) of newer tag. :param str newe...
[ "Generate", "a", "header", "for", "a", "tag", "section", "with", "specific", "parameters", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L269-L322
[ "def", "generate_header", "(", "self", ",", "newer_tag_name", ",", "newer_tag_link", ",", "newer_tag_time", ",", "older_tag_link", ",", "project_url", ")", ":", "log", "=", "\"\"", "# Generate date string:", "# noinspection PyUnresolvedReferences", "time_string", "=", "...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.generate_log_between_tags
Generate log between 2 specified tags. :param dict older_tag: All issues before this tag's date will be excluded. May be special value, if new tag is the first tag. (Means **older_tag** is when the repo was created.) ...
pygcgen/generator.py
def generate_log_between_tags(self, older_tag, newer_tag): """ Generate log between 2 specified tags. :param dict older_tag: All issues before this tag's date will be excluded. May be special value, if new tag is the first tag. (Mean...
def generate_log_between_tags(self, older_tag, newer_tag): """ Generate log between 2 specified tags. :param dict older_tag: All issues before this tag's date will be excluded. May be special value, if new tag is the first tag. (Mean...
[ "Generate", "log", "between", "2", "specified", "tags", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L324-L349
[ "def", "generate_log_between_tags", "(", "self", ",", "older_tag", ",", "newer_tag", ")", ":", "filtered_issues", ",", "filtered_pull_requests", "=", "self", ".", "filter_issues_for_tags", "(", "newer_tag", ",", "older_tag", ")", "older_tag_name", "=", "older_tag", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.filter_issues_for_tags
Apply all filters to issues and pull requests. :param dict older_tag: All issues before this tag's date will be excluded. May be special value, if new tag is the first tag. (Means **older_tag** is when the repo was cr...
pygcgen/generator.py
def filter_issues_for_tags(self, newer_tag, older_tag): """ Apply all filters to issues and pull requests. :param dict older_tag: All issues before this tag's date will be excluded. May be special value, if new tag is the first tag. ...
def filter_issues_for_tags(self, newer_tag, older_tag): """ Apply all filters to issues and pull requests. :param dict older_tag: All issues before this tag's date will be excluded. May be special value, if new tag is the first tag. ...
[ "Apply", "all", "filters", "to", "issues", "and", "pull", "requests", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L351-L380
[ "def", "filter_issues_for_tags", "(", "self", ",", "newer_tag", ",", "older_tag", ")", ":", "filtered_pull_requests", "=", "self", ".", "delete_by_time", "(", "self", ".", "pull_requests", ",", "older_tag", ",", "newer_tag", ")", "filtered_issues", "=", "self", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.generate_log_for_all_tags
The full cycle of generation for whole project. :rtype: str :return: The complete change log for released tags.
pygcgen/generator.py
def generate_log_for_all_tags(self): """ The full cycle of generation for whole project. :rtype: str :return: The complete change log for released tags. """ if self.options.verbose: print("Generating log...") self.issues2 = copy.deepcopy(self.issues)...
def generate_log_for_all_tags(self): """ The full cycle of generation for whole project. :rtype: str :return: The complete change log for released tags. """ if self.options.verbose: print("Generating log...") self.issues2 = copy.deepcopy(self.issues)...
[ "The", "full", "cycle", "of", "generation", "for", "whole", "project", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L382-L410
[ "def", "generate_log_for_all_tags", "(", "self", ")", ":", "if", "self", ".", "options", ".", "verbose", ":", "print", "(", "\"Generating log...\"", ")", "self", ".", "issues2", "=", "copy", ".", "deepcopy", "(", "self", ".", "issues", ")", "log1", "=", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.generate_unreleased_section
Generate log for unreleased closed issues. :rtype: str :return: Generated ready-to-add unreleased section.
pygcgen/generator.py
def generate_unreleased_section(self): """ Generate log for unreleased closed issues. :rtype: str :return: Generated ready-to-add unreleased section. """ if not self.filtered_tags: return "" now = datetime.datetime.utcnow() now = now.replace(t...
def generate_unreleased_section(self): """ Generate log for unreleased closed issues. :rtype: str :return: Generated ready-to-add unreleased section. """ if not self.filtered_tags: return "" now = datetime.datetime.utcnow() now = now.replace(t...
[ "Generate", "log", "for", "unreleased", "closed", "issues", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L445-L460
[ "def", "generate_unreleased_section", "(", "self", ")", ":", "if", "not", "self", ".", "filtered_tags", ":", "return", "\"\"", "now", "=", "datetime", ".", "datetime", ".", "utcnow", "(", ")", "now", "=", "now", ".", "replace", "(", "tzinfo", "=", "dateu...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.get_string_for_issue
Parse issue and generate single line formatted issue line. Example output: - Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) ([skywinder](https://github.com/skywinder)) - Add coveralls integration [\#223](https://github.com/skywinder/g...
pygcgen/generator.py
def get_string_for_issue(self, issue): """ Parse issue and generate single line formatted issue line. Example output: - Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) ([skywinder](https://github.com/skywinder)) - Add c...
def get_string_for_issue(self, issue): """ Parse issue and generate single line formatted issue line. Example output: - Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) ([skywinder](https://github.com/skywinder)) - Add c...
[ "Parse", "issue", "and", "generate", "single", "line", "formatted", "issue", "line", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L462-L487
[ "def", "get_string_for_issue", "(", "self", ",", "issue", ")", ":", "encapsulated_title", "=", "self", ".", "encapsulate_string", "(", "issue", "[", "'title'", "]", ")", "try", ":", "title_with_number", "=", "u\"{0} [\\\\#{1}]({2})\"", ".", "format", "(", "encap...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.issue_line_with_user
If option author is enabled, a link to the profile of the author of the pull reqest will be added to the issue line. :param str line: String containing a markdown-formatted single issue. :param dict issue: Fetched issue from GitHub. :rtype: str :return: Issue line with added aut...
pygcgen/generator.py
def issue_line_with_user(self, line, issue): """ If option author is enabled, a link to the profile of the author of the pull reqest will be added to the issue line. :param str line: String containing a markdown-formatted single issue. :param dict issue: Fetched issue from GitHu...
def issue_line_with_user(self, line, issue): """ If option author is enabled, a link to the profile of the author of the pull reqest will be added to the issue line. :param str line: String containing a markdown-formatted single issue. :param dict issue: Fetched issue from GitHu...
[ "If", "option", "author", "is", "enabled", "a", "link", "to", "the", "profile", "of", "the", "author", "of", "the", "pull", "reqest", "will", "be", "added", "to", "the", "issue", "line", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L489-L512
[ "def", "issue_line_with_user", "(", "self", ",", "line", ",", "issue", ")", ":", "if", "not", "issue", ".", "get", "(", "\"pull_request\"", ")", "or", "not", "self", ".", "options", ".", "author", ":", "return", "line", "if", "not", "issue", ".", "get"...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.generate_log_for_tag
Generates log for tag section with header and body. :param list(dict) pull_requests: List of PR's in this tag section. :param list(dict) issues: List of issues in this tag section. :param dict newer_tag: Github data of tag for this section. :param str older_tag_name: Older tag, used for...
pygcgen/generator.py
def generate_log_for_tag(self, pull_requests, issues, newer_tag, older_tag_name): """ Generates log for tag section with header and body. :param list(dict) pull_requests: List of ...
def generate_log_for_tag(self, pull_requests, issues, newer_tag, older_tag_name): """ Generates log for tag section with header and body. :param list(dict) pull_requests: List of ...
[ "Generates", "log", "for", "tag", "section", "with", "header", "and", "body", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L514-L550
[ "def", "generate_log_for_tag", "(", "self", ",", "pull_requests", ",", "issues", ",", "newer_tag", ",", "older_tag_name", ")", ":", "newer_tag_link", ",", "newer_tag_name", ",", "newer_tag_time", "=", "self", ".", "detect_link_tag_time", "(", "newer_tag", ")", "gi...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.issues_to_log
Generate ready-to-paste log from list of issues and pull requests. :param list(dict) issues: List of issues in this tag section. :param list(dict) pull_requests: List of PR's in this tag section. :rtype: str :return: Generated log for issues and pull requests.
pygcgen/generator.py
def issues_to_log(self, issues, pull_requests): """ Generate ready-to-paste log from list of issues and pull requests. :param list(dict) issues: List of issues in this tag section. :param list(dict) pull_requests: List of PR's in this tag section. :rtype: str :return: Ge...
def issues_to_log(self, issues, pull_requests): """ Generate ready-to-paste log from list of issues and pull requests. :param list(dict) issues: List of issues in this tag section. :param list(dict) pull_requests: List of PR's in this tag section. :rtype: str :return: Ge...
[ "Generate", "ready", "-", "to", "-", "paste", "log", "from", "list", "of", "issues", "and", "pull", "requests", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L552-L569
[ "def", "issues_to_log", "(", "self", ",", "issues", ",", "pull_requests", ")", ":", "log", "=", "\"\"", "sections_a", ",", "issues_a", "=", "self", ".", "parse_by_sections", "(", "issues", ",", "pull_requests", ")", "for", "section", ",", "s_issues", "in", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.parse_by_sections
This method sort issues by types (bugs, features, etc. or just closed issues) by labels. :param list(dict) issues: List of issues in this tag section. :param list(dict) pull_requests: List of PR's in this tag section. :rtype: dict(list(dict)), list(dict) :return: Issues and PR's...
pygcgen/generator.py
def parse_by_sections(self, issues, pull_requests): """ This method sort issues by types (bugs, features, etc. or just closed issues) by labels. :param list(dict) issues: List of issues in this tag section. :param list(dict) pull_requests: List of PR's in this tag section. ...
def parse_by_sections(self, issues, pull_requests): """ This method sort issues by types (bugs, features, etc. or just closed issues) by labels. :param list(dict) issues: List of issues in this tag section. :param list(dict) pull_requests: List of PR's in this tag section. ...
[ "This", "method", "sort", "issues", "by", "types", "(", "bugs", "features", "etc", ".", "or", "just", "closed", "issues", ")", "by", "labels", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L571-L591
[ "def", "parse_by_sections", "(", "self", ",", "issues", ",", "pull_requests", ")", ":", "issues_a", "=", "[", "]", "sections_a", "=", "OrderedDict", "(", ")", "if", "not", "self", ".", "options", ".", "sections", ":", "return", "[", "sections_a", ",", "i...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.exclude_issues_by_labels
Delete all issues with labels from exclude-labels option. :param list(dict) issues: All issues for tag. :rtype: list(dict) :return: Filtered issues.
pygcgen/generator.py
def exclude_issues_by_labels(self, issues): """ Delete all issues with labels from exclude-labels option. :param list(dict) issues: All issues for tag. :rtype: list(dict) :return: Filtered issues. """ if not self.options.exclude_labels: return copy.de...
def exclude_issues_by_labels(self, issues): """ Delete all issues with labels from exclude-labels option. :param list(dict) issues: All issues for tag. :rtype: list(dict) :return: Filtered issues. """ if not self.options.exclude_labels: return copy.de...
[ "Delete", "all", "issues", "with", "labels", "from", "exclude", "-", "labels", "option", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L623-L645
[ "def", "exclude_issues_by_labels", "(", "self", ",", "issues", ")", ":", "if", "not", "self", ".", "options", ".", "exclude_labels", ":", "return", "copy", ".", "deepcopy", "(", "issues", ")", "remove_issues", "=", "set", "(", ")", "exclude_labels", "=", "...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.filter_by_milestone
:param list(dict) filtered_issues: Filtered issues. :param str tag_name: Name (title) of tag. :param list(dict) all_issues: All issues. :rtype: list(dict) :return: Filtered issues according milestone.
pygcgen/generator.py
def filter_by_milestone(self, filtered_issues, tag_name, all_issues): """ :param list(dict) filtered_issues: Filtered issues. :param str tag_name: Name (title) of tag. :param list(dict) all_issues: All issues. :rtype: list(dict) :return: Filtered issues according mileston...
def filter_by_milestone(self, filtered_issues, tag_name, all_issues): """ :param list(dict) filtered_issues: Filtered issues. :param str tag_name: Name (title) of tag. :param list(dict) all_issues: All issues. :rtype: list(dict) :return: Filtered issues according mileston...
[ ":", "param", "list", "(", "dict", ")", "filtered_issues", ":", "Filtered", "issues", ".", ":", "param", "str", "tag_name", ":", "Name", "(", "title", ")", "of", "tag", ".", ":", "param", "list", "(", "dict", ")", "all_issues", ":", "All", "issues", ...
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L647-L661
[ "def", "filter_by_milestone", "(", "self", ",", "filtered_issues", ",", "tag_name", ",", "all_issues", ")", ":", "filtered_issues", "=", "self", ".", "remove_issues_in_milestones", "(", "filtered_issues", ")", "if", "tag_name", ":", "# add missed issues (according miles...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.find_issues_to_add
Add all issues, that should be in that tag, according to milestone. :param list(dict) all_issues: All issues. :param str tag_name: Name (title) of tag. :rtype: List[dict] :return: Issues filtered by milestone.
pygcgen/generator.py
def find_issues_to_add(all_issues, tag_name): """ Add all issues, that should be in that tag, according to milestone. :param list(dict) all_issues: All issues. :param str tag_name: Name (title) of tag. :rtype: List[dict] :return: Issues filtered by milestone. """...
def find_issues_to_add(all_issues, tag_name): """ Add all issues, that should be in that tag, according to milestone. :param list(dict) all_issues: All issues. :param str tag_name: Name (title) of tag. :rtype: List[dict] :return: Issues filtered by milestone. """...
[ "Add", "all", "issues", "that", "should", "be", "in", "that", "tag", "according", "to", "milestone", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L664-L680
[ "def", "find_issues_to_add", "(", "all_issues", ",", "tag_name", ")", ":", "filtered", "=", "[", "]", "for", "issue", "in", "all_issues", ":", "if", "issue", ".", "get", "(", "\"milestone\"", ")", ":", "if", "issue", "[", "\"milestone\"", "]", "[", "\"ti...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.remove_issues_in_milestones
:param list(dict) filtered_issues: Filtered issues. :rtype: list(dict) :return: List with removed issues, that contain milestones with same name as a tag.
pygcgen/generator.py
def remove_issues_in_milestones(self, filtered_issues): """ :param list(dict) filtered_issues: Filtered issues. :rtype: list(dict) :return: List with removed issues, that contain milestones with same name as a tag. """ for issue in filtered_issues: ...
def remove_issues_in_milestones(self, filtered_issues): """ :param list(dict) filtered_issues: Filtered issues. :rtype: list(dict) :return: List with removed issues, that contain milestones with same name as a tag. """ for issue in filtered_issues: ...
[ ":", "param", "list", "(", "dict", ")", "filtered_issues", ":", "Filtered", "issues", ".", ":", "rtype", ":", "list", "(", "dict", ")", ":", "return", ":", "List", "with", "removed", "issues", "that", "contain", "milestones", "with", "same", "name", "as"...
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L682-L696
[ "def", "remove_issues_in_milestones", "(", "self", ",", "filtered_issues", ")", ":", "for", "issue", "in", "filtered_issues", ":", "# leave issues without milestones", "if", "issue", "[", "\"milestone\"", "]", ":", "# check, that this milestone is in tag list:", "for", "t...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.delete_by_time
Filter issues that belong to specified tag range. :param list(dict) issues: Issues to filter. :param dict older_tag: All issues before this tag's date will be excluded. May be special value, if **newer_tag** is the first tag. (Means **older_...
pygcgen/generator.py
def delete_by_time(self, issues, older_tag, newer_tag): """ Filter issues that belong to specified tag range. :param list(dict) issues: Issues to filter. :param dict older_tag: All issues before this tag's date will be excluded. May be special value, if **...
def delete_by_time(self, issues, older_tag, newer_tag): """ Filter issues that belong to specified tag range. :param list(dict) issues: Issues to filter. :param dict older_tag: All issues before this tag's date will be excluded. May be special value, if **...
[ "Filter", "issues", "that", "belong", "to", "specified", "tag", "range", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L698-L725
[ "def", "delete_by_time", "(", "self", ",", "issues", ",", "older_tag", ",", "newer_tag", ")", ":", "if", "not", "older_tag", "and", "not", "newer_tag", ":", "# in case if no tags are specified - return unchanged array", "return", "copy", ".", "deepcopy", "(", "issue...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.include_issues_by_labels
Include issues with labels, specified in self.options.include_labels. :param list(dict) all_issues: All issues. :rtype: list(dict) :return: Filtered issues.
pygcgen/generator.py
def include_issues_by_labels(self, all_issues): """ Include issues with labels, specified in self.options.include_labels. :param list(dict) all_issues: All issues. :rtype: list(dict) :return: Filtered issues. """ included_by_labels = self.filter_by_include_label...
def include_issues_by_labels(self, all_issues): """ Include issues with labels, specified in self.options.include_labels. :param list(dict) all_issues: All issues. :rtype: list(dict) :return: Filtered issues. """ included_by_labels = self.filter_by_include_label...
[ "Include", "issues", "with", "labels", "specified", "in", "self", ".", "options", ".", "include_labels", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L727-L744
[ "def", "include_issues_by_labels", "(", "self", ",", "all_issues", ")", ":", "included_by_labels", "=", "self", ".", "filter_by_include_labels", "(", "all_issues", ")", "wo_labels", "=", "self", ".", "filter_wo_labels", "(", "all_issues", ")", "il", "=", "set", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.filter_wo_labels
Filter all issues that don't have a label. :rtype: list(dict) :return: Issues without labels.
pygcgen/generator.py
def filter_wo_labels(self, all_issues): """ Filter all issues that don't have a label. :rtype: list(dict) :return: Issues without labels. """ issues_wo_labels = [] if not self.options.add_issues_wo_labels: for issue in all_issues: if ...
def filter_wo_labels(self, all_issues): """ Filter all issues that don't have a label. :rtype: list(dict) :return: Issues without labels. """ issues_wo_labels = [] if not self.options.add_issues_wo_labels: for issue in all_issues: if ...
[ "Filter", "all", "issues", "that", "don", "t", "have", "a", "label", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L746-L759
[ "def", "filter_wo_labels", "(", "self", ",", "all_issues", ")", ":", "issues_wo_labels", "=", "[", "]", "if", "not", "self", ".", "options", ".", "add_issues_wo_labels", ":", "for", "issue", "in", "all_issues", ":", "if", "not", "issue", "[", "'labels'", "...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.filter_by_include_labels
Filter issues to include only issues with labels specified in include_labels. :param list(dict) issues: Pre-filtered issues. :rtype: list(dict) :return: Filtered issues.
pygcgen/generator.py
def filter_by_include_labels(self, issues): """ Filter issues to include only issues with labels specified in include_labels. :param list(dict) issues: Pre-filtered issues. :rtype: list(dict) :return: Filtered issues. """ if not self.options.include_labe...
def filter_by_include_labels(self, issues): """ Filter issues to include only issues with labels specified in include_labels. :param list(dict) issues: Pre-filtered issues. :rtype: list(dict) :return: Filtered issues. """ if not self.options.include_labe...
[ "Filter", "issues", "to", "include", "only", "issues", "with", "labels", "specified", "in", "include_labels", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L761-L779
[ "def", "filter_by_include_labels", "(", "self", ",", "issues", ")", ":", "if", "not", "self", ".", "options", ".", "include_labels", ":", "return", "copy", ".", "deepcopy", "(", "issues", ")", "filtered_issues", "=", "[", "]", "include_labels", "=", "set", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.filter_by_labels
Filter issues for include/exclude labels. :param list(dict) all_issues: All issues. :param str kind: Either "issues" or "pull requests". :rtype: list(dict) :return: Filtered issues.
pygcgen/generator.py
def filter_by_labels(self, all_issues, kind): """ Filter issues for include/exclude labels. :param list(dict) all_issues: All issues. :param str kind: Either "issues" or "pull requests". :rtype: list(dict) :return: Filtered issues. """ filtered_issues = ...
def filter_by_labels(self, all_issues, kind): """ Filter issues for include/exclude labels. :param list(dict) all_issues: All issues. :param str kind: Either "issues" or "pull requests". :rtype: list(dict) :return: Filtered issues. """ filtered_issues = ...
[ "Filter", "issues", "for", "include", "/", "exclude", "labels", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L781-L795
[ "def", "filter_by_labels", "(", "self", ",", "all_issues", ",", "kind", ")", ":", "filtered_issues", "=", "self", ".", "include_issues_by_labels", "(", "all_issues", ")", "filtered", "=", "self", ".", "exclude_issues_by_labels", "(", "filtered_issues", ")", "if", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.get_filtered_pull_requests
This method fetches missing params for PR and filter them by specified options. It include add all PR's with labels from options.include_labels and exclude all from options.exclude_labels. :param list(dict) pull_requests: All pull requests. :rtype: list(dict) :return: Fi...
pygcgen/generator.py
def get_filtered_pull_requests(self, pull_requests): """ This method fetches missing params for PR and filter them by specified options. It include add all PR's with labels from options.include_labels and exclude all from options.exclude_labels. :param list(dict) pull_re...
def get_filtered_pull_requests(self, pull_requests): """ This method fetches missing params for PR and filter them by specified options. It include add all PR's with labels from options.include_labels and exclude all from options.exclude_labels. :param list(dict) pull_re...
[ "This", "method", "fetches", "missing", "params", "for", "PR", "and", "filter", "them", "by", "specified", "options", ".", "It", "include", "add", "all", "PR", "s", "with", "labels", "from", "options", ".", "include_labels", "and", "exclude", "all", "from", ...
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L797-L813
[ "def", "get_filtered_pull_requests", "(", "self", ",", "pull_requests", ")", ":", "pull_requests", "=", "self", ".", "filter_by_labels", "(", "pull_requests", ",", "\"pull requests\"", ")", "pull_requests", "=", "self", ".", "filter_merged_pull_requests", "(", "pull_r...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.filter_merged_pull_requests
This method filter only merged PR and fetch missing required attributes for pull requests. Using merged date is more correct than closed date. :param list(dict) pull_requests: Pre-filtered pull requests. :rtype: list(dict) :return:
pygcgen/generator.py
def filter_merged_pull_requests(self, pull_requests): """ This method filter only merged PR and fetch missing required attributes for pull requests. Using merged date is more correct than closed date. :param list(dict) pull_requests: Pre-filtered pull requests. :rtype: l...
def filter_merged_pull_requests(self, pull_requests): """ This method filter only merged PR and fetch missing required attributes for pull requests. Using merged date is more correct than closed date. :param list(dict) pull_requests: Pre-filtered pull requests. :rtype: l...
[ "This", "method", "filter", "only", "merged", "PR", "and", "fetch", "missing", "required", "attributes", "for", "pull", "requests", ".", "Using", "merged", "date", "is", "more", "correct", "than", "closed", "date", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L815-L845
[ "def", "filter_merged_pull_requests", "(", "self", ",", "pull_requests", ")", ":", "if", "self", ".", "options", ".", "verbose", ":", "print", "(", "\"Fetching merge date for pull requests...\"", ")", "closed_pull_requests", "=", "self", ".", "fetcher", ".", "fetch_...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.fetch_and_filter_tags
Fetch and filter tags, fetch dates and sort them in time order.
pygcgen/generator.py
def fetch_and_filter_tags(self): """ Fetch and filter tags, fetch dates and sort them in time order. """ self.all_tags = self.fetcher.get_all_tags() self.filtered_tags = self.get_filtered_tags(self.all_tags) self.fetch_tags_dates()
def fetch_and_filter_tags(self): """ Fetch and filter tags, fetch dates and sort them in time order. """ self.all_tags = self.fetcher.get_all_tags() self.filtered_tags = self.get_filtered_tags(self.all_tags) self.fetch_tags_dates()
[ "Fetch", "and", "filter", "tags", "fetch", "dates", "and", "sort", "them", "in", "time", "order", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L847-L854
[ "def", "fetch_and_filter_tags", "(", "self", ")", ":", "self", ".", "all_tags", "=", "self", ".", "fetcher", ".", "get_all_tags", "(", ")", "self", ".", "filtered_tags", "=", "self", ".", "get_filtered_tags", "(", "self", ".", "all_tags", ")", "self", ".",...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.sort_tags_by_date
Sort all tags by date. :param list(dict) tags: All tags. :rtype: list(dict) :return: Sorted list of tags.
pygcgen/generator.py
def sort_tags_by_date(self, tags): """ Sort all tags by date. :param list(dict) tags: All tags. :rtype: list(dict) :return: Sorted list of tags. """ if self.options.verbose: print("Sorting tags...") tags.sort(key=lambda x: self.get_time_of_ta...
def sort_tags_by_date(self, tags): """ Sort all tags by date. :param list(dict) tags: All tags. :rtype: list(dict) :return: Sorted list of tags. """ if self.options.verbose: print("Sorting tags...") tags.sort(key=lambda x: self.get_time_of_ta...
[ "Sort", "all", "tags", "by", "date", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L856-L869
[ "def", "sort_tags_by_date", "(", "self", ",", "tags", ")", ":", "if", "self", ".", "options", ".", "verbose", ":", "print", "(", "\"Sorting tags...\"", ")", "tags", ".", "sort", "(", "key", "=", "lambda", "x", ":", "self", ".", "get_time_of_tag", "(", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.get_time_of_tag
Get date and time for tag, fetching it if not already cached. :param dict tag: Tag to get the datetime for. :rtype: datetime :return: datetime for specified tag.
pygcgen/generator.py
def get_time_of_tag(self, tag): """ Get date and time for tag, fetching it if not already cached. :param dict tag: Tag to get the datetime for. :rtype: datetime :return: datetime for specified tag. """ if not tag: raise ChangelogGeneratorError("tag i...
def get_time_of_tag(self, tag): """ Get date and time for tag, fetching it if not already cached. :param dict tag: Tag to get the datetime for. :rtype: datetime :return: datetime for specified tag. """ if not tag: raise ChangelogGeneratorError("tag i...
[ "Get", "date", "and", "time", "for", "tag", "fetching", "it", "if", "not", "already", "cached", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L871-L896
[ "def", "get_time_of_tag", "(", "self", ",", "tag", ")", ":", "if", "not", "tag", ":", "raise", "ChangelogGeneratorError", "(", "\"tag is nil\"", ")", "name_of_tag", "=", "tag", "[", "\"name\"", "]", "time_for_name", "=", "self", ".", "tag_times_dict", ".", "...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.detect_link_tag_time
Detect link, name and time for specified tag. :param dict tag: Tag data. :rtype: str, str, datetime :return: Link, name and time of the tag.
pygcgen/generator.py
def detect_link_tag_time(self, tag): """ Detect link, name and time for specified tag. :param dict tag: Tag data. :rtype: str, str, datetime :return: Link, name and time of the tag. """ # if tag is nil - set current time newer_tag_time = self.get_time_of...
def detect_link_tag_time(self, tag): """ Detect link, name and time for specified tag. :param dict tag: Tag data. :rtype: str, str, datetime :return: Link, name and time of the tag. """ # if tag is nil - set current time newer_tag_time = self.get_time_of...
[ "Detect", "link", "name", "and", "time", "for", "specified", "tag", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L898-L923
[ "def", "detect_link_tag_time", "(", "self", ",", "tag", ")", ":", "# if tag is nil - set current time", "newer_tag_time", "=", "self", ".", "get_time_of_tag", "(", "tag", ")", "if", "tag", "else", "datetime", ".", "datetime", ".", "now", "(", ")", "# if it's fut...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.version_of_first_item
Try to detect the newest tag from self.options.base, otherwise return a special value indicating the creation of the repo. :rtype: str :return: Tag name to use as 'oldest' tag. May be special value, indicating the creation of the repo.
pygcgen/generator.py
def version_of_first_item(self): """ Try to detect the newest tag from self.options.base, otherwise return a special value indicating the creation of the repo. :rtype: str :return: Tag name to use as 'oldest' tag. May be special value, indicating the creation of...
def version_of_first_item(self): """ Try to detect the newest tag from self.options.base, otherwise return a special value indicating the creation of the repo. :rtype: str :return: Tag name to use as 'oldest' tag. May be special value, indicating the creation of...
[ "Try", "to", "detect", "the", "newest", "tag", "from", "self", ".", "options", ".", "base", "otherwise", "return", "a", "special", "value", "indicating", "the", "creation", "of", "the", "repo", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L935-L948
[ "def", "version_of_first_item", "(", "self", ")", ":", "try", ":", "sections", "=", "read_changelog", "(", "self", ".", "options", ")", "return", "sections", "[", "0", "]", "[", "\"version\"", "]", "except", "(", "IOError", ",", "TypeError", ")", ":", "r...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.get_temp_tag_for_repo_creation
If not already cached, fetch the creation date of the repo, cache it and return the special value indicating the creation of the repo. :rtype: str :return: value indicating the creation
pygcgen/generator.py
def get_temp_tag_for_repo_creation(self): """ If not already cached, fetch the creation date of the repo, cache it and return the special value indicating the creation of the repo. :rtype: str :return: value indicating the creation """ tag_date = self.tag_times_d...
def get_temp_tag_for_repo_creation(self): """ If not already cached, fetch the creation date of the repo, cache it and return the special value indicating the creation of the repo. :rtype: str :return: value indicating the creation """ tag_date = self.tag_times_d...
[ "If", "not", "already", "cached", "fetch", "the", "creation", "date", "of", "the", "repo", "cache", "it", "and", "return", "the", "special", "value", "indicating", "the", "creation", "of", "the", "repo", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L950-L962
[ "def", "get_temp_tag_for_repo_creation", "(", "self", ")", ":", "tag_date", "=", "self", ".", "tag_times_dict", ".", "get", "(", "REPO_CREATED_TAG_NAME", ",", "None", ")", "if", "not", "tag_date", ":", "tag_name", ",", "tag_date", "=", "self", ".", "fetcher", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.get_filtered_tags
Return tags after filtering tags in lists provided by option: --between-tags & --exclude-tags :param list(dict) all_tags: All tags. :rtype: list(dict) :return: Filtered tags.
pygcgen/generator.py
def get_filtered_tags(self, all_tags): """ Return tags after filtering tags in lists provided by option: --between-tags & --exclude-tags :param list(dict) all_tags: All tags. :rtype: list(dict) :return: Filtered tags. """ filtered_tags = self.filter_sinc...
def get_filtered_tags(self, all_tags): """ Return tags after filtering tags in lists provided by option: --between-tags & --exclude-tags :param list(dict) all_tags: All tags. :rtype: list(dict) :return: Filtered tags. """ filtered_tags = self.filter_sinc...
[ "Return", "tags", "after", "filtering", "tags", "in", "lists", "provided", "by", "option", ":", "--", "between", "-", "tags", "&", "--", "exclude", "-", "tags" ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L964-L979
[ "def", "get_filtered_tags", "(", "self", ",", "all_tags", ")", ":", "filtered_tags", "=", "self", ".", "filter_since_tag", "(", "all_tags", ")", "if", "self", ".", "options", ".", "between_tags", ":", "filtered_tags", "=", "self", ".", "filter_between_tags", "...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.filter_since_tag
Filter tags according since_tag option. :param list(dict) all_tags: All tags. :rtype: list(dict) :return: Filtered tags.
pygcgen/generator.py
def filter_since_tag(self, all_tags): """ Filter tags according since_tag option. :param list(dict) all_tags: All tags. :rtype: list(dict) :return: Filtered tags. """ tag = self.detect_since_tag() if not tag or tag == REPO_CREATED_TAG_NAME: r...
def filter_since_tag(self, all_tags): """ Filter tags according since_tag option. :param list(dict) all_tags: All tags. :rtype: list(dict) :return: Filtered tags. """ tag = self.detect_since_tag() if not tag or tag == REPO_CREATED_TAG_NAME: r...
[ "Filter", "tags", "according", "since_tag", "option", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L981-L1008
[ "def", "filter_since_tag", "(", "self", ",", "all_tags", ")", ":", "tag", "=", "self", ".", "detect_since_tag", "(", ")", "if", "not", "tag", "or", "tag", "==", "REPO_CREATED_TAG_NAME", ":", "return", "copy", ".", "deepcopy", "(", "all_tags", ")", "filtere...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.filter_due_tag
Filter tags according due_tag option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags.
pygcgen/generator.py
def filter_due_tag(self, all_tags): """ Filter tags according due_tag option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags. """ filtered_tags = [] tag = self.options.due_tag tag_names = [t["name"] for t...
def filter_due_tag(self, all_tags): """ Filter tags according due_tag option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags. """ filtered_tags = [] tag = self.options.due_tag tag_names = [t["name"] for t...
[ "Filter", "tags", "according", "due_tag", "option", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L1010-L1034
[ "def", "filter_due_tag", "(", "self", ",", "all_tags", ")", ":", "filtered_tags", "=", "[", "]", "tag", "=", "self", ".", "options", ".", "due_tag", "tag_names", "=", "[", "t", "[", "\"name\"", "]", "for", "t", "in", "all_tags", "]", "try", ":", "idx...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.filter_between_tags
Filter tags according between_tags option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags.
pygcgen/generator.py
def filter_between_tags(self, all_tags): """ Filter tags according between_tags option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags. """ tag_names = [t["name"] for t in all_tags] between_tags = [] for ...
def filter_between_tags(self, all_tags): """ Filter tags according between_tags option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags. """ tag_names = [t["name"] for t in all_tags] between_tags = [] for ...
[ "Filter", "tags", "according", "between_tags", "option", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L1036-L1071
[ "def", "filter_between_tags", "(", "self", ",", "all_tags", ")", ":", "tag_names", "=", "[", "t", "[", "\"name\"", "]", "for", "t", "in", "all_tags", "]", "between_tags", "=", "[", "]", "for", "tag", "in", "self", ".", "options", ".", "between_tags", "...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.filter_excluded_tags
Filter tags according exclude_tags and exclude_tags_regex option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags.
pygcgen/generator.py
def filter_excluded_tags(self, all_tags): """ Filter tags according exclude_tags and exclude_tags_regex option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags. """ filtered_tags = copy.deepcopy(all_tags) if self.o...
def filter_excluded_tags(self, all_tags): """ Filter tags according exclude_tags and exclude_tags_regex option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags. """ filtered_tags = copy.deepcopy(all_tags) if self.o...
[ "Filter", "tags", "according", "exclude_tags", "and", "exclude_tags_regex", "option", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L1073-L1086
[ "def", "filter_excluded_tags", "(", "self", ",", "all_tags", ")", ":", "filtered_tags", "=", "copy", ".", "deepcopy", "(", "all_tags", ")", "if", "self", ".", "options", ".", "exclude_tags", ":", "filtered_tags", "=", "self", ".", "apply_exclude_tags", "(", ...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.apply_exclude_tags_regex
Filter tags according exclude_tags_regex option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags.
pygcgen/generator.py
def apply_exclude_tags_regex(self, all_tags): """ Filter tags according exclude_tags_regex option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags. """ filtered = [] for tag in all_tags: if not re.match...
def apply_exclude_tags_regex(self, all_tags): """ Filter tags according exclude_tags_regex option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags. """ filtered = [] for tag in all_tags: if not re.match...
[ "Filter", "tags", "according", "exclude_tags_regex", "option", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L1088-L1102
[ "def", "apply_exclude_tags_regex", "(", "self", ",", "all_tags", ")", ":", "filtered", "=", "[", "]", "for", "tag", "in", "all_tags", ":", "if", "not", "re", ".", "match", "(", "self", ".", "options", ".", "exclude_tags_regex", ",", "tag", "[", "\"name\"...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
Generator.apply_exclude_tags
Filter tags according exclude_tags option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags.
pygcgen/generator.py
def apply_exclude_tags(self, all_tags): """ Filter tags according exclude_tags option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags. """ filtered = copy.deepcopy(all_tags) for tag in all_tags: if tag...
def apply_exclude_tags(self, all_tags): """ Filter tags according exclude_tags option. :param list(dict) all_tags: Pre-filtered tags. :rtype: list(dict) :return: Filtered tags. """ filtered = copy.deepcopy(all_tags) for tag in all_tags: if tag...
[ "Filter", "tags", "according", "exclude_tags", "option", "." ]
topic2k/pygcgen
python
https://github.com/topic2k/pygcgen/blob/c41701815df2c8c3a57fd5f7b8babe702127c8a1/pygcgen/generator.py#L1104-L1118
[ "def", "apply_exclude_tags", "(", "self", ",", "all_tags", ")", ":", "filtered", "=", "copy", ".", "deepcopy", "(", "all_tags", ")", "for", "tag", "in", "all_tags", ":", "if", "tag", "[", "\"name\"", "]", "not", "in", "self", ".", "options", ".", "excl...
c41701815df2c8c3a57fd5f7b8babe702127c8a1
valid
random_chars
Generate a random string from a-zA-Z0-9 :param n: length of the string :return: the random string
deeputils/common.py
def random_chars(n): """ Generate a random string from a-zA-Z0-9 :param n: length of the string :return: the random string """ return ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(n))
def random_chars(n): """ Generate a random string from a-zA-Z0-9 :param n: length of the string :return: the random string """ return ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(n))
[ "Generate", "a", "random", "string", "from", "a", "-", "zA", "-", "Z0", "-", "9", ":", "param", "n", ":", "length", "of", "the", "string", ":", "return", ":", "the", "random", "string" ]
valency/deeputils
python
https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L24-L30
[ "def", "random_chars", "(", "n", ")", ":", "return", "''", ".", "join", "(", "random", ".", "SystemRandom", "(", ")", ".", "choice", "(", "string", ".", "ascii_letters", "+", "string", ".", "digits", ")", "for", "_", "in", "range", "(", "n", ")", "...
27efd91668de0223ed8b07cfadf2151632521520
valid
random_letters
Generate a random string from a-zA-Z :param n: length of the string :return: the random string
deeputils/common.py
def random_letters(n): """ Generate a random string from a-zA-Z :param n: length of the string :return: the random string """ return ''.join(random.SystemRandom().choice(string.ascii_letters) for _ in range(n))
def random_letters(n): """ Generate a random string from a-zA-Z :param n: length of the string :return: the random string """ return ''.join(random.SystemRandom().choice(string.ascii_letters) for _ in range(n))
[ "Generate", "a", "random", "string", "from", "a", "-", "zA", "-", "Z", ":", "param", "n", ":", "length", "of", "the", "string", ":", "return", ":", "the", "random", "string" ]
valency/deeputils
python
https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L33-L39
[ "def", "random_letters", "(", "n", ")", ":", "return", "''", ".", "join", "(", "random", ".", "SystemRandom", "(", ")", ".", "choice", "(", "string", ".", "ascii_letters", ")", "for", "_", "in", "range", "(", "n", ")", ")" ]
27efd91668de0223ed8b07cfadf2151632521520
valid
random_numbers
Generate a random string from 0-9 :param n: length of the string :return: the random string
deeputils/common.py
def random_numbers(n): """ Generate a random string from 0-9 :param n: length of the string :return: the random string """ return ''.join(random.SystemRandom().choice(string.digits) for _ in range(n))
def random_numbers(n): """ Generate a random string from 0-9 :param n: length of the string :return: the random string """ return ''.join(random.SystemRandom().choice(string.digits) for _ in range(n))
[ "Generate", "a", "random", "string", "from", "0", "-", "9", ":", "param", "n", ":", "length", "of", "the", "string", ":", "return", ":", "the", "random", "string" ]
valency/deeputils
python
https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L42-L48
[ "def", "random_numbers", "(", "n", ")", ":", "return", "''", ".", "join", "(", "random", ".", "SystemRandom", "(", ")", ".", "choice", "(", "string", ".", "digits", ")", "for", "_", "in", "range", "(", "n", ")", ")" ]
27efd91668de0223ed8b07cfadf2151632521520
valid
dict_search
Search dictionary list by key and value :param d: dictionary list :param k: key :param v: value :return: the index of the first dictionary in the array with the specific key / value
deeputils/common.py
def dict_search(d, k, v): """ Search dictionary list by key and value :param d: dictionary list :param k: key :param v: value :return: the index of the first dictionary in the array with the specific key / value """ for i in range(len(d)): if d[i][k] == v: return i ...
def dict_search(d, k, v): """ Search dictionary list by key and value :param d: dictionary list :param k: key :param v: value :return: the index of the first dictionary in the array with the specific key / value """ for i in range(len(d)): if d[i][k] == v: return i ...
[ "Search", "dictionary", "list", "by", "key", "and", "value", ":", "param", "d", ":", "dictionary", "list", ":", "param", "k", ":", "key", ":", "param", "v", ":", "value", ":", "return", ":", "the", "index", "of", "the", "first", "dictionary", "in", "...
valency/deeputils
python
https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L51-L62
[ "def", "dict_search", "(", "d", ",", "k", ",", "v", ")", ":", "for", "i", "in", "range", "(", "len", "(", "d", ")", ")", ":", "if", "d", "[", "i", "]", "[", "k", "]", "==", "v", ":", "return", "i", "return", "None" ]
27efd91668de0223ed8b07cfadf2151632521520
valid
dict_merge
Merge two dictionary lists :param a: original list :param b: alternative list, element will replace the one in original list with same key :param k: key :return: the merged list
deeputils/common.py
def dict_merge(a, b, k): """ Merge two dictionary lists :param a: original list :param b: alternative list, element will replace the one in original list with same key :param k: key :return: the merged list """ c = a.copy() for j in range(len(b)): flag = False for i i...
def dict_merge(a, b, k): """ Merge two dictionary lists :param a: original list :param b: alternative list, element will replace the one in original list with same key :param k: key :return: the merged list """ c = a.copy() for j in range(len(b)): flag = False for i i...
[ "Merge", "two", "dictionary", "lists", ":", "param", "a", ":", "original", "list", ":", "param", "b", ":", "alternative", "list", "element", "will", "replace", "the", "one", "in", "original", "list", "with", "same", "key", ":", "param", "k", ":", "key", ...
valency/deeputils
python
https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L65-L82
[ "def", "dict_merge", "(", "a", ",", "b", ",", "k", ")", ":", "c", "=", "a", ".", "copy", "(", ")", "for", "j", "in", "range", "(", "len", "(", "b", ")", ")", ":", "flag", "=", "False", "for", "i", "in", "range", "(", "len", "(", "c", ")",...
27efd91668de0223ed8b07cfadf2151632521520
valid
dict_sort
Sort a dictionary list by key :param d: dictionary list :param k: key :return: sorted dictionary list
deeputils/common.py
def dict_sort(d, k): """ Sort a dictionary list by key :param d: dictionary list :param k: key :return: sorted dictionary list """ return sorted(d.copy(), key=lambda i: i[k])
def dict_sort(d, k): """ Sort a dictionary list by key :param d: dictionary list :param k: key :return: sorted dictionary list """ return sorted(d.copy(), key=lambda i: i[k])
[ "Sort", "a", "dictionary", "list", "by", "key", ":", "param", "d", ":", "dictionary", "list", ":", "param", "k", ":", "key", ":", "return", ":", "sorted", "dictionary", "list" ]
valency/deeputils
python
https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L85-L92
[ "def", "dict_sort", "(", "d", ",", "k", ")", ":", "return", "sorted", "(", "d", ".", "copy", "(", ")", ",", "key", "=", "lambda", "i", ":", "i", "[", "k", "]", ")" ]
27efd91668de0223ed8b07cfadf2151632521520
valid
dict_top
Return top n of a dictionary list sorted by key :param d: dictionary list :param k: key :param n: top n :param reverse: whether the value should be reversed :return: top n of the sorted dictionary list
deeputils/common.py
def dict_top(d, k, n, reverse=False): """ Return top n of a dictionary list sorted by key :param d: dictionary list :param k: key :param n: top n :param reverse: whether the value should be reversed :return: top n of the sorted dictionary list """ h = list() for i in range(len(d)...
def dict_top(d, k, n, reverse=False): """ Return top n of a dictionary list sorted by key :param d: dictionary list :param k: key :param n: top n :param reverse: whether the value should be reversed :return: top n of the sorted dictionary list """ h = list() for i in range(len(d)...
[ "Return", "top", "n", "of", "a", "dictionary", "list", "sorted", "by", "key", ":", "param", "d", ":", "dictionary", "list", ":", "param", "k", ":", "key", ":", "param", "n", ":", "top", "n", ":", "param", "reverse", ":", "whether", "the", "value", ...
valency/deeputils
python
https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L95-L111
[ "def", "dict_top", "(", "d", ",", "k", ",", "n", ",", "reverse", "=", "False", ")", ":", "h", "=", "list", "(", ")", "for", "i", "in", "range", "(", "len", "(", "d", ")", ")", ":", "heappush", "(", "h", ",", "(", "-", "d", "[", "i", "]", ...
27efd91668de0223ed8b07cfadf2151632521520
valid
dict_flatten
Replace nested dict keys to underscore-connected keys :param d: the dictionary :return: flattened dictionary
deeputils/common.py
def dict_flatten(d): """ Replace nested dict keys to underscore-connected keys :param d: the dictionary :return: flattened dictionary """ if type(d) != dict: return d else: dd = dict() for key, value in d.items(): if type(value) == dict: fo...
def dict_flatten(d): """ Replace nested dict keys to underscore-connected keys :param d: the dictionary :return: flattened dictionary """ if type(d) != dict: return d else: dd = dict() for key, value in d.items(): if type(value) == dict: fo...
[ "Replace", "nested", "dict", "keys", "to", "underscore", "-", "connected", "keys", ":", "param", "d", ":", "the", "dictionary", ":", "return", ":", "flattened", "dictionary" ]
valency/deeputils
python
https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L114-L130
[ "def", "dict_flatten", "(", "d", ")", ":", "if", "type", "(", "d", ")", "!=", "dict", ":", "return", "d", "else", ":", "dd", "=", "dict", "(", ")", "for", "key", ",", "value", "in", "d", ".", "items", "(", ")", ":", "if", "type", "(", "value"...
27efd91668de0223ed8b07cfadf2151632521520
valid
dict_format_type
Replace the values of a dict with certain type to other values :param d: the dictionary :param source: the source type, e.g., int :param formatter: the formatter method, e.g., return the string format of an int :param include_list: whether list should be formatted, otherwise list will be considered as s...
deeputils/common.py
def dict_format_type(d, source, formatter, include_list=True): """ Replace the values of a dict with certain type to other values :param d: the dictionary :param source: the source type, e.g., int :param formatter: the formatter method, e.g., return the string format of an int :param include_lis...
def dict_format_type(d, source, formatter, include_list=True): """ Replace the values of a dict with certain type to other values :param d: the dictionary :param source: the source type, e.g., int :param formatter: the formatter method, e.g., return the string format of an int :param include_lis...
[ "Replace", "the", "values", "of", "a", "dict", "with", "certain", "type", "to", "other", "values", ":", "param", "d", ":", "the", "dictionary", ":", "param", "source", ":", "the", "source", "type", "e", ".", "g", ".", "int", ":", "param", "formatter", ...
valency/deeputils
python
https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L133-L158
[ "def", "dict_format_type", "(", "d", ",", "source", ",", "formatter", ",", "include_list", "=", "True", ")", ":", "if", "not", "isinstance", "(", "d", ",", "dict", ")", ":", "if", "isinstance", "(", "d", ",", "source", ")", ":", "return", "formatter", ...
27efd91668de0223ed8b07cfadf2151632521520
valid
dict_remove_key
Recursively remove a key from a dict :param d: the dictionary :param k: key which should be removed :return: formatted dictionary
deeputils/common.py
def dict_remove_key(d, k): """ Recursively remove a key from a dict :param d: the dictionary :param k: key which should be removed :return: formatted dictionary """ dd = dict() for key, value in d.items(): if not key == k: if isinstance(value, dict): d...
def dict_remove_key(d, k): """ Recursively remove a key from a dict :param d: the dictionary :param k: key which should be removed :return: formatted dictionary """ dd = dict() for key, value in d.items(): if not key == k: if isinstance(value, dict): d...
[ "Recursively", "remove", "a", "key", "from", "a", "dict", ":", "param", "d", ":", "the", "dictionary", ":", "param", "k", ":", "key", "which", "should", "be", "removed", ":", "return", ":", "formatted", "dictionary" ]
valency/deeputils
python
https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L161-L177
[ "def", "dict_remove_key", "(", "d", ",", "k", ")", ":", "dd", "=", "dict", "(", ")", "for", "key", ",", "value", "in", "d", ".", "items", "(", ")", ":", "if", "not", "key", "==", "k", ":", "if", "isinstance", "(", "value", ",", "dict", ")", "...
27efd91668de0223ed8b07cfadf2151632521520
valid
dict_remove_value
Recursively remove keys with a certain value from a dict :param d: the dictionary :param v: value which should be removed :return: formatted dictionary
deeputils/common.py
def dict_remove_value(d, v): """ Recursively remove keys with a certain value from a dict :param d: the dictionary :param v: value which should be removed :return: formatted dictionary """ dd = dict() for key, value in d.items(): if not value == v: if isinstance(value...
def dict_remove_value(d, v): """ Recursively remove keys with a certain value from a dict :param d: the dictionary :param v: value which should be removed :return: formatted dictionary """ dd = dict() for key, value in d.items(): if not value == v: if isinstance(value...
[ "Recursively", "remove", "keys", "with", "a", "certain", "value", "from", "a", "dict", ":", "param", "d", ":", "the", "dictionary", ":", "param", "v", ":", "value", "which", "should", "be", "removed", ":", "return", ":", "formatted", "dictionary" ]
valency/deeputils
python
https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L180-L196
[ "def", "dict_remove_value", "(", "d", ",", "v", ")", ":", "dd", "=", "dict", "(", ")", "for", "key", ",", "value", "in", "d", ".", "items", "(", ")", ":", "if", "not", "value", "==", "v", ":", "if", "isinstance", "(", "value", ",", "dict", ")",...
27efd91668de0223ed8b07cfadf2151632521520