parameters: (template)
return_statement: return pieces
docstring: Split a path into segments and perform a sanity check.  If it detects
      '..' in the path it will raise a `TemplateNotFound` error.
docstring_summary: Split a path into segments and perform a sanity check.  If it detects
      '..' in the path it will raise a `TemplateNotFound` error.
docstring_tokens: Split a path into segments and perform a sanity check . If it detects .. in the path it will raise a TemplateNotFound error .
function: 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
function_tokens: def split_template_path ( template ) : 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