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

All Samples(49)  |  Call(36)  |  Derive(0)  |  Import(13)

        def buildStatementsNode(provider, nodes, source_ref, frame = False):
    # We are not creating empty statement sequences.
    if nodes is None:
        return None

    # Build as list of statements, throw away empty ones, and remove useless
    # nesting.
    statements = buildNodeList(provider, nodes, source_ref, allow_none = True)
    statements = mergeStatements(statements)

    # We are not creating empty statement sequences. Might be empty, because
    # e.g. a global node generates not really a statement, or pass statements.
    if not statements:
        return None

    # In case of a frame is desired, build it instead.
    if frame:
        if provider.isExpressionFunctionBody():
            parameters = provider.getParameters()

            arg_names     = parameters.getCoArgNames()
            kw_only_count = parameters.getKwOnlyParameterCount()
            code_name     = provider.getFunctionName()
            guard_mode    = "generator" if provider.isGenerator() else "full"
            has_starlist  = parameters.getStarListArgumentName() is not None
            has_stardict  = parameters.getStarDictArgumentName() is not None

            return StatementsFrame(
                statements    = statements,
                guard_mode    = guard_mode,
                var_names     = arg_names,
                arg_count     = len( arg_names ),
                kw_only_count = kw_only_count,
                code_name     = code_name,
                has_starlist  = has_starlist,
                has_stardict  = has_stardict,
                source_ref    = source_ref
            )
        else:
            return makeModuleFrame(
                module     = provider,
                statements = statements,
                source_ref = source_ref
            )
    else:
        return StatementsSequence(
            statements = statements,
            source_ref = source_ref
        )
        


src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationFunctionStatements.py   Nuitka(Download)
from nuitka.nodes.AssignNodes import StatementAssignmentVariable
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeDictCreationOrConstant,
 
    function_statements_body = buildStatementsNode(
        provider   = function_body,
        nodes      = function_statements,
        frame      = True,

src/n/u/Nuitka-0.5.1.5/nuitka/tree/ReformulationFunctionStatements.py   Nuitka(Download)
from nuitka.nodes.AssignNodes import StatementAssignmentVariable
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeDictCreationOrConstant,
 
    function_statements_body = buildStatementsNode(
        provider   = function_body,
        nodes      = function_statements,
        frame      = True,

src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationClasses.py   Nuitka(Download)
from nuitka.nodes.ParameterSpecs import ParameterSpec
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeSequenceCreationOrConstant,
 
    body = buildStatementsNode(
        provider   = class_creation_function,
        nodes      = class_statements,
        frame      = True,
 
    body = buildStatementsNode(
        provider   = function_body,
        nodes      = class_statements,
        frame      = True,

src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationTryFinallyStatements.py   Nuitka(Download)
from nuitka.nodes.TryNodes import StatementTryFinally
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeStatementsSequenceOrStatement,
        pushBuildContext("finally")
        final = buildStatementsNode(
            provider   = provider,
            nodes      = node.finalbody,
            source_ref = source_ref
        pushBuildContext("finally")
        final = buildStatementsNode(
            provider   = provider,
            nodes      = node.finalbody,
            source_ref = source_ref

src/n/u/Nuitka-0.5.1.5/nuitka/tree/ReformulationClasses.py   Nuitka(Download)
from nuitka.nodes.ParameterSpecs import ParameterSpec
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeSequenceCreationOrConstant,
 
    body = buildStatementsNode(
        provider   = class_creation_function,
        nodes      = class_statements,
        frame      = True,
 
    body = buildStatementsNode(
        provider   = function_body,
        nodes      = class_statements,
        frame      = True,

src/n/u/Nuitka-0.5.1.5/nuitka/tree/Building.py   Nuitka(Download)
 
# Some helpers.
from .Helpers import (
    makeStatementsSequenceOrStatement,
    makeSequenceCreationOrConstant,
        condition  = buildNode( provider, node.test, source_ref ),
        yes_branch = buildStatementsNode(
            provider   = provider,
            nodes      = node.body,
            source_ref = source_ref
        ),
        no_branch  = buildStatementsNode(
            provider   = provider,
    return StatementTryFinally(
        tried      = buildStatementsNode(
            provider   = provider,
            nodes      = node.body,
            source_ref = source_ref
        ),
        final      = buildStatementsNode(
            provider   = provider,

src/n/u/Nuitka-HEAD/nuitka/tree/Building.py   Nuitka(Download)
 
# Some helpers.
from .Helpers import (
    makeStatementsSequenceOrStatement,
    makeSequenceCreationOrConstant,
        condition  = buildNode( provider, node.test, source_ref ),
        yes_branch = buildStatementsNode(
            provider   = provider,
            nodes      = node.body,
            source_ref = source_ref
        ),
        no_branch  = buildStatementsNode(
            provider   = provider,
        provider    = provider,
        build_tried = lambda : buildStatementsNode(
            provider   = provider,
            nodes      = node.body,
            source_ref = source_ref
 
    result = buildStatementsNode(
        provider   = provider,
        nodes      = body,
        source_ref = source_ref

src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationLoopStatements.py   Nuitka(Download)
)
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeStatementsSequence,
 
    else_block = buildStatementsNode(
        provider   = provider,
        nodes      = node.orelse if node.orelse else None,
        source_ref = source_ref
    statements += (
        buildStatementsNode(
            provider   = provider,
            nodes      = node.body,
            source_ref = source_ref
 
    else_block = buildStatementsNode(
        provider   = provider,
        nodes      = node.orelse if node.orelse else None,
        source_ref = source_ref
    pushIndicatorVariable(None)
    loop_statements = buildStatementsNode(
        provider   = provider,
        nodes      = node.body,
        source_ref = source_ref

src/n/u/Nuitka-0.5.1.5/nuitka/tree/ReformulationLoopStatements.py   Nuitka(Download)
)
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeStatementsSequence,
 
    else_block = buildStatementsNode(
        provider   = provider,
        nodes      = node.orelse if node.orelse else None,
        source_ref = source_ref
    statements += (
        buildStatementsNode(
            provider   = provider,
            nodes      = node.body,
            source_ref = source_ref
 
    else_block = buildStatementsNode(
        provider   = provider,
        nodes      = node.orelse if node.orelse else None,
        source_ref = source_ref
            ),
            buildStatementsNode(
                provider   = provider,
                nodes      = node.body,
                source_ref = source_ref

src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationTryExceptStatements.py   Nuitka(Download)
 
 
from .Helpers import(
    makeStatementsSequenceFromStatement,
    makeStatementsSequence,
 
    tried = buildStatementsNode(
        provider   = provider,
        nodes      = node.body,
        source_ref = source_ref
            statements = [
                buildStatementsNode(
                    provider   = provider,
                    nodes      = exception_block,
                    source_ref = source_ref
                ),
                buildStatementsNode(
                    provider   = provider,
                    nodes      = exception_block,
                    source_ref = source_ref
                StatementTryFinally(
                    tried      = buildStatementsNode(
                        provider   = provider,
                        nodes      = exception_block,
                        source_ref = source_ref

  1 | 2  Next