def METHOD_NAME(network_location):
    """
    Intended to wrap contexts with usage of `NetworkClient` for a given `NetworkLocation`.
    If a `NetworkClientError` is raised during yielded context, the appropriate connection status is
    saved to the `NetworkLocation` and the number of `connection_faults` is incremented.
    :param network_location: The NetworkLocation model for capturing connection state
    :type network_location: kolibri.core.discovery.models.NetworkLocation
    """
    try:
        # yield for context processing
        yield
        # finally confirm status is OKAY
        network_location.connection_status = ConnectionStatus.Okay
    except (errors.NetworkLocationConnectionFailure, errors.NetworkLocationNotFound):
        network_location.connection_status = ConnectionStatus.ConnectionFailure
    except errors.NetworkLocationResponseFailure:
        network_location.connection_status = ConnectionStatus.ResponseFailure
    except errors.NetworkLocationResponseTimeout:
        network_location.connection_status = ConnectionStatus.ResponseTimeout
    except errors.NetworkLocationInvalidResponse:
        network_location.connection_status = ConnectionStatus.InvalidResponse
    except errors.NetworkLocationConflict:
        network_location.connection_status = ConnectionStatus.Conflict
    # reset connection faults if it was successful
    if network_location.connection_status == ConnectionStatus.Okay:
        network_location.connection_faults = 0
    else:
        # increment the number of faulty connection attempts
        network_location.connection_faults += 1
    # it's possible the network location was deleted while making requests during the context
    if NetworkLocation.objects.filter(id=network_location.id).exists():
        network_location.save()