<commit_before>"""Test script for wal api.
   This script uses a custom cache location for the files."""
import pathlib
import pywal


CACHE_DIR = pathlib.Path.home() / "wal-test"
COLOR_COUNT = 16


def main():
    """Main function."""
    # Create the custom cache directory.
    pywal.util.create_dir(CACHE_DIR / "schemes")

    # Validate image and pick a random image if a
    # directory is given below.
    #
    # CACHE_DIR is an optional argument and is used to check the current
    # wallpaper against the random selection. This prevents shuffling to
    # the identical image when a directory is passed as an argument.
    image = pywal.get_image("/home/dylan/Pictures/Wallpapers/", CACHE_DIR)

    # Return a dict with the palette.
    #
    # The last argument is 'quiet' mode. When set to true, no notifications
    # are displayed.
    colors = pywal.create_palette(image, CACHE_DIR, COLOR_COUNT, True)

    # Apply the palette to all open terminals.
    # Second argument is a boolean for VTE terminals.
    # Set it to true if the terminal you're using is
    # VTE based. (xfce4-terminal, termite, gnome-terminal.)
    pywal.send_sequences(colors, False, CACHE_DIR)

    # Reload xrdb, i3 and polybar.
    pywal.reload_env(CACHE_DIR)<commit_msg>examples: Update example<commit_after>"""Test script for wal api.
   This script uses a custom cache location for the files."""
import pathlib
import pywal


CACHE_DIR = pathlib.Path.home() / "wal-test"
COLOR_COUNT = 16


def main():
    """Main function."""
    # Create the custom cache directory.
    pywal.util.create_dir(CACHE_DIR / "schemes")

    # Validate image and pick a random image if a
    # directory is given below.
    #
    # CACHE_DIR is an optional argument and is used to check the current
    # wallpaper against the random selection. This prevents shuffling to
    # the identical image when a directory is passed as an argument.
    image = pywal.get_image("/home/dylan/Pictures/Wallpapers/", CACHE_DIR)

    # Return a dict with the palette.
    #
    # The last argument is 'quiet' mode. When set to true, no notifications
    # are displayed.
    colors = pywal.create_palette(image, CACHE_DIR, COLOR_COUNT, quiet=True)

    # Apply the palette to all open terminals.
    # Second argument is a boolean for VTE terminals.
    # Set it to true if the terminal you're using is
    # VTE based. (xfce4-terminal, termite, gnome-terminal.)
    pywal.send_sequences(colors, False, CACHE_DIR)

    # Reload xrdb, i3 and polybar.
    pywal.reload_env(CACHE_DIR)
{'fraction_non_alphanumeric': 0.08257963035784506, 'fraction_numerical': 0.0031458906802988595, 'mean_word_length': 3.218905472636816, 'pattern_counts': {'":': 0, '<': 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': '1342202', 'n_tokens_mistral': 789, 'n_tokens_neox': 742, 'n_words': 295}