<commit_before># -*- coding: utf-8 -*-
u"""
Created on 2015-8-14

@author: cheng.li
"""

from finpy.Patterns.ClassProperty import ClassPropertyMetaClass
from finpy.Patterns.ClassProperty import classproperty
from finpy.DateUtilities import Date


class Settings(object):
    __metaclass__ = ClassPropertyMetaClass
    _evaluationDate = Date.todaysDate()

    @classproperty
    def evaluationDate(cls):
        return cls._evaluationDate

    @evaluationDate.setter
    def evaluationDate(cls, value):
        if not isinstance(value, Date):
            raise ValueError("{0} is not a valid finpy date object".format(value))
        cls._evaluationDate = value
<commit_msg>more setting method<commit_after># -*- coding: utf-8 -*-
u"""
Created on 2015-8-14

@author: cheng.li
"""

from finpy.Patterns.ClassProperty import ClassPropertyMetaClass
from finpy.Patterns.ClassProperty import classproperty
from finpy.DateUtilities import Date


class Settings(object):
    __metaclass__ = ClassPropertyMetaClass
    _evaluationDate = None

    @classproperty
    def evaluationDate(cls):
        if cls._evaluationDate is None:
            return Date.todaysDate()
        return cls._evaluationDate

    @evaluationDate.setter
    def evaluationDate(cls, value):
        if not isinstance(value, Date):
            raise ValueError("{0} is not a valid finpy date object".format(value))
        cls._evaluationDate = value

    @classmethod
    def resetEvaluationDate(cls):
        cls._evaluationDate = None

    @classmethod
    def anchorEvaluationDate(cls):
        if cls._evaluationDate is None:
            cls._evaluationDate = Date.todaysDate()
{'fraction_non_alphanumeric': 0.08682452944748027, 'fraction_numerical': 0.01092896174863388, 'mean_word_length': 3.3713527851458887, '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': '1419381', 'n_tokens_mistral': 480, 'n_tokens_neox': 467, 'n_words': 124}