<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ReadDirectory(self, path, extension='yaml'):
 """Reads artifact definitions from a directory. This function does not recurse sub directories. Args: path (str):
 path of the directory to read from. extension (Optional[str]):
 extension of the filenames to read. Yields: ArtifactDefinition: an artifact definition. """

    if extension:
      glob_spec = os.path.join(path, '*.{0:s}'.format(extension))
    else:
      glob_spec = os.path.join(path, '*')

    for artifact_file in glob.glob(glob_spec):
      for artifact_definition in self.ReadFile(artifact_file):
        yield artifact_definition