Indicates whether the provided package should be scanned (based upon the inclusion/exclusion lists).
4596
public boolean shouldScanPackage(String pkg)
    {
        // assume an empty string if it wasn't specified
        if (pkg == null)
        {
            pkg = "";
        }
        WindupJavaConfigurationModel configuration = getJavaConfigurationModel(getGraphContext());
        for (PackageModel pkgModel : configuration.getExcludeJavaPackages())
        {
            String excludePkg = pkgModel.getPackageName();
            if (pkg.startsWith(excludePkg))
            {
                return false;
            }
        }

        // if the list is empty, assume it is intended to just accept all packages
        if (!configuration.getScanJavaPackages().iterator().hasNext())
        {
            return true;
        }

        for (PackageModel pkgModel : configuration.getScanJavaPackages())
        {
            String includePkg = pkgModel.getPackageName();
            if (pkg.startsWith(includePkg))
            {
                return true;
            }
        }

        return false;
    }
21117
public boolean isIBMPackage(String packageName) {
        if (packageName != null) {
            BundlePackages p = populatePackageLists();
            // If we still can't get our list of packages (for example, in unit tests), let everything pass
            if (p != null) {
                if (p.containsPrivatePackage(packageName)) {
                    return true;
                } else if (p.containsExportedPackage(packageName)) {
                    // Add an extra check - if this is an exported package, it could be spec or third-party, not IBM
                    SharedPackageInspector inspector = st.getService();
                    if (inspector != null) {
                        PackageType exported = inspector.getExportedPackageType(packageName);
                        // If it's spec, third party, or stable it's not internal - otherwise, it is
                        if ( exported == null )
                            return true;
                        if ( exported.isSpecApi() || exported.isThirdPartyApi() || exported.isStableApi() ) 
                            return false;
                        
                        return true;
                    }

                    // If we couldn't get hold of the service, assume it was internal if our bundles export it
                    return true;
                }

            }
        }
        return false;
    }
1286983
private boolean hasPrintedPackageIndex(String pkgname) {
        String[] list = printedPackageHeaders.toArray(new String[] {});
        for (int i = 0; i < list.length; i++) {
            if (pkgname.startsWith(list[i])) {
                return true;
            }
        }
        return false;
    }
520160
public void setRegisterBlueprintsByPackage(String _package) throws RegisterBlueprintException {

        Set<Class<?>> annotated = null;
        try {
            annotated = new ClassesInPackageScanner().findAnnotatedClasses(_package, Blueprint.class);
        } catch (IOException e) {
            throw new RegisterBlueprintException(e);
        }

        logger.info("Scanned {} and found {}", _package, annotated);

        this.setRegisterBlueprints(annotated);
    }
408033
function isPackageAlreadyInstalled(packageInstallFolder) {
    try {
        const flagFilePath = path.join(packageInstallFolder, INSTALLED_FLAG_FILENAME);
        if (!fs.existsSync(flagFilePath)) {
            return false;
        }
        const fileContents = fs.readFileSync(flagFilePath).toString();
        return fileContents.trim() === process.version;
    }
    catch (e) {
        return false;
    }
}
1062630
public static List<Class<?>> scanPackage(String... packages) throws IOException, ClassNotFoundException {
        List<Class<?>> list = new ArrayList<>();
        for (String pkg : packages) {
            list.addAll(getClasses(pkg));
        }
        return list;
    }
105381
def pkg_available(pkg_name,required=False):
    ''''''
    if pkg_name in pkgs:
        return True
    if required:
        nl.notify('Error: could not find required analysis package %s' % pkg_name,level=nl.level.error)
    return False
1102393
def is_filtered(self, relpath):
        """"""
        # Only include files under the parent_dir
        if relpath.startswith("../"):
            return True

        # Ignore files that we don't want timestamps from
        if self.timestamps_for is not None and type(self.timestamps_for) is list:
            match = False
            for line in self.timestamps_for:
                if fnmatch.fnmatch(relpath, line):
                    match = True
                    break
            if not match:
                return True

        # Matched is true by default if
        # * Have exclude
        # * No exclude and no include
        matched = self.exclude or not any([self.exclude, self.include])

        # Anything not matching exclude gets included
        if self.exclude:
            for line in self.exclude:
                if fnmatch.fnmatch(relpath, line):
                    matched = False

        # Anything matching include gets included
        if self.include:
            for line in self.include:
                if fnmatch.fnmatch(relpath, line):
                    matched = True
                    break

        return not matched
1277671
def is_file(package):
    """"""
    if hasattr(package, "keys"):
        return any(key for key in package.keys() if key in ["file", "path"])

    if os.path.exists(str(package)):
        return True

    for start in SCHEME_LIST:
        if str(package).startswith(start):
            return True

    return False
14802
protected boolean isApplicationClass(String className) {
        for (String packageName : packagesToFilter) {
            if (className.startsWith(packageName)) return false;
        }
        return true;
    }
1076308
private void checkDoc() {
        if (foundDoc) {
            if (!checkDocWarningEmitted) {
                env.warning(null, "javadoc.Multiple_package_comments", name());
                checkDocWarningEmitted = true;
            }
        } else {
            foundDoc = true;
        }
    }
1144804
function (items) {
        if (!config.ignoreDeprecatedPackages) {
          return items;
        }
        var list = _.filter(items, function (item) {
          // Ignore packages
          if (ignore.indexOf(item.name) !== -1) {
            return false;
          }
          // Limit to whitelisted packages
          if (whitelist[item.website] && item.name !== whitelist[item.website]) {
            return false;
          }
          return true;
        });
        return list;
      }
1293772
function ensureAvailable(packageMap, pkg, identifierKey) {

  var value = pkg[identifierKey];

  if (value in packageMap) {
    throw new Error('package with ' + identifierKey + ' <' + value + '> already defined');
  }
}
771719
def should_exclude(type_or_instance, exclusion_list):
    
    if type_or_instance in exclusion_list: # Check class definition
        return True
    if type(type_or_instance) in exclusion_list: # Check instance type
        return True
    try:
        if type_or_instance.__class__ in exclusion_list: # Check instance class
            return True
    except:
        pass

    return False
578132
def is_empty(self):
        
        for family in self.iter_package_families():
            for pkg in self.iter_packages(family):
                return False

        return True
397052
protected function isPackageSupported($package)
    {
        $extra = $package->getExtra();
        if (!empty($extra['drupal']['security-coverage']['status'])
          && $extra['drupal']['security-coverage']['status'] == 'not-covered') {
            return false;
        }
        return true;
    }
288549
protected boolean checkExcludePackages(String classPackageName) {
		if (excludePackages != null && excludePackages.length > 0) {
			WildcardHelper wildcardHelper = new WildcardHelper();

			// we really don't care about the results, just the boolean
			Map<String, String> matchMap = new HashMap<String, String>();

			for (String packageExclude : excludePackages) {
				int[] packagePattern = wildcardHelper.compilePattern(packageExclude);
				if (wildcardHelper.match(matchMap, classPackageName, packagePattern)) {
					return false;
				}
			}
		}
		return true;
	}