code: def parse_case(string, acronyms=None, preserve_case=False):
      words, separator, was_upper = _separate_words(string)
      if acronyms:
          acronyms = _sanitize_acronyms(acronyms)
          check_acronym = _advanced_acronym_detection
      else:
          acronyms = []
          check_acronym = _simple_acronym_detection
      i = 0
      s = None
      while i < len(words):
          word = words[i]
          if word is not None and UPPER.match(word):
              if s is None:
                  s = i
          elif s is not None:
              i = check_acronym(s, i, words, acronyms) + 1
              s = None
          i += 1
      if s is not None:
          check_acronym(s, i, words, acronyms)
      words = [w for w in words if w is not None]
      case_type = _determine_case(was_upper, words, string)
      if preserve_case:
          if was_upper:
              words = [w.upper() for w in words]
      else:
          words = _normalize_words(words, acronyms)
      return words, case_type, separator