code: def check_result(
      expect_full_designs,
      lhs,
      rhs,
      data,
      expected_rhs_values,
      expected_rhs_names,
      expected_lhs_values,
      expected_lhs_names,
  ):  # pragma: no cover
      assert np.allclose(rhs, expected_rhs_values)
      assert rhs.design_info.column_names == expected_rhs_names
      if lhs is not None:
          assert np.allclose(lhs, expected_lhs_values)
          assert lhs.design_info.column_names == expected_lhs_names
      else:
          assert expected_lhs_values is None
          assert expected_lhs_names is None
  
      if expect_full_designs:
          if lhs is None:
              (new_rhs,) = build_design_matrices(
                  [rhs.design_info], data
              )
          else:
              new_lhs, new_rhs = build_design_matrices(
                  [lhs.design_info, rhs.design_info], data
              )
              assert np.allclose(new_lhs, lhs)
              assert (
                  new_lhs.design_info.column_names == expected_lhs_names
              )
          assert np.allclose(new_rhs, rhs)
          assert new_rhs.design_info.column_names == expected_rhs_names
      else:
          assert rhs.design_info.terms is None
          assert lhs is None or lhs.design_info.terms is None
  
imports: import sys
  import __future__
  import six
  import numpy
  import pytest
  from patsy import PatsyError
  from patsy.design_info import DesignMatrix, DesignInfo
  from patsy.eval import EvalEnvironment
  from patsy.desc import ModelDesc, Term, INTERCEPT
  from patsy.categorical import C
  from patsy.contrasts import Helmert
  from patsy.user_util import balanced, LookupFactor
  from patsy.build import design_matrix_builders, build_design_matrices
  from patsy.highlevel import *
  from patsy.util import have_pandas, have_pandas_categorical, have_pandas_categorical_dtype, pandas_Categorical_from_codes
  from patsy.origin import Origin
label_desc: Use image node_id 1 for calling a global function with example usage: check_result(expect_full_designs, lhs, rhs, data, expected_rhs_values, expected_rhs_names, expected_lhs_values, expected_lhs_names) without return types