code: def _get_disorder_mappings(composition, partitions):
          
  
          def _get_replacement_dict_from_partition(partition):
              d = {}  # to be passed to Structure.replace_species()
              for sp_list in partition:
                  if len(sp_list) > 1:
                      total_occ = sum([composition[sp] for sp in sp_list])
                      merged_comp = {sp: composition[sp] / total_occ for sp in sp_list}
                      for sp in sp_list:
                          d[sp] = merged_comp
              return d
  
          disorder_mapping = [_get_replacement_dict_from_partition(p)
                              for p in partitions]
  
          return disorder_mapping
docs: Private method to obtain the mapping to create
          a disordered structure from a given partition.