<commit_before># Copyright (c) 2011-2021, <NAME>
# License: MIT License
import ezdxf


def main():
    doc = ezdxf.new("AC1009")

    # block creation
    block = doc.blocks.new("TEST")
    block.add_line((-1, -1), (+1, +1))
    block.add_line((-1, +1), (+1, -1))

    # block usage
    ms = doc.modelspace()
    ms.add_blockref("TEST", (5, 5))
    doc.saveas("using_blocks.dxf")


if __name__ == "__main__":
    main()<commit_msg>refactor example simple_block.py<commit_after># Copyright (c) 2011-2022, <NAME>
# License: MIT License
import pathlib
import ezdxf

CWD = pathlib.Path("~/Desktop/Outbox").expanduser()
if not CWD.exists():
    CWD = pathlib.Path(".")

# ------------------------------------------------------------------------------
# This example shows how to create a BLOCK definition and a block reference
# (INSERT entity).
#
# tutorial: https://ezdxf.mozman.at/docs/tutorials/blocks.html
# ------------------------------------------------------------------------------


def main():
    doc = ezdxf.new("AC1009")

    # Create a BLOCK definition:
    block = doc.blocks.new("TEST")
    block.add_line((-1, -1), (+1, +1))
    block.add_line((-1, +1), (+1, -1))

    # Create a block reference (INSERT entity):
    ms = doc.modelspace()
    ms.add_blockref("TEST", (5, 5))
    doc.saveas(CWD / "using_blocks.dxf")


if __name__ == "__main__":
    main()
{'fraction_non_alphanumeric': 0.2717311906501096, 'fraction_numerical': 0.03214024835646457, 'mean_word_length': 2.1494252873563218, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '7367718', 'n_tokens_mistral': 482, 'n_tokens_neox': 456, 'n_words': 110}