<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_lib_modules(self, full):
 """Returns a list of the modules in the same folder as the one being wrapped for compilation as a linked library. :arg full: when True, all the code files in the source file's directory are considered as dependencies; otherwise only those explicitly needed are kept. """

        #The only complication with the whole process is that we need to get the list of
        #dependencies for the current module. For full lib, we compile *all* the files in
        #the directory, otherwise only those that are explicitly required.
        result = []
        if full:
            found = {}
            from os import path
            mypath = path.dirname(self.module.filepath)
            self.module.parent.scan_path(mypath, found)
            for codefile in found:
                self.module.parent.load_dependency(codefile.replace(".f90", ""), True, True, False)
                
            for modname, module in list(self.module.parent.modules.items()):
                if path.dirname(module.filepath).lower() == mypath.lower():
                    result.append(modname)
        else:
            result.extend(self.module.search_dependencies())

        return self._process_module_needs(result)