human
Remove string from list if from substring list
assistant
Here is some code to get last element of string splitted by '\\' from list of strings `list_dirs`

[l.split('\\')[-1] for l in list_dirs]

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.