code: def _gen_overwrite_1d_array_adjustment_case(dtype):
      """
      Generate test cases for overwrite adjustments.
  
      The algorithm used here is the same as the one used above for
      multiplicative adjustments.  The only difference is the semantics of how
      the adjustments are expected to modify the arrays.
  
      This is parameterized on `make_input` and `make_expected_output` functions,
      which take 1-D lists of values and transform them into desired input/output
      arrays. We do this so that we can easily test both vanilla numpy ndarrays
      and our own LabelArray class for strings.
      """
      adjustment_type = {
          bool_dtype: Boolean1DArrayOverwrite,
          float64_dtype: Float641DArrayOverwrite,
          datetime64ns_dtype: Datetime641DArrayOverwrite,
      }[dtype]
      make_expected_dtype = as_dtype(dtype)
      missing_value = default_missing_value_for_dtype(
          datetime64ns_dtype
      )
  
      adjustments = {}
      buffer_as_of = [None] * 6
      baseline = make_expected_dtype(
          [
              [2, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
          ]
      )
  
      buffer_as_of[0] = make_expected_dtype(
          [
              [2, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
          ]
      )
  
      vals1 = [1]
      # Note that row indices are inclusive!
      adjustments[1] = [
          adjustment_type(
              0,
              0,
              0,
              0,
              array([coerce_to_dtype(dtype, val) for val in vals1]),
          )
      ]
      buffer_as_of[1] = make_expected_dtype(
          [
              [1, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
          ]
      )
  
      # No adjustment at index 2.
      buffer_as_of[2] = buffer_as_of[1]
  
      vals3 = [4, 4, 1]
      adjustments[3] = [
          adjustment_type(
              0,
              2,
              0,
              0,
              array([coerce_to_dtype(dtype, val) for val in vals3]),
          )
      ]
      buffer_as_of[3] = make_expected_dtype(
          [
              [4, 2, 2],
              [4, 2, 2],
              [1, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
              [2, 2, 2],
          ]
      )
  
      vals4 = [5] * 4
      adjustments[4] = [
          adjustment_type(
              0,
              3,
              2,
              2,
              array([coerce_to_dtype(dtype, val) for val in vals4]),
          )
      ]
      buffer_as_of[4] = make_expected_dtype(
          [
              [4, 2, 5],
              [4, 2, 5],
              [1, 2, 5],
              [2, 2, 5],
              [2, 2, 2],
              [2, 2, 2],
          ]
      )
  
      vals5 = range(1, 6)
      adjustments[5] = [
          adjustment_type(
              0,
              4,
              1,
              1,
              array([coerce_to_dtype(dtype, val) for val in vals5]),
          ),
      ]
      buffer_as_of[5] = make_expected_dtype(
          [
              [4, 1, 5],
              [4, 2, 5],
              [1, 3, 5],
              [2, 4, 5],
              [2, 5, 2],
              [2, 2, 2],
          ]
      )
      return _gen_expectations(
          baseline,
          missing_value,
          adjustments,
          buffer_as_of,
          nrows=6,
          perspective_offsets=(0, 1),
      )
  
imports: from collections import namedtuple
  from itertools import chain, product
  from string import ascii_lowercase, ascii_uppercase
  from textwrap import dedent
  from unittest import TestCase
  from nose_parameterized import parameterized
  from numpy import arange, array, asarray, dtype, full
  from six.moves import zip_longest
  from toolz import curry
  from zipline.errors import WindowLengthNotPositive, WindowLengthTooLong
  from zipline.lib.adjustment import Boolean1DArrayOverwrite, BooleanOverwrite, Datetime641DArrayOverwrite, Datetime64Overwrite, Float641DArrayOverwrite, Float64Multiply, Float64Overwrite, Int64Overwrite, Object1DArrayOverwrite, ObjectOverwrite
  from zipline.lib.adjusted_array import AdjustedArray
  from zipline.lib.labelarray import LabelArray
  from zipline.testing import check_arrays
  from zipline.testing.predicates import assert_equal
  from zipline.utils.compat import unicode
  from zipline.utils.numpy_utils import coerce_to_dtype, datetime64ns_dtype, default_missing_value_for_dtype, bool_dtype, float64_dtype, int64_dtype, object_dtype
label_desc: Use image node_id 9 for calling a global function with example usage: _gen_overwrite_1d_array_adjustment_case(dtype) and returns: _gen_expectations