code: def load_text(
      path: PurePath,
      url: Optional[str] = None,
      *,
      filter_subset: Optional[int] = None,
  ):
      """
      ### Load text file
  
      :param path: is the location of the text file
      :param url: is the URL to download the file from
      :param filter_subset: is the number of characters to filter.
       Use this during testing when trying large datasets
      :return: the text content
      """
  
      path = Path(path)
  
      # Download if it doesn't exist
      if not path.exists():
          if not url:
              raise FileNotFoundError(str(path))
          else:
              download_file(url, path)
  
      with monit.section("Load data"):
          # Load data
          with open(str(path), "r") as f:
              text = f.read()
          # Filter
          if filter_subset:
              text = text[:filter_subset]
  
      #
      return text
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/neox/utils/text_dataset.py
imports: from pathlib import PurePath, Path
  from typing import Optional, List
  import torch
  import torch.utils.data
  from labml import lab
  from labml import monit
  from labml.logger import inspect
  from labml.utils.download import download_file
  from labml_nn.neox.tokenizer import get_tokenizer
label_desc: Use image node_id 1 for calling a global function with example usage: load_text(path, url) and returns: text