当前位置: 首页>>代码示例>>Python>>正文


Python helpers.next函数代码示例

本文整理汇总了Python中nifty.environment.helpers.next函数的典型用法代码示例。如果您正苦于以下问题:Python next函数的具体用法?Python next怎么用?Python next使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了next函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: analyze_errorr_card_list

def analyze_errorr_card_list(module):
    card_iter = env.get_card_iterator(module)
    card_1, ngout = analyze_errorr_card_1(env.next(card_iter), module)
    card_2, ign = analyze_errorr_card_2(env.next(card_iter), module)
    # Card 3 should only be defined for ngout = 0.
    if ngout == 0:
        analyze_errorr_card_3(env.next(card_iter), module)
开发者ID:guminsun,项目名称:nifty,代码行数:7,代码来源:analyze_errorr.py

示例2: analyze_groupr_card_10

def analyze_groupr_card_10(card, module):
    rule.card_must_be_defined('card_10', card, module, None)
    stmt_iter = env.get_statement_iterator(card)
    order_map = groupr_settings.card_10_order_map
    rule.analyze_statement(order_map.get(0), env.next(stmt_iter), card, module)
    rule.no_statement_allowed(env.next(stmt_iter), card, module)
    return card
开发者ID:guminsun,项目名称:nifty,代码行数:7,代码来源:analyze_groupr.py

示例3: organize_card_list

def organize_card_list(card_list, module):
    card_iter = env.get_card_iterator(module)
    organize_card_1(env.next(card_iter), module)
    # Number of card_2's denotes the number of materials to process. Each
    # card_2 is assumed to have an accompanying card_3 and card_4 which
    # defines the temperatures and sigma zero values, respectively.
    number_of_card_2 = len(env.get_cards('card_2', module))
    # The last card 2 should not be considered as a next material to process,
    # since it is expected to terminate the execution of purr.
    # Therefore, 'number_of_card_2-1' is used to create the range to iterate
    # over.
    for c2 in range(number_of_card_2-1):
        card_2, ntemp, nsigz = organize_card_2(env.next(card_iter), module)
        # XXX: Assuming card 3 is only defined when there actually are temps
        # that should be defined.
        if ntemp > 0:
            organize_card_3(ntemp, env.next(card_iter), module)
        # XXX: Assuming card 4 is only defined when there actually are sigz
        # that should be defined.
        if nsigz > 0:
            organize_card_4(nsigz, env.next(card_iter), module)
    # The last card is expected to be a card 2 with matd = 0, to indicate
    # termination of purr.
    organize_card_2_stop(env.next(card_iter), module)
    return module
开发者ID:guminsun,项目名称:nifty,代码行数:25,代码来源:organize_purr.py

示例4: analyze_moder_card_list

def analyze_moder_card_list(module):
    card_iter = env.get_card_iterator(module)
    card_1, nin = analyze_moder_card_1(env.next(card_iter), module)
    # Card 2 and 3 should only be defined if abs(nin) is in the range [1,19].
    if abs(nin) in range(1,20):
        analyze_moder_card_2(env.next(card_iter), module)
        # The number of card 3's cannot be predicted, need to count 'em.
        number_of_card_3 = len(env.get_cards('card_3', module))
        # Need at least two card 3's? One to indicate the next material and
        # one to terminate the moder run.
        if number_of_card_3 < 2:
            rule.too_few_cards_defined(number_of_card_3, 2, 'card_3', module)
        # The last card 3 should not be considered as a next material to
        # process, since it is expected to terminate the execution of moder.
        # Therefore, 'number_of_card_3-1' is used to create the range to
        # iterate over.
        for c3 in range(number_of_card_3-1):
            analyze_moder_card_3(env.next(card_iter), module)
        # The last card is expected to be a card 3 with nin = 0, to indicate
        # termination of moder.
        analyze_moder_card_3_stop(env.next(card_iter), module)
    # No more cards are allowed. The next card returned by env.next(card_iter)
    # should be 'None'.
    rule.no_card_allowed(env.next(card_iter), module)
    return module
开发者ID:guminsun,项目名称:nifty,代码行数:25,代码来源:analyze_moder.py

示例5: analyze_thermr_card_list

def analyze_thermr_card_list(module):
    card_iter = env.get_card_iterator(module)
    analyze_thermr_card_1(env.next(card_iter), module)
    card_2, ntemp = analyze_thermr_card_2(env.next(card_iter), module)
    analyze_thermr_card_3(ntemp, env.next(card_iter), module)
    analyze_thermr_card_4(env.next(card_iter), module)
    rule.no_card_allowed(env.next(card_iter), module)
    return module
开发者ID:guminsun,项目名称:nifty,代码行数:8,代码来源:analyze_thermr.py

示例6: analyze_card_1

def analyze_card_1(card, module):
    rule.card_must_be_defined('card_1', card, module, None)
    stmt_iter = env.get_statement_iterator(card)
    order_map = unresr_settings.card_1_order_map
    for i in range(len(order_map)):
        rule.analyze_statement(order_map.get(i), env.next(stmt_iter), card, module)
    rule.no_statement_allowed(env.next(stmt_iter), card, module)
    return card
开发者ID:guminsun,项目名称:nifty,代码行数:8,代码来源:analyze_unresr.py

示例7: analyze_card_7

def analyze_card_7(card, module):
    rule.card_must_be_defined('card_7', card, module, None)
    stmt_iter = env.get_statement_iterator(card)
    order_map = gaminr_settings.card_7_order_map
    rule.analyze_statement(order_map.get(0), env.next(stmt_iter), card, module)
    rule.no_statement_allowed(env.next(stmt_iter), card, module)
    matd = env.get_identifier_value('matd', order_map, card)
    return card, matd
开发者ID:guminsun,项目名称:nifty,代码行数:8,代码来源:analyze_gaminr.py

示例8: analyze_plotr_card_1

def analyze_plotr_card_1(card, module):
    rule.card_must_be_defined('card_1', card, module, None)
    stmt_iter = env.get_statement_iterator(card)
    order_map = plotr_settings.card_1_order_map
    for i in range(len(order_map)):
        rule.analyze_statement(order_map.get(i), env.next(stmt_iter), card, module)
    rule.no_statement_allowed(env.next(stmt_iter), card, module)
    lori = env.get_identifier_value('lori', order_map, card)
    return card, lori
开发者ID:guminsun,项目名称:nifty,代码行数:9,代码来源:analyze_plotr.py

示例9: analyze_reconr_card_4

def analyze_reconr_card_4(card, module):
    msg = ('\'card_4\' must be defined for each material desired (card 3)')
    rule.card_must_be_defined('card_4', card, module, msg)
    stmt_iter = env.get_statement_iterator(card)
    order_map = reconr_settings.card_4_order_map
    for i in range(len(order_map)):
        rule.analyze_statement(order_map.get(i), env.next(stmt_iter), card, module)
    rule.no_statement_allowed(env.next(stmt_iter), card, module)
    return card
开发者ID:guminsun,项目名称:nifty,代码行数:9,代码来源:analyze_reconr.py

示例10: analyze_errorr_card_2

def analyze_errorr_card_2(card, module):
    rule.card_must_be_defined('card_2', card, module, None)
    stmt_iter = env.get_statement_iterator(card)
    order_map = errorr_settings.card_2_order_map
    for i in range(len(order_map)):
        rule.analyze_statement(order_map.get(i), env.next(stmt_iter), card, module)
    rule.no_statement_allowed(env.next(stmt_iter), card, module)
    ign = env.get_identifier_value('ign', order_map, card)
    return card, ign
开发者ID:guminsun,项目名称:nifty,代码行数:9,代码来源:analyze_errorr.py

示例11: analyze_covr_card_3c

def analyze_covr_card_3c(card, module):
    msg = ('expected \'card_3c\' since nout > 0 in \'card_1\'.')
    rule.card_must_be_defined('card_3c', card, module, msg)
    stmt_iter = env.get_statement_iterator(card)
    order_map = covr_settings.card_3c_order_map
    for i in range(len(order_map)):
        rule.analyze_statement(order_map.get(i), env.next(stmt_iter), card, module)
    rule.no_statement_allowed(env.next(stmt_iter), card, module)
    return card
开发者ID:guminsun,项目名称:nifty,代码行数:9,代码来源:analyze_covr.py

示例12: analyze_plotr_card_10

def analyze_plotr_card_10(card, module):
    # XXX: Provide a descriptive message of why card 10 should be supplied.
    rule.card_must_be_defined('card_10', card, module, None)
    stmt_iter = env.get_statement_iterator(card)
    order_map = plotr_settings.card_10_order_map
    for i in range(len(order_map)):
        rule.analyze_statement(order_map.get(i), env.next(stmt_iter), card, module)
    rule.no_statement_allowed(env.next(stmt_iter), card, module)
    return card
开发者ID:guminsun,项目名称:nifty,代码行数:9,代码来源:analyze_plotr.py

示例13: analyze_reconr_card_3

def analyze_reconr_card_3(card, module):
    rule.card_must_be_defined('card_3', card, module, None)
    stmt_iter = env.get_statement_iterator(card)
    order_map = reconr_settings.card_3_order_map
    for i in range(len(order_map)):
        rule.analyze_statement(order_map.get(i), env.next(stmt_iter), card, module)
    rule.no_statement_allowed(env.next(stmt_iter), card, module)
    ncards = env.get_identifier_value('ncards', order_map, card)
    ngrid = env.get_identifier_value('ngrid', order_map, card)
    return card, ncards, ngrid
开发者ID:guminsun,项目名称:nifty,代码行数:10,代码来源:analyze_reconr.py

示例14: analyze_reconr_card_6

def analyze_reconr_card_6(ngrid, card, module):
    msg = ('expected ' + str(ngrid) + ' \'card_6\'s, since ' +
           'ngrid = ' + str(ngrid) + ' in the current \'card_3\'.')
    rule.card_must_be_defined('card_6', card, module, msg)
    stmt_iter = env.get_statement_iterator(card)
    order_map = reconr_settings.card_6_order_map
    for i in range(len(order_map)):
        rule.analyze_statement(order_map.get(i), env.next(stmt_iter), card, module)
    rule.no_statement_allowed(env.next(stmt_iter), card, module)
    return card
开发者ID:guminsun,项目名称:nifty,代码行数:10,代码来源:analyze_reconr.py

示例15: analyze_moder_card_3

def analyze_moder_card_3(card, module):
    msg = ('expected \'card_3\' since the absolute value of the input unit ' +
           '(\'nin\') is in the range [1,19] in \'card_1\'.')
    rule.card_must_be_defined('card_3', card, module, msg)
    stmt_iter = env.get_statement_iterator(card)
    order_map = moder_settings.card_3_order_map
    for i in range(len(order_map)):
        rule.analyze_statement(order_map.get(i), env.next(stmt_iter), card, module)
    rule.no_statement_allowed(env.next(stmt_iter), card, module)
    return card
开发者ID:guminsun,项目名称:nifty,代码行数:10,代码来源:analyze_moder.py


注:本文中的nifty.environment.helpers.next函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。