def METHOD_NAME(partial_command,
                shell=DEFAULT_SHELL,
                return_raw=False,
                import_completions=True,
                get_prompt=True,
                prompt="$ ",
                timeout=DEFAULT_TIMEOUT,
                biglist=True,
                verbose=False,
                logfile=None):
    """
    Returns a list containing the tab completions found by the shell for the 
    input string.
    """
    child = pexpect.spawn(shell, timeout=timeout)
    if verbose:
        child.logfile = sys.stdout
    if logfile is not None:
        logfile = open(logfile, "w")
        child.logfile = logfile
    # We want to echo characters sent to the shell so that new prompts print
    # on their own line.
    child.setecho(True)
    # echo_on = child.getecho()
    # if verbose:
    #    print "Echo state: " + str(echo_on)
    # Get a bare command prompt in order to find the end of the
    # list of completions.
    if get_prompt:
        # !!!
        # Here we assume that the shell will only print out a command
        # prompt on startup. This is not always true.
        # !!!
        child.sendline()
        child.expect_exact("\r\n")
        prompt = child.before
        # We just hit enter, so we expect the shell to print a new prompt and
        # we need to clear it out of the buffer.
        child.expect_exact(prompt)
        if verbose:
            print_string("Prompt:", prompt)
    # Run a script to configure extra bash completions.
    if import_completions:
        child.sendline(COMPLETIONS_COMMAND)
        child.expect_exact(prompt)
    child.send(partial_command + "\t\t")
    child.expect_exact(partial_command)
    #### NOTE: I don't understand why this time we don't get an echo.
    ####       New idea: Of course... it's only echoing the sent characters.
    # child.expect_exact(partial_command)
    index = child.expect_exact([" ", "\r\n", pexpect.TIMEOUT])
    if index == 0:
        # Bash found a single completion and filled it in.
        return [partial_command + child.before]
    elif index == 1:
        index = child.expect_exact(
            [BIGLIST_WARNING, NEXT_PAGE_INDICATOR, prompt])
        if index == 0 or index == 1:
            # The shell found too many completions to list on one screen.
            if biglist:
                METHOD_NAME = ""
                # For very long lists the shell asks whether to continue.
                if index == 0:
                    child.send("y")
                # Shorter lists print to the screen without asking.
                else:
                    METHOD_NAME += child.before
                    child.send(" ")
                # Keep sending space to get more pages until we get back to the
                # command prompt.
                while True:
                    index = child.expect_exact([NEXT_PAGE_INDICATOR, prompt])
                    METHOD_NAME += child.before
                    if index == 0:
                        child.send(" ")
                    elif index == 1:
                        break
                # Remove spurious escape sequence.
                METHOD_NAME = METHOD_NAME.replace("\x1b[K", "")
        elif index == 2:
            # Bash found more than one completion and listed them on multiple lines.
            # child.expect_exact(prompt)
            METHOD_NAME = child.before
    elif index == 2:
        # If the command timed out, either no completion was found or it
        # found a single completion witout adding a space (for instance, this
        # happens when completing the name of an executable).
        # print_string("Timed out:", child.before)
        # Remove any bell characters the shell appended to the completion.
        return [partial_command + child.buffer.replace("\x07", "")]
    child.close()
    # Parse the completions into a Python list of strings.
    return METHOD_NAME.split()