def trim_data(raw_data) -> bytes:
    """Removes head and tail from byte string.

    Args:
        raw_data: Input bytes to be trimmed.

    Returns:
        Trimmed data string.
    """

    return raw_data[5:-2]