def _get_code_w_scope(data, position, obj_end, opts):
    """Decode a BSON code_w_scope to bson.code.Code."""
    code, position = _get_string(data, position + 4, obj_end, opts)
    scope, position = _get_object(data, position, obj_end, opts)
    return Code(code, scope), position