code: def _from_sample(self, sample: str | bytes) -> str:
      if isinstance(sample, bytes):
          sample = sample.decode("utf-8")
      return sample
  
imports: from __future__ import annotations
  import typing
  from typing import TYPE_CHECKING
  from starlette.requests import Request
  from starlette.responses import Response
  import bentoml
  from bentoml._internal.service.openapi import SUCCESS_DESCRIPTION
  from bentoml._internal.service.openapi.specification import MediaType
  from bentoml._internal.service.openapi.specification import Schema
  from bentoml._internal.utils.http import set_cookies
  from bentoml.exceptions import BentoMLException
  from bentoml.io import IODescriptor
label_desc: Use image node_id 3 for calling the CustomDescriptor obj's underlying member method code with example usage: obj._from_sample(sample) and returns: sample