code: def wait(self, timeout=None, poll_interval=1.0):
          
          start = time.time()
          while self.activity_id is None:
              self.poll()
              time.sleep(poll_interval)
              if timeout and (time.time() - start) > timeout:
                  raise exc.TimeoutExceeded()
          # If we got this far, we must have an activity!
          return self.client.get_activity(self.activity_id)
docs: Wait for the upload to complete or to err out.
  
          Will return the resulting Activity or raise an exception if the upload fails.
  
          :param timeout: The max seconds to wait. Will raise TimeoutExceeded
                          exception if this time passes without success or error response.
          :type timeout: float
  
          :param poll_interval: How long to wait between upload checks.  Strava
                                recommends 1s minimum. (default 1.0s)
          :type poll_interval: float
  
          :return: The uploaded Activity object (fetched from server)
          :rtype: :class:`stravalib.model.Activity`
  
          :raise stravalib.exc.TimeoutExceeded: If a timeout was specified and
                                                activity is still processing after
                                                timeout has elapsed.
          :raise stravalib.exc.ActivityUploadFailed: If the poll returns an error.