code: def _fix_type(value):
      
      # Because numpy floats can not be pickled to json
      if isinstance(value, string_types):
          return str(value)
      if isinstance(value, float_):
          return float(value)
      if isinstance(value, bool_):
          return bool(value)
      if isinstance(value, set):
          return list(value)
      if isinstance(value, dict):
          return OrderedDict((key, value[key]) for key in sorted(value))
      # handle legacy Formula type
      if value.__class__.__name__ == "Formula":
          return str(value)
      if value is None:
          return ""
      return value
docs: convert possible types to str, float, and bool