<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_data_item_from_data_and_metadata(self, data_and_metadata: DataAndMetadata.DataAndMetadata, title: str=None) -> DataItem: """Create a data item in the library from a data and metadata object. The data for the data item will be written to disk immediately and unloaded from memory. If you wish to delay writing to disk and keep using the data, create an empty data item and use the data item methods to modify the data. :param data_and_metadata: The data and metadata. :param title: The title of the data item (optional). :return: The new :py:class:`nion.swift.Facade.DataItem` object. :rtype: :py:class:`nion.swift.Facade.DataItem` .. versionadded:: 1.0 Scriptable: Yes """

        data_item = DataItemModule.new_data_item(data_and_metadata)
        if title is not None:
            data_item.title = title
        self.__document_model.append_data_item(data_item)
        return DataItem(data_item)