'Validates/Converts values which should be Graph Objects.'

def __setitem__(self, key, value, _raise=True):

    if (not isinstance(key, six.string_types)):
        if _raise:
            raise TypeError('Key    must    be    string,    not    {}'.format(type(key)))
        return
    if key.endswith('src'):
        if (key in self._get_valid_attributes()):
            value = graph_objs_tools.assign_id_to_src(key, value)
            return super(PlotlyDict, self).__setitem__(key, value)
    subplot_key = self._get_subplot_key(key)
    if (subplot_key is not None):
        value = self._value_to_graph_object(subplot_key, value, _raise=_raise)
        if isinstance(value, (PlotlyDict, PlotlyList)):
            return super(PlotlyDict, self).__setitem__(key, value)
    if (key not in self._get_valid_attributes()):
        if (key in self._get_deprecated_attributes()):
            warnings.warn("Oops!    '{attribute}'    has    been    deprecated    in    '{object_name}'\nThis    may    still    work,    but    you    should    update    your    code    when    possible.\n\nRun    `.help('{attribute}')`    for    more    information.".format(attribute=key, object_name=self._name))
            return super(PlotlyDict, self).__setitem__(key, value)
        else:
            if _raise:
                path = (self._get_path() + (key,))
                raise exceptions.PlotlyDictKeyError(self, path)
            return
    if (self._get_attribute_role(key) == 'object'):
        value = self._value_to_graph_object(key, value, _raise=_raise)
        if (not isinstance(value, (PlotlyDict, PlotlyList))):
            return
    super(PlotlyDict, self).__setitem__(key, value)
