code: def encode_jpeg(numpy_image, quality):
      numpy_image = cv2.cvtColor(numpy_image, cv2.COLOR_RGB2BGR)
      success, result = cv2.imencode(
          ".jpg", numpy_image, [int(cv2.IMWRITE_JPEG_QUALITY), quality]
      )
  
      if not success:
          raise ValueError("Impossible to encode image in jpeg")
  
      return result.reshape(-1)
  
imports: from abc import ABCMeta, abstractmethod
  from dataclasses import replace
  from typing import Optional, Callable, TYPE_CHECKING, Tuple, Type
  import cv2
  import numpy
  from numba.typed import Dict
  from PIL.Image import Image
  from .base import Field, ARG_TYPE
  from ..pipeline.operation import Operation
  from ..pipeline.state import State
  from ..pipeline.compiler import Compiler
  from ..pipeline.allocation_query import AllocationQuery
  from ..libffcv import imdecode, memcpy, resize_crop
label_desc: Use image node_id 1 for calling a global function with example usage: encode_jpeg(numpy_image, quality) and returns: result