(self, what, mode)
Return a pair of lists of completions for something. The first list
        is a sublist of the second. Both are sorted.

        If there is a Python subprocess, get the comp. list there.  Otherwise,
        either fetch_completions() is running in the subprocess itself or it
        was called in an IDLE EditorWindow before any script had been run.

        The subprocess environment is that of the most recently run script.  If
        two unrelated modules are being edited some calltips in the current
        module may be inoperative if the module was not the last to run.
Return a pair of lists of completions for something. The first list
        is a sublist of the second. Both are sorted.
Return a pair of lists of completions for something . The first list is a sublist of the second . Both are sorted .
def fetch_completions(self, what, mode):
        """Return a pair of lists of completions for something. The first list
        is a sublist of the second. Both are sorted.

        If there is a Python subprocess, get the comp. list there.  Otherwise,
        either fetch_completions() is running in the subprocess itself or it
        was called in an IDLE EditorWindow before any script had been run.

        The subprocess environment is that of the most recently run script.  If
        two unrelated modules are being edited some calltips in the current
        module may be inoperative if the module was not the last to run.
        """
        try:
            rpcclt = self.editwin.flist.pyshell.interp.rpcclt
        except:
            rpcclt = None
        if rpcclt:
            return rpcclt.remotecall("exec", "get_the_completion_list",
                                     (what, mode), {})
        else:
            if mode == ATTRS:
                if what == "":  # Main module names.
                    namespace = {**__main__.__builtins__.__dict__,
                                 **__main__.__dict__}
                    bigl = eval("dir()", namespace)
                    bigl.extend(completion_kwds)
                    bigl.sort()
                    if "__all__" in bigl:
                        smalll = sorted(eval("__all__", namespace))
                    else:
                        smalll = [s for s in bigl if s[:1] != '_']
                else:
                    try:
                        entity = self.get_entity(what)
                        bigl = dir(entity)
                        bigl.sort()
                        if "__all__" in bigl:
                            smalll = sorted(entity.__all__)
                        else:
                            smalll = [s for s in bigl if s[:1] != '_']
                    except:
                        return [], []

            elif mode == FILES:
                if what == "":
                    what = "."
                try:
                    expandedpath = os.path.expanduser(what)
                    bigl = os.listdir(expandedpath)
                    bigl.sort()
                    smalll = [s for s in bigl if s[:1] != '.']
                except OSError:
                    return [], []

            if not smalll:
                smalll = bigl
            return smalll, bigl
def fetch_completions ( self , what , mode ) : try : rpcclt = self . editwin . flist . pyshell . interp . rpcclt except : rpcclt = None if rpcclt : return rpcclt . remotecall ( "exec" , "get_the_completion_list" , ( what , mode ) , { } ) else : if mode == ATTRS : if what == "" : # Main module names. namespace = { * * __main__ . __builtins__ . __dict__ , * * __main__ . __dict__ } bigl = eval ( "dir()" , namespace ) bigl . extend ( completion_kwds ) bigl . sort ( ) if "__all__" in bigl : smalll = sorted ( eval ( "__all__" , namespace ) ) else : smalll = [ s for s in bigl if s [ : 1 ] != '_' ] else : try : entity = self . get_entity ( what ) bigl = dir ( entity ) bigl . sort ( ) if "__all__" in bigl : smalll = sorted ( entity . __all__ ) else : smalll = [ s for s in bigl if s [ : 1 ] != '_' ] except : return [ ] , [ ] elif mode == FILES : if what == "" : what = "." try : expandedpath = os . path . expanduser ( what ) bigl = os . listdir ( expandedpath ) bigl . sort ( ) smalll = [ s for s in bigl if s [ : 1 ] != '.' ] except OSError : return [ ] , [ ] if not smalll : smalll = bigl return smalll , bigl