code: def build_json_opts(pretty=False):
      opts = {"sort_keys": True}
      if pretty:
          opts["indent"] = 2
      else:
          opts["separators"] = (",", ":")
      return opts
  
imports: import pytest
  import plotly.io.json
  import plotly.graph_objects
  import plotly.express
  import numpy
  import pandas
  import json
  import datetime
  import re
  import sys
  import warnings
  from pytz import timezone
  from _plotly_utils.optional_imports import get_module
label_desc: Use image node_id 1 for calling a global function with example usage: build_json_opts(pretty) and returns: opts