def load_source(name, pathname):
 if six.PY2:
  import imp
  return imp.load_source(name, pathname)
 else:
  loader = importlib.machinery.SourceFileLoader(name, pathname)
  return loader.load_module(name)

def load_source ( name , pathname ) : if six . PY2 : import imp return imp . load_source ( name , pathname ) else : loader = importlib . machinery . SourceFileLoader ( name , pathname ) return loader . load_module ( name )
this function provides the backward compatibility for imp .