@classmethod
def get_default_factory(cls, namespace=None, logger=None):
    """ Creates a default connection to the local Docker engine.

        This ``classmethod`` acts as a singleton. If one hasn't been made it
        will attempt to create it and attach the instance to the class
        definition. Because of this the method is the preferable way to obtain
        the default connection so it doesn't get overwritten or modified by
        accident.

        Note:
            By default this method will attempt to connect to the **local**
            Docker engine only. Do not use this when attempting to use
            a remote engine on a different machine.

        Args:
            namespace (str): use this namespace if we're creating a new
                default factory instance.
            logger (:obj:`logging.Logger`): instance of logger to attach
                to this factory instance.

        Returns:
            :obj:`~.ContainerFactory`: instance to interact with Docker engine.
        """
    if cls.DEFAULT is None:
        cls(None, namespace, make_default=True, logger=logger)
    return cls.DEFAULT
