def _GetVersionsPerM4Scripts(self, projects):
    projects_path = os.path.dirname(self._data_directory)
    projects_path = os.path.dirname(projects_path)

    m4_script_glob = os.path.join(self._data_directory, u'm4', u'*.m4')
    versions_per_m4_script = {}
    for path in glob.glob(m4_script_glob):
      m4_script_file = M4ScriptFile(path)

      version = None
      logging.info(u'Reading: {0:s}'.format(path))
      if m4_script_file.ReadVersion():
        version = m4_script_file.version
      if not version:
        version = u'missing'

      versions_per_m4_script[m4_script_file.name] = {version: []}

    for project in projects:
      project_m4_scripts_path = os.path.join(projects_path, project.name, u'm4')

      for m4_script in versions_per_m4_script.keys():
        m4_script_path = os.path.join(project_m4_scripts_path, m4_script)
        if not os.path.exists(m4_script_path):
          continue

        m4_script_file = M4ScriptFile(m4_script_path)

        version = None
        logging.info(u'Reading: {0:s}'.format(m4_script_path))
        if m4_script_file.ReadVersion():
          version = m4_script_file.version
        if not version:
          version = u'missing'

        projects_per_version = versions_per_m4_script[m4_script]
        if version not in projects_per_version:
          projects_per_version[version] = []

        projects_per_version[version].append(project.name)

    return versions_per_m4_script
output conversion
dataset/ETHPy150Open libyal/libyal/scripts/overview-generate.py/StatusWikiPageGenerator._GetVersionsPerM4Scripts--crossover with--dataset/ETHPy150Open yhat/ggplot/ggplot/utils/color.py/Color._return