<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def record_changeset(self, custom_changeset_id: uuid.UUID = None) -> uuid.UUID: """ Creates a new changeset. Changesets are referenced by a random uuid4 to prevent collisions between multiple changesets. """

        if custom_changeset_id is not None:
            if custom_changeset_id in self.journal_data:
                raise ValidationError(
                    "Tried to record with an existing changeset id: %r" % custom_changeset_id
                )
            else:
                changeset_id = custom_changeset_id
        else:
            changeset_id = uuid.uuid4()

        self.journal_data[changeset_id] = {}
        return changeset_id