<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def acquire_pidfile(rundir, process_type=PROCESS_TYPE, name=None):
 """ Open a PID file for writing, using the given process type and process name for the filename. The returned file can be then passed to writePidFile after forking. @rtype: str @returns: file object, open for writing """

    from feat.common.run import get_pidpath
    _ensure_dir(rundir, "rundir")
    path = get_pidpath(rundir, process_type, name)
    return open(path, 'w')