code: def preprocess_fn(x, rescale: bool, expand_dims: bool):
      if rescale:
          x = x / 127.5 - 1.0
      if expand_dims:
          x = np.expand_dims(x, 0)
      return x
  
file_path: chitra/tests/serve/test_app.py
imports: import unittest.mock
  from unittest.mock import MagicMock
  import numpy
  import pytest
  from chitra.serve import GradioApp
  from chitra.serve import constants
label_desc: Use image node_id 2 for calling a global function with example usage: preprocess_fn(x, rescale, expand_dims) and returns: x