<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def open(self, directory=None, filename=None, mode="rb"):
 """Opens a file for writing or reading."""

        path = os.path.join(directory, filename)
        return open(path, mode)