// IsJavaCC returns true if the CDS package bytes describe a chaincode
// that requires the java runtime environment to execute
191876
func (s *SupportImpl) IsJavaCC(buf []byte) (bool, error) {
	//the inner dep spec will contain the type
	ccpack, err := ccprovider.GetCCPackage(buf)
	if err != nil {
		return false, err
	}
	cds := ccpack.GetDepSpec()
	return (cds.ChaincodeSpec.Type == pb.ChaincodeSpec_JAVA), nil
}
881085
func isExecutable(filename string) (bool, error) {
	info, err := os.Stat(filename)
	if err != nil {
		return false, err
	}
	mode := info.Mode()
	return ((mode & 0x01) | (mode & 0x08) | (mode & 0x40)) != 0, nil
}
899648
func IsVerbose(ctx context.Context) bool {
	bv, ok := ctx.Value(ctxKeyVerbose).(bool)
	if !ok {
		return false
	}
	return bv
}
129730
func (lscc *LifeCycleSysCC) isValidChaincodeName(chaincodeName string) error {
	if chaincodeName == "" {
		return EmptyChaincodeNameErr("")
	}

	if !isValidCCNameOrVersion(chaincodeName, allowedChaincodeName) {
		return InvalidChaincodeNameErr(chaincodeName)
	}

	return nil
}
1265877
func IsConfigBlock(block *cb.Block) bool {
	envelope, err := ExtractEnvelope(block, 0)
	if err != nil {
		return false
	}

	payload, err := GetPayload(envelope)
	if err != nil {
		return false
	}

	if payload.Header == nil {
		return false
	}

	hdr, err := UnmarshalChannelHeader(payload.Header.ChannelHeader)
	if err != nil {
		return false
	}

	return cb.HeaderType(hdr.Type) == cb.HeaderType_CONFIG || cb.HeaderType(hdr.Type) == cb.HeaderType_ORDERER_TRANSACTION
}
1221255
func IsJSON(s string) bool {
	var js map[string]interface{}
	return json.Unmarshal([]byte(s), &js) == nil
}
1238065
func getChaincodeSpec(cmd *cobra.Command) (*pb.ChaincodeSpec, error) {
	spec := &pb.ChaincodeSpec{}
	if err := checkChaincodeCmdParams(cmd); err != nil {
		// unset usage silence because it's a command line usage error
		cmd.SilenceUsage = false
		return spec, err
	}

	// Build the spec
	input := &pb.ChaincodeInput{}
	if err := json.Unmarshal([]byte(chaincodeCtorJSON), &input); err != nil {
		return spec, errors.Wrap(err, "chaincode argument error")
	}

	chaincodeLang = strings.ToUpper(chaincodeLang)
	spec = &pb.ChaincodeSpec{
		Type:        pb.ChaincodeSpec_Type(pb.ChaincodeSpec_Type_value[chaincodeLang]),
		ChaincodeId: &pb.ChaincodeID{Path: chaincodePath, Name: chaincodeName, Version: chaincodeVersion},
		Input:       input,
	}
	return spec, nil
}
1336042
func (c *MemcacheCacher) IsExist(key string) bool {
	_, err := c.c.Get(key)
	return err == nil
}
933650
func (p *Provider) IsSysCC(name string) bool {
	for _, sysCC := range p.SysCCs {
		if sysCC.Name() == name {
			return true
		}
	}
	if isDeprecatedSysCC(name) {
		return true
	}
	return false
}
1306066
func (wkb TLFWriterKeyBundleV3) IsWriter(user keybase1.UID, deviceKey kbfscrypto.CryptPublicKey) bool {
	_, ok := wkb.Keys[user][deviceKey]
	return ok
}
103496
func IsCode(code string, err error) bool {
	if argoErr, ok := err.(argoerr); ok {
		return argoErr.code == code
	}
	return false

}
367628
func IsV10(sv *hcsschema.Version) bool {
	if sv.Major == 1 && sv.Minor == 0 {
		return true
	}
	return false
}
889353
func (c *Context) IsProgram(program *js.Object) bool {
	return c.Call("isProgram", program).Bool()
}
903458
func isKeySafe(s []byte) bool {
	return whitelistPattern.Match(s) && !blacklistPattern.Match(s)
}
840873
func chaincodePackage(cmd *cobra.Command, args []string, cdsFact ccDepSpecFactory, cf *ChaincodeCmdFactory) error {
	if cdsFact == nil {
		return fmt.Errorf("Error chaincode deployment spec factory not specified")
	}
	// Parsing of the command line is done so silence cmd usage
	cmd.SilenceUsage = true

	var err error
	if cf == nil {
		cf, err = InitCmdFactory(cmd.Name(), false, false)
		if err != nil {
			return err
		}
	}
	spec, err := getChaincodeSpec(cmd)
	if err != nil {
		return err
	}

	cds, err := cdsFact(spec)
	if err != nil {
		return fmt.Errorf("error getting chaincode code %s: %s", chaincodeName, err)
	}

	var bytesToWrite []byte
	if createSignedCCDepSpec {
		bytesToWrite, err = getChaincodeInstallPackage(cds, cf)
		if err != nil {
			return err
		}
	} else {
		bytesToWrite = utils.MarshalOrPanic(cds)
	}

	logger.Debugf("Packaged chaincode into deployment spec of size <%d>, with args = %v", len(bytesToWrite), args)
	fileToWrite := args[0]
	err = ioutil.WriteFile(fileToWrite, bytesToWrite, 0700)
	if err != nil {
		logger.Errorf("failed writing deployment spec to file [%s]: [%s]", fileToWrite, err)
		return err
	}

	return err
}
1051930
func isVPCNotRecommendedError(err error) bool {
	err = errors.Cause(err)
	_, ok := err.(*vpcNotRecommendedError)
	return ok
}
80013
func (t Type) IsBuiltin() bool {
	_, ok := scalarTypes[t.TypeString()]
	return ok
}