def GetCamelName(histogram_node, depth=0):
  """Returns the first camelcase name part of the histogram node.

  Args:
    histogram_node: The histogram node.
    depth: The depth that specifies which name part will be returned.
        e.g. For a histogram of name
        'CustomTabs.DynamicModule.CreatePackageContextTime'
        The returned camelname for depth 0 is 'Custom';
        The returned camelname for depth 1 is 'Dynamic';
        The returned camelname for depth 2 is 'Create'.

        Default depth is set to 0 as this function is imported and
        used in other files, where depth used is 0.

  Returns:
    The camelcase namepart at specified depth.
    If the number of name parts is less than the depth, return 'others'.
  """
  histogram_name = histogram_node.getAttribute('name')
  split_string_list = histogram_name.split('.')
  if len(split_string_list) <= depth:
    return 'others'
  else:
    name_part = split_string_list[depth]
    start_index = 0
    # |all_upper| is used to identify the case where the name is ABCDelta, in
    # which case the camelname of depth 0 should be ABC, instead of A.
    all_upper = True
    for index, letter in enumerate(name_part):
      if letter.islower() or letter.isnumeric():
        all_upper = False
      if letter.isupper() and all_upper == False:
        start_index = index
        break

  if start_index == 0:
    return name_part
  else:
    return name_part[0:start_index]