code: def set_errors(
      figure,
      trace=None,
      axis="y",
      type="data",
      values=None,
      values_minus=None,
      color=None,
      thickness=1,
      width=None,
      opacity=None,
      **kwargs,
  ):
      figure = fig_to_dict(figure)
      if "value" in kwargs:
          values = kwargs["value"]
      data = figure["data"]
      if "continuous" not in type:
          width = width if width else 5
          opacity = opacity if opacity else 1
          color = to_rgba(color, opacity) if color else None
          error = get_error_bar(
              axis=axis,
              type=type,
              values=values,
              values_minus=values_minus,
              color=color,
              thickness=thickness,
              width=width,
              opacity=opacity,
          )
          if trace:
              data[figure.trace_dict[trace]].update(
                  {"error_{0}".format(axis): error}
              )
          else:
              for trace in data:
                  trace.update({"error_{0}".format(axis): error})
      else:
          width = width if width else 0.5
          opacity = opacity if opacity else 0.3
  
          def get_traces(
              trace, value, type, color=None, width=0.2, opacity=0.3
          ):
              if not is_list(value):
                  value = [value] * len(trace["y"])
              if values_minus:
                  if is_list(values_minus):
                      min_value = values_minus
                  else:
                      min_value = [values_minus] * len(trace["y"])
              else:
                  min_value = value
              if "percent" in type:
                  y_up = [
                      trace["y"][_] * (1 + value[_] / 100.00)
                      for _ in range(len(value))
                  ]
                  y_down = [
                      trace["y"][_] * (1 - min_value[_] / 100.00)
                      for _ in range(len(min_value))
                  ]
              else:
                  y_up = [
                      trace["y"][_] + value[_]
                      for _ in range(len(value))
                  ]
                  y_down = [
                      trace["y"][_] - min_value[_]
                      for _ in range(len(min_value))
                  ]
              upper = Scatter(
                  y=y_up,
                  mode="lines",
                  showlegend=False,
                  line=Line(width=width),
                  x=trace["x"],
              )
              if "yaxis" in trace:
                  upper["yaxis"] = trace["yaxis"]
              if color:
                  color = normalize(color)
              else:
                  if "color" in trace["line"]:
                      color = trace["line"]["color"]
                  else:
                      color = "charcoal"
              color = to_rgba(color, opacity) if color else None
              upper["line"]["color"] = color
              lower = copy.deepcopy(upper)
              name = trace["name"] + "_" if "name" in trace else ""
              upper.update(name=name + "upper")
              color = to_rgba(normalize(color), opacity)
              lower.update(
                  fill="tonexty",
                  fillcolor=color,
                  name=name + "lower",
                  y=y_down,
              )
              return upper, lower
  
          if trace:
              traces = [figure.trace_dict[trace]]
          else:
              traces = list(range(len(figure["data"])))
          for i in traces:
              trace = figure["data"][i]
              upper, lower = get_traces(
                  trace,
                  values,
                  type,
                  color=color,
                  width=width,
                  opacity=opacity,
              )
              figure["data"].extend([upper, lower])
      return figure
  
imports: import copy
  import numpy
  import pandas
  import plotly.offline
  import plotly.figure_factory
  from plotly.graph_objs import Figure, Scatter, Line
  from plotly.subplots import make_subplots
  from .None import themes
  from .None import auth, ta
  from .colors import normalize, to_rgba
  from .utils import check_kwargs, deep_update, dict_replace_keyword, kwargs_from_keyword, merge_dict, is_list, make_list
label_desc: Use image node_id 28 for calling a global function with example usage: set_errors(figure, trace, axis, type, values, values_minus, color, thickness, width, opacity) and returns: figure, upper,  lower