code: func (c Client) Generate(dir string) error {
  	globAPIDef = c.APIDef
  
  	// generate helper
  	if err := commons.GenerateFile(nil, "./templates/python/client_utils_python.tmpl", "client_utils_python", filepath.Join(dir, "client_utils.py"), true); err != nil {
  		return err
  	}
  
  	// generate http client
  	if err := commons.GenerateFile(nil, c.Template.httpClientFile, c.Template.httpClientName, filepath.Join(dir, "http_client.py"), true); err != nil {
  		return err
  	}
  
  	if err := c.generateServices(dir); err != nil {
  		return err
  	}
  
  	if err := c.generateSecurity(dir); err != nil {
  		return err
  	}
  
  	// python classes
  	classes, err := GenerateAllClasses(c.APIDef, dir, false)
  	if err != nil {
  		return err
  	}
  
  	// helper for python classes
  	if err := commons.GenerateFile(nil, "./templates/python/client_support.tmpl",
  		"client_support", filepath.Join(dir, "client_support.py"), true); err != nil {
  		return err
  	}
  
  	if c.UnmarshallResponse {
  		if err := commons.GenerateFile(nil, "./templates/python/unmarshall_error.tmpl",
  			"unmarshall_error", filepath.Join(dir, "unmarshall_error.py"), true); err != nil {
  			return err
  		}
  		if err := commons.GenerateFile(nil, "./templates/python/unhandled_api_error.tmpl",
  			"unhandled_api_error", filepath.Join(dir, "unhandled_api_error.py"), true); err != nil {
  			return err
  		}
  	}
  
  	sort.Strings(classes)
  	c.Classes = classes
  	return commons.GenerateFile(c, c.Template.initFile, c.Template.initName, filepath.Join(dir, "__init__.py"), true)
  }
docs: // Generate generates python client library files