def _remove_keys(obj, keys_to_remove):
    """Remove the given fields from a JSON-like object.

    Traverses `obj` and removes the given keys at any nesting depth.

    Examples:

    _strip_keys({'a': [{'a': 0, 'b': 1}], 'b': 2}, ['a']) ==
    {'b': 2}

    _strip_keys({'a': [{'a': 0, 'b': 1}], 'b': 2}, ['b']) ==
    {'a': [{'a': 0}]}

    Args:
        obj: A JSON-like object
        keys_to_remove: A list of keys

    Returns:
        A copy of `obj` with the given fields removed at any nesting depth.
    """
    if isinstance(obj, list):
        return [_remove_keys(item, keys_to_remove) for item in obj]
    elif isinstance(obj, dict):
        return {
            key: _remove_keys(value, keys_to_remove)
            for key, value in obj.items() if key not in keys_to_remove}
    else:
        return obj