pymc4/ast_compiler.py
def parse_snippet(source, filename, mode, flags, firstlineno, privateprefix_ignored=None):
    """Like ast.parse, but accepts indented code snippet with a line number offset."""
    args = filename, mode, flags | ast.PyCF_ONLY_AST, True
    prefix = "\n"
    try:
        a = compile(prefix + source, *args)
    except IndentationError:
        # Already indented? Wrap with dummy compound statement
        prefix = "with 0:\n"
        a = compile(prefix + source, *args)
        # peel wrapper
        a.body = a.body[0].body
    ast.increment_lineno(a, firstlineno - 2)
    return a
Like ast.parse, but accepts indented code snippet with a line number offset.
Like ast.parse, but accepts indented code snippet with a line number offset.
Like ast . parse but accepts indented code snippet with a line number offset .
def parse_snippet(source, filename, mode, flags, firstlineno, privateprefix_ignored=None):
    args = filename, mode, flags | ast.PyCF_ONLY_AST, True
    prefix = "\n"
    try:
        a = compile(prefix + source, *args)
    except IndentationError:
        prefix = "with 0:\n"
        a = compile(prefix + source, *args)
        a.body = a.body[0].body
    ast.increment_lineno(a, firstlineno - 2)
    return a
def parse_snippet ( source , filename , mode , flags , firstlineno , privateprefix_ignored = None ) : args = filename , mode , flags | ast . PyCF_ONLY_AST , True prefix = "\n" try : a = compile ( prefix + source , * args ) except IndentationError : prefix = "with 0:\n" a = compile ( prefix + source , * args ) a . body = a . body [ 0 ] . body ast . increment_lineno ( a , firstlineno - 2 ) return a
Like ast.parse, but accepts indented code snippet with a line number offset.
Like ast . parse but accepts indented code snippet with a line number offset .
"""Like ast.parse, but accepts indented code snippet with a line number offset.""" # Already indented? Wrap with dummy compound statement # peel wrapper
source
filename
mode
flags
firstlineno
privateprefix_ignored