<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _init_baremetal_trunk_interfaces(self, port_seg, segment):
 """Initialize baremetal switch interfaces and DB entry. With baremetal transactions, the interfaces are not known during initialization so they must be initialized when the transactions are received. * Reserved switch entries are added if needed. * Reserved port entries are added. * Determine if port channel is configured on the interface and store it so we know to create a port-channel binding instead of that defined in the transaction. In this case, the RESERVED binding is the ethernet interface with port-channel stored in channel-group field. When this channel-group is not 0, we know to create a port binding as a port-channel instead of interface ethernet. """


        # interfaces list requiring switch initialization and
        # reserved port and port_binding db entry creation
        list_to_init = []

        # interfaces list requiring reserved port and port_binding
        # db entry creation
        inactive_switch = []

        connections = self._get_baremetal_connections(
                          port_seg, False, True)
        for switch_ip, intf_type, port, is_native, _ in connections:
            try:
                nxos_db.get_switch_if_host_mappings(
                    switch_ip,
                    nexus_help.format_interface_name(intf_type, port))
            except excep.NexusHostMappingNotFound:
                if self.is_switch_active(switch_ip):
                    # channel-group added later
                    list_to_init.append(
                        (switch_ip, intf_type, port, is_native, 0))
                else:
                    inactive_switch.append(
                        (switch_ip, intf_type, port, is_native, 0))

        # channel_group is appended to tuples in list_to_init
        self.driver.initialize_baremetal_switch_interfaces(list_to_init)

        host_id = port_seg.get('dns_name')
        if host_id is None:
            host_id = const.RESERVED_PORT_HOST_ID

        # Add inactive list to list_to_init to create RESERVED
        # port data base entries
        list_to_init += inactive_switch
        for switch_ip, intf_type, port, is_native, ch_grp in list_to_init:
            nxos_db.add_host_mapping(
                host_id,
                switch_ip,
                nexus_help.format_interface_name(intf_type, port),
                ch_grp, False)