code: def get_orderings(args, grouper, grouped):
      """
      `orders` is the user-supplied ordering (with the remaining data-frame-supplied
      ordering appended if the column is used for grouping). It includes anything the user
      gave, for any variable, including values not present in the dataset. It is used
      downstream to set e.g. `categoryarray` for cartesian axes
  
      `group_names` is the set of groups, ordered by the order above
  
      `group_values` is a subset of `orders` in both keys and values. It contains a key
       for every grouped mapping and its values are the sorted *data* values for these
       mappings.
      """
      orders = (
          {}
          if "category_orders" not in args
          else args["category_orders"].copy()
      )
      group_names = []
      group_values = {}
      for group_name in grouped.groups:
          if len(grouper) == 1:
              group_name = (group_name,)
          group_names.append(group_name)
          for col in grouper:
              if col != one_group:
                  uniques = args["data_frame"][col].unique()
                  if col not in orders:
                      orders[col] = list(uniques)
                  else:
                      for val in uniques:
                          if val not in orders[col]:
                              orders[col].append(val)
                  group_values[col] = sorted(
                      uniques, key=orders[col].index
                  )
  
      for i, col in reversed(list(enumerate(grouper))):
          if col != one_group:
              group_names = sorted(
                  group_names,
                  key=lambda g: orders[col].index(g[i])
                  if g[i] in orders[col]
                  else -1,
              )
  
      return orders, group_names, group_values
  
imports: import plotly.graph_objs
  import plotly.io
  from collections import namedtuple, OrderedDict
  from ._special_inputs import IdentityMap, Constant, Range
  from _plotly_utils.basevalidators import ColorscaleValidator
  from plotly.colors import qualitative, sequential
  import math
  import pandas
  import numpy
  from plotly.subplots import make_subplots, _set_trace_grid_reference, _subplot_type_for_trace_type
label_desc: Use image node_id 34 for calling a global function with example usage: get_orderings(args, grouper, grouped) and returns: orders,  group_names,  group_values