original_docstring: 
      A filter that batches items. It works pretty much like `slice`
      just the other way round. It returns a list of lists with the
      given number of items. If you provide a second parameter this
      is used to fill missing items. See this example:
  
      .. sourcecode:: html+jinja
  
          <table>
          {%- for row in items|batch(3, '&nbsp;') %}
            <tr>
            {%- for column in row %}
              <tr>{{ column }}</td>
            {%- endfor %}
            </tr>
          {%- endfor %}
          </table>
  
      *new in Jinja 1.1*
      
docstring: A filter that batches items. It works pretty much like `slice`
  just the other way round. It returns a list of lists with the
  given number of items. If you provide a second parameter this
  is used to fill missing items. See this example.
  
  : html+jinja
  
  
  
  
docstring_tokens: A filter that batches items . It works pretty much like ` slice ` just the other way round . It returns a list of lists with the given number of items . If you provide a second parameter this is used to fill missing items . See this example . : html + jinja
code: def do_batch(linecount, fill_with=None):
      """
      A filter that batches items. It works pretty much like `slice`
      just the other way round. It returns a list of lists with the
      given number of items. If you provide a second parameter this
      is used to fill missing items. See this example:
  
      .. sourcecode:: html+jinja
  
          <table>
          {%- for row in items|batch(3, '&nbsp;') %}
            <tr>
            {%- for column in row %}
              <tr>{{ column }}</td>
            {%- endfor %}
            </tr>
          {%- endfor %}
          </table>
  
      *new in Jinja 1.1*
      """
      def wrapped(env, context, value):
          result = []
          tmp = []
          for item in value:
              if len(tmp) == linecount:
                  result.append(tmp)
                  tmp = []
              tmp.append(item)
          if tmp:
              if fill_with is not None and len(tmp) < linecount:
                  tmp += [fill_with] * (linecount - len(tmp))
              result.append(tmp)
          return result
      return wrapped
code_tokens: def do_batch ( linecount , fill_with = None ) : def wrapped ( env , context , value ) : result = [ ] tmp = [ ] for item in value : if len ( tmp ) == linecount : result . append ( tmp ) tmp = [ ] tmp . append ( item ) if tmp : if fill_with is not None and len ( tmp ) < linecount : tmp += [ fill_with ] * ( linecount - len ( tmp ) ) result . append ( tmp ) return result return wrapped
short_docstring: A filter that batches items.
short_docstring_tokens: A filter that batches items .
comment: """
      A filter that batches items. It works pretty much like `slice`
      just the other way round. It returns a list of lists with the
      given number of items. If you provide a second parameter this
      is used to fill missing items. See this example:
  
      .. sourcecode:: html+jinja
  
          <table>
          {%- for row in items|batch(3, '&nbsp;') %}
            <tr>
            {%- for column in row %}
              <tr>{{ column }}</td>
            {%- endfor %}
            </tr>
          {%- endfor %}
          </table>
  
      *new in Jinja 1.1*
      """