code: def make_axis_dummies(frame, axis="minor", transform=None):
      """
      Construct 1-0 dummy variables corresponding to designated axis
      labels
  
      Parameters
      ----------
      frame : DataFrame
      axis : {'major', 'minor'}, default 'minor'
      transform : function, default None
          Function to apply to axis labels first. For example, to
          get "day of week" dummies in a time series regression
          you might call::
  
              make_axis_dummies(panel, axis='major',
                                transform=lambda d: d.weekday())
      Returns
      -------
      dummies : DataFrame
          Column names taken from chosen axis
      """
      numbers = {"major": 0, "minor": 1}
      num = numbers.get(axis, axis)
  
      items = frame.index.levels[num]
      codes = frame.index.codes[num]
      if transform is not None:
          mapped_items = items.map(transform)
          codes, items = _factorize_from_iterable(
              mapped_items.take(codes)
          )
  
      values = np.eye(len(items), dtype=float)
      values = values.take(codes, axis=0)
  
      return DataFrame(values, columns=items, index=frame.index)
  
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 10 for calling a global function with example usage: make_axis_dummies(frame, axis, transform) and returns: DataFrame