code: def un_camel_case(text):
      r
      revtext = text[::-1]
      pieces = []
      while revtext:
          match = CAMEL_RE.match(revtext)
          if match:
              pieces.append(match.group(1))
              revtext = revtext[match.end():]
          else:
              pieces.append(revtext)
              revtext = ''
      revstr = ' '.join(piece.strip(' _') for piece in pieces
                        if piece.strip(' _'))
      return revstr[::-1].replace('- ', '-')
docs: r"""
      Splits apart words that are written in CamelCase.
  
      Bugs:
  
      - Non-ASCII characters are treated as lowercase letters, even if they are
        actually capital letters.
  
      Examples:
  
      >>> un_camel_case('1984ZXSpectrumGames')
      '1984 ZX Spectrum Games'
  
      >>> un_camel_case('aaAa aaAaA 0aA  AAAa!AAA')
      'aa Aa aa Aa A 0a A AA Aa! AAA'
  
      >>> un_camel_case('MotörHead')
      'Mot\xf6r Head'
  
      >>> un_camel_case('MSWindows3.11ForWorkgroups')
      'MS Windows 3.11 For Workgroups'
  
      This should not significantly affect text that is not camel-cased:
  
      >>> un_camel_case('ACM_Computing_Classification_System')
      'ACM Computing Classification System'
  
      >>> un_camel_case('Anne_Blunt,_15th_Baroness_Wentworth')
      'Anne Blunt, 15th Baroness Wentworth'
  
      >>> un_camel_case('Hindi-Urdu')
      'Hindi-Urdu'