class_docstr: Abstraction of a NLU pipeline unit
  
  Pipeline processing units such as intent parsers, intent classifiers and
  slot fillers must implement this class.
  
   A :class:`ProcessingUnit` is associated with a *config_type*, which
  represents the :class:`.ProcessingUnitConfig` used to initialize it.
docstr: Load a :class:`ProcessingUnit` from a persisted processing unit
  directory
  
  Args:
      unit_path (str or :class:`pathlib.Path`): path to the persisted
          processing unit
      unit_name (str, optional): Name of the processing unit to load.
          By default, the unit name is assumed to be stored in a
          "metadata.json" file located in the directory at unit_path.
  
  Raises:
      LoadingError: when unit_name is None and no metadata file is found
          in the processing unit directory
docstr_tok: ["Load","a",":","class",":","`","ProcessingUnit","`","from","a","persisted","processing","unit","directory","Args",":","unit_path","(","str","or",":","class",":","`","pathlib.Path","`",")",":","path","to","the","persisted","processing","unit","unit_name","(","str",",","optional",")",":","Name","of","the","processing","unit","to","load",".","By","default",",","the","unit","name","is","assumed","to","be","stored","in","a","``","metadata.json","''","file","located","in","the","directory","at","unit_path",".","Raises",":","LoadingError",":","when","unit_name","is","None","and","no","metadata","file","is","found","in","the","processing","unit","directory"]
code: def load_from_path(cls, unit_path, unit_name=None, **shared):
      """Load a :class:`ProcessingUnit` from a persisted processing unit
      directory
  
      Args:
          unit_path (str or :class:`pathlib.Path`): path to the persisted
              processing unit
          unit_name (str, optional): Name of the processing unit to load.
              By default, the unit name is assumed to be stored in a
              "metadata.json" file located in the directory at unit_path.
  
      Raises:
          LoadingError: when unit_name is None and no metadata file is found
              in the processing unit directory
      """
      unit_path = Path(unit_path)
      if unit_name is None:
          metadata_path = unit_path / "metadata.json"
          if not metadata_path.exists():
              raise LoadingError(
                  "Missing metadata for processing unit at path %s"
                  % str(unit_path)
              )
          with metadata_path.open(encoding="utf8") as f:
              metadata = json.load(f)
          unit_name = metadata["unit_name"]
      unit = cls.by_name(unit_name)
      return unit.from_path(unit_path, **shared)
  
imports: from __future__ import unicode_literals
  import io
  import json
  import shutil
  from abc import ABCMeta, abstractmethod, abstractproperty
  from builtins import str, bytes
  from pathlib import Path
  from future.utils import with_metaclass
  from snips_nlu.common.abc_utils import abstractclassmethod, classproperty
  from snips_nlu.common.io_utils import temp_dir, unzip_archive
  from snips_nlu.common.registrable import Registrable
  from snips_nlu.common.utils import json_string, check_random_state
  from snips_nlu.constants import BUILTIN_ENTITY_PARSER, CUSTOM_ENTITY_PARSER, CUSTOM_ENTITY_PARSER_USAGE, RESOURCES, LANGUAGE, RANDOM_STATE
  from snips_nlu.entity_parser import BuiltinEntityParser, CustomEntityParser, CustomEntityParserUsage
  from snips_nlu.exceptions import LoadingError
  from snips_nlu.pipeline.configs import ProcessingUnitConfig
  from snips_nlu.pipeline.configs.config import DefaultProcessingUnitConfig
  from snips_nlu.resources import load_resources
label_desc: Use image node_id 6 for calling the ProcessingUnit obj's underlying member method code with example usage: obj.load_from_path(cls, unit_path, unit_name) and returns: unit