<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_selected_library_state(self):
 """Returns the LibraryState which was selected in the LibraryTree :return: selected state in TreeView :rtype: LibraryState """

        library_os_path, library_path, library_name, item_key = self.extract_library_properties_from_selected_row()
        if library_path is None:
            return None

        logger.debug("Link library state '{0}' (with library tree path: {2} and file system path: {1}) into state "
                     "machine.".format(str(item_key), library_os_path,
                                       self.convert_if_human_readable(str(library_path)) + "/" + str(item_key)))
        library_name = library_os_path.split(os.path.sep)[-1]
        return LibraryState(library_path, library_name, "0.1", format_folder_name_human_readable(library_name))