def FormatFlowConstruct(self, line_elts, body_block, expr_or_assign,
                          force_brace=None):
    force_brace = force_brace or _options.force_brace
    line_block = LB(self.prefix_as_list + line_elts)
    if force_brace or expr_or_assign.expr2.HasType('Brace'):
      if expr_or_assign.expr2.HasType('Brace'):
        lbrace, exprlist, rbrace = self.FormatFields(expr_or_assign.expr2)
      else:
        lbrace, exprlist, rbrace = (TB('{'), [body_block], TB('}'))
      l_body = IB(SB(exprlist)) if len(exprlist) else MTTB
      # A fixed layout with braces.
      return SB([LB([line_block, TBSP, lbrace]), l_body, rbrace],
                break_mult=_options.adj_flow)
    else:
      # Choice of either a single line layout, or a stacked one.
      return CB([LB([line_block, TBSP, body_block]),
                 SB([line_block, IB(body_block)],
                    break_mult=_options.adj_flow)])
Format a flow control construct, such as a for loop, etc.
dataset/ETHPy150Open google/rfmt/formatter/default_format_policy.py/DefaultFormatPolicy.FormatFlowConstruct