本文整理汇总了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)
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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