class_docstr: Parameters
  ---------
  country_group : h5py.Group
      The group for a single country in an HDF5 daily pricing file.
class_docstr_tok: ["Parameters","--","--","--","--","-","country_group",":","h5py.Group","The","group","for","a","single","country","in","an","HDF5","daily","pricing","file","."]
docstr: Get the latest day on or before ``dt`` in which ``asset`` traded.
  
  If there are no trades on or before ``dt``, returns ``pd.NaT``.
  
  Parameters
  ----------
  asset : zipline.asset.Asset
      The asset for which to get the last traded day.
  dt : pd.Timestamp
      The dt at which to start searching for the last traded day.
  
  Returns
  -------
  last_traded : pd.Timestamp
      The day of the last trade for the given asset, using the
      input dt as a vantage point.
docstr_tok: ["Get","the","latest","day","on","or","before","``","dt","``","in","which","``","asset","``","traded",".","If","there","are","no","trades","on","or","before","``","dt","``",",","returns","``","pd.NaT","``",".","Parameters","--","--","--","--","--","asset",":","zipline.asset.Asset","The","asset","for","which","to","get","the","last","traded","day",".","dt",":","pd.Timestamp","The","dt","at","which","to","start","searching","for","the","last","traded","day",".","Returns","--","--","--","-","last_traded",":","pd.Timestamp","The","day","of","the","last","trade","for","the","given","asset",",","using","the","input","dt","as","a","vantage","point","."]
code: def get_last_traded_dt(self, asset, dt):
      """
      Get the latest day on or before ``dt`` in which ``asset`` traded.
  
      If there are no trades on or before ``dt``, returns ``pd.NaT``.
  
      Parameters
      ----------
      asset : zipline.asset.Asset
          The asset for which to get the last traded day.
      dt : pd.Timestamp
          The dt at which to start searching for the last traded day.
  
      Returns
      -------
      last_traded : pd.Timestamp
          The day of the last trade for the given asset, using the
          input dt as a vantage point.
      """
      sid_ix = self.sids.searchsorted(asset.sid)
      # Used to get a slice of all dates up to and including ``dt``.
      dt_limit_ix = self.dates.searchsorted(dt.asm8, side="right")
  
      # Get the indices of all dates with nonzero volume.
      nonzero_volume_ixs = np.ravel(
          np.nonzero(
              self._country_group[DATA][VOLUME][sid_ix, :dt_limit_ix]
          )
      )
  
      if len(nonzero_volume_ixs) == 0:
          return pd.NaT
  
      return pd.Timestamp(self.dates[nonzero_volume_ixs][-1], tz="UTC")
  
imports: from functools import partial
  import h5py
  import logbook
  import numpy
  import pandas
  from six import iteritems, raise_from, viewkeys
  from six.moves import reduce
  from zipline.data.bar_reader import NoDataAfterDate, NoDataBeforeDate, NoDataForSid, NoDataOnDate
  from zipline.data.session_bars import CurrencyAwareSessionBarReader
  from zipline.utils.memoize import lazyval
  from zipline.utils.numpy_utils import bytes_array_to_native_str_object_array
  from zipline.utils.pandas_utils import check_indexes_all_same
label_desc: Use image node_id 21 for calling the HDF5DailyBarReader obj's underlying member method code with example usage: obj.get_last_traded_dt(asset, dt) and returns: pd, pd