nodes: 0, module; 1, function_definition; 2, function_name:do_sort; 3, parameters; 4, block; 5, identifier:value; 6, default_parameter; 7, expression_statement; 8, if_statement; 9, return_statement; 10, identifier:case_sensitive; 11, False; 12, comment:"""Sort an iterable.  If the iterable is made of strings the second
      parameter can be used to control the case sensitiveness of the
      comparison which is disabled by default.
  
      .. sourcecode:: jinja
  
          {% for item in iterable|sort %}
              ...
          {% endfor %}
      """; 13, not_operator; 14, block; 15, else_clause; 16, call; 17, identifier:case_sensitive; 18, function_definition; 19, block; 20, identifier:sorted; 21, argument_list; 22, function_name:sort_func; 23, parameters; 24, block; 25, expression_statement; 26, identifier:seq; 27, keyword_argument; 28, identifier:item; 29, if_statement; 30, return_statement; 31, assignment; 32, identifier:key; 33, identifier:sort_func; 34, call; 35, block; 36, identifier:item; 37, identifier:sort_func; 38, None; 39, identifier:isinstance; 40, argument_list; 41, expression_statement; 42, identifier:item; 43, identifier:basestring; 44, assignment; 45, identifier:item; 46, call; 47, attribute; 48, argument_list; 49, identifier:item; 50, identifier:lower
code: def do_sort(value, case_sensitive=False):
      """Sort an iterable.  If the iterable is made of strings the second
      parameter can be used to control the case sensitiveness of the
      comparison which is disabled by default.
  
      .. sourcecode:: jinja
  
          {% for item in iterable|sort %}
              ...
          {% endfor %}
      """
      if not case_sensitive:
          def sort_func(item):
              if isinstance(item, basestring):
                  item = item.lower()
              return item
      else:
          sort_func = None
      return sorted(seq, key=sort_func)