// IsSpecificRPCError checks whether the given error is a wamp RPC error witch the expected error URI
773346
func IsSpecificRPCError(err error, uri wamp.URI) bool {
	rpc, ok := err.(client.RPCError)
	return ok && rpc.Err.Error == uri
}
1342857
func IsEventError(err error) bool {
	switch err.(type) {
	case ErrInvalidFilterName, *ErrInvalidFilterName:
		return true
	case ErrFilterNamePrefix, *ErrFilterNamePrefix:
		return true
	case ErrFilterNameSuffix, *ErrFilterNameSuffix:
		return true
	case ErrInvalidFilterValue, *ErrInvalidFilterValue:
		return true
	case ErrDuplicateEventName, *ErrDuplicateEventName:
		return true
	case ErrUnsupportedConfiguration, *ErrUnsupportedConfiguration:
		return true
	case ErrDuplicateQueueConfiguration, *ErrDuplicateQueueConfiguration:
		return true
	case ErrUnknownRegion, *ErrUnknownRegion:
		return true
	case ErrARNNotFound, *ErrARNNotFound:
		return true
	case ErrInvalidARN, *ErrInvalidARN:
		return true
	case ErrInvalidEventName, *ErrInvalidEventName:
		return true
	}

	return false
}
123681
func IsXCF(src *sdl.RWops) bool {
	_src := (*C.SDL_RWops)(unsafe.Pointer(src))
	return int(C.IMG_isXCF(_src)) > 0
}
600844
func IsSpecificServiceAccount(ctx context.Context, names ...string) bool {
	accountName, ok := extractServiceAccountName(ctx)
	if !ok {
		return false
	}
	for _, name := range names {
		if accountName == name {
			return true
		}
	}
	return false
}
202651
func IsExecFormatError(err error) bool {
	e, ok := err.(*os.PathError)
	return ok && e.Err == syscall.ENOEXEC
}
1282677
func IsIncompatibleSeriesError(err interface{}) bool {
	if err == nil {
		return false
	}
	// In case of a wrapped error, check the cause first.
	value := err
	cause := errors.Cause(err.(error))
	if cause != nil {
		value = cause
	}
	_, ok := value.(*ErrIncompatibleSeries)
	return ok
}
431670
func IsBuilderUnexpectedType(err error) bool {
	_, ok := Cause(err).(BuilderUnexpectedTypeError)
	return ok
}
107855
func AscIfType(p1Ptr, p2Ptr *IfAddr) int {
	return AscType(&p1Ptr.SockAddr, &p2Ptr.SockAddr)
}
561701
func NewRPCError(code RPCErrorCode, message string) *RPCError {
	return &RPCError{
		Code:    code,
		Message: message,
	}
}
242203
func IsProviderIDNotUniqueError(err interface{}) bool {
	if err == nil {
		return false
	}
	// In case of a wrapped error, check the cause first.
	value := err
	cause := errors.Cause(err.(error))
	if cause != nil {
		value = cause
	}
	_, ok := value.(*ErrProviderIDNotUnique)
	return ok
}
1258397
func IsConversionError(err error) (bool, error) {
	e, ok := errs.Cause(err).(ConversionError)
	if !ok {
		return false, nil
	}
	return true, e
}
1180659
func IsCRDConditionEquivalent(lhs, rhs *CustomResourceDefinitionCondition) bool {
	if lhs == nil && rhs == nil {
		return true
	}
	if lhs == nil || rhs == nil {
		return false
	}

	return lhs.Message == rhs.Message && lhs.Reason == rhs.Reason && lhs.Status == rhs.Status && lhs.Type == rhs.Type
}
1031304
func IsCorruptionError(err error) bool {
	switch err {
	case io.ErrUnexpectedEOF, zip.ErrFormat, zip.ErrChecksum, zip.ErrAlgorithm, ErrHashMismatch:
		return true
	}
	return false
}
172343
func IsCrdConditionTrue(crd *apiext_v1b1.CustomResourceDefinition, conditionType apiext_v1b1.CustomResourceDefinitionConditionType) bool {
	return IsCrdConditionPresentAndEqual(crd, conditionType, apiext_v1b1.ConditionTrue)
}
897089
func checkCopySyntaxTypeC(srcURLs []string, tgtURL string, isRecursive bool, keys map[string][]prefixSSEPair) {
	// Check source.
	if len(srcURLs) != 1 {
		fatalIf(errInvalidArgument().Trace(), "Invalid number of source arguments.")
	}

	// Check target.
	if _, tgtContent, err := url2Stat(tgtURL, false, keys); err == nil {
		if !tgtContent.Type.IsDir() {
			fatalIf(errInvalidArgument().Trace(tgtURL), "Target `"+tgtURL+"` is not a folder.")
		}
	}

	for _, srcURL := range srcURLs {
		c, srcContent, err := url2Stat(srcURL, false, keys)
		// incomplete uploads are not necessary for copy operation, no need to verify for them.
		isIncomplete := false
		if err != nil {
			if !isURLPrefixExists(srcURL, isIncomplete) {
				fatalIf(err.Trace(srcURL), "Unable to stat source `"+srcURL+"`.")
			}
			// No more check here, continue to the next source url
			continue
		}

		if srcContent.Type.IsDir() {
			// Require --recursive flag if we are copying a directory
			if !isRecursive {
				fatalIf(errInvalidArgument().Trace(srcURL), "To copy a folder requires --recursive flag.")
			}

			// Check if we are going to copy a directory into itself
			if isURLContains(srcURL, tgtURL, string(c.GetURL().Separator)) {
				fatalIf(errInvalidArgument().Trace(), "Copying a folder into itself is not allowed.")
			}
		}
	}

}
1032741
func (e *RPCError) Error() string {
	return strconv.Itoa(e.Code) + ":" + e.Message
}
279351
func (res RPCResponses) HasError() bool {
	for _, res := range res {
		if res.Error != nil {
			return true
		}
	}
	return false
}