code: def _commastring(astr):
      startindex = 0
      result = []
      while startindex < len(astr):
          mo = format_re.match(astr, pos=startindex)
          try:
              (order1, repeats, order2, dtype) = mo.groups()
          except (TypeError, AttributeError):
              raise ValueError(
                  'format number %d of "%s" is not recognized'
                  % (len(result) + 1, astr)
              )
          startindex = mo.end()
          # Separator or ending padding
          if startindex < len(astr):
              if space_re.match(astr, pos=startindex):
                  startindex = len(astr)
              else:
                  mo = sep_re.match(astr, pos=startindex)
                  if not mo:
                      raise ValueError(
                          'format number %d of "%s" is not recognized'
                          % (len(result) + 1, astr)
                      )
                  startindex = mo.end()
  
          if order2 == b"":
              order = order1
          elif order1 == b"":
              order = order2
          else:
              order1 = _convorder.get(order1, order1)
              order2 = _convorder.get(order2, order2)
              if order1 != order2:
                  raise ValueError(
                      "inconsistent byte-order specification %s and %s"
                      % (order1, order2)
                  )
              order = order1
  
          if order in [b"|", b"=", _nbo]:
              order = b""
          dtype = order + dtype
          if repeats == b"":
              newitem = dtype
          else:
              newitem = (dtype, eval(repeats))
          result.append(newitem)
  
      return result
  
imports: from __future__ import division, absolute_import, print_function
  import re
  import sys
  import platform
  from numpy.compat import unicode
  from numpy.core.overrides import set_module
  from .multiarray import dtype, array, ndarray
label_desc: Use image node_id 5 for calling a global function with example usage: _commastring(astr) and returns: result