<commit_before># -*- coding: utf-8 -*-
"""
glifLib.py -- Generic module for reading and writing the .glif format.

More info about the .glif format (GLyphInterchangeFormat) can be found here:

	http://unifiedfontobject.org

The main class in this module is GlyphSet. It manages a set of .glif files
in a folder. It offers two ways to read glyph data, and one way to write
glyph data. See the class doc string for details.
"""

from __future__ import unicode_literals
import os
from io import BytesIO, open
from warnings import warn
from collections import OrderedDict
from fontTools.misc.py23 import basestring, unicode, tobytes
from ufoLib import plistlib
from ufoLib.pointPen import AbstractPointPen, PointToSegmentPen
from ufoLib.filenames import userNameToFileName
from ufoLib.validators import isDictEnough, genericTypeValidator, colorValidator,\
	guidelinesValidator, anchorsValidator, identifierValidator, imageValidator, glyphLibValidator

from lxml import etree

__all__ = [
	"GlyphSet",
	"GlifLibError",
	"readGlyphFromString", "writeGlyphToString",
	"glyphNameToFileName"
]


class GlifLibError(Exception): pass

class MissingPlistError(GlifLibError): pass

# ---------
# Constants
# ---------

LAYERINFO_FILENAME = "layerinfo.plist"
supportedUFOFormatVersions = [1, 2, 3]
supportedGLIFFormatVersions = [1, 2]


# ------------
# Simple Glyph
# ------------<commit_msg>glifLib: use ufoLib.etree<commit_after># -*- coding: utf-8 -*-
"""
glifLib.py -- Generic module for reading and writing the .glif format.

More info about the .glif format (GLyphInterchangeFormat) can be found here:

	http://unifiedfontobject.org

The main class in this module is GlyphSet. It manages a set of .glif files
in a folder. It offers two ways to read glyph data, and one way to write
glyph data. See the class doc string for details.
"""

from __future__ import unicode_literals
import os
from io import BytesIO, open
from warnings import warn
from collections import OrderedDict
from fontTools.misc.py23 import basestring, unicode, tobytes
from ufoLib import plistlib
from ufoLib.pointPen import AbstractPointPen, PointToSegmentPen
from ufoLib.filenames import userNameToFileName
from ufoLib.validators import isDictEnough, genericTypeValidator, colorValidator,\
	guidelinesValidator, anchorsValidator, identifierValidator, imageValidator, glyphLibValidator
from ufoLib import etree


__all__ = [
	"GlyphSet",
	"GlifLibError",
	"readGlyphFromString", "writeGlyphToString",
	"glyphNameToFileName"
]


class GlifLibError(Exception): pass

class MissingPlistError(GlifLibError): pass

# ---------
# Constants
# ---------

LAYERINFO_FILENAME = "layerinfo.plist"
supportedUFOFormatVersions = [1, 2, 3]
supportedGLIFFormatVersions = [1, 2]


# ------------
# Simple Glyph
# ------------
{'fraction_non_alphanumeric': 0.10028860028860029, 'fraction_numerical': 0.005772005772005772, 'mean_word_length': 4.5239043824701195, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '5860977', 'n_tokens_mistral': 868, 'n_tokens_neox': 816, 'n_words': 286}