<commit_before>#!/usr/bin/env python

import os
import unicodedata
from lcdproc.server import Server

class GeocacheDisplay:
  def __init__(self):
    self.__lcd = Server()
    self.__lcd.start_session()
    self.__screen = self.__lcd.add_screen("cache")
    self.__screen.set_heartbeat("off")
    self.__screen.set_duration(10)
    self.__screen.set_priority("hidden")

    self.__title_widget = self.__screen.add_scroller_widget("title",1,1,12,1,"h",1,"")
    self.__code_widget = self.__screen.add_string_widget("code","",y=2)
    self.__distance_to_cache_widget = self.__screen.add_string_widget("dist","",y=2, x=9)
    self.__bearing_to_cache_widget = self.__screen.add_string_widget("btc","",y=2, x=14)
    self.__bearing_widget = self.__screen.add_string_widget("bearing","",y=1, x=14)

  def update(self, cache_name, code, bearing, bearing_to_cache, distance_to_cache):
    self.__title_widget.set_text(cache_name.encode('ascii'))
    self.__code_widget.set_text(code.encode('ascii'))
    if (distance_to_cache > 1000):
      self.__distance_to_cache_widget.set_text('%0.0fkm' % (distance_to_cache / 1000.0))
    else:
      self.__distance_to_cache_widget.set_text('%0.0fm' % distance_to_cache)
    self.__bearing_widget.set_text(bearing)
    self.__bearing_to_cache_widget.set_text(bearing_to_cache)

  def hide(self):
    self.__screen.set_priority("hidden")

  def show(self, foreground):
    if foreground:
      self.__screen.set_priority("foreground")
    else:
      seld.__screen.set_priority("info")
<commit_msg>fixed typo<commit_after>#!/usr/bin/env python

import os
import unicodedata
from lcdproc.server import Server

class GeocacheDisplay:
  def __init__(self):
    self.__lcd = Server()
    self.__lcd.start_session()
    self.__screen = self.__lcd.add_screen("cache")
    self.__screen.set_heartbeat("off")
    self.__screen.set_duration(10)
    self.__screen.set_priority("hidden")

    self.__title_widget = self.__screen.add_scroller_widget("title",1,1,12,1,"h",1,"")
    self.__code_widget = self.__screen.add_string_widget("code","",y=2)
    self.__distance_to_cache_widget = self.__screen.add_string_widget("dist","",y=2, x=9)
    self.__bearing_to_cache_widget = self.__screen.add_string_widget("btc","",y=2, x=14)
    self.__bearing_widget = self.__screen.add_string_widget("bearing","",y=1, x=14)

  def update(self, cache_name, code, bearing, bearing_to_cache, distance_to_cache):
    self.__title_widget.set_text(cache_name.encode('ascii'))
    self.__code_widget.set_text(code.encode('ascii'))
    if (distance_to_cache > 1000):
      self.__distance_to_cache_widget.set_text('%0.0fkm' % (distance_to_cache / 1000.0))
    else:
      self.__distance_to_cache_widget.set_text('%0.0fm' % distance_to_cache)
    self.__bearing_widget.set_text(bearing)
    self.__bearing_to_cache_widget.set_text(bearing_to_cache)

  def hide(self):
    self.__screen.set_priority("hidden")

  def show(self, foreground):
    if foreground:
      self.__screen.set_priority("foreground")
    else:
      self.__screen.set_priority("info")

{'fraction_non_alphanumeric': 0.13738959764474976, 'fraction_numerical': 0.019627085377821395, 'mean_word_length': 5.091633466135458, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2321508', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1051, 'n_words': 133}