// isForbidden determines if an import is forbidden,
// which is true when the import is:
//   - of a package under the rootPackage
//   - is not of the base import path or a sub-package of it
//   - is not of an allowed path or a sub-package of one
188108
func (i *ImportRestriction) isForbidden(imp string) bool {
	importsBelowRoot := strings.HasPrefix(imp, rootPackage)
	importsBelowBase := strings.HasPrefix(imp, i.BaseDir)
	importsAllowed := false
	for _, allowed := range i.AllowedImports {
		exactlyImportsAllowed := imp == allowed
		importsBelowAllowed := strings.HasPrefix(imp, fmt.Sprintf("%s/", allowed))
		importsAllowed = importsAllowed || (importsBelowAllowed || exactlyImportsAllowed)
	}

	return importsBelowRoot && !importsBelowBase && !importsAllowed
}
1250306
func (d *IGD) IsForwardedUDP(port uint16) (bool, error) {
	return d.checkForward(port, "UDP")
}
2823
func IsVendorDir(dir string) bool {
	return strings.HasPrefix(dir, "vendor/") || strings.Contains(dir, "/vendor/")
}
1109032
private void isForbidden(File request, AddOnModel addOnModel) {
        if (forbiddenWriteDirectories.stream()
                .anyMatch(compare -> request.toPath().startsWith(compare.toPath()))) {
            throw getException("file: " + request.toString() + " is forbidden. Attempt made by: "
                    + addOnModel.getID());
        }
    }
897982
func isAllowedInternal(c context.Context) bool {
	settings := common.GetSettings(c)
	if settings.Buildbot.InternalReader == "" {
		return false
	}
	allowed, err := auth.IsMember(c, settings.Buildbot.InternalReader)
	if err != nil {
		logging.WithError(err).Errorf(c, "IsMember(%q) failed", settings.Buildbot.InternalReader)
		allowed = false
	}
	return allowed
}
97742
func isVendorPackage(n *graph.Node) bool {
	if strings.Contains(n.UniqueName, "/vendor/") {
		return true
	}

	return false
}
1048772
func IsInImports(imports []*ast.ImportSpec, unfoundvar string) bool {

	for _, v := range imports {
		ab := strings.Split(strings.Replace(v.Path.Value, "\"", "", 2), "/")
		if ab[len(ab)-1] == unfoundvar {
			return true
		}

	}

	return false
}
1105150
func isExported(f reflect.StructField) bool {
	if f.PkgPath != "" && !f.Anonymous {
		return false
	}
	return true
}
369564
func (s *NATService) GetIpForwardingRuleByID(id string, opts ...OptionFunc) (*IpForwardingRule, int, error) {
	p := &ListIpForwardingRulesParams{}
	p.p = make(map[string]interface{})

	p.p["id"] = id

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return nil, -1, err
		}
	}

	l, err := s.ListIpForwardingRules(p)
	if err != nil {
		if strings.Contains(err.Error(), fmt.Sprintf(
			"Invalid parameter id value=%s due to incorrect long value format, "+
				"or entity does not exist", id)) {
			return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
		}
		return nil, -1, err
	}

	if l.Count == 0 {
		return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
	}

	if l.Count == 1 {
		return l.IpForwardingRules[0], l.Count, nil
	}
	return nil, l.Count, fmt.Errorf("There is more then one result for IpForwardingRule UUID: %s!", id)
}
1024206
func (p *PKGBUILD) IsDevel() bool {
	for _, name := range p.Pkgnames {
		if strings.HasSuffix(name, "-git") {
			return true
		}

		if strings.HasSuffix(name, "-svn") {
			return true
		}

		if strings.HasSuffix(name, "-hg") {
			return true
		}

		if strings.HasSuffix(name, "-bzr") {
			return true
		}
	}

	return false
}
862822
func (a *AddressWitnessPubKeyHash) IsForNet(net *chaincfg.Params) bool {
	return a.hrp == net.Bech32HRPSegwit
}
227758
func IsCryptoConfigFullyOverridden(c *CryptoConfigOptions) bool {
	return !anyNil(c.isSecurityEnabled, c.securityAlgorithm, c.securityLevel, c.securityProvider, c.softVerify, c.securityProviderLibPath, c.securityProviderPin, c.securityProviderLabel, c.keyStorePath)
}
221686
func IsHidden(ctx context.Context) bool {
	bv, ok := ctx.Value(ctxKeyHidden).(bool)
	if !ok {
		return false
	}
	return bv
}
582908
func IsPermissionDenied(err error) bool {
	pd, ok := err.(permissionDeniedError)
	return ok && pd.IsPermissionDenied()
}
192252
public boolean isForbidden() {
        if (authorities.size() == 0) {
            return false; // If no restrictions, return false
        }

        boolean result = true;

        for (Authority priv : authorities) {
            result = !SecurityUtil.isGranted(priv.name);

            if (requiresAll == result) {
                break;
            }
        }

        return result;
    }
70534
func (s *Schema) IsPropRequired(pname string) bool {
	for _, name := range s.Required {
		if name == pname {
			return true
		}
	}
	return false
}
1115287
func (i *ImportRestriction) forbiddenImportsFor(pkg Package) []string {
	forbiddenImportSet := map[string]struct{}{}
	imports := pkg.Imports
	if !i.ExcludeTests {
		imports = append(imports, append(pkg.TestImports, pkg.XTestImports...)...)
	}
	for _, imp := range imports {
		path := extractVendorPath(imp)
		if i.isForbidden(path) {
			forbiddenImportSet[path] = struct{}{}
		}
	}

	var forbiddenImports []string
	for imp := range forbiddenImportSet {
		forbiddenImports = append(forbiddenImports, imp)
	}
	return forbiddenImports
}