code: def test_r_predictor_serialization():
      predictor = RHierarchicalForecastPredictor(
          freq="1D",
          prediction_length=3,
          is_hts=True,
          target_dim=7,
          num_bottom_ts=4,
          nodes=[2, [2] * 2],
          nonnegative=False,
          method_name=SUPPORTED_HIERARCHICAL_METHODS[0],
          fmethod="ets",
      )
      assert predictor == serde.decode(serde.encode(predictor))
  
file_path: gluonts/test/ext/r_forecast/test_r_hierarchical_predictor.py
imports: from typing import List, Tuple, Union
  import itertools
  import pytest
  from gluonts.core import serde
  from gluonts.dataset.util import forecast_start
  from gluonts.evaluation import MultivariateEvaluator, backtest_metrics
  from gluonts.model import SampleForecast
  from gluonts.ext.r_forecast import RHierarchicalForecastPredictor, R_IS_INSTALLED, RPY2_IS_INSTALLED, SUPPORTED_HIERARCHICAL_METHODS
label_desc: Use image node_id 3 for calling a global function with example usage: test_r_predictor_serialization() without return types