code: def test_get_values_for_csv():
      index = pd.date_range(freq="1D", periods=3, start="2017-01-01")
  
      # First, with no arguments.
      expected = np.array(
          ["2017-01-01", "2017-01-02", "2017-01-03"], dtype=object
      )
  
      result = index._get_values_for_csv()
      tm.assert_numpy_array_equal(result, expected)
  
      # No NaN values, so na_rep has no effect
      result = index._get_values_for_csv(na_rep="pandas")
      tm.assert_numpy_array_equal(result, expected)
  
      # Make sure date formatting works
      expected = np.array(
          ["01-2017-01", "01-2017-02", "01-2017-03"], dtype=object
      )
  
      result = index._get_values_for_csv(date_format="%m-%Y-%d")
      tm.assert_numpy_array_equal(result, expected)
  
      # NULL object handling should work
      index = DatetimeIndex(["2017-01-01", NaT, "2017-01-03"])
      expected = np.array(
          ["2017-01-01", "NaT", "2017-01-03"], dtype=object
      )
  
      result = index._get_values_for_csv(na_rep="NaT")
      tm.assert_numpy_array_equal(result, expected)
  
      expected = np.array(
          ["2017-01-01", "pandas", "2017-01-03"], dtype=object
      )
  
      result = index._get_values_for_csv(na_rep="pandas")
      tm.assert_numpy_array_equal(result, expected)
  
      result = index._get_values_for_csv(
          na_rep="NaT", date_format="%Y-%m-%d %H:%M:%S.%f"
      )
      expected = np.array(
          [
              "2017-01-01 00:00:00.000000",
              "NaT",
              "2017-01-03 00:00:00.000000",
          ],
          dtype=object,
      )
      tm.assert_numpy_array_equal(result, expected)
  
      # invalid format
      result = index._get_values_for_csv(
          na_rep="NaT", date_format="foo"
      )
      expected = np.array(["foo", "NaT", "foo"], dtype=object)
      tm.assert_numpy_array_equal(result, expected)
  
imports: from datetime import datetime
  import dateutil.tz
  import numpy
  import pytest
  import pytz
  import pandas
  from pandas import DatetimeIndex, NaT, Series
  import pandas._testing
label_desc: Use image node_id 1 for calling a global function with example usage: test_get_values_for_csv() without return types