<commit_before>from typing import Any


def attr_property(private_name, type=Any):

    @property
    def attr_property(self):
        return getattr(self, private_name)

    @attr_property.setter
    def attr_property(self, value):
        setattr(self, private_name, value)

    return attr_property


def item_property(name, type=Any):

    @property
    def item_property(self) -> type:
        return self[name]

    @item_property.setter
    def item_property(self, value: type) -> None:
        self[name] = value

    return item_property<commit_msg>Improve item-property typing<commit_after>from typing import Any, MutableMapping, Optional


def attr_property(private_name, type=str):

    @property
    def attr_property(self):
        return getattr(self, private_name)

    @attr_property.setter
    def attr_property(self, value):
        setattr(self, private_name, value)

    return attr_property


def item_property(name):

    @property
    def item_property(self: MutableMapping[str, str]) -> Optional[str]:
        return self.get(name)

    @item_property.setter
    def item_property(self: MutableMapping[str, str], value: str) -> None:
        self[name] = value
    
    @item_property.deleter
    def item_property(self: MutableMapping[str, str]) -> None:
        del self[name]

    return item_property
{'fraction_non_alphanumeric': 0.09405568096313018, 'fraction_numerical': 0.0, 'mean_word_length': 3.433333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '3193930', 'n_tokens_mistral': 416, 'n_tokens_neox': 398, 'n_words': 96}