code: def ReadFromDirectory(self, artifacts_reader, path, extension='yaml'):
      
      for artifact_definition in artifacts_reader.ReadDirectory(
          path, extension=extension):
        self.RegisterDefinition(artifact_definition)
docs: Reads artifact definitions into the registry from files in a directory.
  
      This function does not recurse sub directories.
  
      Args:
        artifacts_reader (ArtifactsReader): an artifacts reader.
        path (str): path of the directory to read from.
        extension (Optional[str]): extension of the filenames to read.
  
      Raises:
        KeyError: if a duplicate artifact definition is encountered.