<commit_before>#!/usr/bin/env python
import argparse
import sys

import logging
log = logging.getLogger()

from display.virtual import PyGameScene
from display.atmosphere import Sky


def world_callback(world):
    return False

PIXELS = 90


if __name__ == "__main__":
    log.setLevel(logging.INFO)
    logging.basicConfig(format="%(thread)d:%(asctime)s:%(levelname)s:%(module)s :: %(message)s")

    parser = argparse.ArgumentParser()
    parser.add_argument('-v', action="store_true", dest="virtual", default=False,
                        help='Use virtual scene instead of NeoPixel')

    arg = parser.parse_args(sys.argv[1:])

    try:
        from display.neopixel import NeoPixelScene
    except:
        print "Failed to load NeoPixelScene, forcing virtual"
        arg.virtual = True

    if arg.virtual:
        scene = PyGameScene(PIXELS, pixel_size=10)
    else:
        scene = NeoPixelScene(PIXELS)

    scene.add_sprite( Sky(clouds=2, world_size=PIXELS) )
    scene.run( world_callback )<commit_msg>only import pygame vs neopixel related libraries in the testing when necessary<commit_after>#!/usr/bin/env python
import argparse
import sys

import logging
log = logging.getLogger()

from display.atmosphere import Sky


def world_callback(world):
    return False

PIXELS = 90


if __name__ == "__main__":
    log.setLevel(logging.INFO)
    logging.basicConfig(format="%(thread)d:%(asctime)s:%(levelname)s:%(module)s :: %(message)s")

    parser = argparse.ArgumentParser()
    parser.add_argument('-v', action="store_true", dest="virtual", default=False,
                        help='Use virtual scene instead of NeoPixel')

    arg = parser.parse_args(sys.argv[1:])

    if arg.virtual:
        from display.virtual import PyGameScene
        scene = PyGameScene(PIXELS, pixel_size=10)
    else:
        from display.neopixel import NeoPixelScene
        scene = NeoPixelScene(PIXELS)

    scene.add_sprite( Sky(clouds=2, world_size=PIXELS) )
    scene.run( world_callback )
{'fraction_non_alphanumeric': 0.11183550651955868, 'fraction_numerical': 0.006018054162487462, 'mean_word_length': 3.6180555555555554, 'pattern_counts': {'":': 2, '<': 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': '1824139', 'n_tokens_mistral': 657, 'n_tokens_neox': 626, 'n_words': 144}