code: def parse_scale(x):
      
      match = re.match(r'^(.+?):(\d+)$', x)
      if not match:
          raise ValueError('Invalid scale "%s".' % x)
      return match.group(1), int(match.group(2))
docs: Splits a "%s:%d" string and returns the string and number.
  
      :return: A ``(string, int)`` pair extracted from ``x``.
  
      :raise ValueError: the string ``x`` does not respect the input format.