<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_python(self, value):
 """Expect list of record instances, convert to a SortedDict for internal representation"""

        if not self.multiselect:
            if value and not isinstance(value, list):
                value = [value]

        value = value or []

        records = SortedDict()

        for record in value:
            self.validate_value(record)
            records[record.id] = record

        return_value = self._set(records)
        self.record._raw['values'][self.id] = self.get_swimlane()

        return return_value