(directory)
This is necessary so that we get the imports from the same directory where the file
    we are completing is located.
This is necessary so that we get the imports from the same directory where the file
    we are completing is located.
This is necessary so that we get the imports from the same directory where the file we are completing is located .
def complete_from_dir(directory):
    '''
    This is necessary so that we get the imports from the same directory where the file
    we are completing is located.
    '''
    global currDirModule
    if currDirModule is not None:
        if len(sys.path) > 0 and sys.path[0] == currDirModule:
            del sys.path[0]

    currDirModule = directory
    sys.path.insert(0, directory)
def complete_from_dir ( directory ) : global currDirModule if currDirModule is not None : if len ( sys . path ) > 0 and sys . path [ 0 ] == currDirModule : del sys . path [ 0 ] currDirModule = directory sys . path . insert ( 0 , directory )