# Path: sacred/utils.py
# def modules_exist(*modnames):
#     return all(module_exists(m) for m in modnames)
# 
# Path: sacred/utils.py
# def get_package_version(name):
#     """Returns a parsed version string of a package."""
#     version_string = importlib.import_module(name).__version__
#     return parse_version(version_string)
# 
# def parse_version(version_string):
#     """Returns a parsed version string."""
#     return version.parse(version_string)


import importlib
        import warnings
        import tensorflow as tf
        import tensorflow.compat.v1 as tf
    import ctypes
from sacred.utils import modules_exist
from sacred.utils import get_package_version, parse_version
    from ctypes.util import find_library
    # Ensures backward and forward compatibility with TensorFlow 1 and 2.
    if get_package_version("tensorflow") < parse_version("1.13.1"):

        warnings.warn(
            "Use of TensorFlow 1.12 and older is deprecated. "
            "Use Tensorflow 1.13 or newer instead.",
            DeprecationWarning,
        )
    else:
    return tf


# Get libc in a cross-platform way and use it to also flush the c stdio buffers
# credit to J.F. Sebastians SO answer from here:
# http://stackoverflow.com/a/22434262/1388435
try:
except ImportError:
    libc = None
else:
    try:
        libc = ctypes.cdll.msvcrt  # Windows
    except OSError:
        libc = ctypes.cdll.LoadLibrary(find_library("c"))


has_numpy, np = optional_import("numpy")
has_yaml, yaml = optional_import("yaml")
has_pandas, pandas = optional_import("pandas")

has_sqlalchemy = modules_exist("sqlalchemy")

# Path: sacred/utils.py
# def modules_exist(*modnames):
#     return all(module_exists(m) for m in modnames)
# 
# Path: sacred/utils.py
# def get_package_version(name):
#     """Returns a parsed version string of a package."""
#     version_string = importlib.import_module(name).__version__
#     return parse_version(version_string)
# 
# def parse_version(version_string):
#     """Returns a parsed version string."""
#     return version.parse(version_string)


# Path: sacred/optional.py
import importlib
        import warnings
        import tensorflow as tf
        import tensorflow.compat.v1 as tf
    import ctypes
from sacred.utils import modules_exist
from sacred.utils import get_package_version, parse_version
    from ctypes.util import find_library

    # Ensures backward and forward compatibility with TensorFlow 1 and 2.
    if get_package_version("tensorflow") < parse_version("1.13.1"):

        warnings.warn(
            "Use of TensorFlow 1.12 and older is deprecated. "
            "Use Tensorflow 1.13 or newer instead.",
            DeprecationWarning,
        )
    else:
    return tf


# Get libc in a cross-platform way and use it to also flush the c stdio buffers
# credit to J.F. Sebastians SO answer from here:
# http://stackoverflow.com/a/22434262/1388435
try:
except ImportError:
    libc = None
else:
    try:
        libc = ctypes.cdll.msvcrt  # Windows
    except OSError:
        libc = ctypes.cdll.LoadLibrary(find_library("c"))


has_numpy, np = optional_import("numpy")
has_yaml, yaml = optional_import("yaml")
has_pandas, pandas = optional_import("pandas")

has_sqlalchemy = modules_exist("sqlalchemy")

has_mako = modules_exist("mako")