<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _to_pb(self):
 """Construct a KeyRange protobuf. :rtype: :class:`~google.cloud.spanner_v1.proto.keys_pb2.KeyRange` :returns: protobuf corresponding to this instance. """

        kwargs = {}

        if self.start_open is not None:
            kwargs["start_open"] = _make_list_value_pb(self.start_open)

        if self.start_closed is not None:
            kwargs["start_closed"] = _make_list_value_pb(self.start_closed)

        if self.end_open is not None:
            kwargs["end_open"] = _make_list_value_pb(self.end_open)

        if self.end_closed is not None:
            kwargs["end_closed"] = _make_list_value_pb(self.end_closed)

        return KeyRangePB(**kwargs)