code: def test_infer_encoding_types_with_condition():
      channels = alt.channels
  
      args, kwds = _getargs(
          size=alt.condition("pred1", alt.value(1), alt.value(2)),
          color=alt.condition("pred2", alt.value("red"), "cfield:N"),
          opacity=alt.condition("pred3", "ofield:N", alt.value(0.2)),
      )
  
      expected = {
          "size": channels.SizeValue(
              2,
              condition=alt.ConditionalPredicateValueDefnumberExprRef(
                  value=1, test=alt.Predicate("pred1")
              ),
          ),
          "color": channels.Color(
              "cfield:N",
              condition=alt.ConditionalPredicateValueDefGradientstringnullExprRef(
                  value="red", test=alt.Predicate("pred2")
              ),
          ),
          "opacity": channels.OpacityValue(
              0.2,
              condition=alt.ConditionalPredicateMarkPropFieldOrDatumDef(
                  field=alt.FieldName("ofield"),
                  test=alt.Predicate("pred3"),
                  type=alt.StandardType("nominal"),
              ),
          ),
      }
      assert infer_encoding_types(args, kwds, channels) == expected
  
imports: import types
  from packaging.version import Version
  from importlib.metadata import version
  import numpy
  import pandas
  import pytest
  import altair
  from altair.utils.core import parse_shorthand, update_nested, infer_encoding_types
  from altair.utils.core import infer_dtype
label_desc: Use image node_id 13 for calling a global function with example usage: test_infer_encoding_types_with_condition() without return types