<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cname(cls, map_name, container, instance=None):
 """ Generates a container name that should be used for creating new containers and checking the status of existing containers. In this implementation, the format will be ``<map name>.<container name>.<instance>``. If no instance is provided, it is just ``<map name>.<container name>``. :param map_name: Container map name. :type map_name: unicode | str :param container: Container configuration name. :type container: unicode | str :param instance: Instance name (optional). :type instance: unicode | str :return: Container name. :rtype: unicode | str """

        if instance:
            return '{0}.{1}.{2}'.format(map_name, container, instance)
        return '{0}.{1}'.format(map_name, container)