code: func NewFlaskServer(apiDef *raml.APIDefinition, apiDocsDir, targetDir string,
  	withMain bool, libRootURLs []string, gevent bool) *FlaskServer {
  
  	// TODO : get rid of this global variables
  	globAPIDef = apiDef
  	globLibRootURLs = libRootURLs
  
  	// generates resource
  	var prs []pythonResource
  	for _, rd := range getServerResourcesDefs(apiDef) {
  		pr := newResource(rd, apiDef, serverKindFlask)
  		prs = append(prs, pr)
  	}
  
  	templates := templates(serverKindFlask)
  
  	return &FlaskServer{
  		APIDef:       apiDef,
  		Title:        apiDef.Title,
  		apiDocsDir:   apiDocsDir,
  		WithMain:     withMain,
  		ResourcesDef: prs,
  		Gevent:       gevent,
  		Template:     templates,
  		targetDir:    targetDir,
  	}
  }
docs: // NewFlaskServer creates new flask server from an RAML file