code: def _unstack_extension_series(series, level, fill_value):
      """
      Unstack an ExtensionArray-backed Series.
  
      The ExtensionDtype is preserved.
  
      Parameters
      ----------
      series : Series
          A Series with an ExtensionArray for values
      level : Any
          The level name or number.
      fill_value : Any
          The user-level (not physical storage) fill value to use for
          missing values introduced by the reshape. Passed to
          ``series.values.take``.
  
      Returns
      -------
      DataFrame
          Each column of the DataFrame will have the same dtype as
          the input Series.
      """
      # Implementation note: the basic idea is to
      # 1. Do a regular unstack on a dummy array of integers
      # 2. Followup with a columnwise take.
      # We use the dummy take to discover newly-created missing values
      # introduced by the reshape.
      from pandas.core.reshape.concat import concat
  
      dummy_arr = np.arange(len(series))
      # fill_value=-1, since we will do a series.values.take later
      result = _Unstacker(
          dummy_arr, series.index, level=level, fill_value=-1
      ).get_result()
  
      out = []
      values = extract_array(series, extract_numpy=False)
  
      for col, indices in result.iteritems():
          out.append(
              Series(
                  values.take(
                      indices.values,
                      allow_fill=True,
                      fill_value=fill_value,
                  ),
                  name=col,
                  index=result.index,
              )
          )
      return concat(
          out, axis="columns", copy=False, keys=result.columns
      )
  
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 4 for calling a global function with example usage: _unstack_extension_series(series, level, fill_value) and returns: concat