code: def _test_in_memory_file(
      self, content, expected_ext, custom_extension=None
  ):
      file = File.from_content(content, extension=custom_extension)
      bin_content = (
          content.encode() if isinstance(content, str) else content
      )
  
      self.assertIs(file.file_type, FileType.IN_MEMORY)
      with self.assertRaises(NeptuneException):
          _ = file.path
      self.assertEqual(bin_content, file.content)
      self.assertEqual(bin_content, self._save_and_return_content(file))
      self.assertEqual(expected_ext, file.extension)
  
imports: import pickle
  import unittest
  from io import BytesIO, StringIO
  import numpy
  from bokeh.plotting import figure
  from PIL import Image
  from neptune.exceptions import NeptuneException, StreamAlreadyUsedException
  from neptune.internal.types.file_types import FileType, InMemoryComposite
  from neptune.internal.utils.images import _get_pil_image_data
  from neptune.types import File
  from tests.e2e.utils import tmp_context
label_desc: Use image node_id 5 for calling the TestFile obj's underlying member method code with example usage: obj._test_in_memory_file(content, expected_ext, custom_extension) without return types