code: def _ring_2d(m, n):
      """Ring-order of a mxn mesh.
  
      If m and n are both even, then we generate a ring like this:
  
         0 -- 1 -- 2 -- 3
         |    |    |    |
         15-- 6 -- 5 -- 4
         |    |    |    |
         14-- 7 -- 8 -- 9
         |    |    |    |
         13-- 12-- 11-- 10
  
      Args:
        m: an integer
        n: an integer
      Returns:
        a list of mxn pairs
      """
      if m == 1:
          return [(0, i) for i in range(n)]
      if n == 1:
          return [(i, 0) for i in range(m)]
      if m % 2 != 0:
          tf.logging.warning("Odd dimension")
          return [(i % m, i // m) for i in range(n * m)]
      ret = [(0, 0)]
      for i in range(m // 2):
          for j in range(1, n):
              ret.append((2 * i, j))
          for j in range(n - 1, 0, -1):
              ret.append((2 * i + 1, j))
      for i in range(m - 1, 0, -1):
          ret.append((i, 0))
      return ret
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import os
  import gin
  from mesh_tensorflow import ops_with_redefined_builtins
  from mesh_tensorflow import tpu_variables
  from mesh_tensorflow import utils
  from six.moves import xrange
  import tensorflow.compat.v1
  from tensorflow.python.tpu.ops import tpu_ops
label_desc: Use image node_id 1 for calling a global function with example usage: _ring_2d(m, n) and returns: ret, unknown, unknown, unknown