def find_campaigns(srs, start, end, ignore):
 all_sr_names = set()
 all_campaigns = set()
 srs = set(srs)
 while srs:
  all_sr_names |= {sr.name for sr in srs}
  new_campaigns_by_date = get_campaigns_by_date(srs, start, end, ignore)
  new_campaigns = set(chain.from_iterable(new_campaigns_by_date.itervalues()))
  all_campaigns.update(new_campaigns)
  new_sr_names = set(chain.from_iterable((campaign.target.subreddit_names for campaign in new_campaigns)))
  new_sr_names -= all_sr_names
  srs = set(Subreddit._by_name(new_sr_names).values())
 return all_campaigns

def find_campaigns ( srs , start , end , ignore ) : all_sr_names = set ( ) all_campaigns = set ( ) srs = set ( srs ) while srs : all_sr_names |= { sr . name for sr in srs } new_campaigns_by_date = get_campaigns_by_date ( srs , start , end , ignore ) new_campaigns = set ( chain . from_iterable ( new_campaigns_by_date . itervalues ( ) ) ) all_campaigns . update ( new_campaigns ) new_sr_names = set ( chain . from_iterable ( ( campaign . target . subreddit_names for campaign in new_campaigns ) ) ) new_sr_names -= all_sr_names srs = set ( Subreddit . _by_name ( new_sr_names ) . values ( ) ) return all_campaigns
get all campaigns in srs and pull in campaigns in other targeted srs .