@classmethod
def from_box(cls, box, width=0.01, color=(0, 0, 0, 1)):
    """Duck type the box from a valid input.

        Boxes can be a list, dictionary, or object with attributes.
        """
    try:
        Lx = box.Lx
        Ly = box.Ly
        Lz = getattr(box, 'Lz', 0)
        xy = getattr(box, 'xy', 0)
        xz = getattr(box, 'xz', 0)
        yz = getattr(box, 'yz', 0)
    except AttributeError:
        try:
            Lx = box['Lx']
            Ly = box['Ly']
            Lz = box.get('Lz', 0)
            xy = box.get('xy', 0)
            xz = box.get('xz', 0)
            yz = box.get('yz', 0)
        except (IndexError, KeyError, TypeError):
            if not len(box) in [2, 3, 6]:
                raise ValueError(
                    'List-like objects must have length 2, 3, or 6 to be converted to a box.'
                    )
            Lx = box[0]
            Ly = box[1]
            Lz = box[2] if len(box) > 2 else 0
            xy, xz, yz = box[3:6] if len(box) == 6 else (0, 0, 0)
    return cls(Lx=Lx, Ly=Ly, Lz=Lz, xy=xy, xz=xz, yz=yz, width=width, color
        =color)
