code: def unalter_zero_tip_joint_states(tree, feature, state2index):
      
      lh_joint_state_feature = get_personalized_feature_name(feature, BU_LH_JOINT_STATES)
      for tip in tree:
          if tip.dist > 0:
              continue
          state = getattr(tip, feature, set())
          if len(state) > 1:
              allowed_indices = {state2index[_] for _ in state}
              allowed_index = next(iter(allowed_indices))
              joint_states = getattr(tip, lh_joint_state_feature)
              for i in range(len(state2index)):
                  if joint_states[i] not in allowed_indices:
                      joint_states[i] = allowed_index
          elif len(state) == 1:
              tip.add_feature(lh_joint_state_feature, np.ones(len(state2index), np.int) * state2index[next(iter(state))])
docs: Unalters the joint tip states for zero-distance tips
      to contain only their states.
  
      :param state2index: dict, mapping between states and their indices in the joint state array
      :param tree: ete3.Tree, the tree of interest
      :param feature: str, character for which the likelihood was altered
      :return: void, modifies the get_personalised_feature_name(feature, BU_LH_JOINT_STATES) feature to zero-distance tips.