code: def split_template_path(template):
      """Split a path into segments and perform a sanity check.  If it detects
      '..' in the path it will raise a `TemplateNotFound` error.
      """
      pieces = []
      for piece in template.split("/"):
          if (
              path.sep in piece
              or (path.altsep and path.altsep in piece)
              or piece == path.pardir
          ):
              raise TemplateNotFound(template)
          elif piece and piece != ".":
              pieces.append(piece)
      return pieces
  
imports: import os
  import sys
  import weakref
  from hashlib import sha1
  from os import path
  from types import ModuleType
  from ._compat import abc
  from ._compat import fspath
  from ._compat import iteritems
  from ._compat import string_types
  from .exceptions import TemplateNotFound
  from .utils import internalcode
  from .utils import open_if_exists
label_desc: Use image node_id 1 for calling a global function with example usage: split_template_path(template) and returns: pieces