def get_flattened_track(track):
 flat_track = [track]
 if (track.can_show_chains and track.is_showing_chains):
  instruments = list(find_instrument_devices(track))
  flat_track.extend([c for c in instruments[0].chains])
 return flat_track

def get_flattened_track ( track ) : flat_track = [ track ] if ( track . can_show_chains and track . is_showing_chains ) : instruments = list ( find_instrument_devices ( track ) ) flat_track . extend ( [ c for c in instruments [ 0 ] . chains ] ) return flat_track
returns a flat list of a track with its instrument chains .