def flatten_const_node_list(environment, node_list):
 output = []
 eval_ctx = EvalContext(environment)
 for node in node_list:
  if isinstance(node, Output):
   for node in node.nodes:
    try:
     const = node.as_const(eval_ctx=eval_ctx)
     if (not isinstance(const, six.text_type)):
      raise Unflattenable(const)
     output.append(const)
    except Impossible:
     raise Unflattenable(node)
  else:
   raise Unflattenable(node)
 return u''.join(output)

def flatten_const_node_list ( environment , node_list ) : output = [ ] eval_ctx = EvalContext ( environment ) for node in node_list : if isinstance ( node , Output ) : for node in node . nodes : try : const = node . as_const ( eval_ctx = eval_ctx ) if ( not isinstance ( const , six . text_type ) ) : raise Unflattenable ( const ) output . append ( const ) except Impossible : raise Unflattenable ( node ) else : raise Unflattenable ( node ) return u'' . join ( output )
try to flatten the given node list into a single string .