code: def _GetLegacyPadArgs(op_def, arg_map):
      pads = {}
      keys = ["pad_l", "pad_t", "pad_r", "pad_b"]
      is_pad = "pad" in arg_map
      if is_pad:
          for k in keys:
              pads[k] = arg_map["pad"].i
      else:
          pads = {x: arg_map[x].i for x in keys}
      return pads
  
imports: import argparse
  import copy
  import logging
  import re
  import numpy
  from caffe2.proto import caffe2_pb2, caffe2_legacy_pb2
  from caffe.proto import caffe_pb2
  from caffe2.python import core, utils, workspace
  from google.protobuf import text_format
label_desc: Use image node_id 4 for calling a global function with example usage: _GetLegacyPadArgs(op_def, arg_map) and returns: pads