code: def shape2d(a):
      """
      Ensure a 2D shape.
  
      Args:
          a: a int or tuple/list of length 2
  
      Returns:
          list: of length 2. if ``a`` is a int, return ``[a, a]``.
      """
      if type(a) == int:
          return [a, a]
      if isinstance(a, (list, tuple)):
          assert len(a) == 2
          return list(a)
      raise RuntimeError("Illegal shape: {}".format(a))
  
file_path: tensorpack/tensorpack/utils/argtools.py
imports: import inspect
  import functools
  from .None import logger
label_desc: Use image node_id 4 for calling a global function with example usage: shape2d(a) and returns: list, list