

def configure_input(inp, op):
    ' Configure the inp using op.'
    if is_old_pipeline():
        if op.is_a('vtkDataSet'):
            inp.input = inp
        else:
            inp.input = op.output
    elif hasattr(op, 'output_port'):
        if hasattr(inp, 'input_connection'):
            inp.input_connection = op.output_port
        elif hasattr(inp, 'set_input_connection'):
            inp.set_input_connection(op.output_port)
    elif op.is_a('vtkAlgorithmOutput'):
        inp.input_connection = op
    elif op.is_a('vtkDataSet'):
        inp.set_input_data(op)
    else:
        raise ValueError(('Unknown input type for object %s' % op))

dataset/ETHPy150Open enthought/mayavi/tvtk/common.py configure_input/VarMisuse@35/57 `op`->`inp`