code: def _upload_file_to_cdn(
      local_path: str,
      cdn_path: str,
      content_type: str,
      bucket: Any,
      binary: bool = False,
  ) -> None:
      LOG.record(f":uploading to CDN: {cdn_path}")
      key = boto.s3.key.Key(bucket, cdn_path)
      key.metadata = {
          "Cache-Control": "max-age=31536000",
          "Content-Type": content_type,
      }
      if binary:
          data = open(local_path, "rb").read()
      else:
          data = open(local_path).read().encode("utf-8")
      fp = BytesIO(data)
      key.set_contents_from_file(fp)
  
file_path: bokeh/release/remote.py
imports: from __future__ import annotations
  from io import BytesIO
  from typing import Any
  import boto
  from packaging.version import Version
  from .action import FAILED, PASSED, ActionReturn
  from .config import Config
  from .logger import LOG
  from .system import System
label_desc: Use image node_id 1 for calling a global function with example usage: _upload_file_to_cdn(local_path, cdn_path, content_type, bucket, binary) without return types