# Buggy code
def draw(
    self,
    schedule,
    dt,
    interp_method,
    plot_range,
    scaling=None,
    channels_to_plot=None,
    plot_all=True,
    table=True,
    label=False,
    framechange=True,
    channels=None,
):
    """Draw figure.

    Args:
        schedule (ScheduleComponent): Schedule to draw
        dt (float): time interval
        interp_method (Callable): interpolation function
            See `qiskit.visualization.interpolation` for more information
        plot_range (tuple[float]): plot range
        scaling (float): Relative visual scaling of waveform amplitudes
        channels_to_plot (list[OutputChannel]): deprecated, see `channels`
        plot_all (bool): if plot all channels even it is empty
        table (bool): Draw event table
        label (bool): Label individual instructions
        framechange (bool): Add framechange indicators
        channels (list[OutputChannel]): channels to draw

    Returns:
        matplotlib.figure: A matplotlib figure object for the pulse schedule
    Raises:
        VisualizationError: when schedule cannot be drawn
    """
    figure = plt.figure()

    if channels_to_plot:
        warnings.warn(
            'The parameter "channels_to_plot" is being replaced by "channels"',
            DeprecationWarning,
            3,
        )
        channels = channels_to_plot

    if not channels:
        channels = []
    interp_method = interp_method or interpolation.step_wise

    # setup plot range
    if plot_range:
        t0 = int(np.floor(plot_range[0] / dt))
        tf = int(np.floor(plot_range[1] / dt))
    else:
        t0 = 0
        # when input schedule is empty or comprises only frame changes,
        # we need to overwrite pulse duration by an integer greater than zero,
        # otherwise waveform returns empty array and matplotlib will be crashed.
        if channels_to_plot:
            tf = schedule.timeslots.ch_duration(*channels_to_plot)
        else:
            tf = schedule.stop_time
        tf = tf or 1

    # prepare waveform channels
    (schedule_channels, output_channels, snapshot_channels) = self._build_channels(
        schedule, channels_to_plot, t0, tf
    )

    # count numbers of valid waveform
    n_valid_waveform, v_max = self._count_valid_waveforms(
        output_channels, scaling=scaling, channels=channels, plot_all=plot_all
    )

    if table:
        ax = self._draw_table(figure, schedule_channels, dt, n_valid_waveform)

    else:
        ax = figure.add_subplot(111)
        figure.set_size_inches(self.style.figsize[0], self.style.figsize[1])

    ax.set_facecolor(self.style.bg_color)

    y0 = self._draw_channels(
        ax,
        output_channels,
        interp_method,
        t0,
        tf,
        dt,
        v_max,
        label=label,
        framechange=framechange,
    )

    self._draw_snapshots(ax, snapshot_channels, dt, y0)

    ax.set_xlim(t0 * dt, tf * dt)
    ax.set_ylim(y0, 1)
    ax.set_yticklabels([])

    return figure


# Traceback (TypeError)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-5df9debb5295> in <module>
----> 1 cmd_def.get('u3', [0], 0.3, 0.6, 0.9).draw()

~/Desktop/ajavadia-terra/qiskit/pulse/schedule.py in draw(self, dt, style, filename, interp_method, scaling, channels_to_plot, plot_all, plot_range, interactive, table, label, framechange, channels)
392                                           plot_range=plot_range, interactive=interactive,
393                                           table=table, label=label,
--> 394                                           framechange=framechange, channels=channels)
395
396     def __eq__(self, other: ScheduleComponent) -> bool:

~/Desktop/ajavadia-terra/qiskit/visualization/pulse_visualization.py in pulse_drawer(data, dt, style, filename, interp_method, scaling, channels_to_plot, plot_all, plot_range, interactive, table, label, framechange, channels)
75         image = drawer.draw(data, dt=dt, interp_method=interp_method, scaling=scaling,
76                             plot_range=plot_range, plot_all=plot_all, table=table,
---> 77                             label=label, framechange=framechange, channels=channels)
78     else:
79         raise VisualizationError('This data cannot be visualized.')

~/Desktop/ajavadia-terra/qiskit/visualization/pulse/matplotlib.py in draw(self, schedule, dt, interp_method, plot_range, scaling, channels_to_plot, plot_all, table, label, framechange, channels)
601         # prepare waveform channels
602         (schedule_channels, output_channels,
--> 603          snapshot_channels) = self._build_channels(schedule, channels_to_plot, t0, tf)
604
605         # count numbers of valid waveform

~/Desktop/ajavadia-terra/qiskit/visualization/pulse/matplotlib.py in _build_channels(self, schedule, channels_to_plot, t0, tf)
290         snapshot_channels = collections.OrderedDict()
291
--> 292         _channels = list(schedule.channels) + channels_to_plot
293         _channels = list(set(_channels))
294

TypeError: can only concatenate list (not "NoneType") to list

# Fixed code
def draw(
    self,
    schedule,
    dt,
    interp_method,
    plot_range,
    scaling=None,
    channels_to_plot=None,
    plot_all=True,
    table=True,
    label=False,
    framechange=True,
    channels=None,
):
    """Draw figure.

    Args:
        schedule (ScheduleComponent): Schedule to draw
        dt (float): time interval
        interp_method (Callable): interpolation function
            See `qiskit.visualization.interpolation` for more information
        plot_range (tuple[float]): plot range
        scaling (float): Relative visual scaling of waveform amplitudes
        channels_to_plot (list[OutputChannel]): deprecated, see `channels`
        plot_all (bool): if plot all channels even it is empty
        table (bool): Draw event table
        label (bool): Label individual instructions
        framechange (bool): Add framechange indicators
        channels (list[OutputChannel]): channels to draw

    Returns:
        matplotlib.figure: A matplotlib figure object for the pulse schedule
    Raises:
        VisualizationError: when schedule cannot be drawn
    """
    figure = plt.figure()

    if channels_to_plot is not None:
        warnings.warn(
            'The parameter "channels_to_plot" is being replaced by "channels"',
            DeprecationWarning,
            3,
        )
        channels = channels_to_plot

    if channels is None:
        channels = []
    interp_method = interp_method or interpolation.step_wise

    # setup plot range
    if plot_range:
        t0 = int(np.floor(plot_range[0] / dt))
        tf = int(np.floor(plot_range[1] / dt))
    else:
        t0 = 0
        # when input schedule is empty or comprises only frame changes,
        # we need to overwrite pulse duration by an integer greater than zero,
        # otherwise waveform returns empty array and matplotlib will be crashed.
        if channels:
            tf = schedule.timeslots.ch_duration(*channels)
        else:
            tf = schedule.stop_time
        tf = tf or 1

    # prepare waveform channels
    (schedule_channels, output_channels, snapshot_channels) = self._build_channels(
        schedule, channels, t0, tf
    )

    # count numbers of valid waveform
    n_valid_waveform, v_max = self._count_valid_waveforms(
        output_channels, scaling=scaling, channels=channels, plot_all=plot_all
    )

    if table:
        ax = self._draw_table(figure, schedule_channels, dt, n_valid_waveform)

    else:
        ax = figure.add_subplot(111)
        figure.set_size_inches(self.style.figsize[0], self.style.figsize[1])

    ax.set_facecolor(self.style.bg_color)

    y0 = self._draw_channels(
        ax,
        output_channels,
        interp_method,
        t0,
        tf,
        dt,
        v_max,
        label=label,
        framechange=framechange,
    )

    self._draw_snapshots(ax, snapshot_channels, dt, y0)

    ax.set_xlim(t0 * dt, tf * dt)
    ax.set_ylim(y0, 1)
    ax.set_yticklabels([])

    return figure