code: def count_newlines(value):
      """Count the number of newline characters in the string.  This is
      useful for extensions that filter a stream.
      """
      return len(newline_re.findall(value))
  
imports: import re
  from ast import literal_eval
  from collections import deque
  from operator import itemgetter
  from ._compat import implements_iterator
  from ._compat import intern
  from ._compat import iteritems
  from ._compat import text_type
  from .exceptions import TemplateSyntaxError
  from .utils import LRUCache
label_desc: Use image node_id 4 for calling a global function with example usage: count_newlines(value) and returns: len