Hi all, I am running an example in colab but when I get to this code Iβm getting an error!

class PrettyWidget(QtGui.QWidget):

^

SyntaxError: unexpected EOF while parsing,

As a solution, I installed the specific packages for PyQt5 and the QtGui modules as PyQt4 is not working but that was futile!

I tried this solution Ui_Widget(QtWidgets.QWidget) based on my google search but that did not work also!

can some one guide with this procedure, please? My limited understanding is hindering my processing forward.

thank you in advance for acknowledging my digital presence!

MY CODE:

# For the current version:

!pip install --upgrade tensorflow

!pip install tfLearn

!pip install tqdm

!pip install keras

!apt-get -qq install -y libfluidsynth1

!pip install numpy

!pip install PyQt5

!pip install QtGui

!pip install QtWidgets

from keras.models import Sequential

from keras.layers import Dense, Dropout, Activation

from keras.regularizers import l2

from keras.optimizers import SGD ,Adagrad

from scipy.io import loadmat, savemat

from keras.models import model_from_json

import theano.tensor as T

import theano

import csv

import configparser

import collections

import time

import csv

from math import factorial

import os

from os import listdir

import skimage.transform

from skimage import color

from os.path import isfile, join

import numpy as np

import numpy

from datetime import datetime

from scipy.spatial.distance import cdist,pdist,squareform

import theano.sandbox

#import c3D_model

#import Initialization_function

#from moviepy.editor import VideoFileClip

#from IPython.display import Image, display

import matplotlib.pyplot as plt

import cv2

import os, sys

import pickle

from PyQt5 import QtGui # If PyQt4 is not working in your case, you can try PyQt5

import qtwidgets

seed = 7

numpy.random.seed(seed)

def load_model(json_path):

model = model_from_json(open(json_path).read())

return model

def load_weights(model, weight_path):

dict2 = loadmat(weight_path)

dict = conv_dict(dict2)

i = 0

for layer in model.layers:

weights = dict[str(i)]

layer.set_weights(weights)

i += 1

return model

def conv_dict(dict2): # Helper function to save the model

i = 0

dict = {}

for i in range(len(dict2)):

if str(i) in dict2:

if dict2[str(i)].shape == (0, 0):

dict[str(i)] = dict2[str(i)]

else:

weights = dict2[str(i)][0]

weights2 =

for weight in weights:

if weight.shape in [(1, x) for x in range(0, 5000)]:

weights2.append(weight[0])

else:

weights2.append(weight)

dict[str(i)] = weights2

return dict

def savitzky_golay(y, window_size, order, deriv=0, rate=1):

#try:

window_size = np.abs(np.int(window_size))

order = np.abs(np.int(order))

#except ValueError, msg:

#raise ValueError(βwindow_size and order have to be of type intβ)

```
if window_size % 2 != 1 or window_size < 1:
raise TypeError("window_size size must be a positive odd number")
if window_size < order + 2:
raise TypeError("window_size is too small for the polynomials order")
order_range = range(order + 1)
half_window = (window_size - 1) // 2
b = np.mat([[k ** i for i in order_range] for k in range(-half_window, half_window + 1)])
m = np.linalg.pinv(b).A[deriv] * rate ** deriv * factorial(deriv)
firstvals = y[0] - np.abs(y[1:half_window + 1][::-1] - y[0])
lastvals = y[-1] + np.abs(y[-half_window - 1:-1][::-1] - y[-1])
y = np.concatenate((firstvals, y, lastvals))
return np.convolve(m[::-1], y,mode='valid')
```

# Loading The Video Data

def load_dataset_One_Video_Features(Test_Video_Path):

```
VideoPath =Test_Video_Path
f = open(VideoPath, "r")
words = f.read().split()
num_feat = len(words) / 4096
# Number of features per video to be loaded. In our case num_feat=32, as we divide the video into 32 segments. Npte that
# we have already computed C3D features for the whole video and divide the video features into 32 segments.
count = -1;
VideoFeatues = []
for feat in range(0, int(num_feat)):
feat_row1 = np.float32(words[feat * 4096:feat * 4096 + 4096])
count = count + 1
if count == 0:
VideoFeatues = feat_row1
if count > 0:
VideoFeatues = np.vstack((VideoFeatues, feat_row1))
AllFeatures = VideoFeatues
return AllFeatures
```

class PrettyWidget(QtGui.QWidget):

ERROR:

File ββ, line 1

class PrettyWidget(QtGui.QWidget):

^

SyntaxError: unexpected EOF while parsing