code: def compute_adjusted_padding(
      input_size: int,
      output_size: int,
      kernel_size: int,
      stride: int,
      padding: str,
      dilation: int = 1,
  ) -> tuple[int, int]:
      """Computes adjusted padding for desired ConvTranspose `output_size`."""
      kernel_size = (kernel_size - 1) * dilation + 1
      if padding == "VALID":
          expected_input_size = (
              output_size - kernel_size + stride
          ) // stride
          if input_size != expected_input_size:
              raise ValueError(
                  f"The expected input size with the current set of input "
                  f"parameters is {expected_input_size} which doesn't "
                  f"match the actual input size {input_size}."
              )
          padding_before = 0
      elif padding == "SAME":
          expected_input_size = (output_size + stride - 1) // stride
          if input_size != expected_input_size:
              raise ValueError(
                  f"The expected input size with the current set of input "
                  f"parameters is {expected_input_size} which doesn't "
                  f"match the actual input size {input_size}."
              )
          padding_needed = max(
              0, (input_size - 1) * stride + kernel_size - output_size
          )
          padding_before = padding_needed // 2
      else:
          raise ValueError(
              f"`padding` must be 'VALID' or 'SAME'. Passed: {padding}."
          )
  
      expanded_input_size = (input_size - 1) * stride + 1
      padded_out_size = output_size + kernel_size - 1
      pad_before = kernel_size - 1 - padding_before
      pad_after = padded_out_size - expanded_input_size - pad_before
      return (pad_before, pad_after)
  
imports: from collections.abc import Sequence
  from typing import Optional, Union
  from haiku._src import base
  from haiku._src import initializers
  from haiku._src import module
  from haiku._src import pad
  from haiku._src import utils
  import jax
  from jax import lax
  import jax.numpy
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: compute_adjusted_padding(input_size, output_size, kernel_size, stride, padding, dilation) and returns: pad_before,  pad_after