<commit_before>"""
Example code to show how you can start a YouTube movie
whenever the idle screen is shown.
"""
import time

import pychromecast

cast = pychromecast.PyChromecast()

while True:
    cast.refresh()

    if cast.app_id == pychromecast.APP_ID['HOME']:
        print "Hey, we are on the home screen :( Starting YouTube.."
        pychromecast.play_youtube_video("kxopViU98Xo", cast.host)

    time.sleep(10)
<commit_msg>Fixing example<commit_after>"""
Example code to show how you can start a YouTube movie
whenever the idle screen is shown.
"""
import time

import pychromecast

if __name__ == "__main__":
    cast = pychromecast.get_chromecast(strict=False)

    while True:
        cast.refresh()

        if cast.app_id == pychromecast.APP_ID['HOME']:
            print "Hey, we are on the home screen :( Starting YouTube.."
            pychromecast.play_youtube_video("kxopViU98Xo", ip=cast.host)

        time.sleep(10)

{'fraction_non_alphanumeric': 0.10117145899893504, 'fraction_numerical': 0.008519701810436636, 'mean_word_length': 3.392523364485981, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5543338', 'n_tokens_mistral': 322, 'n_tokens_neox': 308, 'n_words': 90}