Ensures that the URL used to upload operations is properly initialized.

    Args:
      upload_url: a string url.
      current_content_length: an integer identifying the current content length
        of data uploaded to the Batch Job.

    Returns:
      An initialized string URL, or the provided string URL if the URL has
      already been initialized.

def _InitializeURL(self, upload_url, current_content_length):
    """Ensures that the URL used to upload operations is properly initialized.

    Args:
      upload_url: a string url.
      current_content_length: an integer identifying the current content length
        of data uploaded to the Batch Job.

    Returns:
      An initialized string URL, or the provided string URL if the URL has
      already been initialized.
    """
    # If initialization is not necessary, return the provided upload_url.
    if current_content_length != 0:
      return upload_url

    headers = {
        'Content-Type': 'application/xml',
        'Content-Length': 0,
        'x-goog-resumable': 'start'
    }

    # Send an HTTP POST request to the given upload_url
    req = urllib2.Request(upload_url, data={}, headers=headers)
    resp = self._url_opener.open(req)

    return resp.headers['location']