code: def pad(pad_type, padding):
      """padding layer helper"""
      pad_type = pad_type.lower()
      if padding == 0:
          return None
      if pad_type == "reflect":
          layer = nn.ReflectionPad2d(padding)
      elif pad_type == "replicate":
          layer = nn.ReplicationPad2d(padding)
      elif pad_type == "zero":
          layer = nn.ZeroPad2d(padding)
      else:
          raise NotImplementedError(
              f"padding layer [{pad_type}] is not implemented"
          )
      return layer
  
imports: from collections import OrderedDict
  import math
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 8 for calling a global function with example usage: pad(pad_type, padding) and returns: layer, None