code: def _padboth(width, s, has_invisible=True):
      """Center string.
  
      >>> _padboth(6, '\u044f\u0439\u0446\u0430') == ' \u044f\u0439\u0446\u0430 '
      True
  
      """
      iwidth = (
          width + len(s) - len(_strip_invisible(s))
          if has_invisible
          else width
      )
      fmt = "{0:^%ds}" % iwidth
      return fmt.format(s)
  
imports: from __future__ import print_function
  from __future__ import unicode_literals
  from collections import namedtuple
  from platform import python_version_tuple
  import re
label_desc: Use image node_id 13 for calling a global function with example usage: _padboth(width, s, has_invisible) and returns: fmt