code: def WriteArtifactsFile(self, artifacts, filename):
      
      with open(filename, 'w') as file_object:
        file_object.write(self.FormatArtifacts(artifacts))
docs: Writes artifact definitions to a file.
  
      Args:
        artifacts (list[ArtifactDefinition]): artifact definitions to be written.
        filename (str): name of the file to write artifacts to.