<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def value_from_field_name(field_name, analysis_layer):
 """Get the value of analysis layer based on field name. Can also be used for any layer with one feature. :param field_name: Field name of analysis layer that we want to get. :type field_name: str :param analysis_layer: Analysis layer. :type analysis_layer: qgis.core.QgsVectorLayer :return: return the value of a given field name of the analysis. .. versionadded:: 4.0 """

    field_index = analysis_layer.fields().lookupField(field_name)
    if field_index < 0:
        return None
    else:
        feat = QgsFeature()
        analysis_layer.getFeatures().nextFeature(feat)
        return feat[field_index]