def to_str()

in elasticsearch_serverless/compat.py [0:0]


def to_str(x: Union[str, bytes], encoding: str = "ascii") -> str:
    if not isinstance(x, str):
        return x.decode(encoding)
    return x