'Write any results to the collection if we are splitting by artifact.
If not splitting, SendReply will handle writing to the collection.
Args:
result: result to write
artifact_name: artifact name string
output_collection_map: dict of collections when splitting by artifact'

def _WriteResultToSplitCollection(self, result, artifact_name, output_collection_map):

    if (self.args.split_output_by_artifact and self.runner.IsWritingResults()):
        if (artifact_name not in output_collection_map):
            collection = self.ResultCollectionForArtifact(self.urn, artifact_name, token=self.token)
            output_collection_map[artifact_name] = collection
        output_collection_map[artifact_name].Add(result)
