class_docstr: Allow chatbots to be trained with the data from the Ubuntu Dialog Corpus.
docstr: Download a file from the given url.
  Show a progress indicator for the download status.
  Based on: http://stackoverflow.com/a/15645088/1547223
docstr_tok: ["Download","a","file","from","the","given","url",".","Show","a","progress","indicator","for","the","download","status",".","Based","on",":","http",":","\/\/stackoverflow.com\/a\/15645088\/1547223"]
code: def download(self, url, show_status=True):
      """
      Download a file from the given url.
      Show a progress indicator for the download status.
      Based on: http://stackoverflow.com/a/15645088/1547223
      """
      import requests
  
      file_name = url.split("/")[-1]
      file_path = os.path.join(self.data_directory, file_name)
  
      # Do not download the data if it already exists
      if self.is_downloaded(file_path):
          return file_path
  
      with open(file_path, "wb") as open_file:
          print("Downloading %s" % url)
          response = requests.get(url, stream=True)
          total_length = response.headers.get("content-length")
  
          if total_length is None:
              # No content length header
              open_file.write(response.content)
          else:
              download = 0
              total_length = int(total_length)
              for data in response.iter_content(chunk_size=4096):
                  download += len(data)
                  open_file.write(data)
                  if show_status:
                      done = int(50 * download / total_length)
                      sys.stdout.write(
                          "\r[%s%s]" % ("=" * done, " " * (50 - done))
                      )
                      sys.stdout.flush()
  
          # Add a new line after the download bar
          sys.stdout.write("\n")
  
      print("Download location: %s" % file_path)
      return file_path
  
imports: import os
  import sys
  import csv
  import time
  from dateutil import parser
  from chatterbot.conversation import Statement
  from chatterbot.tagging import PosLemmaTagger
  from chatterbot import utils
label_desc: Use image node_id 4 for calling the UbuntuCorpusTrainer obj's underlying member method code with example usage: obj.download(url, show_status) and returns: file_path, file_path