"""
This node is meant to exercise data access for all available data types, including all",
legal combinations of tuples, arrays, and bundle members. The test section here is intentionally",
omitted so that the regression test script can programmatically generate tests for all known types,",
reducing the change of unintentional omissions. This node definition is a duplicate of",
OgnTestAllDataTypes.ogn, except the implementation language is Python."
"""


class OgnTestAllDataTypesPy:
    @staticmethod
    def compute(db) -> bool:
        """Compute just copies the input values to the output of the same name and type"""

        if db.inputs.doNotCompute:
            return True

        db.outputs.a_bool = db.inputs.a_bool
        db.outputs.a_bool_array = db.inputs.a_bool_array

        db.outputs.a_colord_3 = db.inputs.a_colord_3
        db.outputs.a_colord_4 = db.inputs.a_colord_4
        db.outputs.a_colorf_3 = db.inputs.a_colorf_3
        db.outputs.a_colorf_4 = db.inputs.a_colorf_4
        db.outputs.a_colorh_3 = db.inputs.a_colorh_3
        db.outputs.a_colorh_4 = db.inputs.a_colorh_4
        db.outputs.a_colord_3_array = db.inputs.a_colord_3_array
        db.outputs.a_colord_4_array = db.inputs.a_colord_4_array
        db.outputs.a_colorf_3_array = db.inputs.a_colorf_3_array
        db.outputs.a_colorf_4_array = db.inputs.a_colorf_4_array
        db.outputs.a_colorh_3_array = db.inputs.a_colorh_3_array
        db.outputs.a_colorh_4_array = db.inputs.a_colorh_4_array

        db.outputs.a_double = db.inputs.a_double
        db.outputs.a_double_2 = db.inputs.a_double_2
        db.outputs.a_double_3 = db.inputs.a_double_3
        db.outputs.a_double_4 = db.inputs.a_double_4
        db.outputs.a_double_array = db.inputs.a_double_array
        db.outputs.a_double_2_array = db.inputs.a_double_2_array
        db.outputs.a_double_3_array = db.inputs.a_double_3_array
        db.outputs.a_double_4_array = db.inputs.a_double_4_array

        db.outputs.a_execution = db.inputs.a_execution

        db.outputs.a_float = db.inputs.a_float
        db.outputs.a_float_2 = db.inputs.a_float_2
        db.outputs.a_float_3 = db.inputs.a_float_3
        db.outputs.a_float_4 = db.inputs.a_float_4
        db.outputs.a_float_array = db.inputs.a_float_array
        db.outputs.a_float_2_array = db.inputs.a_float_2_array
        db.outputs.a_float_3_array = db.inputs.a_float_3_array
        db.outputs.a_float_4_array = db.inputs.a_float_4_array

        db.outputs.a_frame_4 = db.inputs.a_frame_4
        db.outputs.a_frame_4_array = db.inputs.a_frame_4_array

        db.outputs.a_half = db.inputs.a_half
        db.outputs.a_half_2 = db.inputs.a_half_2
        db.outputs.a_half_3 = db.inputs.a_half_3
        db.outputs.a_half_4 = db.inputs.a_half_4
        db.outputs.a_half_array = db.inputs.a_half_array
        db.outputs.a_half_2_array = db.inputs.a_half_2_array
        db.outputs.a_half_3_array = db.inputs.a_half_3_array
        db.outputs.a_half_4_array = db.inputs.a_half_4_array

        db.outputs.a_int = db.inputs.a_int
        db.outputs.a_int_2 = db.inputs.a_int_2
        db.outputs.a_int_3 = db.inputs.a_int_3
        db.outputs.a_int_4 = db.inputs.a_int_4
        db.outputs.a_int_array = db.inputs.a_int_array
        db.outputs.a_int_2_array = db.inputs.a_int_2_array
        db.outputs.a_int_3_array = db.inputs.a_int_3_array
        db.outputs.a_int_4_array = db.inputs.a_int_4_array

        db.outputs.a_int64 = db.inputs.a_int64
        db.outputs.a_int64_array = db.inputs.a_int64_array

        db.outputs.a_matrixd_2 = db.inputs.a_matrixd_2
        db.outputs.a_matrixd_3 = db.inputs.a_matrixd_3
        db.outputs.a_matrixd_4 = db.inputs.a_matrixd_4
        db.outputs.a_matrixd_2_array = db.inputs.a_matrixd_2_array
        db.outputs.a_matrixd_3_array = db.inputs.a_matrixd_3_array
        db.outputs.a_matrixd_4_array = db.inputs.a_matrixd_4_array

        db.outputs.a_normald_3 = db.inputs.a_normald_3
        db.outputs.a_normalf_3 = db.inputs.a_normalf_3
        db.outputs.a_normalh_3 = db.inputs.a_normalh_3
        db.outputs.a_normald_3_array = db.inputs.a_normald_3_array
        db.outputs.a_normalf_3_array = db.inputs.a_normalf_3_array
        db.outputs.a_normalh_3_array = db.inputs.a_normalh_3_array

        db.outputs.a_objectId = db.inputs.a_objectId
        db.outputs.a_objectId_array = db.inputs.a_objectId_array

        db.outputs.a_path = db.inputs.a_path

        db.outputs.a_pointd_3 = db.inputs.a_pointd_3
        db.outputs.a_pointf_3 = db.inputs.a_pointf_3
        db.outputs.a_pointh_3 = db.inputs.a_pointh_3
        db.outputs.a_pointd_3_array = db.inputs.a_pointd_3_array
        db.outputs.a_pointf_3_array = db.inputs.a_pointf_3_array
        db.outputs.a_pointh_3_array = db.inputs.a_pointh_3_array

        db.outputs.a_quatd_4 = db.inputs.a_quatd_4
        db.outputs.a_quatf_4 = db.inputs.a_quatf_4
        db.outputs.a_quath_4 = db.inputs.a_quath_4
        db.outputs.a_quatd_4_array = db.inputs.a_quatd_4_array
        db.outputs.a_quatf_4_array = db.inputs.a_quatf_4_array
        db.outputs.a_quath_4_array = db.inputs.a_quath_4_array

        db.outputs.a_string = db.inputs.a_string

        db.outputs.a_target = db.inputs.a_target

        db.outputs.a_texcoordd_2 = db.inputs.a_texcoordd_2
        db.outputs.a_texcoordd_3 = db.inputs.a_texcoordd_3
        db.outputs.a_texcoordf_2 = db.inputs.a_texcoordf_2
        db.outputs.a_texcoordf_3 = db.inputs.a_texcoordf_3
        db.outputs.a_texcoordh_2 = db.inputs.a_texcoordh_2
        db.outputs.a_texcoordh_3 = db.inputs.a_texcoordh_3
        db.outputs.a_texcoordd_2_array = db.inputs.a_texcoordd_2_array
        db.outputs.a_texcoordd_3_array = db.inputs.a_texcoordd_3_array
        db.outputs.a_texcoordf_2_array = db.inputs.a_texcoordf_2_array
        db.outputs.a_texcoordf_3_array = db.inputs.a_texcoordf_3_array
        db.outputs.a_texcoordh_2_array = db.inputs.a_texcoordh_2_array
        db.outputs.a_texcoordh_3_array = db.inputs.a_texcoordh_3_array

        db.outputs.a_timecode = db.inputs.a_timecode
        db.outputs.a_timecode_array = db.inputs.a_timecode_array

        db.outputs.a_token = db.inputs.a_token
        db.outputs.a_token_array = db.inputs.a_token_array

        db.outputs.a_uchar = db.inputs.a_uchar
        db.outputs.a_uchar_array = db.inputs.a_uchar_array

        db.outputs.a_uint = db.inputs.a_uint
        db.outputs.a_uint_array = db.inputs.a_uint_array

        db.outputs.a_uint64 = db.inputs.a_uint64
        db.outputs.a_uint64_array = db.inputs.a_uint64_array

        db.outputs.a_vectord_3 = db.inputs.a_vectord_3
        db.outputs.a_vectorf_3 = db.inputs.a_vectorf_3
        db.outputs.a_vectorh_3 = db.inputs.a_vectorh_3
        db.outputs.a_vectord_3_array = db.inputs.a_vectord_3_array
        db.outputs.a_vectorf_3_array = db.inputs.a_vectorf_3_array
        db.outputs.a_vectorh_3_array = db.inputs.a_vectorh_3_array

        # Copy inputs of all kinds to the output bundle. The test should connect a bundle with all types of attributes
        # so that every data type is exercised.
        output_bundle = db.outputs.a_bundle
        state_bundle = db.state.a_bundle
        for bundled_attribute in db.inputs.a_bundle.attributes:

            # By copying each attribute individually rather than doing a bundle copy all of the data types
            # encapsulated by that bundle are exercised.
            new_output = output_bundle.insert(bundled_attribute)
            new_state = state_bundle.insert(bundled_attribute)
            new_output.copy_data(bundled_attribute)
            new_state.copy_data(bundled_attribute)

        # State attributes take on the input values the first time they evaluate, zeroes on subsequent evaluations.
        # The a_firstEvaluation attribute is used as the gating state information to decide when evaluation needs to
        # happen again.
        if db.state.a_firstEvaluation:
            db.state.a_firstEvaluation = False

            db.state.a_bool = db.inputs.a_bool
            db.state.a_bool_array = db.inputs.a_bool_array

            db.state.a_colord_3 = db.inputs.a_colord_3
            db.state.a_colord_4 = db.inputs.a_colord_4
            db.state.a_colorf_3 = db.inputs.a_colorf_3
            db.state.a_colorf_4 = db.inputs.a_colorf_4
            db.state.a_colorh_3 = db.inputs.a_colorh_3
            db.state.a_colorh_4 = db.inputs.a_colorh_4
            db.state.a_colord_3_array = db.inputs.a_colord_3_array
            db.state.a_colord_4_array = db.inputs.a_colord_4_array
            db.state.a_colorf_3_array = db.inputs.a_colorf_3_array
            db.state.a_colorf_4_array = db.inputs.a_colorf_4_array
            db.state.a_colorh_3_array = db.inputs.a_colorh_3_array
            db.state.a_colorh_4_array = db.inputs.a_colorh_4_array

            db.state.a_double = db.inputs.a_double
            db.state.a_double_2 = db.inputs.a_double_2
            db.state.a_double_3 = db.inputs.a_double_3
            db.state.a_double_4 = db.inputs.a_double_4
            db.state.a_double_array = db.inputs.a_double_array
            db.state.a_double_2_array = db.inputs.a_double_2_array
            db.state.a_double_3_array = db.inputs.a_double_3_array
            db.state.a_double_4_array = db.inputs.a_double_4_array

            db.state.a_execution = db.inputs.a_execution

            db.state.a_float = db.inputs.a_float
            db.state.a_float_2 = db.inputs.a_float_2
            db.state.a_float_3 = db.inputs.a_float_3
            db.state.a_float_4 = db.inputs.a_float_4
            db.state.a_float_array = db.inputs.a_float_array
            db.state.a_float_2_array = db.inputs.a_float_2_array
            db.state.a_float_3_array = db.inputs.a_float_3_array
            db.state.a_float_4_array = db.inputs.a_float_4_array

            db.state.a_frame_4 = db.inputs.a_frame_4
            db.state.a_frame_4_array = db.inputs.a_frame_4_array

            db.state.a_half = db.inputs.a_half
            db.state.a_half_2 = db.inputs.a_half_2
            db.state.a_half_3 = db.inputs.a_half_3
            db.state.a_half_4 = db.inputs.a_half_4
            db.state.a_half_array = db.inputs.a_half_array
            db.state.a_half_2_array = db.inputs.a_half_2_array
            db.state.a_half_3_array = db.inputs.a_half_3_array
            db.state.a_half_4_array = db.inputs.a_half_4_array

            db.state.a_int = db.inputs.a_int
            db.state.a_int_2 = db.inputs.a_int_2
            db.state.a_int_3 = db.inputs.a_int_3
            db.state.a_int_4 = db.inputs.a_int_4
            db.state.a_int_array = db.inputs.a_int_array
            db.state.a_int_2_array = db.inputs.a_int_2_array
            db.state.a_int_3_array = db.inputs.a_int_3_array
            db.state.a_int_4_array = db.inputs.a_int_4_array

            db.state.a_int64 = db.inputs.a_int64
            db.state.a_int64_array = db.inputs.a_int64_array

            db.state.a_matrixd_2 = db.inputs.a_matrixd_2
            db.state.a_matrixd_3 = db.inputs.a_matrixd_3
            db.state.a_matrixd_4 = db.inputs.a_matrixd_4
            db.state.a_matrixd_2_array = db.inputs.a_matrixd_2_array
            db.state.a_matrixd_3_array = db.inputs.a_matrixd_3_array
            db.state.a_matrixd_4_array = db.inputs.a_matrixd_4_array

            db.state.a_normald_3 = db.inputs.a_normald_3
            db.state.a_normalf_3 = db.inputs.a_normalf_3
            db.state.a_normalh_3 = db.inputs.a_normalh_3
            db.state.a_normald_3_array = db.inputs.a_normald_3_array
            db.state.a_normalf_3_array = db.inputs.a_normalf_3_array
            db.state.a_normalh_3_array = db.inputs.a_normalh_3_array

            db.state.a_objectId = db.inputs.a_objectId
            db.state.a_objectId_array = db.inputs.a_objectId_array

            db.state.a_path = db.inputs.a_path

            db.state.a_pointd_3 = db.inputs.a_pointd_3
            db.state.a_pointf_3 = db.inputs.a_pointf_3
            db.state.a_pointh_3 = db.inputs.a_pointh_3
            db.state.a_pointd_3_array = db.inputs.a_pointd_3_array
            db.state.a_pointf_3_array = db.inputs.a_pointf_3_array
            db.state.a_pointh_3_array = db.inputs.a_pointh_3_array

            db.state.a_quatd_4 = db.inputs.a_quatd_4
            db.state.a_quatf_4 = db.inputs.a_quatf_4
            db.state.a_quath_4 = db.inputs.a_quath_4
            db.state.a_quatd_4_array = db.inputs.a_quatd_4_array
            db.state.a_quatf_4_array = db.inputs.a_quatf_4_array
            db.state.a_quath_4_array = db.inputs.a_quath_4_array

            db.state.a_string = db.inputs.a_string
            db.state.a_stringEmpty = db.inputs.a_string

            db.state.a_target = db.inputs.a_target

            db.state.a_texcoordd_2 = db.inputs.a_texcoordd_2
            db.state.a_texcoordd_3 = db.inputs.a_texcoordd_3
            db.state.a_texcoordf_2 = db.inputs.a_texcoordf_2
            db.state.a_texcoordf_3 = db.inputs.a_texcoordf_3
            db.state.a_texcoordh_2 = db.inputs.a_texcoordh_2
            db.state.a_texcoordh_3 = db.inputs.a_texcoordh_3
            db.state.a_texcoordd_2_array = db.inputs.a_texcoordd_2_array
            db.state.a_texcoordd_3_array = db.inputs.a_texcoordd_3_array
            db.state.a_texcoordf_2_array = db.inputs.a_texcoordf_2_array
            db.state.a_texcoordf_3_array = db.inputs.a_texcoordf_3_array
            db.state.a_texcoordh_2_array = db.inputs.a_texcoordh_2_array
            db.state.a_texcoordh_3_array = db.inputs.a_texcoordh_3_array

            db.state.a_timecode = db.inputs.a_timecode
            db.state.a_timecode_array = db.inputs.a_timecode_array

            db.state.a_token = db.inputs.a_token
            db.state.a_token_array = db.inputs.a_token_array

            db.state.a_uchar = db.inputs.a_uchar
            db.state.a_uchar_array = db.inputs.a_uchar_array

            db.state.a_uint = db.inputs.a_uint
            db.state.a_uint_array = db.inputs.a_uint_array

            db.state.a_uint64 = db.inputs.a_uint64
            db.state.a_uint64_array = db.inputs.a_uint64_array

            db.state.a_vectord_3 = db.inputs.a_vectord_3
            db.state.a_vectorf_3 = db.inputs.a_vectorf_3
            db.state.a_vectorh_3 = db.inputs.a_vectorh_3
            db.state.a_vectord_3_array = db.inputs.a_vectord_3_array
            db.state.a_vectorf_3_array = db.inputs.a_vectorf_3_array
            db.state.a_vectorh_3_array = db.inputs.a_vectorh_3_array
        else:
            db.state.a_bool = False
            db.state.a_bool_array = []

            db.state.a_colord_3 = [0.0, 0.0, 0.0]
            db.state.a_colord_4 = [0.0, 0.0, 0.0, 0.0]
            db.state.a_colorf_3 = [0.0, 0.0, 0.0]
            db.state.a_colorf_4 = [0.0, 0.0, 0.0, 0.0]
            db.state.a_colorh_3 = [0.0, 0.0, 0.0]
            db.state.a_colorh_4 = [0.0, 0.0, 0.0, 0.0]
            db.state.a_colord_3_array = []
            db.state.a_colord_4_array = []
            db.state.a_colorf_3_array = []
            db.state.a_colorf_4_array = []
            db.state.a_colorh_3_array = []
            db.state.a_colorh_4_array = []

            db.state.a_double = 0.0
            db.state.a_double_2 = [0.0, 0.0]
            db.state.a_double_3 = [0.0, 0.0, 0.0]
            db.state.a_double_4 = [0.0, 0.0, 0.0, 0.0]
            db.state.a_double_array = []
            db.state.a_double_2_array = []
            db.state.a_double_3_array = []
            db.state.a_double_4_array = []

            db.state.a_execution = 0

            db.state.a_float = 0.0
            db.state.a_float_2 = [0.0, 0.0]
            db.state.a_float_3 = [0.0, 0.0, 0.0]
            db.state.a_float_4 = [0.0, 0.0, 0.0, 0.0]
            db.state.a_float_array = []
            db.state.a_float_2_array = []
            db.state.a_float_3_array = []
            db.state.a_float_4_array = []

            db.state.a_frame_4 = [
                [0.0, 0.0, 0.0, 0.0],
                [0.0, 0.0, 0.0, 0.0],
                [0.0, 0.0, 0.0, 0.0],
                [0.0, 0.0, 0.0, 0.0],
            ]
            db.state.a_frame_4_array = []

            db.state.a_half = 0.0
            db.state.a_half_2 = [0.0, 0.0]
            db.state.a_half_3 = [0.0, 0.0, 0.0]
            db.state.a_half_4 = [0.0, 0.0, 0.0, 0.0]
            db.state.a_half_array = []
            db.state.a_half_2_array = []
            db.state.a_half_3_array = []
            db.state.a_half_4_array = []

            db.state.a_int = 0
            db.state.a_int_2 = [0, 0]
            db.state.a_int_3 = [0, 0, 0]
            db.state.a_int_4 = [0, 0, 0, 0]
            db.state.a_int_array = []
            db.state.a_int_2_array = []
            db.state.a_int_3_array = []
            db.state.a_int_4_array = []

            db.state.a_int64 = 0
            db.state.a_int64_array = []

            db.state.a_matrixd_2 = [[0.0, 0.0], [0.0, 0.0]]
            db.state.a_matrixd_3 = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]
            db.state.a_matrixd_4 = [
                [0.0, 0.0, 0.0, 0.0],
                [0.0, 0.0, 0.0, 0.0],
                [0.0, 0.0, 0.0, 0.0],
                [0.0, 0.0, 0.0, 0.0],
            ]
            db.state.a_matrixd_2_array = []
            db.state.a_matrixd_3_array = []
            db.state.a_matrixd_4_array = []

            db.state.a_normald_3 = [0.0, 0.0, 0.0]
            db.state.a_normalf_3 = [0.0, 0.0, 0.0]
            db.state.a_normalh_3 = [0.0, 0.0, 0.0]
            db.state.a_normald_3_array = []
            db.state.a_normalf_3_array = []
            db.state.a_normalh_3_array = []

            db.state.a_objectId = 0
            db.state.a_objectId_array = []

            db.outputs.a_path = ""

            db.state.a_pointd_3 = [0.0, 0.0, 0.0]
            db.state.a_pointf_3 = [0.0, 0.0, 0.0]
            db.state.a_pointh_3 = [0.0, 0.0, 0.0]
            db.state.a_pointd_3_array = []
            db.state.a_pointf_3_array = []
            db.state.a_pointh_3_array = []

            db.state.a_quatd_4 = [0.0, 0.0, 0.0, 0.0]
            db.state.a_quatf_4 = [0.0, 0.0, 0.0, 0.0]
            db.state.a_quath_4 = [0.0, 0.0, 0.0, 0.0]
            db.state.a_quatd_4_array = []
            db.state.a_quatf_4_array = []
            db.state.a_quath_4_array = []

            db.state.a_string = ""
            db.state.a_stringEmpty = ""

            db.state.a_target = []

            db.state.a_texcoordd_2 = [0.0, 0.0]
            db.state.a_texcoordd_3 = [0.0, 0.0, 0.0]
            db.state.a_texcoordf_2 = [0.0, 0.0]
            db.state.a_texcoordf_3 = [0.0, 0.0, 0.0]
            db.state.a_texcoordh_2 = [0.0, 0.0]
            db.state.a_texcoordh_3 = [0.0, 0.0, 0.0]
            db.state.a_texcoordd_2_array = []
            db.state.a_texcoordd_3_array = []
            db.state.a_texcoordf_2_array = []
            db.state.a_texcoordf_3_array = []
            db.state.a_texcoordh_2_array = []
            db.state.a_texcoordh_3_array = []

            db.state.a_timecode = 0.0
            db.state.a_timecode_array = []

            db.state.a_token = ""
            db.state.a_token_array = []

            db.state.a_uchar = 0
            db.state.a_uchar_array = []

            db.state.a_uint = 0
            db.state.a_uint_array = []

            db.state.a_uint64 = 0
            db.state.a_uint64_array = []

            db.state.a_vectord_3 = [0.0, 0.0, 0.0]
            db.state.a_vectorf_3 = [0.0, 0.0, 0.0]
            db.state.a_vectorh_3 = [0.0, 0.0, 0.0]
            db.state.a_vectord_3_array = []
            db.state.a_vectorf_3_array = []
            db.state.a_vectorh_3_array = []

        return True
