# Path: qnd/estimator.py
# def def_estimator(distributed=False):
#     config = def_config(distributed)
# 
#     @util.func_scope
#     def estimator(model_fn, model_dir):
#         return tf.contrib.learn.Estimator(_wrap_model_fn(model_fn),
#                                           config=config(),
#                                           model_dir=model_dir)
# 
#     return estimator
# 
# Path: qnd/flag.py
# FLAGS = gargparse.ARGS
# 
# def add_flag(name, *args, **kwargs):
#     """Add a flag.
# 
#     Added flags can be accessed by `FLAGS` module variable.
#     (e.g. `FLAGS.my_flag_name`)
# 
#     - Args
#         - `name`: Flag name. Real flag name will be `"--{}".format(name)`.
#         - `*args`, `**kwargs`: The rest arguments are the same as
#             `argparse.ArgumentParser.add_argument()`.
#     """
#     global _FLAG_NAMES
# 
#     if 'help' not in kwargs:
#         kwargs['help'] = '(no description)'
# 
#     if name not in _FLAG_NAMES:
#         _FLAG_NAMES.add(name)
#         gargparse.add_argument("--" + name, *args, **kwargs)
# 
# def add_output_dir_flag():
#     add_flag("output_dir",
#              default="output",
#              help="Directory where checkpoint and event files are stored")


import http.server
import json
import logging
import queue
import threading
import numpy as np
import tensorflow as tf
from .estimator import def_estimator
from .flag import FLAGS, add_flag, add_output_dir_flag




def def_serve():
    """Define `serve()` function.

    See also `help(def_serve())`.

    - Returns
        - `serve()` function.
    """

# Path: qnd/estimator.py
# def def_estimator(distributed=False):
#     config = def_config(distributed)
# 
#     @util.func_scope
#     def estimator(model_fn, model_dir):
#         return tf.contrib.learn.Estimator(_wrap_model_fn(model_fn),
#                                           config=config(),
#                                           model_dir=model_dir)
# 
#     return estimator
# 
# Path: qnd/flag.py
# FLAGS = gargparse.ARGS
# 
# def add_flag(name, *args, **kwargs):
#     """Add a flag.
# 
#     Added flags can be accessed by `FLAGS` module variable.
#     (e.g. `FLAGS.my_flag_name`)
# 
#     - Args
#         - `name`: Flag name. Real flag name will be `"--{}".format(name)`.
#         - `*args`, `**kwargs`: The rest arguments are the same as
#             `argparse.ArgumentParser.add_argument()`.
#     """
#     global _FLAG_NAMES
# 
#     if 'help' not in kwargs:
#         kwargs['help'] = '(no description)'
# 
#     if name not in _FLAG_NAMES:
#         _FLAG_NAMES.add(name)
#         gargparse.add_argument("--" + name, *args, **kwargs)
# 
# def add_output_dir_flag():
#     add_flag("output_dir",
#              default="output",
#              help="Directory where checkpoint and event files are stored")


# Path: qnd/serve.py
import http.server
import json
import logging
import queue
import threading
import numpy as np
import tensorflow as tf
from .estimator import def_estimator
from .flag import FLAGS, add_flag, add_output_dir_flag





def def_serve():
    """Define `serve()` function.

    See also `help(def_serve())`.

    - Returns
        - `serve()` function.
    """

    add_output_dir_flag()