code: def _get_date_parse_fn(target):
      """get date parse function
  
      This method is used to parse date arguments as target type.
  
      Example:
          get_date_parse_fn('20120101')('2017-01-01') => '20170101'
          get_date_parse_fn(20120101)('2017-01-01') => 20170101
      """
      if isinstance(target, int):
  
          def _fn(x):
              return int(str(x).replace("-", "")[:8])  # 20200201
  
      elif isinstance(target, str) and len(target) == 8:
  
          def _fn(x):
              return str(x).replace("-", "")[:8]  # '20200201'
  
      else:
  
          def _fn(x):
              return x  # '2021-01-01'
  
      return _fn
  
imports: import copy
  import torch
  import warnings
  import numpy
  import pandas
  from qlib.data.dataset import DatasetH
label_desc: Use image node_id 3 for calling a global function with example usage: _get_date_parse_fn(target) and returns: _fn, int, str, x