code: def view(db_name):
      
      def decorator(func):
          v = View(db_name, func)
          v.register()
          return v
      return decorator
docs: Register a map function as a view
  
      Currently, only a single map function can be created for each view
  
      NOTE: the map function source is saved in CouchDB, so it cannot depend on
      anything outside the function's scope.
  
      :param db_name: the database name