<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def store_last_browsed_path(data):
 """ Defines a wrapper method used to store the last browsed path. :param data: Path data. :type data: QString or QList :return: Last browsed path. :rtype: unicode """


    if type(data) in (tuple, list, QStringList):
        data = [foundations.strings.to_string(path) for path in data]
        last_browsed_path = foundations.common.get_first_item(data)
    elif type(data) in (unicode, QString):
        data = last_browsed_path = foundations.strings.to_string(data)
    else:
        raise TypeError("{0} | '{1}' type is not supported!".format(__name__, type(data)))

    if foundations.common.path_exists(last_browsed_path):
        last_browsed_path = os.path.normpath(last_browsed_path)
        if os.path.isfile(last_browsed_path):
            last_browsed_path = os.path.dirname(last_browsed_path)

        LOGGER.debug("> Storing last browsed path: '%s'.", last_browsed_path)
        RuntimeGlobals.last_browsed_path = last_browsed_path
    return data