code: def _compress(self, bytes_in, compression_type):
      if not compression_type:
          return bytes_in
      elif compression_type == "ZLIB":
          return zlib.compress(bytes_in)
      else:
          out = io.BytesIO()
          with gzip.GzipFile(fileobj=out, mode="wb") as f:
              f.write(bytes_in)
          return out.getvalue()
  
file_path: tensorflow/tensorflow/python/kernel_tests/image_ops/decode_compressed_op_test.py
imports: import gzip
  import io
  import zlib
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import parsing_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the DecodeCompressedOpTest obj's underlying member method code with example usage: obj._compress(bytes_in, compression_type) and returns: bytes_in, zlib, out