The error is in above line. You forgot to close the brackets there.
Change this:
print(clf.predict(x_test[1:10])
to
print(clf.predict(x_test[1:10]))
And even after that you will get error in the line:
clf.f1_score(...)
The above line is wrong, it should be:
f1_score(y_test, clf.predict(x_test))
solved Scikit-learn Custom Scoring Function 1