(
    dhis2_server: ConnectionSettings,
    data_set_id: str,
    org_unit_id: str,
    period: str,
)
return response.json().get('dataValues', None)
Returns a list of `DHIS2 data values`_, or ``None`` if the the given
    org unit has no data collected for the last quarter.

    Raises exceptions on connection timeout or non-200 response status.


    .. _DHIS2 data values: https://docs.dhis2.org/master/en/developer/html/webapi_data_values.html
Returns a list of `DHIS2 data values`_, or ``None`` if the the given
    org unit has no data collected for the last quarter.
Returns a list of DHIS2 data values _ or None if the the given org unit has no data collected for the last quarter .
def fetch_data_set(
    dhis2_server: ConnectionSettings,
    data_set_id: str,
    org_unit_id: str,
    period: str,
) -> Optional[List[dict]]:
    """
    Returns a list of `DHIS2 data values`_, or ``None`` if the the given
    org unit has no data collected for the last quarter.

    Raises exceptions on connection timeout or non-200 response status.


    .. _DHIS2 data values: https://docs.dhis2.org/master/en/developer/html/webapi_data_values.html

    """
    max_attempts = 3
    backoff_seconds = 3 * 60

    requests = dhis2_server.get_requests()
    endpoint = '/dataValueSets' if DROP_API_PREFIX else '/api/dataValueSets'
    params = {
        'period': period,
        'dataSet': data_set_id,
        'orgUnit': org_unit_id,
    }
    attempt = 0
    while True:
        attempt += 1
        try:
            response = requests.get(endpoint, params, raise_for_status=True)
        except (RequestException, HTTPError):
            if attempt < max_attempts:
                sleep(backoff_seconds * attempt)
            else:
                raise
        else:
            break
    return response.json().get('dataValues', None)
def fetch_data_set ( dhis2_server : ConnectionSettings , data_set_id : str , org_unit_id : str , period : str , ) -> Optional [ List [ dict ] ] : max_attempts = 3 backoff_seconds = 3 * 60 requests = dhis2_server . get_requests ( ) endpoint = '/dataValueSets' if DROP_API_PREFIX else '/api/dataValueSets' params = { 'period' : period , 'dataSet' : data_set_id , 'orgUnit' : org_unit_id , } attempt = 0 while True : attempt += 1 try : response = requests . get ( endpoint , params , raise_for_status = True ) except ( RequestException , HTTPError ) : if attempt < max_attempts : sleep ( backoff_seconds * attempt ) else : raise else : break return response . json ( ) . get ( 'dataValues' , None )