code: def get_proto_dim(dim):
      if dim.WhichOneof("dimension") == "constant":
          return dim.constant.size
      else:
          if not dim.unknown.variadic:
              return get_new_symbol()
          raise NotImplementedError(
              "Variadic dimensions not yet implemented."
          )
  
label_desc: Use image node_id 1 for calling a global function with example usage: get_proto_dim(dim) and returns: dim, get_new_symbol