<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def layer_from_combo(combo):
 """Get the QgsMapLayer currently selected in a combo. Obtain QgsMapLayer id from the userrole of the QtCombo and return it as a QgsMapLayer. :returns: The currently selected map layer a combo. :rtype: QgsMapLayer """

    index = combo.currentIndex()
    if index < 0:
        return None

    layer_id = combo.itemData(index, Qt.UserRole)
    layer = QgsProject.instance().mapLayer(layer_id)
    return layer