<commit_before>from pathlib import Path
import logging
import ezdxf
from ezdxf.proxygraphic import ProxyGraphicDebugger

ezdxf.options.load_proxy_graphics = True

OUTBOX = Path('~/Desktop/Outbox').expanduser()
logging.basicConfig(filename=OUTBOX / "ezdxf-log.txt", level='DEBUG')
logger = logging.getLogger('ezdxf')

DXFTEST = Path(r'D:\Source\dxftest')
MBWAY_EXAMPLE = DXFTEST / "mleader" / "mbway-mleader.dxf"

doc = ezdxf.readfile(MBWAY_EXAMPLE)
mleader = doc.entitydb['403']
with open(OUTBOX / "proxy-debug.txt", mode="wt") as stream:
    proxy = ProxyGraphicDebugger(mleader.proxy_graphic, doc,
                                 debug_stream=stream)
    proxy.log_commands()
    proxy.log_entities()

logging.shutdown()
<commit_msg>minor edit<commit_after>from pathlib import Path
import logging
import ezdxf
from ezdxf.proxygraphic import ProxyGraphicDebugger

ezdxf.options.load_proxy_graphics = True

OUTBOX = Path('~/Desktop/Outbox').expanduser()
logging.basicConfig(filename=OUTBOX / "ezdxf-log.txt", level='DEBUG')
logger = logging.getLogger('ezdxf')

EXAMPLE = Path(ezdxf.EZDXF_TEST_FILES) / "mleader" / "mbway-mleader.dxf"

doc = ezdxf.readfile(EXAMPLE)
mleader = doc.entitydb['403']
with open(OUTBOX / "proxy-debug.txt", mode="wt") as stream:
    proxy = ProxyGraphicDebugger(mleader.proxy_graphic, doc,
                                 debug_stream=stream)
    proxy.log_commands()
    proxy.log_entities()

logging.shutdown()

{'fraction_non_alphanumeric': 0.12421929215822346, 'fraction_numerical': 0.004163775156141568, 'mean_word_length': 4.5038167938931295, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6585940', 'n_tokens_mistral': 514, 'n_tokens_neox': 502, 'n_words': 87}