# Path: lambda_src/runcmd/docker/errors.py
# class InvalidVersion(DockerException):
#     pass
# 
# Path: lambda_src/runcmd/docker/utils/decorators.py
# def check_resource(f):
#     @functools.wraps(f)
#     def wrapped(self, resource_id=None, *args, **kwargs):
#         if resource_id is None:
#             if kwargs.get('container'):
#                 resource_id = kwargs.pop('container')
#             elif kwargs.get('image'):
#                 resource_id = kwargs.pop('image')
#         if isinstance(resource_id, dict):
#             resource_id = resource_id.get('Id', resource_id.get('ID'))
#         if not resource_id:
#             raise errors.NullResource(
#                 'image or container param is undefined'
#             )
#         return f(self, resource_id, *args, **kwargs)
#     return wrapped
# 
# def minimum_version(version):
#     def decorator(f):
#         @functools.wraps(f)
#         def wrapper(self, *args, **kwargs):
#             if utils.version_lt(self._version, version):
#                 raise errors.InvalidVersion(
#                     '{0} is not available for version < {1}'.format(
#                         f.__name__, version
#                     )
#                 )
#             return f(self, *args, **kwargs)
#         return wrapper
#     return decorator
# 
# Path: lambda_src/runcmd/docker/utils/utils.py
# def version_lt(v1, v2):
#     return compare_version(v1, v2) > 0


import json
from ..errors import InvalidVersion
from ..utils import check_resource, minimum_version
from ..utils import version_lt
                                                 ipam=ipam_config)
        """
        if options is not None and not isinstance(options, dict):
            raise TypeError('options must be a dictionary')

        data = {
            'Name': name,
            'Driver': driver,
            'Options': options,
            'IPAM': ipam,
            'CheckDuplicate': check_duplicate,
        }

        if labels is not None:
            if version_lt(self._version, '1.23'):
                raise InvalidVersion(
                    'network labels were introduced in API 1.23'
                )
            if not isinstance(labels, dict):
                raise TypeError('labels must be a dictionary')
            data["Labels"] = labels

        if enable_ipv6:
            if version_lt(self._version, '1.23'):
                raise InvalidVersion(
                    'enable_ipv6 was introduced in API 1.23'
                )
            data['EnableIPv6'] = True

        if internal:

# Path: lambda_src/runcmd/docker/errors.py
# class InvalidVersion(DockerException):
#     pass
# 
# Path: lambda_src/runcmd/docker/utils/decorators.py
# def check_resource(f):
#     @functools.wraps(f)
#     def wrapped(self, resource_id=None, *args, **kwargs):
#         if resource_id is None:
#             if kwargs.get('container'):
#                 resource_id = kwargs.pop('container')
#             elif kwargs.get('image'):
#                 resource_id = kwargs.pop('image')
#         if isinstance(resource_id, dict):
#             resource_id = resource_id.get('Id', resource_id.get('ID'))
#         if not resource_id:
#             raise errors.NullResource(
#                 'image or container param is undefined'
#             )
#         return f(self, resource_id, *args, **kwargs)
#     return wrapped
# 
# def minimum_version(version):
#     def decorator(f):
#         @functools.wraps(f)
#         def wrapper(self, *args, **kwargs):
#             if utils.version_lt(self._version, version):
#                 raise errors.InvalidVersion(
#                     '{0} is not available for version < {1}'.format(
#                         f.__name__, version
#                     )
#                 )
#             return f(self, *args, **kwargs)
#         return wrapper
#     return decorator
# 
# Path: lambda_src/runcmd/docker/utils/utils.py
# def version_lt(v1, v2):
#     return compare_version(v1, v2) > 0


# Path: lambda_src/runcmd/docker/api/network.py
import json
from ..errors import InvalidVersion
from ..utils import check_resource, minimum_version
from ..utils import version_lt

                                                 ipam=ipam_config)
        """
        if options is not None and not isinstance(options, dict):
            raise TypeError('options must be a dictionary')

        data = {
            'Name': name,
            'Driver': driver,
            'Options': options,
            'IPAM': ipam,
            'CheckDuplicate': check_duplicate,
        }

        if labels is not None:
            if version_lt(self._version, '1.23'):
                raise InvalidVersion(
                    'network labels were introduced in API 1.23'
                )
            if not isinstance(labels, dict):
                raise TypeError('labels must be a dictionary')
            data["Labels"] = labels

        if enable_ipv6:
            if version_lt(self._version, '1.23'):
                raise InvalidVersion(
                    'enable_ipv6 was introduced in API 1.23'
                )
            data['EnableIPv6'] = True

        if internal:

            if version_lt(self._version, '1.22'):