def GetName(self, path=None):
    """Retrieves the project name from the path of the script.

    Args:
      path: optional path to the script. If None, __file__ will be used instead.

    Returns:
      A string containing the project name or None.
    """
    if self._project_name:
      return self._project_name

    if not path:
      path = os.path.abspath(__file__)
    project_name = path
    project_name = os.path.dirname(project_name)
    project_name = os.path.dirname(project_name)
    project_name = os.path.basename(project_name)

    for supported_project_name in self.SUPPORTED_PROJECTS:
      if supported_project_name in project_name:
        self._project_name = supported_project_name
        return self._project_name

    logging.error(
        u'Unsupported project name: {0:s}.'.format(project_name))
    return
dataset/ETHPy150Open log2timeline/dfvfs/utils/review.py/ProjectHelper.GetName/original