code: def _standardize_value(v):
      if v is None:
          return v
      if isinstance(v, bool):
          return bool(v)
      if isinstance(v, str):
          return str(v)
      if is_float(v):
          if math.isfinite(v):
              return float(v)
          # None for special values like 'nan' etc. because
          # some json parsers (like com.google.gson.Gson) do not handle them well.
          return None
      if is_int(v):
          return float(v)
      if is_dict_or_dataframe(v):
          return standardize_dict(v)
      if is_polars_dataframe(v):
          return standardize_dict(v.to_dict(as_series=False))
      if isinstance(v, list):
          return [_standardize_value(elem) for elem in v]
      if isinstance(v, tuple):
          return tuple(_standardize_value(elem) for elem in v)
      if (numpy and isinstance(v, numpy.ndarray)) or (
          pandas and isinstance(v, pandas.Series)
      ):
          return _standardize_value(v.tolist())
      if isinstance(v, datetime):
          if pandas and v is pandas.NaT:
              return None
          else:
              return (
                  v.timestamp() * 1000
              )  # convert from second to millisecond
      if shapely and isinstance(v, shapely.geometry.base.BaseGeometry):
          return json.dumps(shapely.geometry.mapping(v))
      try:
          return repr(v)
      except Exception:
          raise Exception(
              "Unsupported type: {0}({1})".format(v, type(v))
          )
  
file_path: lets-plot/python-package/lets_plot/_type_utils.py
imports: import json
  import math
  from datetime import datetime
  from typing import Dict
label_desc: Use image node_id 7 for calling a global function with example usage: _standardize_value(v) and returns: v, bool, str, None, float, standardize_dict, standardize_dict, unknown, tuple, _standardize_value, json, repr, float, None, unknown