code: def plot_candlestick(df, symbol, datecol="date", directory=None):
      r"""Plot time series data.
  
      Parameters
      ----------
      df : pandas.DataFrame
          The dataframe containing the ``target`` feature.
      symbol : str
          Unique identifier of the data to plot.
      datecol : str, optional
          The name of the date column.
      directory : str, optional
          The full specification of the plot location.
  
      Returns
      -------
      None : None.
  
      Notes
      -----
      The dataframe ``df`` must contain these columns:
  
      * ``open``
      * ``high``
      * ``low``
      * ``close``
  
      References
      ----------
  
      http://bokeh.pydata.org/en/latest/docs/gallery/candlestick.html
  
      """
  
      df[datecol] = pd.to_datetime(df[datecol])
  
      mids = (df.open + df.close) / 2
      spans = abs(df.close - df.open)
  
      inc = df.close > df.open
      dec = df.open > df.close
      w = 12 * 60 * 60 * 1000  # half day in ms
  
      TOOLS = "pan, wheel_zoom, box_zoom, reset, save"
  
      p = figure(
          x_axis_type="datetime",
          tools=TOOLS,
          plot_width=1000,
          toolbar_location="left",
      )
  
      p.title = BSEP.join([symbol.upper(), "Candlestick"])
      p.xaxis.major_label_orientation = math.pi / 4
      p.grid.grid_line_alpha = 0.3
  
      p.segment(df.date, df.high, df.date, df.low, color="black")
      p.rect(
          df.date[inc],
          mids[inc],
          w,
          spans[inc],
          fill_color="#D5E1DD",
          line_color="black",
      )
      p.rect(
          df.date[dec],
          mids[dec],
          w,
          spans[dec],
          fill_color="#F2583E",
          line_color="black",
      )
  
      # Save the plot
      write_plot("bokeh", p, "candlestick_chart", symbol, directory)
  
imports: from alphapy.estimators import get_estimators
  from alphapy.globals import BSEP, PSEP, SSEP, USEP
  from alphapy.globals import ModelType
  from alphapy.globals import Partition, datasets
  from alphapy.globals import Q1, Q3
  from alphapy.utilities import remove_list_items
  from bokeh.plotting import figure, show, output_file
  import itertools
  import logging
  import math
  import matplotlib
  import matplotlib.pyplot
  from mpl_toolkits.mplot3d import Axes3D
  import numpy
  import pandas
  from scipy import interp
  import seaborn
  from sklearn.calibration import calibration_curve
  from sklearn.inspection import partial_dependence
  from sklearn.inspection import plot_partial_dependence
  from sklearn.metrics import auc
  from sklearn.metrics import confusion_matrix
  from sklearn.metrics import roc_curve
  from sklearn.model_selection import cross_val_score
  from sklearn.model_selection import learning_curve
  from sklearn.model_selection import StratifiedKFold
  from sklearn.model_selection import train_test_split
  from sklearn.model_selection import validation_curve
  from sklearn.utils.multiclass import unique_labels
label_desc: Use image node_id 19 for calling a global function with example usage: plot_candlestick(df, symbol, datecol, directory) without return types