code: def testcommon(
      formatstr, args, output=None, limit=None, overflowok=False
  ):
      # if formatstr is a str, test str, bytes, and bytearray;
      # otherwise, test bytes and bytearray
      if isinstance(formatstr, str):
          testformat(formatstr, args, output, limit, overflowok)
          b_format = formatstr.encode("ascii")
      else:
          b_format = formatstr
      ba_format = bytearray(b_format)
      b_args = []
      if not isinstance(args, tuple):
          args = (args,)
      b_args = tuple(args)
      if output is None:
          b_output = ba_output = None
      else:
          if isinstance(output, str):
              b_output = output.encode("ascii")
          else:
              b_output = output
          ba_output = bytearray(b_output)
      testformat(b_format, b_args, b_output, limit, overflowok)
      testformat(ba_format, b_args, ba_output, limit, overflowok)
  
imports: from test.support import verbose, TestFailed
  import locale
  import sys
  import re
  import test.support
  import unittest
label_desc: Use image node_id 2 for calling a global function with example usage: testcommon(formatstr, args, output, limit, overflowok) without return types