Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(19)  |  Call(11)  |  Derive(0)  |  Import(8)
Helper function that merges nested statement sequences. 

        def mergeStatements(statements):
    """ Helper function that merges nested statement sequences. """
    merged_statements = []

    for statement in statements:
        if statement.isStatement() or statement.isStatementsFrame():
            merged_statements.append(statement)
        elif statement.isStatementsSequence():
            merged_statements.extend(mergeStatements(statement.getStatements()))
        else:
            assert False, statement

    return merged_statements
        


src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationTryFinallyStatements.py   Nuitka(Download)
from nuitka.nodes.TryNodes import StatementTryFinally
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeStatementsSequenceOrStatement,
 
        tried = StatementsSequence(
            statements = mergeStatements(statements, allow_none = True),
            source_ref = source_ref
        )
        final = StatementsSequence(
            statements = mergeStatements(
                (
                    prelude,
                    StatementTryFinally(

src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationTryExceptStatements.py   Nuitka(Download)
 
 
from .Helpers import(
    makeStatementsSequenceFromStatement,
    makeStatementsSequence,
 
    statements = mergeStatements(
        (
            StatementAssignmentVariable(
                variable_ref = ExpressionTargetTempVariableRef(

src/n/u/Nuitka-0.5.1.5/nuitka/tree/Building.py   Nuitka(Download)
 
# Some helpers.
from .Helpers import (
    makeStatementsSequenceOrStatement,
    makeSequenceCreationOrConstant,
        tried      = StatementsSequence(
            statements = mergeStatements(
                (
                    buildTryExceptionNode(
                        provider   = provider,

src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationContractionExpressions.py   Nuitka(Download)
from .ReformulationBooleanExpressions import buildAndNode
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    mergeStatements,
            StatementLoop(
                body       = StatementsSequence(
                    statements = mergeStatements(loop_statements),
                    source_ref = source_ref
                ),
 
 
    statements = mergeStatements(statements)
 
    if emit_class is ExpressionYield:

src/n/u/Nuitka-HEAD/nuitka/tree/Building.py   Nuitka(Download)
 
# Some helpers.
from .Helpers import (
    makeStatementsSequenceOrStatement,
    makeSequenceCreationOrConstant,
        build_tried = lambda : StatementsSequence(
            statements = mergeStatements(
                (
                    buildTryExceptionNode(
                        provider   = provider,

src/n/u/Nuitka-0.5.1.5/nuitka/tree/ReformulationContractionExpressions.py   Nuitka(Download)
from .ReformulationBooleanExpressions import buildAndNode
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    mergeStatements,
            StatementLoop(
                body       = StatementsSequence(
                    statements = mergeStatements(loop_statements),
                    source_ref = source_ref
                ),
    function_body.setBody(
        StatementsFrame(
            statements    = mergeStatements(statements),
            guard_mode    = "pass_through"
                              if emit_class is not ExpressionYield else

src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationLambdaExpressions.py   Nuitka(Download)
)
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    mergeStatements,
    body = StatementsFrame(
        statements    = mergeStatements(
            (body,)
        ),
        guard_mode    = "generator" if function_body.isGenerator() else "full",

src/n/u/Nuitka-0.5.1.5/nuitka/tree/ReformulationLambdaExpressions.py   Nuitka(Download)
)
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    mergeStatements,
    body = StatementsFrame(
        statements    = mergeStatements(
            (body,)
        ),
        guard_mode    = "generator" if function_body.isGenerator() else "full",