<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_struct_gradient(self, shape_number):
 """Get the values for the GRADIENT record."""

        obj = _make_object("Gradient")
        bc = BitConsumer(self._src)
        obj.SpreadMode = bc.u_get(2)
        obj.InterpolationMode = bc.u_get(2)
        obj.NumGradients = bc.u_get(4)
        obj.GradientRecords = gradient_records = []

        for _ in range(obj.NumGradients):
            record = _make_object("GradRecord")
            gradient_records.append(record)
            record.Ratio = unpack_ui8(self._src)
            if shape_number <= 2:
                record.Color = self._get_struct_rgb()
            else:
                record.Color = self._get_struct_rgba()
        return obj