<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extract_library_properties_from_selected_row(self):
 """ Extracts properties library_os_path, library_path, library_name and tree_item_key from tree store row """

        (model, row) = self.view.get_selection().get_selected()
        tree_item_key = model[row][self.ID_STORAGE_ID]
        library_item = model[row][self.ITEM_STORAGE_ID]
        library_path = model[row][self.LIB_PATH_STORAGE_ID]
        if isinstance(library_item, dict):  # sub-tree
            os_path = model[row][self.OS_PATH_STORAGE_ID]
            return os_path, None, None, tree_item_key  # relevant elements of sub-tree
        assert isinstance(library_item, string_types)
        library_os_path = library_item

        library_name = library_os_path.split(os.path.sep)[-1]

        return library_os_path, library_path, library_name, tree_item_key