Syntax Error when typing colors = matplotlib.pyplot.rcParams[‘axes.prop_cycle’].by_key()[‘color’]

Constantly getting a Syntax Error for;

colors = matplotlib.pyplot.rcParams['axes.prop_cycle'].by_key()[
            'color']

Full Code:

########### 1. Dependencies
import time
import math
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.animation
import matplotlib.pyplot as plt
import scipy
from matplotlib.figure import Figure
from scipy.signal import filtfilt

# matplotlib.use ('TkAgg') # 3 FPS
import brainflow
from brainflow.board_shim import BoardShim, BrainFlowInputParams, LogLevels, BoardIds
from brainflow.data_filter import DetrendOperations, DataFilter, FilterTypes, AggOperations, WindowFunctions
import scipy.signal as sig


class CytonStream(object):
    def __init__(self):
        ########### 2. Create Variables for Holding the Stream
        self.display_window = DataFilter.get_nearest_power_of_two(500) # Attribute, DataFilter class contains methods for signal processing
        self.data = [0]*self.display_window 
        self.fft = [[0], [0]] # This is for the second "graph" of the Mathplotlib

        ########### 3. Connecting to Cyton Board
        BoardShim.enable_dev_board_logger () 
        params = BrainFlowInputParams()
        board_id = BoardIds.CYTON_BOARD
        self.sample_rate = BoardShim.get_sampling_rate(board_id)
        self.board_channel = BoardShim.get_eeg_channels(board_id)[0]
        params.serial_port = '/dev/cu.usbserial-DM03H7UU' # Port
        board_id = 0 #BoardIds.CYTON_BOARD(0)
        board = BoardShim(board_id, params) # Board Stream Object
        board.prepare_session() # Prepare the session
        # board.start_stream () # use this for default options
        board.start_stream() #Create streaming thread 
        self.board = board
        
        ########### 4. Creating Matplotlib Parmeters/ Plots
        self.fig, axes = plt.subplots(3, 1, figsize=(11,7)
        colors = matplotlib.pyplot.rcParams['axes.prop_cycle'].by_key()[
            'color']
        
        ##### Set the Axes
        self.wave_ax = axes[0] #Location 1
        
        ##### Set Title
        self.wave_ax.set_title("Cyton Waveform") #Title 1

Answer

You are missing a closing parenthesis on the line above the colors = ... line.

        #                                                 ↓ this one
        self.fig, axes = plt.subplots(3, 1, figsize=(11,7))
        colors = matplotlib.pyplot.rcParams['axes.prop_cycle'].by_key()[
            'color']