def __new__(cls, freq=None):
if isinstance(freq, PeriodDtype):<EOL><INDENT>return freq<EOL><DEDENT>elif freq is None:<EOL><INDENT>u = object.__new__(cls)<EOL>u._freq = None<EOL>return u<EOL><DEDENT>if not isinstance(freq, ABCDateOffset):<EOL><INDENT>freq = cls._parse_dtype_strict(freq)<EOL><DEDENT>try:<EOL><INDENT>return cls._cache[freq.freqstr]<EOL><DEDENT>except KeyError:<EOL><INDENT>u = object.__new__(cls)<EOL>u._freq = freq<EOL>cls._cache[freq.freqstr] = u<EOL>return u<EOL><DEDENT>
Parameters
----------
freq : frequency