def get_valid_graph_obj(obj, obj_type=None):
 from plotly.graph_objs import graph_objs
 try:
  cls = getattr(graph_objs, obj_type)
 except (AttributeError, KeyError):
  raise exceptions.PlotlyError("'{}' is not a recognized graph_obj.".format(obj_type))
 return cls(obj, _raise=False)

def get_valid_graph_obj ( obj , obj_type = None ) : from plotly . graph_objs import graph_objs try : cls = getattr ( graph_objs , obj_type ) except ( AttributeError , KeyError ) : raise exceptions . PlotlyError ( "'{}' is not a recognized graph_obj." . format ( obj_type ) ) return cls ( obj , _raise = False )
returns a new graph object that wont raise .