I am generally having a hard time while finding the valid **kwargs for a function or a method. For example let us consider the following example.
import matplotlib.pyplot as plt
plt.xticks(ticks=None, labels=None, **kwargs)
As you can see this .xticks() method accepts **kwargs. In order to find the valid **kwargs, I generally write some random kwarg such as plt.xticks(font_size=14) and then I generally get and AttributeError. For this case the error is the following AttributeError: 'Text' object has no property 'font_size'. Then I go to the documentation and find Text object, and then if I am lucky, I find the valid **kwargs in the documentation and finally I fix my code as plt.yticks(fontsize=14) where fontsize is the valid kwarg for this method. I always follow a similar path like this.
However I found this process so tedious and long. I am looking for an easy and quick solution in general. Is there a quick way to find valid kwargs or should I do this process or another similar process everytime in order to find valid kwargs for a method or a function?