code: def get_default_horizon_from_period(period, num_observations=None):
      """Returns default forecast horizon based on input data period and num_observations
      :param period: float
          Period of each observation (i.e. average time between observations, in seconds)
      :param num_observations: Optional[int]
          Number of observations for training
      :return: int
          default number of periods to forecast
      """
      default_from_period = get_simple_time_frequency_from_period(
          period
      ).value.default_horizon
      if num_observations is not None:
          default_from_observations = (
              num_observations // 2
          )  # twice as much training data as forecast horizon
          return min(
              default_from_period, default_from_observations
          )  # horizon based on limiting factor
      else:
          return default_from_period
  
file_path: greykite/greykite/common/time_properties_forecast.py
imports: import math
  from datetime import timedelta
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.enums import SimpleTimeFrequencyEnum
  from greykite.common.enums import TimeEnum
  from greykite.common.features.timeseries_features import get_default_origin_for_time_vars
  from greykite.common.time_properties import get_canonical_data
  from greykite.common.time_properties import min_gap_in_seconds
label_desc: Use image node_id 1 for calling a global function with example usage: get_default_horizon_from_period(period, num_observations) and returns: min, default_from_period