code: def trend_direction(series):
      if series[-1] is np.nan or series[-1] is np.nan:
          return None
  
      if series[-1] > series[-2]:
          return "up"
      else:
          return "down"
  
imports: import copy
  import csv
  import json
  import numbers
  import os
  import time
  import numpy
  import pandas
  from catalyst.assets._assets import TradingPair
  from catalyst.exchange.utils.exchange_utils import get_algo_folder
  from catalyst.utils.paths import data_root, ensure_directory
  from operator import itemgetter
label_desc: Use image node_id 1 for calling a global function with example usage: trend_direction(series) and returns: None, str, str