human
I wrote the below code

    def check_cid(registry):
        if (len(registry) <= 1):
            return True
        cid1 = registry[(len(registry) - 1)]
        cid2 = registry[(len(registry) - 2)]
        if (cid1 != cid2):
            raise ValueError('{}    !=    {}'.format(cid1, cid2))
        return True
    @retrying.retry(wait_fixed=2000, stop_max_delay=(LATENCY * 1000))
    def test_containers(app_endpoints):
        debug_eid = []
        for agent in app_endpoints:
            @retrying.retry(wait_fixed=2000, stop_max_delay=150000)
            def wait_for_container_propogation():
                response = dcos_api_session.metrics.get('containers', node=agent.host)
                assert (response.status_code == 200)
                assert (len(response.json()) > 0), 'must    have    at    least    1    container'
            wait_for_container_propogation()
            response = dcos_api_session.metrics.get('containers', node=agent.host)
            for c in response.json():
                container_id_path = 'containers/{}'.format(c)
                container_response = dcos_api_session.metrics.get(container_id_path, node=agent.host)
                assert (container_response.status_code == 200)
                assert ('datapoints' in container_response.json()), 'got    {}'.format(container_response.json())
                cid_registry = []
                for dp in container_response.json()['datapoints']:
                    assert ('tags' in dp), 'got    {}'.format(dp)
                    assert (len(dp['tags']) == 5), 'got    {}'.format(len(dp['tags']))
                    assert ('container_id' in dp['tags']), 'got    {}'.format(dp['tags'])
                    cid_registry.append(dp['tags']['container_id'])
                    assert check_cid(cid_registry)
                    for (k, v) in dp['tags'].items():
                        assert (len(v) != 0), 'tag    values    must    not    be    empty'
                assert ('dimensions' in container_response.json()), 'got   ...

What's a good function header?
 Here's a good function header?
assistant
#Here's a good function header.

def test_metrics_containers(dcos_api_session):