code: def _normalize_array(data, missing_value):
      """
      Coerce buffer data for an AdjustedArray into a standard scalar
      representation, returning the coerced array and a dict of argument to pass
      to np.view to use when providing a user-facing view of the underlying data.
  
      - float* data is coerced to float64 with viewtype float64.
      - int32, int64, and uint32 are converted to int64 with viewtype int64.
      - datetime[*] data is coerced to int64 with a viewtype of datetime64[ns].
      - bool_ data is coerced to uint8 with a viewtype of bool_.
  
      Parameters
      ----------
      data : np.ndarray
  
      Returns
      -------
      coerced, view_kwargs : (np.ndarray, np.dtype)
          The input ``data`` array coerced to the appropriate pipeline type.
          This may return the original array or a view over the same data.
      """
      if isinstance(data, LabelArray):
          return data, {}
  
      data_dtype = data.dtype
      if data_dtype in BOOL_DTYPES:
          return data.astype(uint8, copy=False), {"dtype": dtype(bool_)}
      elif data_dtype in FLOAT_DTYPES:
          return data.astype(float64, copy=False), {
              "dtype": dtype(float64)
          }
      elif data_dtype in INT_DTYPES:
          return data.astype(int64, copy=False), {"dtype": dtype(int64)}
      elif is_categorical(data_dtype):
          if not isinstance(
              missing_value, LabelArray.SUPPORTED_SCALAR_TYPES
          ):
              raise TypeError(
                  "Invalid missing_value for categorical array.\n"
                  "Expected None, bytes or unicode. Got %r."
                  % missing_value,
              )
          return LabelArray(data, missing_value), {}
      elif data_dtype.kind == "M":
          try:
              outarray = data.astype("datetime64[ns]", copy=False).view(
                  "int64"
              )
              return outarray, {"dtype": datetime64ns_dtype}
          except OverflowError:
              raise ValueError(
                  "AdjustedArray received a datetime array "
                  "not representable as datetime64[ns].\n"
                  "Min Date: %s\n"
                  "Max Date: %s\n" % (data.min(), data.max())
              )
      else:
          raise TypeError(
              "Don't know how to construct AdjustedArray "
              "on data of type %s." % data_dtype
          )
  
imports: from textwrap import dedent
  from functools import partial
  from numpy import bool_, dtype, float32, float64, int32, int64, int16, uint16, ndarray, uint32, uint8
  from six import iteritems
  from toolz import merge_with
  from zipline.errors import WindowLengthNotPositive, WindowLengthTooLong
  from zipline.lib.labelarray import LabelArray
  from zipline.utils.numpy_utils import datetime64ns_dtype, float64_dtype, int64_dtype, uint8_dtype
  from zipline.utils.memoize import lazyval
  from ._float64window import AdjustedArrayWindow
  from ._int64window import AdjustedArrayWindow
  from ._labelwindow import AdjustedArrayWindow
  from ._uint8window import AdjustedArrayWindow
label_desc: Use image node_id 3 for calling a global function with example usage: _normalize_array(data, missing_value) and returns: data,  dict, data,  dict, data,  dict, data,  dict, LabelArray,  dict, outarray,  dict