code: def _data_checks_pivot_wider(
      df,
      index,
      names_from,
      values_from,
      flatten_levels,
      names_sep,
      names_glue,
      reset_index,
      names_expand,
      index_expand,
  ):
      """
      This function raises errors if the arguments have the wrong
      python type, or if the column does not exist in the dataframe.
      This function is executed before proceeding to the computation phase.
      Type annotations are not provided because this function is where type
      checking happens.
      """
  
      is_multi_index = isinstance(df.columns, pd.MultiIndex)
      if index is not None:
          if is_multi_index:
              if not isinstance(index, list):
                  raise TypeError(
                      "For a MultiIndex column, pass a list of tuples "
                      "to the index argument."
                  )
              index = _check_tuples_multiindex(
                  df.columns, index, "index"
              )
          else:
              if is_list_like(index):
                  index = list(index)
              index = get_index_labels(index, df, axis="columns")
              if not is_list_like(index):
                  index = [index]
              else:
                  index = list(index)
  
      if names_from is None:
          raise ValueError(
              "pivot_wider() is missing 1 required argument: 'names_from'"
          )
  
      if is_multi_index:
          if not isinstance(names_from, list):
              raise TypeError(
                  "For a MultiIndex column, pass a list of tuples "
                  "to the names_from argument."
              )
          names_from = _check_tuples_multiindex(
              df.columns, names_from, "names_from"
          )
      else:
          if is_list_like(names_from):
              names_from = list(names_from)
          names_from = get_index_labels(names_from, df, axis="columns")
          if not is_list_like(names_from):
              names_from = [names_from]
          else:
              names_from = list(names_from)
  
      if values_from is not None:
          if is_multi_index:
              if not isinstance(values_from, list):
                  raise TypeError(
                      "For a MultiIndex column, pass a list of tuples "
                      "to the values_from argument."
                  )
              out = _check_tuples_multiindex(
                  df.columns, values_from, "values_from"
              )
          else:
              if is_list_like(values_from):
                  values_from = list(values_from)
              out = get_index_labels(values_from, df, axis="columns")
              if not is_list_like(out):
                  out = [out]
              else:
                  out = list(out)
          # hack to align with pd.pivot
          if values_from == out[0]:
              values_from = out[0]
          else:
              values_from = out
  
      check("flatten_levels", flatten_levels, [bool])
  
      if names_sep is not None:
          check("names_sep", names_sep, [str])
  
      if names_glue is not None:
          check("names_glue", names_glue, [str])
  
      check("reset_index", reset_index, [bool])
      check("names_expand", names_expand, [bool])
      check("index_expand", index_expand, [bool])
  
      return (
          df,
          index,
          names_from,
          values_from,
          flatten_levels,
          names_sep,
          names_glue,
          reset_index,
          names_expand,
          index_expand,
      )
  
imports: import re
  import warnings
  from collections import defaultdict
  from itertools import chain, zip_longest
  from typing import Callable, Optional, Pattern, Union
  import numpy
  import pandas
  import pandas_flavor
  from pandas.api.types import is_categorical_dtype, is_extension_array_dtype, is_list_like
  from pandas.core.dtypes.concat import concat_compat
  from janitor.functions.utils import _computations_expand_grid, get_index_labels
  from janitor.utils import check, refactored_function
label_desc: Use image node_id 14 for calling a global function with example usage: _data_checks_pivot_wider(df, index, names_from, values_from, flatten_levels, names_sep, names_glue, reset_index, names_expand, index_expand) and returns: df,  index,  names_from,  values_from,  flatten_levels,  names_sep,  names_glue,  reset_index,  names_expand,  index_expand