def METHOD_NAME(lengths):
    """Ensure the lengths of the box are positive and check dimension."""
    if not isinstance(lengths, u.unyt_array):
        if all(isinstance(length, u.unyt_quantity) for length in lengths):
            print("Converting list of unyt quantities to a unyt array")
            lengths = u.unyt_array([l for l in lengths], str(lengths[0].units))
        else:
            warnings.warn("Lengths are assumed to be in nm")
            lengths *= u.nm
    input_unit = lengths.units
    lengths = np.asarray(lengths, dtype=float, order="C")
    np.reshape(lengths, newshape=(3,), order="C")
    lengths *= input_unit
    if input_unit != u.Unit("dimensionless"):
        lengths.convert_to_units(u.nm)
    if np.any(
        np.less(
            lengths,
            [0, 0, 0],
        )
    ):
        raise ValueError(
            "Negative length(s) passed. Lengths must be a value "
            "greater than 0.0. You passed {}".format(lengths)
        )
    if np.any(
        np.equal(
            lengths,
            [0, 0, 0],
        )
    ):
        if lengths[0] > 0 and lengths[1] > 0:
            warnings.warn(
                "A c value of 0 was passed. This will be "
                "interpreted as a 2-D box."
            )
        else:
            raise ValueError(
                "Length(s) of value 0 were passed. Lengths must "
                "be a value greater than 0.0. You passed "
                "{}".format(lengths)
            )
    return lengths