code: def toList(value):
          
          if type(value) == list:
              return value
          elif type(value) in [np.ndarray, tuple, xrange, array.array]:
              return list(value)
          elif isinstance(value, Vector):
              return list(value.toArray())
          else:
              raise TypeError("Could not convert %s to list" % value)
docs: Convert a value to a list, if possible.