code: def test_datetime_ohlc(self):
      # Check expected outcome for ohlc chart with datetime xaxis
  
      high_data = [
          34.20,
          34.37,
          33.62,
          34.25,
          35.18,
          33.25,
          35.37,
          34.62,
      ]
      low_data = [
          31.70,
          30.75,
          32.87,
          31.62,
          30.81,
          32.75,
          32.75,
          32.87,
      ]
      close_data = [
          34.10,
          31.93,
          33.37,
          33.18,
          31.18,
          33.10,
          32.93,
          33.70,
      ]
      open_data = [
          33.01,
          33.31,
          33.50,
          32.06,
          34.12,
          33.05,
          33.31,
          33.50,
      ]
  
      x = [
          datetime.datetime(year=2013, month=3, day=4),
          datetime.datetime(year=2013, month=6, day=5),
          datetime.datetime(year=2013, month=9, day=6),
          datetime.datetime(year=2013, month=12, day=4),
          datetime.datetime(year=2014, month=3, day=5),
          datetime.datetime(year=2014, month=6, day=6),
          datetime.datetime(year=2014, month=9, day=4),
          datetime.datetime(year=2014, month=12, day=5),
      ]
  
      ohlc_d = ff.create_ohlc(
          open_data, high_data, low_data, close_data, dates=x
      )
  
      ex_ohlc_d = {
          "data": [
              {
                  "line": {"color": "#3D9970", "width": 1},
                  "mode": "lines",
                  "name": "Increasing",
                  "showlegend": False,
                  "text": [
                      "Open",
                      "Open",
                      "High",
                      "Low",
                      "Close",
                      "Close",
                      "",
                      "Open",
                      "Open",
                      "High",
                      "Low",
                      "Close",
                      "Close",
                      "",
                      "Open",
                      "Open",
                      "High",
                      "Low",
                      "Close",
                      "Close",
                      "",
                      "Open",
                      "Open",
                      "High",
                      "Low",
                      "Close",
                      "Close",
                      "",
                  ],
                  "type": "scatter",
                  "x": [
                      datetime.datetime(2013, 2, 14, 4, 48),
                      datetime.datetime(2013, 3, 4, 0, 0),
                      datetime.datetime(2013, 3, 4, 0, 0),
                      datetime.datetime(2013, 3, 4, 0, 0),
                      datetime.datetime(2013, 3, 4, 0, 0),
                      datetime.datetime(2013, 3, 21, 19, 12),
                      None,
                      datetime.datetime(2013, 11, 16, 4, 48),
                      datetime.datetime(2013, 12, 4, 0, 0),
                      datetime.datetime(2013, 12, 4, 0, 0),
                      datetime.datetime(2013, 12, 4, 0, 0),
                      datetime.datetime(2013, 12, 4, 0, 0),
                      datetime.datetime(2013, 12, 21, 19, 12),
                      None,
                      datetime.datetime(2014, 5, 19, 4, 48),
                      datetime.datetime(2014, 6, 6, 0, 0),
                      datetime.datetime(2014, 6, 6, 0, 0),
                      datetime.datetime(2014, 6, 6, 0, 0),
                      datetime.datetime(2014, 6, 6, 0, 0),
                      datetime.datetime(2014, 6, 23, 19, 12),
                      None,
                      datetime.datetime(2014, 11, 17, 4, 48),
                      datetime.datetime(2014, 12, 5, 0, 0),
                      datetime.datetime(2014, 12, 5, 0, 0),
                      datetime.datetime(2014, 12, 5, 0, 0),
                      datetime.datetime(2014, 12, 5, 0, 0),
                      datetime.datetime(2014, 12, 22, 19, 12),
                      None,
                  ],
                  "y": [
                      33.01,
                      33.01,
                      34.2,
                      31.7,
                      34.1,
                      34.1,
                      None,
                      32.06,
                      32.06,
                      34.25,
                      31.62,
                      33.18,
                      33.18,
                      None,
                      33.05,
                      33.05,
                      33.25,
                      32.75,
                      33.1,
                      33.1,
                      None,
                      33.5,
                      33.5,
                      34.62,
                      32.87,
                      33.7,
                      33.7,
                      None,
                  ],
              },
              {
                  "line": {"color": "#FF4136", "width": 1},
                  "mode": "lines",
                  "name": "Decreasing",
                  "showlegend": False,
                  "text": [
                      "Open",
                      "Open",
                      "High",
                      "Low",
                      "Close",
                      "Close",
                      "",
                      "Open",
                      "Open",
                      "High",
                      "Low",
                      "Close",
                      "Close",
                      "",
                      "Open",
                      "Open",
                      "High",
                      "Low",
                      "Close",
                      "Close",
                      "",
                      "Open",
                      "Open",
                      "High",
                      "Low",
                      "Close",
                      "Close",
                      "",
                  ],
                  "type": "scatter",
                  "x": [
                      datetime.datetime(2013, 5, 18, 4, 48),
                      datetime.datetime(2013, 6, 5, 0, 0),
                      datetime.datetime(2013, 6, 5, 0, 0),
                      datetime.datetime(2013, 6, 5, 0, 0),
                      datetime.datetime(2013, 6, 5, 0, 0),
                      datetime.datetime(2013, 6, 22, 19, 12),
                      None,
                      datetime.datetime(2013, 8, 19, 4, 48),
                      datetime.datetime(2013, 9, 6, 0, 0),
                      datetime.datetime(2013, 9, 6, 0, 0),
                      datetime.datetime(2013, 9, 6, 0, 0),
                      datetime.datetime(2013, 9, 6, 0, 0),
                      datetime.datetime(2013, 9, 23, 19, 12),
                      None,
                      datetime.datetime(2014, 2, 15, 4, 48),
                      datetime.datetime(2014, 3, 5, 0, 0),
                      datetime.datetime(2014, 3, 5, 0, 0),
                      datetime.datetime(2014, 3, 5, 0, 0),
                      datetime.datetime(2014, 3, 5, 0, 0),
                      datetime.datetime(2014, 3, 22, 19, 12),
                      None,
                      datetime.datetime(2014, 8, 17, 4, 48),
                      datetime.datetime(2014, 9, 4, 0, 0),
                      datetime.datetime(2014, 9, 4, 0, 0),
                      datetime.datetime(2014, 9, 4, 0, 0),
                      datetime.datetime(2014, 9, 4, 0, 0),
                      datetime.datetime(2014, 9, 21, 19, 12),
                      None,
                  ],
                  "y": [
                      33.31,
                      33.31,
                      34.37,
                      30.75,
                      31.93,
                      31.93,
                      None,
                      33.5,
                      33.5,
                      33.62,
                      32.87,
                      33.37,
                      33.37,
                      None,
                      34.12,
                      34.12,
                      35.18,
                      30.81,
                      31.18,
                      31.18,
                      None,
                      33.31,
                      33.31,
                      35.37,
                      32.75,
                      32.93,
                      32.93,
                      None,
                  ],
              },
          ],
          "layout": {
              "hovermode": "closest",
              "xaxis": {"zeroline": False},
          },
      }
      self.assert_fig_equal(ohlc_d["data"][0], ex_ohlc_d["data"][0])
      self.assert_fig_equal(ohlc_d["data"][1], ex_ohlc_d["data"][1])
      self.assert_fig_equal(ohlc_d["layout"], ex_ohlc_d["layout"])
  
imports: import math
  from unittest import TestCase
  import datetime
  import plotly.figure_factory
  import plotly.io
  from plotly.exceptions import PlotlyError
  from plotly.tests.test_optional.optional_utils import NumpyTestUtilsMixin
  from plotly.graph_objs import graph_objs
  from plotly.tests.utils import TestCaseNoTemplate
label_desc: Use image node_id 9 for calling the TestFinanceCharts obj's underlying member method code with example usage: obj.test_datetime_ohlc() without return types