code: def is_trivial(obj):
      if isinstance(obj, (dict, list)):
          if len(obj):
              if isinstance(obj, dict):
                  tests = (is_trivial(obj[key]) for key in obj)
                  return all(tests)
              elif isinstance(obj, list):
                  tests = (is_trivial(entry) for entry in obj)
                  return all(tests)
              else:
                  return False
          else:
              return True
      elif obj is None:
          return True
      else:
          return False
  
file_path: plotly.py/packages/python/chart-studio/chart_studio/tests/test_plot_ly/test_get_figure/test_get_figure.py
imports: from __future__ import absolute_import
  import _plotly_utils.exceptions
  from chart_studio import exceptions
  from chart_studio.plotly import plotly
  from chart_studio.tests.utils import PlotlyTestCase
label_desc: Use image node_id 1 for calling a global function with example usage: is_trivial(obj) and returns: True, True, False, all, all, False