def is_poly(segm):
    """Determine if segm is a polygon. Valid segm expected (polygon or RLE)."""
    assert isinstance(segm, (list, dict)), \
        'Invalid segm type: {}'.format(type(segm))
    return isinstance(segm, list)