class_docstr: Class for generating a dictionary of all words in the PTB corpus
class_docstr_tok: ["Class","for","generating","a","dictionary","of","all","words","in","the","PTB","corpus"]
docstr: This function downloads the corpus if its not already present
  Args:
      work_directory: str, location to download data to
  Returns:
      None
docstr_tok: ["This","function","downloads","the","corpus","if","its","not","already","present","Args",":","work_directory",":","str",",","location","to","download","data","to","Returns",":","None"]
code: def _maybe_download(self, work_directory):
      """
      This function downloads the corpus if its not already present
      Args:
          work_directory: str, location to download data to
      Returns:
          None
      """
      if not os.path.exists(self.filepath):
          print(
              "{} was not found in the directory: {}, looking for compressed version".format(
                  FILENAME[self.dataset], self.filepath
              )
          )
          full_filepath = os.path.join(
              work_directory,
              FILENAME[self.dataset] + "." + EXTENSION[self.dataset],
          )
          if not os.path.exists(full_filepath):
              print("Did not find data")
              print(
                  "PTB can be downloaded from http://www.fit.vutbr.cz/~imikolov/rnnlm/ \n"
                  "wikitext can be downloaded from"
                  " https://einstein.ai/research/the-wikitext-long-term-dependency-language"
                  "-modeling-dataset"
              )
              print(
                  "\nThe terms and conditions of the data set license apply. Intel does not "
                  "grant any rights to the data files or database\n"
              )
              response = input(
                  "\nTo download data from {}, please enter YES: ".format(
                      LICENSE_URL[self.dataset]
                  )
              )
              res = response.lower().strip()
              if res == "yes" or (len(res) == 1 and res == "y"):
                  print("Downloading...")
                  self._download_data(work_directory)
                  self._uncompress_data(work_directory)
              else:
                  print(
                      "Download declined. Response received {} != YES|Y. ".format(
                          res
                      )
                  )
                  print(
                      "Please download the model manually from the links above "
                      "and place in directory: {}".format(
                          work_directory
                      )
                  )
                  sys.exit()
          else:
              self._uncompress_data(work_directory)
  
file_path: nlp-architect/nlp_architect/data/ptb.py
imports: import os
  import sys
  import numpy
  import urllib.request
label_desc: Use image node_id 5 for calling the PTBDictionary obj's underlying member method code with example usage: obj._maybe_download(work_directory) without return types