def kill_process_by_pid(pid):
    """
    Kill a process by its PID (Process ID).

    This function attempts to terminate a process with the given PID using the SIGTERM signal.
    It logs the outcome of the operation, whether successful or not.

    Args:
        pid (int): The Process ID of the process to be terminated.

    Raises:
        ProcessLookupError: If no process with the given PID is found.
        Exception: If an error occurs while attempting to send the SIGTERM signal.
    """
    try:
        os.kill(pid, signal.SIGTERM)
        logger.info(f"Sent SIGTERM to process with PID {pid}")
    except ProcessLookupError:
        logger.error(f"No process found with PID {pid}")
    except Exception as e:
        logger.error(f"Failed to send SIGTERM to process with PID {pid}: {e}")

    Kill a process by its PID (Process ID).

    This function attempts to terminate a process with the given PID using the SIGTERM signal.
    It logs the outcome of the operation, whether successful or not.

    Args:
        pid (int): The Process ID of the process to be terminated.

    Raises:
        ProcessLookupError: If no process with the given PID is found.
        Exception: If an error occurs while attempting to send the SIGTERM signal.
    
src/autotrain/app/utils.py