def METHOD_NAME(filename):
    '''This function retrieves a process ID from a lock file.
    Parameters
    ----------
    filename
        The filename parameter is a string that represents the name of the lock file from which the process
        ID (PID) needs to be retrieved.
    Returns
    -------
        int: The process ID (PID)
        or
        SyntaxError: Indicating that the file should be manually investigated and deleted if appropriate.
    '''
    # Lock file format is established in `jwql/utils/protect_module.py::lock_module`
    with open(filename, 'r') as file:
        for line in file:
            if _PID_LOCKFILE_KEY in line:
                number_index = line.index(_PID_LOCKFILE_KEY) + len(_PID_LOCKFILE_KEY)
                number = line[number_index:].strip()
                return int(number)
    raise SyntaxError(f"No PID found in {filename} - Please manually investigate and delete if appropriate")