<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
plugin to create identicons
Reference: https://github.com/azaghal/pydenticon/blob/master/docs/usage.rst
Might be used to create a colored overlay over a b/w wallpaper
"""

import pydenticon, core

is_sam_plugin = 0
name = "Identicon"
keywords = ["identicon"]
has_toggle = 0
has_set = 0

def main():
    """
    generates an identicon and sends it to the G2
    possibly via an AutoRemote Plugin?
    """
    generator = pydenticon.Generator(5, 5)
    identicon = generator.generate("<EMAIL>", 200, 200)
    f = open("sample.png", "wb")
    f.write(identicon)
    f.close()
    # Send image to phone

def initialize():
    core.log(name, "Everything's fine.")

def process(key, param, comm):
    pass<commit_msg>this is now a thing<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
plugin to create identicons
Reference: https://github.com/azaghal/pydenticon/blob/master/docs/usage.rst
Might be used to create a colored overlay over a b/w wallpaper
"""

import pydenticon, core, time, global_variables

is_sam_plugin = 1
name = "Identicon"
keywords = ["identicon", "schedule_h"]
has_toggle = 0
has_set = 0

def generate(data="I'm Samantha"):
    """
    generates an identicon and sends it to the G2
    possibly via an AutoRemote Plugin?
    """
    generator = pydenticon.Generator(5, 5)
    identicon = generator.generate(data, 200, 200)
    f = open(global_variables.folder_base + "/data/identicon.png", "wb")
    f.write(identicon)
    f.close()
    # Send image to phone

def initialize():
    core.log(name, "Everything's fine.")

def stop():
    core.log(name, "I'm not even running anymore!")
    
def process(key, param, comm):
    if key == "identicon":
        core.log(name, "Generating an Identicon with the data {}.".format(param))
        if param:
            generate(param)
        else:
            generate()
    elif key == "schedule_h" and param == "0":
        generate(time.time())
    else:
        
{'fraction_non_alphanumeric': 0.13373253493013973, 'fraction_numerical': 0.01347305389221557, 'mean_word_length': 3.18580375782881, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '6692283', 'n_tokens_mistral': 683, 'n_tokens_neox': 642, 'n_words': 193}