'Retrieve artifact classes with optional filtering.
All filters must match for the artifact to be returned.
Args:
os_name: string to match against supported_os
name_list: list of strings to match against artifact names
source_type: rdf_artifacts.ArtifactSource.SourceType to match against
source_type
exclude_dependents: if true only artifacts with no dependencies will be
returned
provides: return the artifacts that provide these dependencies
reload_datastore_artifacts: If true, the data store sources are queried
for new artifacts.
Returns:
set of artifacts matching filter criteria'

def GetArtifacts(self, os_name=None, name_list=None, source_type=None, exclude_dependents=False, provides=None, reload_datastore_artifacts=False):

    self._CheckDirty(reload_datastore_artifacts=reload_datastore_artifacts)
    results = set()
    for artifact in self._artifacts.itervalues():
        if (os_name and artifact.supported_os and (os_name not in artifact.supported_os)):
            continue
        if (name_list and (artifact.name not in name_list)):
            continue
        if source_type:
            source_types = [c.type for c in artifact.sources]
            if (source_type not in source_types):
                continue
        if (exclude_dependents and artifact.GetArtifactPathDependencies()):
            continue
        if provides:
            for provide_string in artifact.provides:
                if (provide_string in provides):
                    results.add(artifact)
                    continue
            continue
        results.add(artifact)
    return results
