code: def period_from_list(
      period: Tuple[int, List[int]]
  ) -> dateslib.PeriodTensor:
      """Utility to convert a list of periods to a PeriodTensor.
  
      Args:
        period: A tuple of an integer (which corresponds to the proto type of the
          period (see `period_pb2.Period`)) and a list of period values.
  
      Returns:
        An instance of the `PeriodTensor`.
      """
      amount = period[1]
      period_type = period_pb2.PeriodType.Name(period[0])
      return dateslib.PeriodTensor(
          amount, dateslib.PeriodType[period_type]
      )
  
file_path: tf-quant-finance/tf_quant_finance/experimental/pricing_platform/framework/market_data/utils.py
imports: import functools
  from typing import Callable, Dict, Tuple, List, Union
  from tf_quant_finance import datetime
  from tf_quant_finance.experimental.pricing_platform.framework.core import business_days
  from tf_quant_finance.experimental.pricing_platform.framework.core import daycount_conventions
  from tf_quant_finance.experimental.pricing_platform.framework.core import processed_market_data
  from tf_quant_finance.experimental.pricing_platform.framework.core import types
  from tf_quant_finance.experimental.pricing_platform.instrument_protos import period_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: period_from_list(period) and returns: dateslib