code: def _newnames(datatype, order):
      """
      Given a datatype and an order object, return a new names tuple, with the
      order indicated
      """
      oldnames = datatype.names
      nameslist = list(oldnames)
      if isinstance(order, (str, unicode)):
          order = [order]
      seen = set()
      if isinstance(order, (list, tuple)):
          for name in order:
              try:
                  nameslist.remove(name)
              except ValueError:
                  if name in seen:
                      raise ValueError(
                          "duplicate field name: %s" % (name,)
                      )
                  else:
                      raise ValueError(
                          "unknown field name: %s" % (name,)
                      )
              seen.add(name)
          return tuple(list(order) + nameslist)
      raise ValueError("unsupported order value: %s" % (order,))
  
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 7 for calling a global function with example usage: _newnames(datatype, order) and returns: tuple