Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1from difflib import get_close_matches
2from thefuck.utils import get_all_executables
3from thefuck.specific.sudo import sudo_support
4
5
6@sudo_support
7def match(command, settings):
8 return 'not found' in command.stderr and \
9 bool(get_close_matches(command.script.split(' ')[0],
10 get_all_executables()))
11
12
13@sudo_support
14def get_new_command(command, settings):
15 old_command = command.script.split(' ')[0]
16 new_cmds = get_close_matches(old_command, get_all_executables(), cutoff=0.1)
17 return [' '.join([new_command] + command.script.split(' ')[1:])
18 for new_command in new_cmds]
19
20
21priority = 3000
22

After

1from difflib import get_close_matches
2from thefuck.utils import get_all_executables
3from thefuck.specific.sudo import sudo_support
4
5
6@sudo_support
7def match(command):
8 return 'not found' in command.stderr and \
9 bool(get_close_matches(command.script.split(' ')[0],
10 get_all_executables()))
11
12
13@sudo_support
14def get_new_command(command):
15 old_command = command.script.split(' ')[0]
16 new_cmds = get_close_matches(old_command, get_all_executables(), cutoff=0.1)
17 return [' '.join([new_command] + command.script.split(' ')[1:])
18 for new_command in new_cmds]
19
20
21priority = 3000
22

Before

module
import_from_statement
from "from"
dotted_name
identifier "difflib"
import "import"
dotted_name
identifier "get_close_matches"
import_from_statement
from "from"
dotted_name
identifier "thefuck"
. "."
identifier "utils"
import "import"
dotted_name
identifier "get_all_executables"
import_from_statement
from "from"
dotted_name
identifier "thefuck"
. "."
identifier "specific"
. "."
identifier "sudo"
import "import"
dotted_name
identifier "sudo_support"
decorated_definition
decorator
@ "@"
identifier "sudo_support"
function_definition
def "def"
identifier "match"
parameters
( "("
identifier "command"
, ","
identifier "settings"
) ")"
: ":"
block (+51 nodes collapsed)
decorated_definition
decorator
@ "@"
identifier "sudo_support"
function_definition
def "def"
identifier "get_new_command"
parameters
( "("
identifier "command"
, ","
identifier "settings"
) ")"
: ":"
block (+93 nodes collapsed)
expression_statement
assignment
identifier "priority"
= "="
integer "3000"

After

module
import_from_statement
from "from"
dotted_name
identifier "difflib"
import "import"
dotted_name
identifier "get_close_matches"
import_from_statement
from "from"
dotted_name
identifier "thefuck"
. "."
identifier "utils"
import "import"
dotted_name
identifier "get_all_executables"
import_from_statement
from "from"
dotted_name
identifier "thefuck"
. "."
identifier "specific"
. "."
identifier "sudo"
import "import"
dotted_name
identifier "sudo_support"
decorated_definition
decorator
@ "@"
identifier "sudo_support"
function_definition
def "def"
identifier "match"
parameters
( "("
identifier "command"
) ")"
: ":"
block (+51 nodes collapsed)
decorated_definition
decorator
@ "@"
identifier "sudo_support"
function_definition
def "def"
identifier "get_new_command"
parameters
( "("
identifier "command"
) ")"
: ":"
block (+93 nodes collapsed)
expression_statement
assignment
identifier "priority"
= "="
integer "3000"