code: def restart(config, container, timeout=10, *args, **kwargs):
      '''
      Restart a running container
  
      :type container: string
      :param container: The container id to restart
  
      :type timout: int
      :param timeout: Wait for a timeout to let the container exit gracefully
          before killing it
  
      :rtype: dict
      :returns: boolean
      '''
      err = "Unknown"
      client = _get_client(config)
      try:
          dcontainer = _get_container_infos(config, container)['Id']
          client.restart(dcontainer, timeout=timeout)
          if is_running(config, dcontainer):
              print "Container restarted."
              return True
      except Exception as e:
          err = e
      if stop(config, container, timeout):
          ret = start(config, container)
          if ret: return True
      utils.error("Unable to restart the container: %s"%err)
      return Falsf restart(config, container, timeout=10, *args, **kwargs):
      '''
      Restart a running container
  
      :type container: string
      :param container: The container id to restart
  
      :type timout: int
      :param timeout: Wait for a timeout to let the container exit gracefully
          before killing it
  
      :rtype: dict
      :returns: boolean
      '''
      err = "Unknown"
      client = _get_client(config)
      try:
          dcontainer = _get_container_infos(config, container)['Id']
          client.restart(dcontainer, timeout=timeout)
          if is_running(config, dcontainer):
              print "Container restarted."
              return True
      except Exception as e:
          err = e
      if stop(config, container, timeout):
          ret = start(config, container)
          if ret: return True
      utils.error("Unable to restart the container: %s"%err)
      return False
docs: Restart a running container
  
      :type container: string
      :param container: The container id to restart
  
      :type timout: int
      :param timeout: Wait for a timeout to let the container exit gracefully
          before killing it
  
      :rtype: dict
      :returns: boolean