code: def validate_session(self, session, latest_only=False):
          
          if latest_only:
              if session != self.metadata['terms'][-1]['sessions'][-1]:
                  raise NoDataForPeriod(session)
  
          for t in self.metadata['terms']:
              if session in t['sessions']:
                  return True
          raise NoDataForPeriod(session)
docs: Check that a session is present in the metadata dictionary.
  
          raises :exc:`~billy.scrape.NoDataForPeriod` if session is invalid
  
          :param session:  string representing session to check