code: def stringify(line: str | bytes):
      """Make sure string is returned even if bytes are passed. Docker stream can return bytes."""
      decode_method = getattr(line, "decode", None)
      if decode_method:
          return decode_method(
              encoding="utf-8", errors="surrogateescape"
          )
      else:
          return line
  
imports: from __future__ import annotations
  import ast
  import pickle
  import tarfile
  import warnings
  from collections.abc import Container
  from functools import cached_property
  from io import BytesIO, StringIO
  from tempfile import TemporaryDirectory
  from typing import TYPE_CHECKING, Iterable, Sequence
  from deprecated.classic import deprecated
  from docker.constants import DEFAULT_TIMEOUT_SECONDS
  from docker.errors import APIError
  from docker.types import LogConfig, Mount, Ulimit
  from dotenv import dotenv_values
  from typing_extensions import Literal
  from airflow.exceptions import AirflowProviderDeprecationWarning
  from airflow.models import BaseOperator
  from airflow.providers.docker.exceptions import DockerContainerFailedException, DockerContainerFailedSkipException
  from airflow.providers.docker.hooks.docker import DockerHook
label_desc: Use image node_id 1 for calling a global function with example usage: stringify(line) and returns: decode_method, line