code: def topofig():
      pio.templates.default = None
      for col in topo_df.columns:
          topo_df[col] = topo_df[col].astype(str)
  
      scl = [
          [0.0, "rgb(242,240,247)"],
          [0.2, "rgb(218,218,235)"],
          [0.4, "rgb(188,189,220)"],
          [0.6, "rgb(158,154,200)"],
          [0.8, "rgb(117,107,177)"],
          [1.0, "rgb(84,39,143)"],
      ]
  
      topo_df["text"] = (
          topo_df["state"]
          + "<br>"
          + "Beef "
          + topo_df["beef"]
          + " Dairy "
          + topo_df["dairy"]
          + "<br>"
          + "Fruits "
          + topo_df["total fruits"]
          + " Veggies "
          + topo_df["total veggies"]
          + "<br>"
          + "Wheat "
          + topo_df["wheat"]
          + " Corn "
          + topo_df["corn"]
      )
  
      data = [
          dict(
              type="choropleth",
              colorscale=scl,
              autocolorscale=False,
              locations=topo_df["code"],
              z=topo_df["total exports"].astype(float),
              locationmode="USA-states",
              text=topo_df["text"],
              marker=dict(line=dict(color="rgb(255,255,255)", width=2)),
              showscale=False,
          )
      ]
  
      layout = dict(
          geo=dict(
              scope="usa",
              projection=dict(type="albers usa"),
              showlakes=True,
              lakecolor="rgb(255, 255, 255)",
          ),
          font={"family": "Arial", "size": 12},
      )
  
      yield dict(data=data, layout=layout)
      pio.templates.default = "plotly"
  
imports: import plotly
  import plotly.io
  import plotly.graph_objs
  import os
  import shutil
  import pytest
  import sys
  import pandas
  from io import BytesIO
label_desc: Use image node_id 4 for calling a global function with example usage: topofig() without return types