code: def get_hash(
      swap_proto: ir_swap.InterestRateSwap,
  ) -> Tuple[int, bool]:
      """Computes hash key for the batching strategy."""
      pay_leg = swap_proto.pay_leg
      receive_leg = swap_proto.receive_leg
      flip_legs, key = _get_legs_hash_key(pay_leg, receive_leg)
      currency = swap_proto.currency
      bank_holidays = swap_proto.bank_holidays
      h = utils.hasher(key + [currency, bank_holidays])
      return h, flip_legs
  
imports: from typing import Any, Dict, List, Tuple, Union
  import tensorflow.compat.v2
  from tf_quant_finance import datetime
  from tf_quant_finance.experimental.pricing_platform.framework import utils
  from tf_quant_finance.experimental.pricing_platform.framework.core import business_days
  from tf_quant_finance.experimental.pricing_platform.framework.core import currencies
  from tf_quant_finance.experimental.pricing_platform.framework.core import curve_types
  from tf_quant_finance.experimental.pricing_platform.framework.core import daycount_conventions
  from tf_quant_finance.experimental.pricing_platform.framework.core import rate_indices
  from tf_quant_finance.experimental.pricing_platform.framework.market_data import utils
  from tf_quant_finance.experimental.pricing_platform.framework.rate_instruments import cashflow_streams
  from tf_quant_finance.experimental.pricing_platform.framework.rate_instruments import coupon_specs
  from tf_quant_finance.experimental.pricing_platform.framework.rate_instruments import utils
  from tf_quant_finance.experimental.pricing_platform.instrument_protos import interest_rate_swap_pb2
label_desc: Use image node_id 9 for calling a global function with example usage: get_hash(swap_proto) and returns: h,  flip_legs