code: def minute_frame_to_session_frame(minute_frame, calendar):
      """
      Resample a DataFrame with minute data into the frame expected by a
      BcolzDailyBarWriter.
  
      Parameters
      ----------
      minute_frame : pd.DataFrame
          A DataFrame with the columns `open`, `high`, `low`, `close`, `volume`,
          and `dt` (minute dts)
      calendar : trading_calendars.trading_calendar.TradingCalendar
          A TradingCalendar on which session labels to resample from minute
          to session.
  
      Return
      ------
      session_frame : pd.DataFrame
          A DataFrame with the columns `open`, `high`, `low`, `close`, `volume`,
          and `day` (datetime-like).
      """
      how = OrderedDict(
          (c, _MINUTE_TO_SESSION_OHCLV_HOW[c])
          for c in minute_frame.columns
      )
      labels = calendar.minute_index_to_session_labels(
          minute_frame.index
      )
      return minute_frame.groupby(labels).agg(how)
  
imports: from collections import OrderedDict
  from abc import ABCMeta, abstractmethod
  import numpy
  import pandas
  from six import with_metaclass
  from zipline.data._resample import _minute_to_session_open, _minute_to_session_high, _minute_to_session_low, _minute_to_session_close, _minute_to_session_volume
  from zipline.data.bar_reader import NoDataOnDate
  from zipline.data.minute_bars import MinuteBarReader
  from zipline.data.session_bars import SessionBarReader
  from zipline.utils.memoize import lazyval
label_desc: Use image node_id 1 for calling a global function with example usage: minute_frame_to_session_frame(minute_frame, calendar) and returns: minute_frame