code: func (r RoleMap) Map(remoteRoles []string) ([]string, error) {
  	_, err := r.parse()
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  	var outRoles []string
  	// when no remote roles is specified, assume that
  	// there is a single empty remote role (that should match wildcards)
  	if len(remoteRoles) == 0 {
  		remoteRoles = []string{""}
  	}
  	for _, mapping := range r {
  		expression := mapping.Remote
  		for _, remoteRole := range remoteRoles {
  			// never map default implicit role, it is always
  			// added by default
  			if remoteRole == teleport.DefaultImplicitRole {
  				continue
  			}
  			for _, replacementRole := range mapping.Local {
  				replacement, err := utils.ReplaceRegexp(expression, replacementRole, remoteRole)
  				switch {
  				case err == nil:
  					// empty replacement can occur when $2 expand refers
  					// to non-existing capture group in match expression
  					if replacement != "" {
  						outRoles = append(outRoles, replacement)
  					}
  				case trace.IsNotFound(err):
  					continue
  				default:
  					return nil, trace.Wrap(err)
  				}
  			}
  		}
  	}
  	return outRoles, nil
  }
docs: // Map maps local roles to remote roles