def METHOD_NAME(self, shape, index):
    """Using either the standard or next_generation_api"""
    try:
        line = shape.get(index)
        return line
    except AttributeError:  # next_generation_api
        line = shape.getLine(index)
        return line
    except Exception:
        raise