code: def get_daycount_fn(
      day_count_convention: Union[
          _DayCountConventionsProtoType,
          Callable[..., types.FloatTensor],
      ],
      dtype=None,
  ) -> Callable[..., types.FloatTensor]:
      """Converts input to a daycount convention function."""
      if not isinstance(
          day_count_convention, _DayCountConventionsProtoType
      ):
  
          def _res(start_date, end_date):
              return day_count_convention(
                  start_date.to_tensor(), end_date.to_tensor()
              )
  
          return _res
      try:
          daycount_fn = _daycount_map[day_count_convention]
      except KeyError:
          raise KeyError(
              f"{day_count_convention} is not mapped to a daycount function"
          )
      return functools.partial(daycount_fn, dtype=dtype)
  
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 1 for calling a global function with example usage: get_daycount_fn(day_count_convention, dtype) and returns: functools, _res, day_count_convention