a helper method to convert camelcase to python
965796
def _to_python(input_string):
    ''' '''
    python_string = ''
    for i in range(len(input_string)):
        if not python_string:
            python_string += input_string[i].lower()
        elif input_string[i].isupper():
            python_string += '_%s' % input_string[i].lower()
        else:
            python_string += input_string[i]
    return python_string
1059530
function camelCase(string) {
  if (typeof string !== 'string') {
    throw new TypeError('First argument must be a string');
  }

  // custom property or no hyphen found
  if (CUSTOM_PROPERTY_OR_NO_HYPHEN_REGEX.test(string)) {
    return string;
  }

  // convert to camelCase
  return string
    .toLowerCase()
    .replace(hyphenPatternRegex, function(_, character) {
      return character.toUpperCase();
    });
}
1031561
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)
708937
def _to_snake_case(string):
        
        sub_string = r'\1_\2'
        string = REGEX_CAMEL_FIRST.sub(sub_string, string)
        return REGEX_CAMEL_SECOND.sub(sub_string, string).lower()
306701
def camelcase2list(s, lower=False):
    """"""
    s = re.findall(r'([A-Z][a-z0-9]+)', s)
    return [w.lower() for w in s] if lower else s
202442
def convert_camel_case_string(name: str) -> str:
    """"""
    string = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name)
    return re.sub("([a-z0-9])([A-Z])", r"\1_\2", string).lower()
688050
def camel_case_to_underscore(name):
    """"""
    res = RE_TOKEN1.sub(r'\1_\2', name)
    res = RE_TOKEN2.sub(r'\1_\2', res)
    return res.lower()
864783
def camelcase v
      case
        when v.is_a?(Array)
          v.map {|i| camelcase(i)}
        when v.is_a?(Hash)
          result = {}
          v.each do |k, val|
            result[k.to_s().camelcase(:lower)] = camelcase(val)
          end
          result
        else
          v
      end
    end
76412
def snake_to_camel(s: str) -> str:
    """"""

    fragments = s.split('_')

    return fragments[0] + ''.join(x.title() for x in fragments[1:])
308874
function formatName(input, noCamelCase){
	input = input.replace(/^-+/, "");
	
	// Convert kebab-case to camelCase
	if(!noCamelCase && /-/.test(input))
		input = input.toLowerCase().replace(/([a-z])-+([a-z])/g, (_, a, b) => a + b.toUpperCase());
	
	return input;
}
1117948
def to_camel_case(snake_case_name):
    
    bits = snake_case_name.split('_')
    return ''.join([bit.capitalize() for bit in bits])
186693
function camelCase(str) {
  var capitaliseLead = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];

  str = str.replace(/_([a-z])/g, function (group) {
    if (group[1]) {
      return group[1].toUpperCase();
    }
  });
  if (capitaliseLead) {
    return str.charAt(0).toUpperCase() + str.slice(1);
  } else {
    return str;
  }
}
535927
private static String camelCaseToSentenceCase(String camelCase) {
        String name = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(camelCase), " ");
        return name.substring(0, 1).toUpperCase(Locale.ENGLISH) + name.substring(1)
                .toLowerCase(Locale.ENGLISH);
    }
1052244
def __camel_case(word):
        
        word = word.lower()
        if '_' in word:
            split_word = word.split('_')
        else:
            split_word = word.split()
        if len(split_word) > 0:
            for i, word in enumerate(split_word):
                if i > 0:
                    split_word[i] = word.title()
        strings = ''.join(split_word)
        return strings
1211965
def camelise(text, capital_first=True):
    """"""

    def camelcase():
        if not capital_first:
            yield str.lower
        while True:
            yield str.capitalize

    if istype(text, 'unicode'):
        text = text.encode('utf8')
    c = camelcase()
    return "".join(next(c)(x) if x else '_' for x in text.split("_"))
775782
def snake_case_to_headless_camel_case(snake_string):
  
  return ''.join([snake_string.split('_')[0]] +
                 list(sub_string.capitalize()
                      for sub_string in snake_string.split('_')[1:]))
578213
def underscores_to_camelcase(argument):
    '''  '''
    result = ''
    previous_was_underscore = False
    for char in argument:
        if char != '_':
            if previous_was_underscore:
                result += char.upper()
            else:
                result += char
        previous_was_underscore = char == '_'
    return result