def _get_profiles(self):
        log.info("Getting firefox profiles")

        if self.os == 'linux':
            profiles_folder = self._expand("~/.mozilla/firefox/")

        elif self.os == 'windows':
            if platform.release() == "XP":
                log.error("Unsupported OS (Windows XP). Returning None")
                return None

            profiles_folder = self._expand("%APPDATA%\\Mozilla\\Firefox\\")

        elif self.os == "darwin":
            profiles_folder = self._expand("~/Library/Mozilla/Firefox/")
            if not os.path.exists(profiles_folder):
                profiles_folder = self._expand("~/Library/Application Support/Firefox/")

        else:
            log.error("Unsupported OS. Returning None")
            return None

        log.debug("Firefox profiles root folder set to {}".format(profiles_folder))

        if not os.path.exists(profiles_folder):
            log.error("profiles_folder does not exists, returning {}")
            return {}

        try:
            profiles_path = os.path.join(profiles_folder, "profiles.ini")
            log.debug("profiles.ini path: {}".format(profiles_path))
        except __HOLE__:
            log.error("Joining folder and profiles.ini failed. Returning None")
            return {}
        except Exception as e:
            log.exception(e)
            return {}

        if not os.path.exists(profiles_path):
            # If profiles.ini does not exist no profile folder exists either
            # or does it...
            log.error("Profiles path not found. New FF installation?. Returning None")
            return {}

        profiles = ConfigParser.RawConfigParser()
        profiles.read(profiles_path)
        profiles.remove_section('General')

        available_profiles = {}
        for index, profile in enumerate(profiles.sections()):
            name = profiles.get(profiles.sections()[index], 'Name')
            path = profiles.get(profiles.sections()[index], 'Path')
            available_profiles[name] = path
        log.debug("Profiles:{}".format(available_profiles))
        return available_profiles
dataset/ETHPy150Open Nikola-K/RESTool/RESTool/browsers/firefox.py/Firefox._get_profiles