'Parameters
sid : int
Asset identifier.
Returns
out : pd.Timestamp
The midnight of the last date written in to the output for the
given sid.'

def last_date_in_output_for_sid(self, sid):

    sizes_path = '{0}/close/meta/sizes'.format(self.sidpath(sid))
    if (not os.path.exists(sizes_path)):
        return pd.NaT
    with open(sizes_path, mode='r') as f:
        sizes = f.read()
    data = json.loads(sizes)
    num_days = (data['shape'][0] // self._minutes_per_day)
    if (num_days == 0):
        return pd.NaT
    return self._session_labels[(num_days - 1)]
