parameters: (modulename, package, attr=None)
docstring: Import a module built against the version of Qt we are running.
      The provided name is suffixed with the string 'qtX' where
      X is the major version of Qt that the library was built against.
      The version is determined by inspecting the loaded Python Qt
      bindings. If none can be found then Qt5 is assumed.
  
      If modulename looks like a relative name then the import is first tried as specified
      and if this fails it is attempted as a top-level import without a package name and the relative prefixes removed.
      This allows the built module to live outside of the package in a binary directory of the build. For example, a
      developer build would put the built dynamic library in the bin directory but a package installation
      would have the library in the proper location as indicated by the relative import path. This avoids any build
      products being placed in the source tree.
  
      :param modulename: The name of the dynamic module to find, possibly a relative name
      :param package: If the name looks like a relative import then the package argument is required to specify the
      parent package
      :param attr: Optional attribute to retrieve from the module
      :return: Either the module object if no attribute is specified of the requested attribute
docstring_summary: Import a module built against the version of Qt we are running.
      The provided name is suffixed with the string 'qtX' where
      X is the major version of Qt that the library was built against.
      The version is determined by inspecting the loaded Python Qt
      bindings. If none can be found then Qt5 is assumed.
docstring_tokens: Import a module built against the version of Qt we are running . The provided name is suffixed with the string qtX where X is the major version of Qt that the library was built against . The version is determined by inspecting the loaded Python Qt bindings . If none can be found then Qt5 is assumed .
function: def import_qt(modulename, package, attr=None):
      """Import a module built against the version of Qt we are running.
      The provided name is suffixed with the string 'qtX' where
      X is the major version of Qt that the library was built against.
      The version is determined by inspecting the loaded Python Qt
      bindings. If none can be found then Qt5 is assumed.
  
      If modulename looks like a relative name then the import is first tried as specified
      and if this fails it is attempted as a top-level import without a package name and the relative prefixes removed.
      This allows the built module to live outside of the package in a binary directory of the build. For example, a
      developer build would put the built dynamic library in the bin directory but a package installation
      would have the library in the proper location as indicated by the relative import path. This avoids any build
      products being placed in the source tree.
  
      :param modulename: The name of the dynamic module to find, possibly a relative name
      :param package: If the name looks like a relative import then the package argument is required to specify the
      parent package
      :param attr: Optional attribute to retrieve from the module
      :return: Either the module object if no attribute is specified of the requested attribute
      """
      if modulename.startswith('.'):
          try:
              lib = import_module(modulename + LIB_SUFFIX, package)
          except ImportError as e1:
              try:
                  lib = import_module(modulename.lstrip('.') + LIB_SUFFIX)
              except ImportError as e2:
                  msg = 'import of "{}" failed with "{}"'
                  msg = 'First ' + msg.format(modulename + LIB_SUFFIX, e1) \
                        + '. Second ' + msg.format(modulename.lstrip('.') + LIB_SUFFIX, e2)
                  raise ImportError(msg)
      else:
          lib = import_module(modulename + LIB_SUFFIX)
  
      if attr is not None:
          return getattr(lib, attr)
      else:
          return lib
function_tokens: def import_qt ( modulename , package , attr = None ) : if modulename . startswith ( '.' ) : try : lib = import_module ( modulename + LIB_SUFFIX , package ) except ImportError as e1 : try : lib = import_module ( modulename . lstrip ( '.' ) + LIB_SUFFIX ) except ImportError as e2 : msg = 'import of "{}" failed with "{}"' msg = 'First ' + msg . format ( modulename + LIB_SUFFIX , e1 ) + '. Second ' + msg . format ( modulename . lstrip ( '.' ) + LIB_SUFFIX , e2 ) raise ImportError ( msg ) else : lib = import_module ( modulename + LIB_SUFFIX ) if attr is not None : return getattr ( lib , attr ) else : return lib