old_contents: """Provides the Transport class."""
  
  from time import time
  
  from sqlalchemy import Column, Integer, ForeignKey
  from sqlalchemy.orm import relationship, backref
  from twisted.internet import reactor
  
  from .base import Base, LocationMixin
  
  
  class Transport(Base, LocationMixin):
      """A destination for a unit."""
  
      __tablename__ = 'transports'
      unit_id = Column(Integer, ForeignKey('units.id'), nullable=False)
      unit = relationship(
          'Unit', backref=backref('transport', uselist=False),
          foreign_keys=[unit_id], remote_side='Unit.id'
      )
      destination_id = Column(
          Integer, ForeignKey('buildings.id'), nullable=False
      )
      destination = relationship('Building', backref='incoming')
      land_time = Column(Integer, nullable=True)
  
      def add_passenger(self, unit):
          """Add a unit to self.passengers, and remove the given unit from the
          map."""
          unit.sound('board.wav')
          unit.location = None
          unit.onboard = self
          unit.save()
  
      def remove_passenger(self, unit):
          """Remove a unit from self.passengers and move it back to the map."""
          unit.onboard = None
          unit.location = self.location
          unit.move(*self.unit.coordinates)
          unit.sound('disembark.wav')
          unit.save()
  
      def launch(self):
          """Remove self.unit from self.location, and schedule a landing."""
          self.unit.sound('launch.wav')
          self.unit.location = None
          duration = self.unit.type.speed * self.unit.distance_to(
              self.destination
          )
          self.land_time = time() + duration
          reactor.callLater(duration, type(self).land, self.id)
  
      @classmethod
      def land(cls, id):
          """Land this unit, assuming the landing field still exists."""
          self = cls.get(id)
          if self is None:
              return  # Destroyed.
          self.unit.location = self.location
          self.unit.move(*self.destination.coordinates)
          self.unit.sound('land.wav')
  
new_contents: """Provides the Transport class."""
  
  from time import time
  
  from sqlalchemy import Column, Integer, ForeignKey
  from sqlalchemy.orm import relationship, backref
  from twisted.internet import reactor
  
  from .base import Base, LocationMixin
  
  
  class Transport(Base, LocationMixin):
      """A destination for a unit."""
  
      __tablename__ = 'transports'
      unit_id = Column(Integer, ForeignKey('units.id'), nullable=False)
      unit = relationship(
          'Unit', backref=backref('transport', uselist=False),
          foreign_keys=[unit_id], remote_side='Unit.id'
      )
      destination_id = Column(
          Integer, ForeignKey('buildings.id'), nullable=False
      )
      destination = relationship('Building', backref='incoming')
      land_time = Column(Integer, nullable=True)
  
      def add_passenger(self, unit):
          """Add a unit to self.passengers, and remove the given unit from the
          map."""
          unit.sound('board.wav')
          unit.location = None
          unit.onboard = self
          unit.save()
  
      def remove_passenger(self, unit):
          """Remove a unit from self.passengers and move it back to the map."""
          unit.onboard = None
          unit.location = self.location
          unit.move(*self.unit.coordinates)
          unit.sound('disembark.wav')
          unit.save()
  
      def launch(self):
          """Remove self.unit from self.location, and schedule a landing."""
          self.unit.sound('launch.wav')
          self.unit.location = None
          duration = self.unit.type.speed * self.unit.distance_to(
              self.destination
          )
          self.land_time = time() + duration
          reactor.callLater(duration, type(self).land, self.id)
  
      @classmethod
      def land(cls, id):
          """Land this unit, assuming the landing field still exists."""
          self = cls.get(id)
          if self is None:
              return  # Destroyed.
          self.unit.location = self.location
          self.unit.coordinates = self.destination.coordinates
          self.unit.sound('land.wav')
  
subject: Set coordinates directly to avoid NoSuchSound being raised.