parameters: (*cmd)
docstring: Runs the given command in gsutil with exponential backoff and retries.
docstring_summary: Runs the given command in gsutil with exponential backoff and retries.
docstring_tokens: Runs the given command in gsutil with exponential backoff and retries .
function: def _GsUtil(*cmd):
    """Runs the given command in gsutil with exponential backoff and retries."""
    gs_util = _FindGsUtil()
    cmd = [sys.executable, gs_util] + list(cmd)
  
    retries = 3
    timeout = 4  # Seconds.
    while True:
      _LOGGER.debug('Running %s', cmd)
      prog = subprocess.Popen(cmd, shell=False)
      prog.communicate()
  
      # Stop retrying on success.
      if prog.returncode == 0:
        return
  
      # Raise a permanent failure if retries have been exhausted.
      if retries == 0:
        raise RuntimeError('Command "%s" returned %d.' % (cmd, prog.returncode))
  
      _LOGGER.debug('Sleeping %d seconds and trying again.', timeout)
      time.sleep(timeout)
      retries -= 1
      timeout *= 2
function_tokens: def _GsUtil ( * cmd ) : gs_util = _FindGsUtil ( ) cmd = [ sys . executable , gs_util ] + list ( cmd ) retries = 3 timeout = 4 # Seconds. while True : _LOGGER . debug ( 'Running %s' , cmd ) prog = subprocess . Popen ( cmd , shell = False ) prog . communicate ( ) # Stop retrying on success. if prog . returncode == 0 : return # Raise a permanent failure if retries have been exhausted. if retries == 0 : raise RuntimeError ( 'Command "%s" returned %d.' % ( cmd , prog . returncode ) ) _LOGGER . debug ( 'Sleeping %d seconds and trying again.' , timeout ) time . sleep ( timeout ) retries -= 1 timeout *= 2