def _yield_all_instance_groups(emr_conn, cluster_id, *args, **kwargs):
 for resp in _repeat(emr_conn.list_instance_groups, cluster_id, *args, **kwargs):
  for group in getattr(resp, 'instancegroups', []):
   (yield group)

def _yield_all_instance_groups ( emr_conn , cluster_id , * args , ** kwargs ) : for resp in _repeat ( emr_conn . list_instance_groups , cluster_id , * args , ** kwargs ) : for group in getattr ( resp , 'instancegroups' , [ ] ) : ( yield group )
get all instance groups for the given cluster .