I defined a function(using python) and when I use it, it returns me "unindent does not match any outer indentation level" : [part of my code][1]


 given a path and use it, I met this 
[the result][2]


  [1]: https://i.stack.imgur.com/rRSZV.png
  [2]: https://i.stack.imgur.com/HyaNW.png

when I runs the same code seperated in terminal, it runs correctly. Why?Hhow can I fixed this error?