code: def filter_autoformat(value: Any, **kwargs: Any) -> str:
      """Jinja filter to try and autoformat a given value based on its data type.
  
      Args:
          value (Any): Object to format.
          **kwargs (Any): Optional keyword arguments to pass along to the chosen formatter.
  
      Returns:
          str: Formatted object.
      """
      if value is None:
          return ""
      try:
          if isinstance(value, datetime):
              return filter_dateformat(value, **kwargs)
          elif isinstance(
              value, (int, float, np.int32, np.int64, np.float64)
          ):
              return filter_numberformat(value)
          elif isinstance(value, pd.Series):
              return str(pd.DataFrame(value).T._repr_html_())
          else:
              return str(value._repr_html_())
      except Exception:
          pass
      return str(value)
  
file_path: tslumen/tslumen/jinja_utils.py
imports: from math import ceil, log10, floor
  from typing import List, Optional, Any, Tuple
  from datetime import datetime
  import re
  import numpy
  import pandas
  import jinja2
label_desc: Use image node_id 6 for calling a global function with example usage: filter_autoformat(value) and returns: str, str, filter_dateformat, filter_numberformat, str, str