code: func (pc *class) generate(dir, template, name string) ([]string, error) {
  	fileName := filepath.Join(dir, pc.Name()+".py")
  
  	if pc.AliasOf != "" {
  		return []string{pc.Name()}, commons.GenerateFile(pc, "./templates/python/class_alias.tmpl",
  			"class_alias", fileName, true)
  	}
  
  	// generate enums
  	typeNames := make([]string, 0)
  	for _, f := range pc.Fields {
  		if f.Enum != nil {
  			typeNames = append(typeNames, f.Enum.Name)
  			if err := f.Enum.generate(dir); err != nil {
  				return typeNames, err
  			}
  		}
  	}
  
  	if pc.Enum != nil {
  		typeNames = append(typeNames, pc.Enum.Name)
  		return typeNames, pc.Enum.generate(dir)
  	}
  
  	typeNames = append(typeNames, pc.Name())
  	return typeNames, commons.GenerateFile(pc, template, name, fileName, true)
  }
docs: // generate a python class file