# Path: sacred/utils.py
# class MissingConfigError(SacredError):
#     """A config value that is needed by a captured function is not present in the provided config."""
# 
#     def __init__(
#         self,
#         message="Configuration values are missing:",
#         missing_configs=(),
#         print_traceback=False,
#         filter_traceback="default",
#         print_usage=True,
#     ):
#         message = "{} {}".format(message, missing_configs)
#         super().__init__(
#             message,
#             print_traceback=print_traceback,
#             filter_traceback=filter_traceback,
#             print_usage=print_usage,
#         )
# 
# class SignatureError(SacredError, TypeError):
#     """Error that is raised when the passed arguments do not match the functions signature."""
# 
#     def __init__(
#         self,
#         message,
#         print_traceback=True,
#         filter_traceback="always",
#         print_usage=False,
#     ):
#         super().__init__(message, print_traceback, filter_traceback, print_usage)


import inspect
from inspect import Parameter
from collections import OrderedDict
from sacred.utils import MissingConfigError, SignatureError


ARG_TYPES = [
    Parameter.POSITIONAL_ONLY,
    Parameter.POSITIONAL_OR_KEYWORD,
    Parameter.KEYWORD_ONLY,
]
POSARG_TYPES = [Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR_KEYWORD]


def get_argspec(f):
    sig = inspect.signature(f)
    args = [n for n, p in sig.parameters.items() if p.kind in ARG_TYPES]
    pos_args = [
        n
        for n, p in sig.parameters.items()
        if p.kind in POSARG_TYPES and p.default == inspect._empty
    ]
    varargs = [
        n for n, p in sig.parameters.items() if p.kind == Parameter.VAR_POSITIONAL
    ]
    # only use first vararg  (how on earth would you have more anyways?)
    vararg_name = varargs[0] if varargs else None

    varkws = [n for n, p in sig.parameters.items() if p.kind == Parameter.VAR_KEYWORD]
    # only use first varkw  (how on earth would you have more anyways?)
    kw_wildcard_name = varkws[0] if varkws else None
    kwargs = OrderedDict(
        [
            (n, p.default)

# Path: sacred/utils.py
# class MissingConfigError(SacredError):
#     """A config value that is needed by a captured function is not present in the provided config."""
# 
#     def __init__(
#         self,
#         message="Configuration values are missing:",
#         missing_configs=(),
#         print_traceback=False,
#         filter_traceback="default",
#         print_usage=True,
#     ):
#         message = "{} {}".format(message, missing_configs)
#         super().__init__(
#             message,
#             print_traceback=print_traceback,
#             filter_traceback=filter_traceback,
#             print_usage=print_usage,
#         )
# 
# class SignatureError(SacredError, TypeError):
#     """Error that is raised when the passed arguments do not match the functions signature."""
# 
#     def __init__(
#         self,
#         message,
#         print_traceback=True,
#         filter_traceback="always",
#         print_usage=False,
#     ):
#         super().__init__(message, print_traceback, filter_traceback, print_usage)


# Path: sacred/config/signature.py
import inspect
from inspect import Parameter
from collections import OrderedDict
from sacred.utils import MissingConfigError, SignatureError



ARG_TYPES = [
    Parameter.POSITIONAL_ONLY,
    Parameter.POSITIONAL_OR_KEYWORD,
    Parameter.KEYWORD_ONLY,
]
POSARG_TYPES = [Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR_KEYWORD]


def get_argspec(f):
    sig = inspect.signature(f)
    args = [n for n, p in sig.parameters.items() if p.kind in ARG_TYPES]
    pos_args = [
        n
        for n, p in sig.parameters.items()
        if p.kind in POSARG_TYPES and p.default == inspect._empty
    ]
    varargs = [
        n for n, p in sig.parameters.items() if p.kind == Parameter.VAR_POSITIONAL
    ]
    # only use first vararg  (how on earth would you have more anyways?)
    vararg_name = varargs[0] if varargs else None

    varkws = [n for n, p in sig.parameters.items() if p.kind == Parameter.VAR_KEYWORD]
    # only use first varkw  (how on earth would you have more anyways?)
    kw_wildcard_name = varkws[0] if varkws else None
    kwargs = OrderedDict(
        [
            (n, p.default)

            for n, p in sig.parameters.items()