code: def millify(n):
      """Abbreviate a number to nearest thousand, million, etc.
  
      Adapted from: https://stackoverflow.com/a/3155023/10696164
  
      Parameters
      ----------
      n : int
          The number to abbreviate
  
      Returns
      -------
      millified : str
          The number abbreviated to the nearest thousand, million, etc.
      """
      millnames = ["", "k", "M", "B", "T"]
      n = float(n)
      millidx = max(
          0,
          min(
              len(millnames) - 1,
              int(math.floor(0 if n == 0 else math.log10(abs(n)) / 3)),
          ),
      )
      final_num = float(n / 10 ** (3 * millidx))
      one_decimal = round(final_num, 1)
  
      # If the number is in the millions, and has a decimal, we want to show one
      # decimal. I.e.:
      #  - 967123  -> 967k
      #  - 1000123 -> 1M
      #  - 1100123 -> 1.1M
      final_output = (
          one_decimal
          if n > 1e6 and not one_decimal.is_integer()
          else int(round(final_num, 0))
      )
  
      return f"{final_output}{millnames[millidx]}"
  
imports: from datetime import date, timedelta
  import json
  import math
  import os
  import requests
  from statistics import mean
label_desc: Use image node_id 1 for calling a global function with example usage: millify(n) and returns: final_output, millnames