code: def ensure_not_numpy(x):
      if isinstance(x, bytes):
          return x.decode()
      elif isinstance(x, np.str_):
          return str(x)
      elif isinstance(x, np.generic):
          return float(x.item())
      else:
          return x
  
imports: import base64
  import json
  import os
  import random
  import re
  import string
  import warnings
  from collections.abc import Sequence
  import numpy
  import pandas
  import scipy.sparse
  from ..plots._force_matplotlib import draw_additive_plot
  from ..utils import hclust_ordering
  from ..utils._exceptions import DimensionError
  from ..utils._legacy import Data, DenseData, Instance, Link, Model, convert_to_link
  from ._labels import labels
label_desc: Use image node_id 6 for calling a global function with example usage: ensure_not_numpy(x) and returns: x, str, float, x