You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: helper.go
    path of file: ./repos/evcc/vehicle/tesla
    
    the code of the file until where you have to start completion: package tesla

import (
	"errors"
	"strings"
	"sync"

	"github.com/evcc-io/evcc/api"
	"github.com/teslamotors/vehicle-command/pkg/connector/inet"
)

var (
	mu         sync.Mutex
	identities = make(map[string]*Identity)
)

func getInstance(subject string) *Identity {
	return identi
    
func apiError(err error) error {
	if err != nil && (errors.Is(err, inet.ErrVehicleNotAwake) ||
		strings.HasSuffix(err.Error(), "408 Request Timeout") || strings.HasSuffix(err.Error(), "408 (Request Timeout)") ||
		strings.HasSuffix(err.Error(), "vehicle is offline or asleep")) {
		err = api.ErrAsleep
	}
	return err
}