code: def check_pickle(obj):
      fh = BytesIO()
      pickle.dump(obj, fh, protocol=pickle.HIGHEST_PROTOCOL)
      plen = fh.tell()
      fh.seek(0, 0)
      res = pickle.load(fh)
      fh.close()
      return res, plen
  
imports: from statsmodels.compat.pandas import assert_series_equal
  from io import BytesIO
  import pickle
  import numpy
  import pandas
  import statsmodels.api
label_desc: Use image node_id 1 for calling a global function with example usage: check_pickle(obj) and returns: res,  plen