<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extend(self, other):
 		""" 		Appends the segmentlists from other to the corresponding 		segmentlists in self, adding new segmentslists to self as 		needed. 		"""

		for key, value in other.iteritems():
			if key not in self:
				self[key] = _shallowcopy(value)
			else:
				self[key].extend(value)