code: def get_tags():
      
      tags = getattr(flask.g, 'bukudb', get_bukudb()).get_tag_all()
      result = {
          'tags': tags[0]
      }
      if request.path.startswith('/api/'):
          res = jsonify(result)
      else:
          res = render_template('bukuserver/tags.html', result=result)
      return res
docs: get tags.