def write_500_random_profile_urls():
    urls = []
    sample_size = 500
    for profile in page_query(Profile.query):
        products_count = len(profile.tiids)
        if products_count != 0:
            url = "https://staging-impactstory.org/" + profile.url_slug
            urls.append([products_count, url])
            logger.info(u"getting a new profile url out: {url}".format(
                url=url
            ))

    sampled_urls = random.sample(urls, sample_size)

    logger.info(u"writing our {sample_size} sampled profile URLs".format(
        sample_size=sample_size
    ))

    for row in sampled_urls:
        try:
            print "{products_count},{url}".format(
                products_count=row[0],
                url=row[1]
            )
        except UnicodeEncodeError:
            pass  # whatever, we don't need exactly 500



#mint_stripe_customers_for_all_profiles()
dataset/ETHPy150Open Impactstory/total-impact-webapp/scripts.py/write_500_random_profile_urls/operator `>` -> `!=`