def change_cwd():
 cwd = os.getcwd()
 if (os.path.split(cwd)[1] == 'scripts'):
  os.chdir(os.path.join(cwd, os.pardir))

def change_cwd ( ) : cwd = os . getcwd ( ) if ( os . path . split ( cwd ) [ 1 ] == 'scripts' ) : os . chdir ( os . path . join ( cwd , os . pardir ) )
return a context manager that changes the current working directory .