<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _lock(self):
 """An identity-keyed inter-process lock around the cookie file."""

    lockfile = '{}.lock'.format(self._get_cookie_file())
    safe_mkdir_for(lockfile)
    return OwnerPrintingInterProcessFileLock(lockfile)