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
  Args:
      work_directory: str, location to download data to
  Returns:
      None
docstr_tok: ["This","function","downloads","the","corpus","Args",":","work_directory",":","str",",","location","to","download","data","to","Returns",":","None"]
code: def _download_data(self, work_directory):
      """
      This function downloads the corpus
      Args:
          work_directory: str, location to download data to
      Returns:
          None
      """
      work_directory = os.path.abspath(work_directory)
      if not os.path.exists(work_directory):
          os.mkdir(work_directory)
  
      headers = {"User-Agent": "Mozilla/5.0"}
  
      full_filepath = os.path.join(
          work_directory,
          FILENAME[self.dataset] + "." + EXTENSION[self.dataset],
      )
      req = urllib.request.Request(
          SOURCE_URL[self.dataset], headers=headers
      )
      data_handle = urllib.request.urlopen(req)
      with open(full_filepath, "wb") as fp:
          fp.write(data_handle.read())
      print("Successfully downloaded data to {}".format(full_filepath))
  
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 6 for calling the PTBDictionary obj's underlying member method code with example usage: obj._download_data(work_directory) without return types