<commit_before># coding=utf-8
from __future__ import absolute_import, division, print_function

__author__ = "<NAME> <<EMAIL>>, <NAME>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"

import datetime
import logging
import subprocess
try:
	import queue
except ImportError:
	import Queue as queue
import threading
import collections

from octoprint.settings import settings
import octoprint.plugin

# singleton
_instance = None


def all_events():
	return [getattr(Events, name) for name in Events.__dict__ if not name.startswith("__")]


class Events(object):
	# application startup
	STARTUP = "Startup"
	SHUTDOWN = "Shutdown"

	# connect/disconnect to printer
	CONNECTING = "Connecting"
	CONNECTED = "Connected"
	DISCONNECTING = "Disconnecting"
	DISCONNECTED = "Disconnected"

	# State changes
	PRINTER_STATE_CHANGED = "PrinterStateChanged"

	# connect/disconnect by client
	CLIENT_OPENED = "ClientOpened"
	CLIENT_CLOSED = "ClientClosed"

	# File management
	UPLOAD = "Upload"
	FILE_SELECTED = "FileSelected"
	FILE_DESELECTED = "FileDeselected"
	UPDATED_FILES = "UpdatedFiles"
	METADATA_ANALYSIS_STARTED = "MetadataAnalysisStarted"
	METADATA_ANALYSIS_FINISHED = "MetadataAnalysisFinished"
	METADATA_STATISTICS_UPDATED = "MetadataStatisticsUpdated"

	FILE_ADDED = "FileAdded",
	FILE_REMOVED = "FileRemoved",
	FOLDER_ADDED = "FolderAdded",
	FOLDER_REMOVED = "FolderRemoved",

	# SD Upload
	TRANSFER_STARTED = "TransferStarted"
	TRANSFER_DONE = "TransferDone"

	# print job
	PRINT_STARTED = "PrintStarted"
	PRINT_DONE = "PrintDone"
	PRINT_FAILED = "PrintFailed"
	PRINT_CANCELLED = "PrintCancelled"
	PRINT_PAUSED = "PrintPaused"
	PRINT_RESUMED = "PrintResumed"
	ERROR = "Error"

	# print/gcode events<commit_msg>Fix File(Added|Removed) and Folder(Added|Removed) events<commit_after># coding=utf-8
from __future__ import absolute_import, division, print_function

__author__ = "<NAME> <<EMAIL>>, <NAME>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"

import datetime
import logging
import subprocess
try:
	import queue
except ImportError:
	import Queue as queue
import threading
import collections

from octoprint.settings import settings
import octoprint.plugin

# singleton
_instance = None


def all_events():
	return [getattr(Events, name) for name in Events.__dict__ if not name.startswith("__")]


class Events(object):
	# application startup
	STARTUP = "Startup"
	SHUTDOWN = "Shutdown"

	# connect/disconnect to printer
	CONNECTING = "Connecting"
	CONNECTED = "Connected"
	DISCONNECTING = "Disconnecting"
	DISCONNECTED = "Disconnected"

	# State changes
	PRINTER_STATE_CHANGED = "PrinterStateChanged"

	# connect/disconnect by client
	CLIENT_OPENED = "ClientOpened"
	CLIENT_CLOSED = "ClientClosed"

	# File management
	UPLOAD = "Upload"
	FILE_SELECTED = "FileSelected"
	FILE_DESELECTED = "FileDeselected"
	UPDATED_FILES = "UpdatedFiles"
	METADATA_ANALYSIS_STARTED = "MetadataAnalysisStarted"
	METADATA_ANALYSIS_FINISHED = "MetadataAnalysisFinished"
	METADATA_STATISTICS_UPDATED = "MetadataStatisticsUpdated"

	FILE_ADDED = "FileAdded"
	FILE_REMOVED = "FileRemoved"
	FOLDER_ADDED = "FolderAdded"
	FOLDER_REMOVED = "FolderRemoved"

	# SD Upload
	TRANSFER_STARTED = "TransferStarted"
	TRANSFER_DONE = "TransferDone"

	# print job
	PRINT_STARTED = "PrintStarted"
	PRINT_DONE = "PrintDone"
	PRINT_FAILED = "PrintFailed"
	PRINT_CANCELLED = "PrintCancelled"
	PRINT_PAUSED = "PrintPaused"
	PRINT_RESUMED = "PrintResumed"
	ERROR = "Error"

	# print/gcode events
{'fraction_non_alphanumeric': 0.08704939919893191, 'fraction_numerical': 0.0032042723631508676, 'mean_word_length': 6.001869158878504, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3359791', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1283, 'n_words': 305}