<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def edit(filename, connection=None):
 """Checks out a file into the default changelist :param filename: File to check out :type filename: str :param connection: Connection object to use :type connection: :py:class:`Connection` """

    c = connection or connect()
    rev = c.ls(filename)
    if rev:
        rev[0].edit()