docstr: Load from file path.
docstr_tok: ["Load","from","file","path","."]
code: def load(self) -> List[Document]:
      """Load from file path."""
      import mwparserfromhell
      import mwxml
  
      dump = mwxml.Dump.from_page_xml(self.data)
  
      docs = []
  
      for page in dump.pages:
          if self.views is not None and page.title not in self.views:
              if self.verbose:
                  print("Skipped %s low views" % page.title, flush=True)
              continue
          for revision in page:
              if self.title_words_limit is not None:
                  num_words = len(
                      " ".join(page.title.split("_")).split(" ")
                  )
                  if num_words > self.title_words_limit:
                      if self.verbose:
                          print("Skipped %s" % page.title, flush=True)
                      continue
              if self.verbose:
                  if self.views is not None:
                      print(
                          "Kept %s views: %s"
                          % (page.title, self.views[page.title]),
                          flush=True,
                      )
                  else:
                      print("Kept %s" % page.title, flush=True)
  
              code = mwparserfromhell.parse(revision.text)
              text = code.strip_code(
                  normalize=True,
                  collapse=True,
                  keep_template_params=False,
              )
              title_url = str(page.title).replace(" ", "_")
              metadata = dict(
                  title=page.title,
                  source="https://en.wikipedia.org/wiki/" + title_url,
                  id=page.id,
                  redirect=page.redirect,
                  views=self.views[page.title]
                  if self.views is not None
                  else -1,
              )
              metadata = {
                  k: v for k, v in metadata.items() if v is not None
              }
              docs.append(
                  Document(page_content=text, metadata=metadata)
              )
  
      return docs
  
imports: import ast
  import glob
  import pickle
  import uuid
  from typing import List, Optional
  import os
  import bz2
  import csv
  import numpy
  import pandas
  import pytest
  from matplotlib import pyplot
  from langchain.docstore.document import Document
  from langchain.document_loaders import MWDumpLoader
  from joblib import Parallel, delayed
label_desc: Use image node_id 2 for calling the MWDumpDirectLoader obj's underlying member method code with example usage: obj.load() and returns: docs