code: def import_(module, objects=None, py2=None):
      
      if not PY2:
          mod = __import__(module, fromlist=['*'])
          if objects:
              if not isinstance(objects, (list, tuple)):
                  objects = [objects]
  
              r = []
              for x in objects:
                  r.append(getattr(mod, x))
              if len(r) > 1:
                  return tuple(r)
              else:
                  return r[0]
  
          else:
              return mod
  
      else:
          path = modules_mapping.get(module)
          if not path:
              raise Exception("Can't find the module {} in mappings.".format(module))
  
          if objects:
              if not isinstance(objects, (list, tuple)):
                  objects = [objects]
  
              r = []
              for x in objects:
                  m = path.get(x)
                  if not m:
                      raise Exception("Can't find the object {} in {}.".format(x, path))
                  mod = __import__(m, fromlist=['*'])
                  r.append(getattr(mod, x))
              if len(r) > 1:
                  return tuple(r)
              else:
                  return r[0]
  
          else:
              if isinstance(path, (dict, list)):
                  if not py2:
                      raise Exception("You should give py2 parameter to enable import from py2.")
                  path = py2
              mod = __import__(path, fromlist=['*'])
  
              return mod
docs: :param module: py3 compatiable module path
      :param objects: objects want to imported, it should be a list
      :param via: for some py2 module, you should give the import path according the
          objects which you want to imported
      :return: object or module
  
      Usage:
          import_('urllib.parse', 'urlparse')
          import_('urllib.parse', ['urlparse', 'urljoin'])
          import_('urllib.parse', py2='urllib2')