code: def crossover(source, target):
      """
      The `x`-series is defined as having crossed over `y`-series if the value
      of `x` is greater than the value of `y` and the value of `x` was less than
      the value of `y` on the bar immediately preceding the current bar.
  
      Parameters
      ----------
      source: Series
      target: Series
  
      Returns
      -------
      bool
  
      """
      if isinstance(target, numbers.Number):
          if (
              source[-1] is np.nan
              or source[-2] is np.nan
              or target is np.nan
          ):
              return False
  
          if source[-1] >= target > source[-2]:
              return True
          else:
              return False
  
      else:
          if (
              source[-1] is np.nan
              or source[-2] is np.nan
              or target[-1] is np.nan
              or target[-2] is np.nan
          ):
              return False
  
          if source[-1] > target[-1] and source[-2] < target[-2]:
              return True
          else:
              return False
  
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 2 for calling a global function with example usage: crossover(source, target) and returns: False, True, False, False, True, False