parameters: (target_file, flags)
docstring: Lock the target file. Note that if |target_file| is closed, the lock is
      automatically released.
    Args:
      target_file: file handle of the file to acquire lock.
      flags: can be any of the type LOCK_EX, LOCK_SH, LOCK_NB, or a bitwise
        OR combination of flags.
docstring_summary: Lock the target file. Note that if |target_file| is closed, the lock is
      automatically released.
    Args:
      target_file: file handle of the file to acquire lock.
      flags: can be any of the type LOCK_EX, LOCK_SH, LOCK_NB, or a bitwise
        OR combination of flags.
docstring_tokens: Lock the target file . Note that if |target_file| is closed the lock is automatically released . Args : target_file : file handle of the file to acquire lock . flags : can be any of the type LOCK_EX LOCK_SH LOCK_NB or a bitwise OR combination of flags .
function: def AcquireFileLock(target_file, flags):
    """ Lock the target file. Note that if |target_file| is closed, the lock is
      automatically released.
    Args:
      target_file: file handle of the file to acquire lock.
      flags: can be any of the type LOCK_EX, LOCK_SH, LOCK_NB, or a bitwise
        OR combination of flags.
    """
    assert flags in (
        LOCK_EX, LOCK_SH, LOCK_NB, LOCK_EX | LOCK_NB, LOCK_SH | LOCK_NB)
    if os.name == 'nt':
      _LockImplWin(target_file, flags)
    elif os.name == 'posix':
      _LockImplPosix(target_file, flags)
    else:
      raise NotImplementedError('%s is not supported' % os.name)
function_tokens: def AcquireFileLock ( target_file , flags ) : assert flags in ( LOCK_EX , LOCK_SH , LOCK_NB , LOCK_EX | LOCK_NB , LOCK_SH | LOCK_NB ) if os . name == 'nt' : _LockImplWin ( target_file , flags ) elif os . name == 'posix' : _LockImplPosix ( target_file , flags ) else : raise NotImplementedError ( '%s is not supported' % os . name )