code: def import_object(module_name, attribute_name):
      
      # Py2 compatibility: force str (i.e bytes) when importing.
      module = __import__(str(module_name), {}, {}, [str(attribute_name)], 0)
      return getattr(module, str(attribute_name))
docs: Import an object from its absolute path.
  
      Example:
          >>> import_object('datetime', 'datetime')
          <type 'datetime.datetime'>