(phrase, separator='_')
return result
Convert CamelCased phrase into lower-case delimited words.

  Args:
    phrase: CamelCased phrase.
    separator: The word separator to inject between lowercased words.
  Returns:
    lower case phrase with separators between case changes from lower
    to upper or acronyms (all upper) to lower case.
Convert CamelCased phrase into lower-case delimited words.
Convert CamelCased phrase into lower - case delimited words .
def UnCamelCase(phrase, separator='_'):
  """Convert CamelCased phrase into lower-case delimited words.

  Args:
    phrase: CamelCased phrase.
    separator: The word separator to inject between lowercased words.
  Returns:
    lower case phrase with separators between case changes from lower
    to upper or acronyms (all upper) to lower case.
  """
  phrase_len = len(phrase)
  if not phrase_len:
    return ''

  ch = phrase[0]
  text_run = ch.isalnum()
  last_was_separator = ch.isupper() or not text_run
  caps_run = False
  result = ch.lower()

  # already did first index
  for i in range(phrase_len - 1):
    ch = phrase[i + 1]
    if ch.isupper():
      caps_run = text_run and last_was_separator
      text_run = True
      if not last_was_separator:
        result += separator
        last_was_separator = True
    elif not ch.isalnum():
      caps_run = False
      text_run = False
      last_was_separator = True
    else:
      text_run = True
      last_was_separator = False
      if caps_run:
        result += separator
        last_was_separator = True
        caps_run = False

    result += ch.lower()
  return result
def UnCamelCase ( phrase , separator = '_' ) : phrase_len = len ( phrase ) if not phrase_len : return '' ch = phrase [ 0 ] text_run = ch . isalnum ( ) last_was_separator = ch . isupper ( ) or not text_run caps_run = False result = ch . lower ( ) # already did first index for i in range ( phrase_len - 1 ) : ch = phrase [ i + 1 ] if ch . isupper ( ) : caps_run = text_run and last_was_separator text_run = True if not last_was_separator : result += separator last_was_separator = True elif not ch . isalnum ( ) : caps_run = False text_run = False last_was_separator = True else : text_run = True last_was_separator = False if caps_run : result += separator last_was_separator = True caps_run = False result += ch . lower ( ) return result