code: def _unstack_multiple(data, clocs, fill_value=None):
      if len(clocs) == 0:
          return data
  
      # NOTE: This doesn't deal with hierarchical columns yet
  
      index = data.index
  
      clocs = [index._get_level_number(i) for i in clocs]
  
      rlocs = [i for i in range(index.nlevels) if i not in clocs]
  
      clevels = [index.levels[i] for i in clocs]
      ccodes = [index.codes[i] for i in clocs]
      cnames = [index.names[i] for i in clocs]
      rlevels = [index.levels[i] for i in rlocs]
      rcodes = [index.codes[i] for i in rlocs]
      rnames = [index.names[i] for i in rlocs]
  
      shape = [len(x) for x in clevels]
      group_index = get_group_index(
          ccodes, shape, sort=False, xnull=False
      )
  
      comp_ids, obs_ids = compress_group_index(group_index, sort=False)
      recons_codes = decons_obs_group_ids(
          comp_ids, obs_ids, shape, ccodes, xnull=False
      )
  
      if rlocs == []:
          # Everything is in clocs, so the dummy df has a regular index
          dummy_index = Index(obs_ids, name="__placeholder__")
      else:
          dummy_index = MultiIndex(
              levels=rlevels + [obs_ids],
              codes=rcodes + [comp_ids],
              names=rnames + ["__placeholder__"],
              verify_integrity=False,
          )
  
      if isinstance(data, Series):
          dummy = data.copy()
          dummy.index = dummy_index
  
          unstacked = dummy.unstack(
              "__placeholder__", fill_value=fill_value
          )
          new_levels = clevels
          new_names = cnames
          new_codes = recons_codes
      else:
          if isinstance(data.columns, MultiIndex):
              result = data
              for i in range(len(clocs)):
                  val = clocs[i]
                  result = result.unstack(val)
                  clocs = [v if i > v else v - 1 for v in clocs]
  
              return result
  
          dummy = data.copy()
          dummy.index = dummy_index
  
          unstacked = dummy.unstack(
              "__placeholder__", fill_value=fill_value
          )
          if isinstance(unstacked, Series):
              unstcols = unstacked.index
          else:
              unstcols = unstacked.columns
          new_levels = [unstcols.levels[0]] + clevels
          new_names = [data.columns.name] + cnames
  
          new_codes = [unstcols.codes[0]]
          for rec in recons_codes:
              new_codes.append(rec.take(unstcols.codes[-1]))
  
      new_columns = MultiIndex(
          levels=new_levels,
          codes=new_codes,
          names=new_names,
          verify_integrity=False,
      )
  
      if isinstance(unstacked, Series):
          unstacked.index = new_columns
      else:
          unstacked.columns = new_columns
  
      return unstacked
  
imports: from functools import partial
  import itertools
  import numpy
  from pandas._libs import algos, reshape
  from pandas._libs.sparse import IntIndex
  from pandas.compat import PY2, range, text_type, u, zip
  from pandas.core.dtypes.cast import maybe_promote
  from pandas.core.dtypes.common import ensure_platform_int, is_bool_dtype, is_extension_array_dtype, is_integer_dtype, is_list_like, is_object_dtype, needs_i8_conversion
  from pandas.core.dtypes.missing import notna
  from pandas import compat
  import pandas.core.algorithms
  from pandas.core.arrays import SparseArray
  from pandas.core.arrays.categorical import _factorize_from_iterable
  from pandas.core.frame import DataFrame
  from pandas.core.index import Index, MultiIndex
  from pandas.core.internals.arrays import extract_array
  from pandas.core.series import Series
  from pandas.core.sorting import compress_group_index, decons_obs_group_ids, get_compressed_ids, get_group_index
label_desc: Use image node_id 1 for calling a global function with example usage: _unstack_multiple(data, clocs, fill_value) and returns: unstacked, data, result