def METHOD_NAME(client, func, key, **kwargs):
    """Collects data and stores it in a list."""
    caller = getattr(client, func)
    try:
        response = caller(**kwargs)
        out = response[key]
        while 'nextToken' in response:
            response = caller(**{'nextToken': response['nextToken'], **kwargs})
            out += response[key]
        return out
    except ClientError as error:
        if error.response['Error']['Code'] == 'AccessDeniedException':
            print('AccessDenied for: {}'.format(func))
    return []