def setup(template_paths={}, autoescape=False, cache_size=100, auto_reload=True, bytecode_cache=True):
  """Setup Jinja enviroment
  
  eg. sketch.jinja.setup({
      'app': self.config.paths['app_template_basedir'],
      'sketch': self.config.paths['sketch_template_dir'],
    })
  
  :param template_paths: Dictionary of paths to templates (template_name => template_path)
  :param autoescape: Autoescape
  :param cache_size:
  :param auto_reload:
  :param bytecode_cache: 
  """
  global _jinja_env, _jinja_loaders
  
  if not _jinja_env:
    _jinja_env = JinjaEnviroment(
      autoescape=autoescape,
      cache_size=cache_size,
      auto_reload=auto_reload,
      bytecode_cache=None)

  # @TODO alter so Marshall is not used
  # if bytecode_cache and GAE_CACHE:
    # _jinja_env.bytecode_cache = GAEMemcacheBytecodeCache()

  if type(template_paths) == type(''):
    template_paths = {'site': template_paths}
  
  if len(template_paths) < 1:
    logging.exception('Sketch: jinja.setup: no template sets configured')
    return False

  if len(template_paths) == 1:
    template_set_name = template_paths.keys()[0]
    tp = template_paths[template_set_name]
    if tp in _jinja_loaders:
      _jinja_env.loader = _jinja_loaders[tp]
    else:
      _jinja_env.loader = _jinja_loaders[tp] = jinja2.FileSystemLoader(tp)
    return True
      
  if len(template_paths) > 1:
    loaders = {}
    for dirn, path in template_paths.items():
      loaders[dirn] = jinja2.FileSystemLoader(path)
    _jinja_env.loader = SubdirLoader(loaders)
    return True
  logging.error('Sketch: jinja.setup: no template sets configured (fallthrough)')
  logging.error(_jinja_loaders)
dataset/ETHPy150Open nikcub/floyd/floyd/templating/jinja.py/setup/original