code: def convertData(data, goalType):
      origType = determineEdt(data)
  
      if origType == goalType:
          return data
  
      if goalType == Edt.VECTOR_REAL:
          if origType == Edt.LIST_REAL or origType == Edt.LIST_INTEGER:
              return array(data)
  
          if origType == Edt.LIST_MIXED:
              for item in data:
                  itemType = determineEdt(item)
                  if not (
                      itemType == Edt.REAL or itemType == Edt.INTEGER
                  ):
                      raise TypeError(
                          "Cannot convert data from type LIST_MIXED to type VECTOR_REAL "
                          + "because LIST_MIXED contains items not of type REAL or INTEGER (e.g. "
                          + str(itemType)
                          + ")"
                      )
              return array(data)
  
      if goalType == Edt.VECTOR_INTEGER:
          if origType == Edt.LIST_INTEGER:
              return numpy.array(data, numpy.int32)
  
      if goalType == Edt.VECTOR_REAL:
          if (
              origType == Edt.LIST_INTEGER
              or origType == Edt.VECTOR_INTEGER
          ):
              return numpy.array(data, numpy.float32)
  
      if origType == Edt.LIST_EMPTY:
          if goalType == Edt.VECTOR_REAL:
              return array(data)
          if goalType == Edt.VECTOR_STRING:
              return data
          if goalType == Edt.VECTOR_INTEGER:
              return numpy.array(data, numpy.dtype("int"))
          if goalType == Edt.VECTOR_STEREOSAMPLE:
              return data
  
      if goalType == Edt.MATRIX_REAL and (
          origType == Edt.LIST_LIST_REAL
          or origType == Edt.LIST_LIST_INTEGER
          or origType == Edt.LIST_ARRAY_REAL
      ):
          return array(data)
  
      if goalType == Edt.VECTOR_VECTOR_REAL:
          if (
              origType == Edt.MATRIX_REAL
              or origType == Edt.LIST_LIST_INTEGER
          ):
              return [[float(col) for col in row] for row in data]
  
          if (
              origType == Edt.LIST_LIST_REAL
              or origType == Edt.LIST_LIST_EMPTY
              or Edt.LIST_ARRAY_REAL
          ):
              return data
  
      if goalType == Edt.REAL:
          if origType == Edt.INTEGER or origType == Edt.NUMPY_FLOAT:
              return float(data)
  
      if goalType == Edt.VECTOR_STEREOSAMPLE:
          if origType == Edt.LIST_LIST_INTEGER:
              for row in data:
                  if len(row) != 2:
                      ValueError(
                          "Cannot convert a LIST_LIST_INTEGER to a VECTOR_STEREOSAMPLE if the sub-lists are not of length 2"
                      )
              return array(data)
  
          if origType == Edt.MATRIX_REAL:
              if data.shape[1] != 2:
                  raise TypeError(
                      "Cannot convert a MATRIX_REAL to a VECTOR_STEREOSAMPLE if the second dimension of the MATRIX_REAL is not 2"
                  )
  
              return data
  
          if origType == Edt.LIST_MIXED:
              for row in data:
                  if len(row) != 2:
                      ValueError(
                          "Cannot convert a LIST_MIXED to a VECTOR_STEREOSAMPLE if the sub-lists are not of length 2"
                      )
                  try:
                      convertData(row, Edt.VECTOR_REAL)
                  except:
                      TypeError(
                          "Cannot convert a LIST_MIXED to a VECTOR_STEREOSAMPLE if the sub-lists are not convertible to VECTOR_REAL"
                      )
  
              return array(data)
  
      if goalType == Edt.VECTOR_VECTOR_COMPLEX:
          if origType == Edt.LIST_LIST_COMPLEX:
              return data
  
          if origType == Edt.MATRIX_COMPLEX:
              return [[col for col in row] for row in data]
  
      raise TypeError(
          "Cannot convert data from type %s (%s) to type %s"
          % (str(origType), str(type(data)), str(goalType))
      )
  
imports: import numpy
  from six import iteritems
  from .None import _essentia
label_desc: Use image node_id 5 for calling a global function with example usage: convertData(data, goalType) and returns: data, array, array, array, numpy, numpy, array, data, numpy, data, unknown, data, float, array, data, array, data, unknown