def __init__(self, namespace, segment, bos, eos, skip_empty, root):
root = os.path.expanduser(root)<EOL>if not os.path.isdir(root):<EOL><INDENT>os.makedirs(root)<EOL><DEDENT>self._root = root<EOL>self._dir = os.path.join(root, '<STR_LIT>')<EOL>self._namespace = '<STR_LIT>'.format(namespace)<EOL>subdir_name, pattern, data_hash = self._data_file[segment]<EOL>self._subdir = os.path.join(self._dir, subdir_name)<EOL>self._file_pattern = os.path.join(self._subdir, pattern)<EOL>self._data_hash = data_hash<EOL>self._get_data()<EOL>sampler = '<STR_LIT>' if segment != '<STR_LIT:train>' else '<STR_LIT>'<EOL>super(_GBWStream, self).__init__(<EOL>dataset=CorpusDataset,<EOL>file_pattern=self._file_pattern,<EOL>skip_empty=skip_empty,<EOL>bos=bos,<EOL>eos=eos,<EOL>file_sampler=sampler)<EOL>
Directory layout:
           - root ($MXNET_HOME/datasets/gbw)
             - archive_file (1-billion-word-language-modeling-benchmark-r13output.tar.gz)
             - dir (1-billion-word-language-modeling-benchmark-r13output)
               - subdir (training-monolingual.tokenized.shuffled)
               - subdir (heldout-monolingual.tokenized.shuffled)