# Path: pykern/pkconfig.py
# STRING_TYPES = pkconst.STRING_TYPES
# CHANNEL_ATTR = 'pykern_pkconfig_channel'
# KEY_RE = re.compile('^[a-z][a-z0-9_]*[a-z0-9]$', flags=re.IGNORECASE)
# TUPLE_SEP = ':'
# VALID_CHANNELS = ('dev', 'alpha', 'beta', 'prod')
# INTERNAL_TEST_CHANNELS = VALID_CHANNELS[0:2]
# CHANNEL_DEFAULT = VALID_CHANNELS[0]
# _PARSE_NONE_ATTR = 'pykern_pkconfig_parse_none'
# _PARSE_SECONDS = re.compile(
#     r'^(?:(\d+)d)?(?:(?:(?:(\d+):)?(\d+):)?(\d+))?$',
#     flags=re.IGNORECASE,
# )
# _PARSE_BYTES = re.compile(r'^(\d+)([kmgtp]?)b?$', flags=re.IGNORECASE)
# _PARSE_BYTES_MULTIPLIER = PKDict(
#     k=1024,
#     m=1024**2,
#     g=1024**3,
#     t=1024**4,
# )
# class ReplacedBy(tuple, object):
# class Required(tuple, object):
# class RequiredUnlessDev(tuple, object):
# class _Declaration(object):
# class _Key(str, object):
#     def __new__(cls, new_name):
#     def __new__(cls, *args):
#     def __new__(cls, *args):
# def append_load_path(load_path):
# def channel_in(*args, **kwargs):
# def channel_in_internal_test(channel=None):
# def init(**kwargs):
# def flatten_values(base, new):
# def parse_none(func):
# def parse_bool(value):
# def parse_bytes(value):
# def parse_seconds(value):
# def parse_set(value):
# def parse_tuple(value):
# def raise_error(msg):
# def reset_state_for_testing(add_to_environ=None):
# def to_environ(cfg_keys, values=None, exclude_re=None):
#     def a(k, v):
#     def __init__(self, value):
#     def _fixup_parser(self):
#     def __new__(cls, parts):
# def _clean_environ():
# def _coalesce_values():
# def _flatten_keys(key_parts, values, res):
# def _iter_decls(decls, res):
# def _resolver(decl):
# def _resolve_dict(key, decl):
# def _resolve_list(key, decl):
# def _resolve_value(key, decl):
# def _z(msg):
# 
# Path: pykern/pkdebug.py
# def pkdc(fmt, *args, **kwargs):
#     """Conditional print a message to `output` selectively based on `control`.
# 
#     Controlled output that you can leave in your code permanently.
# 
#     Args:
#         fmt (str): how to :func:`str.format`
#         args: what to format
#         kwargs: what to format
#     """
#     # Since calls are left in for product, this check has
#     # some value.
#     if _have_control:
#         _printer._write(fmt, args, kwargs, with_control=True)
# 
# def pkdp(fmt_or_arg, *args, **kwargs):
#     """Print a message to `output` unconditionally, possibly returning its arg
# 
#     Use for print statements in your code that you don't intend
#     to keep in the system.
# 
#     Use `pkdlog` for permanent log messages.
# 
#     Args:
#         fmt_or_arg (object): how to :func:`str.format`, or object to print
#         args: what to format
#         kwargs: what to format
# 
#     Returns:
#         object: Will return fmt_or_arg, if args and kwargs are empty
#     """
#     if args or kwargs:
#         _printer._write(fmt_or_arg, args, kwargs, with_control=False)
#     else:
#         _printer._write('{}', [fmt_or_arg], {}, with_control=False)
#         return fmt_or_arg


from pykern import pkconfig
from pykern.pkdebug import pkdc, pkdp
import os
    import dateutil.parser
# -*- coding: utf-8 -*-
u"""test `pykern.pkconfig`

:copyright: Copyright (c) 2015 RadiaSoft LLC.  All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function

def _custom_p6(v):
    return dateutil.parser.parse(v)

@pkconfig.parse_none
def _some_key(v):
    if v is None:
        return 999
    return int(v)


# Path: pykern/pkconfig.py
# STRING_TYPES = pkconst.STRING_TYPES
# CHANNEL_ATTR = 'pykern_pkconfig_channel'
# KEY_RE = re.compile('^[a-z][a-z0-9_]*[a-z0-9]$', flags=re.IGNORECASE)
# TUPLE_SEP = ':'
# VALID_CHANNELS = ('dev', 'alpha', 'beta', 'prod')
# INTERNAL_TEST_CHANNELS = VALID_CHANNELS[0:2]
# CHANNEL_DEFAULT = VALID_CHANNELS[0]
# _PARSE_NONE_ATTR = 'pykern_pkconfig_parse_none'
# _PARSE_SECONDS = re.compile(
#     r'^(?:(\d+)d)?(?:(?:(?:(\d+):)?(\d+):)?(\d+))?$',
#     flags=re.IGNORECASE,
# )
# _PARSE_BYTES = re.compile(r'^(\d+)([kmgtp]?)b?$', flags=re.IGNORECASE)
# _PARSE_BYTES_MULTIPLIER = PKDict(
#     k=1024,
#     m=1024**2,
#     g=1024**3,
#     t=1024**4,
# )
# class ReplacedBy(tuple, object):
# class Required(tuple, object):
# class RequiredUnlessDev(tuple, object):
# class _Declaration(object):
# class _Key(str, object):
#     def __new__(cls, new_name):
#     def __new__(cls, *args):
#     def __new__(cls, *args):
# def append_load_path(load_path):
# def channel_in(*args, **kwargs):
# def channel_in_internal_test(channel=None):
# def init(**kwargs):
# def flatten_values(base, new):
# def parse_none(func):
# def parse_bool(value):
# def parse_bytes(value):
# def parse_seconds(value):
# def parse_set(value):
# def parse_tuple(value):
# def raise_error(msg):
# def reset_state_for_testing(add_to_environ=None):
# def to_environ(cfg_keys, values=None, exclude_re=None):
#     def a(k, v):
#     def __init__(self, value):
#     def _fixup_parser(self):
#     def __new__(cls, parts):
# def _clean_environ():
# def _coalesce_values():
# def _flatten_keys(key_parts, values, res):
# def _iter_decls(decls, res):
# def _resolver(decl):
# def _resolve_dict(key, decl):
# def _resolve_list(key, decl):
# def _resolve_value(key, decl):
# def _z(msg):
# 
# Path: pykern/pkdebug.py
# def pkdc(fmt, *args, **kwargs):
#     """Conditional print a message to `output` selectively based on `control`.
# 
#     Controlled output that you can leave in your code permanently.
# 
#     Args:
#         fmt (str): how to :func:`str.format`
#         args: what to format
#         kwargs: what to format
#     """
#     # Since calls are left in for product, this check has
#     # some value.
#     if _have_control:
#         _printer._write(fmt, args, kwargs, with_control=True)
# 
# def pkdp(fmt_or_arg, *args, **kwargs):
#     """Print a message to `output` unconditionally, possibly returning its arg
# 
#     Use for print statements in your code that you don't intend
#     to keep in the system.
# 
#     Use `pkdlog` for permanent log messages.
# 
#     Args:
#         fmt_or_arg (object): how to :func:`str.format`, or object to print
#         args: what to format
#         kwargs: what to format
# 
#     Returns:
#         object: Will return fmt_or_arg, if args and kwargs are empty
#     """
#     if args or kwargs:
#         _printer._write(fmt_or_arg, args, kwargs, with_control=False)
#     else:
#         _printer._write('{}', [fmt_or_arg], {}, with_control=False)
#         return fmt_or_arg


# Path: tests/pkconfig_data/p1/m1.py
from pykern import pkconfig
from pykern.pkdebug import pkdc, pkdp
import os
    import dateutil.parser

# -*- coding: utf-8 -*-
u"""test `pykern.pkconfig`

:copyright: Copyright (c) 2015 RadiaSoft LLC.  All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function

def _custom_p6(v):
    return dateutil.parser.parse(v)

@pkconfig.parse_none
def _some_key(v):
    if v is None:
        return 999
    return int(v)


cfg = pkconfig.init(