def find_instrument_devices(track_or_chain):
 instrument = find_if((lambda d: (d.type == Live.Device.DeviceType.instrument)), track_or_chain.devices)
 if (instrument and (not instrument.can_have_drum_pads) and instrument.can_have_chains):
  return chain([instrument], *imap(find_instrument_devices, instrument.chains))
 return []

def find_instrument_devices ( track_or_chain ) : instrument = find_if ( ( lambda d : ( d . type == Live . Device . DeviceType . instrument ) ) , track_or_chain . devices ) if ( instrument and ( not instrument . can_have_drum_pads ) and instrument . can_have_chains ) : return chain ( [ instrument ] , * imap ( find_instrument_devices , instrument . chains ) ) return [ ]
returns a list with all instrument rack descendants from a track or chain .