def backslash(dir):
if dir[-<NUM_LIT:1>] != '<STR_LIT:/>':<EOL><INDENT>return dir + '<STR_LIT:/>'<EOL><DEDENT>else:<EOL><INDENT>return dir<EOL><DEDENT>
Add '/' to the end of a path if not already the last character.

Adds '/' to end of a path (meant to make formatting of directory path `dir` 
consistently have the slash).

**Parameters**

    **dir** :  string

        Path to a directory.

**Returns**

    **out** :  string

        Same as `dir`, with '/' appended to the end if not already there.