code: def _pad(
      operand,
      padding_value,
      *,
      padding_config,
      _in_avals: Sequence[core.ShapedArray],
      _out_aval: core.ShapedArray,
  ):
      # Do only the interior padding first. This is rarely needed.
      if any(i != 0 for _, _, i in padding_config):
          operand = _interior_padding(
              operand,
              padding_value,
              padding_config,
              jax2tf._eval_shape(_in_avals[0].shape),
          )
  
      # Now do the non-negative edge padding. This is the common case, use tf.pad.
      non_negative_padding = [
          ((lo if lo >= 0 else 0), (hi if hi >= 0 else 0))
          for lo, hi, _ in padding_config
      ]
      operand = tf.pad(
          operand,
          non_negative_padding,
          mode="CONSTANT",
          constant_values=padding_value,
      )
      # Now the negative edge padding (this is also rare)
      if any(lo < 0 or hi < 0 for lo, hi, _ in padding_config):
          output_shape = jax2tf._eval_shape(_out_aval.shape)
          begins = [
              (-lo if lo < 0 else 0) for lo, _, _ in padding_config
          ]
          operand = tf.slice(operand, begins, output_shape)
  
      return operand
  
imports: from __future__ import annotations
  import builtins
  from collections.abc import Sequence
  import dataclasses
  from functools import partial, wraps
  import math
  import string
  from typing import Any, Callable, Optional
  from jax._src import core
  from jax import lax
  from jax._src.lax import slicing
  from jax._src import dtypes
  from jax._src import util
  from jax.experimental.jax2tf import jax2tf
  import numpy
  import tensorflow
label_desc: Use image node_id 17 for calling a global function with example usage: _pad(operand, padding_value) and returns: operand