class_docstr: Handles metadata supplied in configuration files.
class_docstr_tok: ["Handles","metadata","supplied","in","configuration","files","."]
docstr: Represents value as a module attribute.
  
  Examples:
      attr: package.attr
      attr: package.module.attr
  
  :param str value:
  :rtype: str
docstr_tok: ["Represents","value","as","a","module","attribute",".","Examples",":","attr",":","package.attr","attr",":","package.module.attr",":","param","str","value",":",":","rtype",":","str"]
code: def _parse_attr(cls, value, package_dir=None):
      """Represents value as a module attribute.
  
      Examples:
          attr: package.attr
          attr: package.module.attr
  
      :param str value:
      :rtype: str
      """
      attr_directive = "attr:"
      if not value.startswith(attr_directive):
          return value
  
      attrs_path = value.replace(attr_directive, "").strip().split(".")
      attr_name = attrs_path.pop()
  
      module_name = ".".join(attrs_path)
      module_name = module_name or "__init__"
  
      parent_path = os.getcwd()
      if package_dir:
          if attrs_path[0] in package_dir:
              # A custom path was specified for the module we want to import
              custom_path = package_dir[attrs_path[0]]
              parts = custom_path.rsplit("/", 1)
              if len(parts) > 1:
                  parent_path = os.path.join(os.getcwd(), parts[0])
                  module_name = parts[1]
              else:
                  module_name = custom_path
          elif "" in package_dir:
              # A custom parent directory was specified for all root modules
              parent_path = os.path.join(os.getcwd(), package_dir[""])
      sys.path.insert(0, parent_path)
      try:
          module = import_module(module_name)
          value = getattr(module, attr_name)
  
      finally:
          sys.path = sys.path[1:]
  
      return value
  
imports: from __future__ import absolute_import, unicode_literals
  import io
  import os
  import sys
  import warnings
  import functools
  from collections import defaultdict
  from functools import partial
  from functools import wraps
  from importlib import import_module
  from distutils.errors import DistutilsOptionError, DistutilsFileError
  from setuptools.extern.packaging.version import LegacyVersion, parse
  from setuptools.extern.packaging.specifiers import SpecifierSet
  from setuptools.extern.six import string_types, PY3
label_desc: Use image node_id 11 for calling the ConfigHandler obj's underlying member method code with example usage: obj._parse_attr(cls, value, package_dir) and returns: value, value