code: def _CamelCaseToSnakeCase(path_name):
    
    result = []
    for c in path_name:
      if c == '_':
        raise ParseError('Fail to parse FieldMask: Path name '
                         '{0} must not contain "_"s.'.format(path_name))
      if c.isupper():
        result += '_'
        result += c.lower()
      else:
        result += c
    return ''.join(result)
docs: Converts a field name from camelCase to snake_case.