<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _cursor_pb(cursor_pair):
 """Convert a cursor pair to a protobuf. If ``cursor_pair`` is :data:`None`, just returns :data:`None`. Args: cursor_pair (Optional[Tuple[list, bool]]):
 Two-tuple of * a list of field values. * a ``before`` flag Returns: Optional[google.cloud.firestore_v1beta1.types.Cursor]: A protobuf cursor corresponding to the values. """

    if cursor_pair is not None:
        data, before = cursor_pair
        value_pbs = [_helpers.encode_value(value) for value in data]
        return query_pb2.Cursor(values=value_pbs, before=before)