'Get an artifact class from the cache in the flow.'

def _GetArtifactFromName(self, name):

    try:
        art_obj = artifact_registry.REGISTRY.GetArtifact(name)
    except artifact_registry.ArtifactNotRegisteredError:
        artifact_registry.REGISTRY.ReloadDatastoreArtifacts()
        art_obj = artifact_registry.REGISTRY.GetArtifact(name)
    return art_obj
