Convert snake_case to headlessCamelCase.

  Args:
    snake_string: The string to be converted.
  Returns:
    The input string converted to headlessCamelCase.
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:]))
753356
def _snake_to_camel_case(value):
    """"""
    words = value.split("_")
    return words[0] + "".join(map(str.capitalize, words[1:]))
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()
1039801
function stringToCamelCase (str) {
  return str.toLowerCase().replace(rCamel, function (match, group1) {
    return group1.toUpperCase()
  })
}
996885
def snake_case(a_string):
    

    partial = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', a_string)
    return re.sub('([a-z0-9])([A-Z])', r'\1_\2', partial).lower()
167887
def snake_case(string):
    '''  '''
    s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', string)

    return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
642888
function snakeCase(str, { upperCase = false, underscoreBeforeDigits = false } = {}) {
  if (str.length === 0) {
    return str;
  }

  const upper = str.toUpperCase();
  const lower = str.toLowerCase();

  let out = lower[0];

  for (let i = 1, l = str.length; i < l; ++i) {
    const char = str[i];
    const prevChar = str[i - 1];

    const upperChar = upper[i];
    const prevUpperChar = upper[i - 1];

    const lowerChar = lower[i];
    const prevLowerChar = lower[i - 1];

    // If underScoreBeforeDigits is true then, well, insert an underscore
    // before digits :). Only the first digit gets an underscore if
    // there are multiple.
    if (underscoreBeforeDigits && isDigit(char) && !isDigit(prevChar)) {
      out += '_' + char;
      continue;
    }

    // Test if `char` is an upper-case character and that the character
    // actually has different upper and lower case versions.
    if (char === upperChar && upperChar !== lowerChar) {
      // Multiple consecutive upper case characters shouldn't add underscores.
      // For example "fooBAR" should be converted to "foo_bar".
      if (prevChar === prevUpperChar && prevUpperChar !== prevLowerChar) {
        out += lowerChar;
      } else {
        out += '_' + lowerChar;
      }
    } else {
      out += char;
    }
  }

  if (upperCase) {
    return out.toUpperCase();
  } else {
    return out;
  }
}
240870
public static function snakeCase($string, $char = '_')
    {
        $data = \preg_replace('~([a-zа-яё])([A-ZА-ЯЁ])~u', '\\1' . $char . '\\2', $string);

        return static::low($data);
    }
906824
def snake2ucamel(value):
    """"""
    UNDER, LETTER, OTHER = object(), object(), object()
    def group_key_function(char):
        if char == "_":
            return UNDER
        if char in string.ascii_letters:
            return LETTER
        return OTHER
    def process_group(idx, key, chars):
        if key is LETTER:
            return "".join([chars[0].upper()] + chars[1:])
        if key is OTHER     \
        or len(chars) != 1  \
        or idx in [0, last] \
        or LETTER not in (groups[idx-1][1], groups[idx+1][1]):
            return "".join(chars)
        return ""
    raw_groups_gen = itertools.groupby(value, key=group_key_function)
    groups = [(idx, key, list(group_gen))
              for idx, (key, group_gen) in enumerate(raw_groups_gen)]
    last = len(groups) - 1
    return "".join(itertools.starmap(process_group, groups))
1222002
public static function toSnakeCase($string): string
    {
        $string = preg_replace('#([A-Z\d]+)([A-Z][a-z])#', '\1_\2', self::toCamelCase($string));
        $string = preg_replace('#([a-z\d])([A-Z])#', '\1_\2', $string);

        return strtolower(str_replace('-', '_', $string));
    }
330151
def _to_camel_case(string):
        
        components = string.split('_')
        return '%s%s' % (
            components[0],
            ''.join(c.title() for c in components[1:]),
        )
681495
public static function snakecaseToCamelcase(string $string, bool $lower = false): string
    {
        $words = explode('_', $string);

        array_walk($words, function (&$word, $index) {
            $word = ucfirst($word);
        });

        if ($lower) {
            return lcfirst(implode($words));
        }

        return implode($words);
    }
358469
def to_snake_keys(value = self)
      case value
      when Array
        value.map { |v| to_snake_keys(v) }
      when Hash
        snake_hash(value)
      else
        value
      end
    end
1053636
protected function snakeToCamelCase($string, $smallFirst = false)
    {
        $parts = explode('_', $string);

        array_walk($parts, function(&$element) {
           $element = ucfirst($element);
        });

        $result = implode('', $parts);

        return $smallFirst ? lcfirst($result) : $result;
    }
836878
def camel_case(self, snake_case):
        
        components = snake_case.split('_')
        return components[0] + "".join(x.title() for x in components[1:])
1284021
public static String snakeToCamel(String snake, boolean upper) {
        StringBuilder sb = new StringBuilder();
        boolean firstWord = true;
        for (String word : snake.split("_")) {
            if (!word.isEmpty()) {
                if (firstWord && !upper) {
                    sb.append(word.toLowerCase());
                } else {
                    sb.append(Character.toUpperCase(word.charAt(0))).append(word.substring(1).toLowerCase());
                }
                firstWord = false;
            }
        }
        return sb.toString();
    }
8719
func toSnakeCase(name string) (hyphenated string) {
	snakeMemoizer.Lock()
	defer snakeMemoizer.Unlock()
	if hyphenated = snakeMemoizer.memo[name]; hyphenated != "" {
		return hyphenated
	}
	hyphenated = name
	for _, converter := range snakeConverters {
		hyphenated = converter.re.ReplaceAllString(hyphenated, converter.repl)
	}
	hyphenated = strings.ToLower(hyphenated)
	snakeMemoizer.memo[name] = hyphenated
	return
}