import re


def _camel_to_snake(name):
  """ Transform CamelCase name to snake_case name (https://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-snake-case#answer-1176023).
  Args:
    name CamelCase name string
  Returns:
    Equivalent snake_case name string
  """
  return re.sub("([a-z0-9])([A-Z])", r"\1_\2", re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name)).lower()