#NEWLINE# def serialize_pass_slots( pass_slots , by_gs = True ) : #NEWLINE# #INDENT# '\n    Serializes a list of pass slots into an array of JSON-like serializable\n    slot objects.\n\n    :param pass_slots: Original array with the database slot models\n    :param by_gs: Indicates whether the serialization should be by GS\n    :return: Serializable list\n    ' #NEWLINE# serial_array = [ ] #NEWLINE# for s in pass_slots : #NEWLINE# #INDENT# serial_array . append ( { #NEWLINE# #INDENT# segment_serializers . SC_ID_K : s . spacecraft . identifier , #NEWLINE# segment_serializers . GS_ID_K : by_gs . groundstation . identifier , #NEWLINE# availability_serializers . DATE_START_K : s . start . isoformat ( ) , #NEWLINE# availability_serializers . DATE_END_K : s . end . isoformat ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return serial_array