def get_transfer_stop_pairs(self):
transfer_stop_pairs = []<EOL>previous_arrival_stop = None<EOL>current_trip_id = None<EOL>for leg in self.legs:<EOL><INDENT>if leg.trip_id is not None and leg.trip_id != current_trip_id and previous_arrival_stop is not None:<EOL><INDENT>transfer_stop_pair = (previous_arrival_stop, leg.departure_stop)<EOL>transfer_stop_pairs.append(transfer_stop_pair)<EOL><DEDENT>previous_arrival_stop = leg.arrival_stop<EOL>current_trip_id = leg.trip_id<EOL><DEDENT>return transfer_stop_pairs<EOL>
Get stop pairs through which transfers take place

Returns
-------
transfer_stop_pairs: list