TypeError: __init__() got an unexpected keyword argument 'rotation'

from keras.preprocessing.image import ImageDataGenerator

train_datagen=ImageDataGenerator(rescale=1./255,
rotation=40,
wigth_shift_range=0.2,
height_shift_range=0.2,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True,
fill_mode=‘nearest’
)
test_datagen=ImageDataGenerator(rescale=1./255)
train_generator=train_datagen.flow_from_directory(train_dir,
target_size=(150,150),
class_mode=‘categorical’,
batch_size=batch_size)
test_generator=test_datagen.flow_from_directory(train_dir,
target_size=(150,150),
class_mode=‘categorical’,
batch_size=batch_size,
shuffle=False)

Based on the posted code you are using Keras so I would recommend asking in the TensorFlow discussion board as you will find the experts there.
With that being said the error points to an invalid argument called rotation so check the docs of this class and make sure valid arguments are passed to it.