def _get_inputs(
    context,
    node,
    expected: Union[int, List, Tuple, Dict[TorchFrontend, int]] = None,
    min_expected: Union[int, Dict[TorchFrontend, int]] = None,
) -> List[Var]:
    """
    Look up a node's inputs in @context and return them as a list. If
    @expected is not None, also verifies the number of inputs matches the
    value of @expected.
    """

    def check_if_number_of_inputs_expected(num_inputs: int, expected: Union[int, List, Tuple]) -> None:
        expected = [expected] if isinstance(expected, int) else expected
        if num_inputs not in expected:
            raise ValueError(
                f"node {node.name} ({node.kind}) got {num_inputs} input(s), expected {expected}"
            )

    def check_if_number_of_inputs_more_than_min_expected(num_inputs: int, min_expected: int) -> None:
        if num_inputs < min_expected:
            raise ValueError(
                f"node {node.name} ({node.kind}) got {num_inputs} input(s), "
                f"expected minimum {min_expected} inputs"
            )

    inputs = _get_bindings(context, node.inputs)

    if expected is not None:
        if isinstance(expected, dict):
            if context.frontend in expected:
                check_if_number_of_inputs_expected(len(inputs), expected[context.frontend])
        else:
            check_if_number_of_inputs_expected(len(inputs), expected)

    if min_expected is not None:
        if isinstance(min_expected, dict):
            if context.frontend in min_expected:
                check_if_number_of_inputs_more_than_min_expected(len(inputs), min_expected[context.frontend])
        else:
            check_if_number_of_inputs_more_than_min_expected(len(inputs), min_expected)

    return inputs

    Look up a node's inputs in @context and return them as a list. If
    @expected is not None, also verifies the number of inputs matches the
    value of @expected.
    
coremltools/converters/mil/frontend/torch/ops.py