code: def find_offset_of_content_in_file(
      file: io.BufferedIOBase, content: bytes, start_offset: int = 0
  ) -> int:
      """Find the offset of the first occurrence of content in a file.
  
      Args:
          file: File object
          content: Content to find
          start_offset: Start offset to read from, inclusive.
  
      Returns:
          Offset of the first occurrence of content in a file.
      """
      logger.debug(f"Finding offset of content {content} in file")
      file.seek(
          start_offset, io.SEEK_SET
      )  # move file pointer to start of file
      offset = start_offset
      while True:
          # Read in block
          block_data = file.read(BLOCK_SIZE)
          if block_data == b"":
              # Stop reading
              return -1
          # Find the offset of the first occurrence of content in the block
          block_offset = block_data.find(content)
          if block_offset != -1:
              # Found the offset in the block
              return offset + block_offset
          # Continue reading
          offset += len(block_data)
  
imports: import logging
  from typing import Optional, Tuple
  import concurrent.futures
  import ray.dashboard.modules.log.log_utils
  import ray.dashboard.modules.log.log_consts
  import ray.dashboard.utils
  import ray.dashboard.optional_utils
  from ray._private.ray_constants import env_integer
  import asyncio
  import grpc
  import io
  import os
  from pathlib import Path
  from ray.core.generated import reporter_pb2
  from ray.core.generated import reporter_pb2_grpc
  from ray._private.ray_constants import LOG_PREFIX_TASK_ATTEMPT_START, LOG_PREFIX_TASK_ATTEMPT_END
label_desc: Use image node_id 1 for calling a global function with example usage: find_offset_of_content_in_file(file, content, start_offset) and returns: unknown, unknown