def _flatten(params):
    """Flatten the list objects in a list of DB-API parameters,
    e.g. `[1, [2, 3]]` becomes `[1, 2, 3]`.
    """
    params_flat = []
    for param in params:
        if isinstance(param, list):
            for item in param:
                params_flat.append(item)
        else:
            params_flat.append(param)
    return params_flat