'Attempt to convert value to graph object.
:param (str|unicode) key: Should be an object_name from GRAPH_REFERENCE
:param (dict) value: This will fail if it\'s not a dict.
:param (bool) _raise: Flag to prevent inappropriate erring.
:return: (PlotlyList|PlotlyDict|None) `None` if `_raise` and failure.'

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

    if (key in graph_reference.ARRAYS):
        val_types = (list,)
    else:
        val_types = (dict,)
    if (not isinstance(value, val_types)):
        if _raise:
            path = (self._get_path() + (key,))
            raise exceptions.PlotlyDictValueError(self, path)
        else:
            return
    return GraphObjectFactory.create(key, value, _raise=_raise, _parent=self, _parent_key=key)
