def get_any_collection(bus):
 try:
  return Collection(bus)
 except ItemNotFoundException:
  pass
 try:
  return Collection(bus, SESSION_COLLECTION)
 except ItemNotFoundException:
  pass
 collections = list(get_all_collections(bus))
 if collections:
  return collections[0]
 else:
  raise ItemNotFoundException('No collections found.')

def get_any_collection ( bus ) : try : return Collection ( bus ) except ItemNotFoundException : pass try : return Collection ( bus , SESSION_COLLECTION ) except ItemNotFoundException : pass collections = list ( get_all_collections ( bus ) ) if collections : return collections [ 0 ] else : raise ItemNotFoundException ( 'No collections found.' )
returns any collection .