The short answer:
Scatter and Layout objects created dynamicly. Therefore pycharm cannot find its definition.
Details:
This is the first include in your py file;
from plotly.graph_objs import Scatter, Layout
after that it call plotly/graph_objs/__init__.py file ;
from plotly.graph_objs.graph_objs import * # this is protected with __all__
after that
__all__ = list(graph_reference.CLASSES.keys())
This defination is in plotly/graph_objs/graph_objs.py file. __all__ is a list of public objects of that module.
https://docs.python.org/2/tutorial/modules.html#importing-from-a-package
defination of CLASSES in plotly/graph_referance.py;
CLASSES = _get_classes()
In this function it itarates variable named _BACKWARDS_COMPAT_CLASS_NAMES and create classes;
_BACKWARDS_COMPAT_CLASS_NAMES = {
...
'Scatter': {'object_name': 'scatter', 'base_type': dict},
...
'Layout': {'object_name': 'layout', 'base_type': dict},
...
}