code: def test_decode(self):
      data = pd.Series([self._create_timestamp() for _ in range(1_000)])
      data[0] = np.nan
      enc = DatetimeEncoder()
      enc.prepare([])
      encoded_repr = enc.encode(data)
      assert not torch.isinf(encoded_repr).any()
      assert not torch.isnan(encoded_repr).any()
      dec_data = enc.decode(encoded_repr)
  
      for d, t in zip(dec_data[1:], data.tolist()[1:]):
          # ignore edge cases within border of supported years
          if (
              pd.Timestamp.min.year + 1
              < datetime.fromtimestamp(t).year
              < pd.Timestamp.max.year - 1
          ):
              if not np.isclose(d, t, atol=5):
                  assert datetime.fromtimestamp(
                      d
                  ) == datetime.fromtimestamp(t)
              else:
                  assert np.isclose(d, t, atol=5)
      assert np.isnan(dec_data[0])
  
file_path: lightwood/tests/unit_tests/encoder/date/test_datetime.py
imports: import unittest
  from datetime import datetime
  import numpy
  import pandas
  import torch
  from lightwood.encoder.datetime.datetime import DatetimeEncoder
  from lightwood.encoder.datetime.datetime_sin_normalizer import DatetimeNormalizerEncoder
label_desc: Use image node_id 4 for calling the TestDatetimeEncoder obj's underlying member method code with example usage: obj.test_decode() without return types