code: func (u HubUser) GetAvailableLicenses(ctx context.Context) ([]LicenseDisplay, error) {
  	subs, err := u.Client.ListSubscriptions(ctx, u.token, u.User.ID)
  	if err != nil {
  		return nil, err
  	}
  	for _, org := range u.Orgs {
  		orgSub, err := u.Client.ListSubscriptions(ctx, u.token, org.ID)
  		if err != nil {
  			return nil, err
  		}
  		subs = append(subs, orgSub...)
  	}
  
  	// Convert the SubscriptionDetails to a more user-friendly type to render in the CLI
  
  	res := []LicenseDisplay{}
  
  	// Filter out expired licenses
  	i := 0
  	for _, s := range subs {
  		if s.State == "active" && s.Expires != nil {
  			owner := ""
  			if s.DockerID == u.User.ID {
  				owner = u.User.Username
  			} else {
  				ownerOrg, err := u.GetOrgByID(s.DockerID)
  				if err == nil {
  					owner = ownerOrg.Orgname
  				} else {
  					owner = "unknown"
  					logrus.Debugf("Unable to lookup org ID %s: %s", s.DockerID, err)
  				}
  			}
  			comps := []string{}
  			for _, pc := range s.PricingComponents {
  				comps = append(comps, fmt.Sprintf("%s:%d", pc.Name, pc.Value))
  			}
  			res = append(res, LicenseDisplay{
  				Subscription:     *s,
  				Num:              i,
  				Owner:            owner,
  				ComponentsString: strings.Join(comps, ","),
  			})
  			i++
  		}
  	}
  
  	return res, nil
  }
docs: // GetAvailableLicenses finds all available licenses for a given account and their orgs