def __init__(self, legs=None):
self.legs = []<EOL>self.departure_time = None<EOL>self.arrival_time = None<EOL>self.trip_ids = set()<EOL>self.n_boardings = <NUM_LIT:0><EOL>if legs is not None:<EOL><INDENT>for leg in legs:<EOL><INDENT>self.add_leg(leg)<EOL><DEDENT><DEDENT>
Parameters
----------
legs: list[Connection]