def get_instances_to_sync(context, updated_since=None, project_id=None, deleted=True, shuffle=False, uuids_only=False):
 filters = {}
 if (updated_since is not None):
  filters['changes-since'] = updated_since
 if (project_id is not None):
  filters['project_id'] = project_id
 if (not deleted):
  filters['deleted'] = False
 instances = db.instance_get_all_by_filters(context, filters, 'deleted', 'asc')
 if shuffle:
  random.shuffle(instances)
 for instance in instances:
  if uuids_only:
   (yield instance['uuid'])
  else:
   (yield instance)

def get_instances_to_sync ( context , updated_since = None , project_id = None , deleted = True , shuffle = False , uuids_only = False ) : filters = { } if ( updated_since is not None ) : filters [ 'changes-since' ] = updated_since if ( project_id is not None ) : filters [ 'project_id' ] = project_id if ( not deleted ) : filters [ 'deleted' ] = False instances = db . instance_get_all_by_filters ( context , filters , 'deleted' , 'asc' ) if shuffle : random . shuffle ( instances ) for instance in instances : if uuids_only : ( yield instance [ 'uuid' ] ) else : ( yield instance )
return a generator that will return a list of active and deleted instances to sync with parent cells .