code: def get_period(period: period_pb2.Period) -> dateslib.PeriodTensor:
      period_type = period_pb2.PeriodType.Name(period.type)
      return dateslib.PeriodTensor(
          period.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 5 for calling a global function with example usage: get_period(period) and returns: dateslib