def METHOD_NAME(numpy_array):
    try:
        mapping = numpy_mappings[numpy_array.dtype]
        pc = list(map(mapping[1], numpy.ravel(numpy_array)))
        return mapping[0](numpy_array.size, pc)
    except KeyError:
        raise ValueError(
            "unsupported numpy array dtype for conversion to pmt %s" % (numpy_array.dtype))