<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
    Define miscellaneous utilities.
"""

from __future__ import absolute_import

import os
import sys
import subprocess
import warnings

__all__ = ('Property',
           'abstract_method',
           'default_opener',
           'deprecate',
           'get_fobj',
           'is_string_like',
           'len_cmp',
           'ordered_partitions',
           'OrderedDict',
           'partitions',
           'partition_set',
           'powerset',
           'product_maker',
           'require_keys',
           'str_product',
           'zip')

try:
    from itertools import izip as zip
except ImportError:
    # 3.x has no izip, since zip is builtin.
    pass

try:
    from collections import OrderedDict
except ImportError:
    from ordereddict import OrderedDict

def Property( fcn ):
    """Simple property decorator.

    Usage:

        @Property
        def attr():
            doc = '''The docstring.'''
            def fget(self):
                pass
            def fset(self, value):
                pass
            def fdel(self)
                pass
            return locals()

    """
    return property( **fcn() )<commit_msg>Assign zip to builtin zip for Python 3.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
    Define miscellaneous utilities.
"""

from __future__ import absolute_import

import os
import sys
import subprocess
import warnings

__all__ = ('Property',
           'abstract_method',
           'default_opener',
           'deprecate',
           'get_fobj',
           'is_string_like',
           'len_cmp',
           'ordered_partitions',
           'OrderedDict',
           'partitions',
           'partition_set',
           'powerset',
           'product_maker',
           'require_keys',
           'str_product',
           'zip')

try:
    from itertools import izip as zip
except ImportError:
    # 3.x has no izip, since zip is builtin.
    zip = zip

try:
    from collections import OrderedDict
except ImportError:
    from ordereddict import OrderedDict

def Property( fcn ):
    """Simple property decorator.

    Usage:

        @Property
        def attr():
            doc = '''The docstring.'''
            def fget(self):
                pass
            def fset(self, value):
                pass
            def fdel(self)
                pass
            return locals()

    """
    return property( **fcn() )
{'fraction_non_alphanumeric': 0.09963547995139732, 'fraction_numerical': 0.002025111381125962, 'mean_word_length': 1.6818675352877308, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5128363', 'n_tokens_mistral': 700, 'n_tokens_neox': 680, 'n_words': 194}