ails.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with Olvid.  If not, see <https://www.gnu.org/licenses/>.
 */
package io.olvid.messenger

import io.olvid.engine.engine.Engine
import io.olvid.engine.engine.types.EngineNotificationListener
import io.olvid.engine.engine.types.EngineNotifications
import io.olvid.engine.engine.types.identities.ObvGroupV2
import io.olvid.messenger.customClasses.ifNull
import io.olvid.messenger.databases.AppDatabase
import io.olvid.messenger.databases.entity.DiscussionCustomization
import io.olvid.messenger.databases.entity.Group2
import io.olvid.messenger.databases.entity.Message
import io.olvid.messenger.databases.entity.jsons.JsonExpiration
import io.olvid.messenger.databases.entity.jsons.JsonSharedSettings
import io.olvid.messenger.databases.tasks.CreateOrUpdateGroupV2Task
import io.olvid.messenger.databases.tasks.UpdateGroupV2PhotoFromEngineTask

class EngineNotificationProcessorForGroupsV2 internal constructor(engine: Engine) :
    EngineNotificationListener {
    private val db: AppDatabase = AppDatabase.getInstance()
    private var registrationNumber: Long? = null

    init {
        for (notificationName in arrayOf(
            EngineNotifications.GROUP_V2_CREATED_OR_UPDATED,
            EngineNotifications.GROUP_V2_PHOTO_CHANGED,
            EngineNotifications.GROUP_V2_UPDATE_IN_PROGRESS_CHANGED,
            EngineNotifications.GROUP_V2_DELETED,
            EngineNotifications.KEYCLOAK_GROUP_V2_SHARED_SETTINGS
        )) {
            engine.addNotificationListener(notificationName, this)
        }
    }

    override fun callback(notificationName: String, userInfo: HashMap<String, Any>) {
        when (notificationName) {
            EngineNotifications.GROUP_V2_CREATED_OR_UPDATED -> {
                val groupV2 = userInfo[EngineNotifications.GROUP_V2_CREATED_OR_UPDATED_GROUP_KEY] as? ObvGroupV2?
                val groupWasJustCreatedByMe = userInfo[EngineNotifications.GROUP_V2_CREATED_OR_UPDATED_NEW_GROUP_KEY] as? Boolean?
                val updatedByMe = userInfo[EngineNotifications.GROUP_V2_CREATED_OR_UPDATED_BY_ME_KEY] as? Boolean?
                val updatedBy = userInfo[EngineNotifications.GROUP_V2_CREATED_OR_UPDATED_BY_KEY] as? ByteArray?
                @Suppress("UNCHECKED_CAST")
                val groupLeavers = userInfo[EngineNotifications.GROUP_V2_CREATED_OR_UPDATED_GROUP_LEAVERS_KEY] as? Array<ByteArray>?
                val createdOnOtherDevice = userInfo[EngineNotifications.GROUP_V2_CREATED_OR_UPDATED_CREATED_ON_OTHER_DEVICE] as Boolean?
                if (groupV2 == null || groupWasJustCreatedByMe == null || updatedByMe == null || createdOnOtherDevice == null) {
                    return
                }

                CreateOrUpdateGroupV2Task(
                    groupV2,
                    groupWasJustCreatedByMe,
                    updatedByMe,
                    createdOnOtherDevice,
                    false,
                    updatedBy,
                    groupLeavers
                ).run()
            }

            EngineNotifications.GROUP_V2_PHOTO_CHANGED -> {
                val bytesOwnedIdentity =
                    userInfo[EngineNotifications.GROUP_V2_PHOTO_CHANGED_BYTES_OWNED_IDENTITY_KEY] as ByteArray?
                val bytesGroupIdentifier =
                    userInfo[EngineNotifications.GROUP_V2_PHOTO_CHANGED_BYTES_GROUP_IDENTIFIER_KEY] as ByteArray?
                if (bytesOwnedIdentity == null ||


		stm_put_device(stm);

	return ret;
}

static struct configfs_group_operations stp_policies_group_ops = {
	.make_group	= stp_policies_make,
};

static struct config_item_type stp_policies_type = {
	.ct_group_ops	= &stp_policies_group_ops,
	.ct_owner	= THIS_MODULE,
};

static struct configfs_subsystem stp_policy_subsys = {
	.su_group = {
		.cg_item = {
			.ci_namebuf	= "stp-policy",
			.ci_type	= &stp_policies_type,
		},
	},
};

/*
 * Lock the policy mutex from the outside
 */
static struct stp_policy_node *
__stp_policy_node_lookup(struct stp_policy *policy, char *s)
{
	struct stp_policy_node *policy_node, *ret;
	struct list_head *head = &policy->group.cg_children;
	struct config_item *item;
	char *start, *end = s;

	if (list_empty(head))
		return NULL;

	/* return the first entry if everything else fails */
	item = list_entry(head->next, struct config_item, ci_entry);
	ret = to_stp_policy_node(item);

next:
	for (;;) {
		start = strsep(&end, "/");
		if (!start)
			break;

		if (!*start)
			continue;

		list_for_each_entry(item, head, ci_entry) {
			policy_node = to_stp_policy_node(item);

			if (!strcmp(start,
				    policy_node->group.cg_item.ci_name)) {
				ret = policy_node;

				if (!end)
					goto out;

				head = &policy_node->group.cg_children;
				goto next;
			}
		}
		break;
	}

out:
	return ret;
}

struct stp_policy_node *
stp_policy_node_lookup(struct stm_device *stm, char *s)
{
	struct stp_policy_node *policy_node = NULL;

	mutex_lock(&stp_policy_subsys.su_mutex);

	mutex_lock(&stm->policy_mutex);
	if (stm->policy)
		policy_node = __stp_policy_node_lookup(stm->policy, s);
	mutex_unlock(&stm->policy_mutex);

	if (policy_node)
		config_item_get(&policy_node->group.cg_item);
	mutex_unlock(&stp_policy_subsys.su_mutex);

	return policy_node;
}

void stp_policy_node_put(struct stp_policy_node *policy_node)
{
	config_item_put(&policy_node->group.cg_item);
}

int __init stp_configfs_init(void)
{
	int err;

	config_group_init(&stp_policy_subsys.su_group);
	mutex_init(&stp_policy_subsys.su_mutex);
	err = configfs_register_subsystem(&stp_policy_subsys);

	return err;
}

void __exit stp_configfs_exit(void)
{
	configfs_unregister_subsystem(&stp_policy_subsys);
}


CompletionEvent)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEvent`, `OfflineAudioCompletionEventInit`*"]
    pub fn new(
        type_: &str,
        event_init_dict: &OfflineAudioCompletionEventInit,
    ) -> Result<OfflineAudioCompletionEvent, JsValue>;
}
<filename>gstreamer-rtsp-server/src/auto/rtsp_server.rs
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT

use crate::RTSPAuth;
use crate::RTSPClient;
use crate::RTSPFilterResult;
use crate::RTSPMountPoints;
use crate::RTSPSessionPool;
use crate::RTSPThreadPool;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::ToValue;
use std::boxed::Box as Box_;
use std::mem::transmute;
use std::ptr;

glib::wrapper! {
    #[doc(alias = "GstRTSPServer")]
    pub struct RTSPServer(Object<ffi::GstRTSPServer, ffi::GstRTSPServerClass>);

    match fn {
        type_ => || ffi::gst_rtsp_server_get_type(),
    }
}

impl RTSPServer {
    #[doc(alias = "gst_rtsp_server_new")]
    pub fn new() -> RTSPServer {
        assert_initialized_main_thread!();
        unsafe { from_glib_full(ffi::gst_rtsp_server_new()) }
    }

    #[doc(alias = "gst_rtsp_server_io_func")]
    pub fn io_func<P: IsA<gio::Socket>, Q: IsA<RTSPServer>>(
        socket: &P,
        condition: glib::IOCondition,
        server: &Q,
    ) -> Result<(), glib::error::BoolError> {
        skip_assert_initialized!();
        unsafe {
            glib::result_from_gboolean!(
                ffi::gst_rtsp_server_io_func(
                    socket.as_ref().to_glib_none().0,
                    condition.into_glib(),
                    server.as_ref().to_glib_none().0
                ),
                "Failed to connect the source"
            )
        }
    }
}

impl Default for RTSPServer {
    fn default() -> Self {
        Self::new()
    }
}

unsafe impl Send for RTSPServer {}
unsafe impl Sync for RTSPServer {}

pub const NONE_RTSP_SERVER: Option<&RTSPServer> = None;

pub trait RTSPServerExt: 'static {
    #[doc(alias = "gst_rtsp_server_client_filter")]
    fn client_filter(
        &self,
        func: Option<&mut dyn (FnMut(&RTSPServer, &RTSPClient) -> RTSPFilterResult)>,
    ) -> Vec<RTSPClient>;

    #[doc(alias = "gst_rtsp_server_create_socket")]
    fn create_socket<P: IsA<gio::Cancellable>>(
        &self,
        cancellable: Option<&P>,
    ) -> Result<gio::Socket, glib::Error>;


)
    }
    #[doc = "Bit 11 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie11(&self) -> ADC14IE11_R {
        ADC14IE11_R::new(((self.bits >> 11) & 0x01) != 0)
    }
    #[doc = "Bit 12 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie12(&self) -> ADC14IE12_R {
        ADC14IE12_R::new(((self.bits >> 12) & 0x01) != 0)
    }
    #[doc = "Bit 13 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie13(&self) -> ADC14IE13_R {
        ADC14IE13_R::new(((self.bits >> 13) & 0x01) != 0)
    }
    #[doc = "Bit 14 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie14(&self) -> ADC14IE14_R {
        ADC14IE14_R::new(((self.bits >> 14) & 0x01) != 0)
    }
    #[doc = "Bit 15 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie15(&self) -> ADC14IE15_R {
        ADC14IE15_R::new(((self.bits >> 15) & 0x01) != 0)
    }
    #[doc = "Bit 16 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie16(&self) -> ADC14IE16_R {
        ADC14IE16_R::new(((self.bits >> 16) & 0x01) != 0)
    }
    #[doc = "Bit 17 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie17(&self) -> ADC14IE17_R {
        ADC14IE17_R::new(((self.bits >> 17) & 0x01) != 0)
    }
    #[doc = "Bit 19 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie19(&self) -> ADC14IE19_R {
        ADC14IE19_R::new(((self.bits >> 19) & 0x01) != 0)
    }
    #[doc = "Bit 18 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie18(&self) -> ADC14IE18_R {
        ADC14IE18_R::new(((self.bits >> 18) & 0x01) != 0)
    }
    #[doc = "Bit 20 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie20(&self) -> ADC14IE20_R {
        ADC14IE20_R::new(((self.bits >> 20) & 0x01) != 0)
    }
    #[doc = "Bit 21 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie21(&self) -> ADC14IE21_R {
        ADC14IE21_R::new(((self.bits >> 21) & 0x01) != 0)
    }
    #[doc = "Bit 22 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie22(&self) -> ADC14IE22_R {
        ADC14IE22_R::new(((self.bits >> 22) & 0x01) != 0)
    }
    #[doc = "Bit 23 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie23(&self) -> ADC14IE23_R {
        ADC14IE23_R::new(((self.bits >> 23) & 0x01) != 0)
    }
    #[doc = "Bit 24 - Interrupt enable"]
    #[inline(always)]
    pub fn adc14ie24(&self) -> ADC14IE24_R {
        ADC14IE24_R::new(((self.bits >> 24) & 0x01) != 0)
    }
    #[doc = "Bit 25 - Interrupt enable"]
    #[inline(always


n(name) {
      return meta.byId(name || this.defaultIconset);
    },

    iconChanged: function() {
      if (this.icon) {
        var parts = String(this.icon).split(':');
        var icon = parts.pop();
        if (icon) {
          var set = this.getIconset(parts.pop());
          if (set) {
            set.applyIcon(this, icon, this.activeTheme, this.size / set.iconSize);
          }
        }
      }
    }

  });

})();
</script>

</polymer-element>
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<link rel="import" href="../../core-iconset-svg/core-iconset-svg.html">
<core-iconset-svg id="device" iconSize="24">
<svg><defs>
<g id="battery-std">
	<g>
		<rect fill="none" width="24" height="24"/>
		<g>
			<path d="M16.7,4H15V2H9v2H7.3C6.6,4,6,4.6,6,5.3v15.3C6,21.4,6.6,22,7.3,22h9.3c0.7,0,1.3-0.6,1.3-1.3V5.3C18,4.6,17.4,4,16.7,4z
				 M16,12H8V6h8V12z"/>
		</g>
	</g>
</g>
<g id="screen-rotation">
	<g>
		<rect fill="none" width="24" height="24"/>
		<path d="M16.5,2.5c3.3,1.5,5.6,4.7,6,8.5h1.5C23.4,4.8,18.3,0,12,0c-0.2,0-0.4,0-0.7,0l3.8,3.8L16.5,2.5z M10.2,1.7
			c-0.6-0.6-1.5-0.6-2.1,0L1.7,8.1c-0.6,0.6-0.6,1.5,0,2.1l12,12c0.6,0.6,1.5,0.6,2.1,0l6.4-6.4c0.6-0.6,0.6-1.5,0-2.1L10.2,1.7z
			 M14.8,21.2l-12-12l6.4-6.4l12,12L14.8,21.2z M7.5,21.5c-3.3-1.5-5.6-4.7-6-8.5H0.1C0.6,19.2,5.7,24,12,24c0.2,0,0.4,0,0.7,0
			l-3.8-3.8L7.5,21.5z"/>
	</g>
</g>
<g id="signal-cellular-2-bar">
	<g>
		<path fill="#231F20" d="M2,22h20V2L2,22z M20,20h-6v-7.2l6-6V20z"/>
		<rect fill="none" width="24" height="24"/>
	</g>
</g>
<g id="sd-storage">
	<g>
		<rect fill="none" width="24" height="24"/>
		<g>
			<path d="M18,2h-8L4,8l0,12c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2V4C20,2.9,19.1,2,18,2z M12,8h-2V4h2V8z M15,8h-2V4h2V8z M18,8h-2
				V4h2V8z"/>
		</g>
	</g>
</g>
<g id="data-usage">
	<g>
		<rect fill="none" width="24" height="24"/>
		<path d="M13,2.1v3c3.4,0.5,6,3.4,6,6.9c0,0.9-0.2,1.7-0.5,2.5l2.6,1.5c0.6-1


e Maximum (F1)")
        self.__btn_icon_size_2.setToolTip("Set Icon Size Normal (F2)")
        self.__btn_icon_size_3.setToolTip("Set Icon Size Minimum (F3)")
        self.__btn_play.setToolTip("Play Playlist in Viewer (P)")
        self.__btn_import.setToolTip("Import File into Nuke (I)")

        # lineEdit
        self.__lineEdit_debug = QtWidgets.QLineEdit("파일을 등록하세요")
        self.__lineEdit_debug.setFont(self.font_2)
        self.__lineEdit_debug.setEnabled(False)
        self.__lineEdit_debug.setAlignment(QtCore.Qt.AlignVCenter)
        self.__lineEdit_debug.setStyleSheet(
            "color: rgb(255, 255, 255);" "background-color: rgba(0, 0, 0, 0);"
        )
        # checkBox
        hbox_checkBox = QtWidgets.QHBoxLayout()
        hbox_checkBox.setAlignment(QtCore.Qt.AlignRight)
        check_label = QtWidgets.QLabel("Multiple Viewer")
        self.__check_viewer = QtWidgets.QCheckBox()
        self.__check_viewer.setChecked(True)
        self.__check_viewer.setToolTip("Choose Viewer (V)")
        check_label.setToolTip("Choose Viewer (V)")

        # labels
        label_list = QtWidgets.QLabel("Selected Playlist")
        label_list.setAlignment(QtCore.Qt.AlignCenter)
        label_list.setFont(self.font_3)

        # spacer
        h_spacer = QtWidgets.QSpacerItem(
            200, 25, QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed
        )

        # set layouts
        hbox_btn.addWidget(self.__btn_icon_size_1)
        hbox_btn.addWidget(self.__btn_icon_size_2)
        hbox_btn.addWidget(self.__btn_icon_size_3)
        hbox_btn.addWidget(self.__lineEdit_debug)
        hbox_btn.addWidget(self.__btn_import)
        hbox_btn.addWidget(self.__btn_play)

        hbox_checkBox.addWidget(check_label)
        hbox_checkBox.addWidget(self.__check_viewer)

        hbox_chg_idx.addWidget(label_list)
        hbox_chg_idx.addItem(h_spacer)
        hbox_chg_idx.addWidget(self.__btn_idx_up)
        hbox_chg_idx.addWidget(self.__btn_idx_down)

        vbox_1.addWidget(self.__item_listview)
        vbox_1.addLayout(hbox_checkBox)
        vbox_1.addLayout(hbox_btn)
        vbox_2.addLayout(hbox_chg_idx)
        vbox_2.addWidget(self.__text_listview)
        main_hbox = QtWidgets.QHBoxLayout()
        main_hbox.addLayout(vbox_1)
        main_hbox.addLayout(vbox_2)

        # set widget
        self.setFixedSize(840, 480)
        # self.setSizePolicy(
        #     QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
        # )
        widget_1.setLayout(main_hbox)
        self.setCentralWidget(widget_1)
        qt_lib.QtLibs.center_on_screen(self)
        self.setWindowTitle("Nuke Player")
        self.setStyleSheet(
            "color: rgb(255, 255, 255);" "background-color: rgb(70, 70, 70);"
        )

    def __set_menu(self) -> None:
        """
        메뉴바 생성 및 메뉴 관리
        """
        # menu
        menubar = QtWidgets.QMenuBar()
        menu_file = menubar.addMenu("File")
        menu_help = menubar.addMenu("Help")
        self.file_1 = QtWidgets.QAction("Open in Files", self)
        # self.file_2 = QtWidgets.QAction("Quit", self)
        self.help_1 = QtWidgets.QAction("What's this?", self)
        self.help_2 = QtWidgets.QAction("Keyboard Shortcut", self)
        self.file_1.setShortcut(QtGui.QKeySequence("Ctrl+F"))
        # self.file_2.setShortcut(QtGui.QKeySequence("Ctrl+Q"))
        self.help_1.setShortcut(QtGui.QKeySequence("Ctrl+W"))
        self.help_2.setShortcut(QtGui.QKeySequence("Ctrl+K"))
        menu_help.addAction(self.help_1)
        menu_help.addAction(self.help_2)
        menu_file.addAction(self.file_1)
        # menu_file.addAction(self.file_2)
        # menubar QSS
        menubar.setStyleSheet(
            """
            QMenuBar {
                background-color: rgb(55, 55, 55);
                border: 1px solid #303030;
                font-family: Sans Serif;
                font-size: 12px;
            }

            QMenuBar::item {
                background-color: transparent;
                color: white;
                padding: 4px 10px;
            }

            QMenuBar::item:selected {
                background-color: rgb(30, 30, 30);
            }
            """
        )

        # menu QSS
        menu_help.setStyleSheet(
            """
            QMenu {
                background-color: rgb(50, 50, 50);
                color: white;
                border: 1px solid #303030;
                font-family: Sans Serif;
                font


#region License and copyright notice
/*
 * Kaliko Content Management System
 *
 * Copyright (c) Fredrik Schultz
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3.0 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 * http://www.gnu.org/licenses/lgpl-3.0.html
 */
#endregion

namespace KalikoCMS.PropertyType {
    using System;
    using Attributes;
    using Serialization;

    [AttributeUsage(AttributeTargets.Property)]
    public sea


.array_to_csv({name, location})},
                                        carcassia_lam_precondition_fn,
                                        carcassia_lam_start_fn,
                                        carcassia_lam_completion_condition_fn,
                                        carcassia_lam_completion_fn)

  local quests = {{thirsty_quest, 2},
                  {rowboat_quest, 2},
		  {fishfeast_quest, 2},
                  {villagevisit_quest, 2},
		  {newjob_quest, 2},
		  {fadv


3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z", 496, 512))},
			{EFontAwesomeIcon.Solid_GlobeAfrica, new FontAwesomeInformation("Globe with Africa shown", EFontAwesomeStyle.Solid, "", new FontAwesomeSvgInformation("M248 8C111.03 8 0 119.03 0 256s111.03 248 248 248 248-111.03 248-248S384.97 8 248 8zm160 215.5v6.93c0 5.87-3.32 11.24-8.57 13.86l-15.39 7.7a15.485 15.485 0 0 1-15.53-.97l-18.21-12.14a15.52 15.52 0 0 0-13.5-1.81l-2.65.88c-9.7 3.23-13.66 14.79-7.99 23.3l13.24 19.86c2.87 4.31 7.71 6.9 12.89 6.9h8.21c8.56 0 15.5 6.94 15.5 15.5v11.34c0 3.35-1.09 6.62-3.1 9.3l-18.74 24.98c-1.42 1.9-2.39 4.1-2.83 6.43l-4.3 22.83c-.62 3.29-2.29 6.29-4.76 8.56a159.608 159.608 0 0 0-25 29.16l-13.03 19.55a27.756 27.756 0 0 1-23.09 12.36c-10.51 0-20.12-5.94-24.82-15.34a78.902 78.902 0 0 1-8.33-35.29V367.5c0-8.56-6.94-15.5-15.5-15.5h-25.88c-14.49 0-28.38-5.76-38.63-16a54.659 54.659 0 0 1-16-38.63v-14.06c0-17.19 8.1-33.38 21.85-43.7l27.58-20.69a54.663 54.663 0 0 1 32.78-10.93h.89c8.48 0 16.85 1.97 24.43 5.77l14.72 7.36c3.68 1.84 7.93 2.14 11.83.84l47.31-15.77c6.33-2.11 10.6-8.03 10.6-14.7 0-8.56-6.94-15.5-15.5-15.5h-10.09c-4.11 0-8.05-1.63-10.96-4.54l-6.92-6.92a15.493 15.493 0 0 0-10.96-4.54H199.5c-8.56 0-15.5-6.94-15.5-15.5v-4.4c0-7.11 4.84-13.31 11.74-15.04l14.45-3.61c3.74-.94 7-3.23 9.14-6.44l8.08-12.11


 or.b #$80,d5
ll3:    move.b d5,(a0,d6)
        addq.b #1,d6
        cmp.b #$18,d6
        bne ll4
        or.b #$80,$f1(a6)
        tst.b $d9(a6)
        bpl ll5
        addq.b #1,$d6(a6)
        addq.b #1,$02a5(a6)
        btst #2,$028d(a6)
        beq ll7
        moveq #-1,d0
ll8:    nop
        dbf d0,ll8
ll7:    btst #1,$028d(a6)
        bne ll7
        move.b $d6(a6),d6
        move.l (sp)+,$ac(a6)
        rts

insline:
        move.b $d6(a6),d6
insl:   lea $d9(a6),a0
il0:    addq.b #1,d6
        tst.b (a0,d6)
        bpl il0
        move.b d6,$02a5(a6)
        cmp.b #$18,d6
        ble inslin
        bsr scroll
        move.b $02a5(a6),d6
        subq.b #1,d6
        subq.b #1,$d6(a6)
        bra msb5

inslin:
        move.l $ac(a6),-(sp)
        moveq #$19,d6
insl1:  subq.b #1,d6
        bsr vram
        cmp.b $02a5(a6),d6
        ble inl0
        lea $d8(a6),a0
        lea c64+$ecef,a1
        move.b (a1,d6),$ac(a6)
        move.b (a0,d6),d5
        st mflg
        bsr moveup
        bra insl1
inl0:   bsr clrline
        moveq #$17,d6
ins6:   cmp.b $02a5(a6),d6
        blt ins8
        move.b 2(a0,d6),d5
        and.b #$7f,d5
        tst.b 1(a0,d6)
        bpl ins7
        or.b #$80,d5
ins7:   move.b d5,2(a0,d6)
        subq.b #1,d6
        bne ins6
ins8:   move.b $02a5(a6),d6
        bsr msb5
        move.l (sp)+,$ac(a6)
        rts

moveup:
        and.b #$03,d5
        or.b $0288(a6),d5
        move.b d5,$ad(a6)
        moveq #$27,d7
        move.b $ad(a6),d2
        asl #8,d2
        move.b $ac(a6),d2
        lea (a6,d2.l),a0
        move.b $d2(a6),d2
        asl #8,d2
        move.b $d1(a6),d2
        lea (a6,d2.l),a1
movu:   move.b (a0,d7),(a1,d7)
        subq.b #1,d7
        bpl movu
        clr.l d0
        move.b d6,d0                    *Nummer der Bildschirmzeile
        mulu #1280,d0
        move.l scbase(pc),a0
        add.l d0,a0
        move.l a0,a1
        add.l #1280,a1
        move #319,d0
        tst.b mflg
        beq movu1
        clr.b mflg


效果311404',	'入场时获得自身耐久50％1个盾墙，我方目标受到攻击时优先扣除盾墙的吸收护盾值',	'',	'入场时获得自身耐久50％1个盾墙，我方目标受到攻击时优先扣除盾墙的吸收护盾值',	'',	'2',	'test_icon_1',	'',	''},
{'311405',	'',	'天赋效果311405',	'入场时获得自身耐久60％1个盾墙，我方目标受到攻击时优先扣除盾墙的吸收护盾值',	'',	'入场时获得自身耐久60％1个盾墙，我方目标受到攻击时优先扣除盾墙的吸收护盾值',	'',	'2',	'test_icon_1',	'',	''},
{'311501',	'',	'天赋效果311501',	'目标单位存在<skillEff=物理屏障>时，每HIT攻击追加目标耐久2%</color>攻击的额外伤害，不超过攻击者攻击24％',	'',	'目标单位存在<skillEff=物理屏障>时，每HIT<color=#FFC432>追加目标耐久2%</color>攻击的额外伤害，不超过攻击者<color=#FFC432>24％',	'',	'2',	'test_icon_1',	'',	''},
{'311502',	'',	'天赋效果311502',	'目标单位存在<skillEff=物理屏障>时，每HIT攻击追加目标耐久3%</color>攻击的额外伤害，不超过攻击者攻击36％',	'',	'目标单位存在<skillEff=物理屏障>时，每HIT<color=#FFC432>追加目标耐久3%</color>攻击的额外伤害，不超过攻击者<color=#FFC432>36％',	'',	'2',	'test_icon_1',	'',	''},
{'311503',	'',	'天赋效果311503',	'目标单位存在<skillEff=物理屏障>时，每HIT攻击追加目标耐久4%</color>攻击的额外伤害，不超过攻击者攻击48％',	'',	'目标单位存在<skillEff=物理屏障>时，每HIT<color=#FFC432>追加目标耐久4%</color>攻击的额外伤害，不超过攻击者<color=#FFC432>48％',	'',	'2',	'test_icon_1',	'',	''},
{'311504',	'',	'天赋效果311504',	'目标单位存在<skillEff=物理屏障>时，每HIT攻击追加目标耐久5%</color>攻击的额外伤害，不超过攻击者攻击60％',	'',	'目标单位存在<skillEff=物理屏障>时，每HIT<color


-0.18-0.72l1.34-6 C5.46,5.35,5.97,5,6.57,5H16v8.61L10.4,19.67z M20,13h-3V5h3V13z"] {
                color: var(--yt-spec-grey-3);
                d: path("M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v1.91l.01.01L1 14c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm4 0v12h4V3h-4z");
            }

            /* Share */
            [d="M15,5.63L20.66,12L15,18.37V15v-1h-1c-3.96,0-7.14,1-9.75,3.09c1.84-4.07,5.11-6.4,9.89-7.1L15,9.86V9V5.63 M14,3v6 C6.22,10.13,3.11,15.33,2,21c2.78-3.97,6.44-6,12-6v6l8-9L14,3L14,3z"] {
                color: var(--yt-spec-grey-3);
                d: path("M14 9V3L22 12L14 21V15C8.44 15 4.78 17.03 2 21C3.11 15.33 6.22 10.13 14 9Z");
            }

            /* Download */
            [d="M17 18V19H6V18H17ZM16.5 11.4L15.8 10.7L12 14.4V4H11V14.4L7.2 10.6L6.5 11.3L11.5 16.3L16.5 11.4Z"] {
                color: var(--yt-spec-grey-3);
                d: path("M16 13h-3V3h-2v10H8l4 4 4-4zM4 19v2h16v-2H4z");
            }

            /* Thanks */
            [d="M16.5,3C19.02,3,21,5.19,21,7.99c0,3.7-3.28,6.94-8.25,11.86L12,20.59l-0.74-0.73l-0.04-0.04C6.27,14.92,3,11.69,3,7.99 C3,5.19,4.98,3,7.5,3c1.4,0,2.79,0.71,3.71,1.89L12,5.9l0.79-1.01C13.71,3.71,15.1,3,16.5,3 M16.5,2c-1.74,0-3.41,0.88-4.5,2.28 C10.91,2.88,9.24,2,7.5,2C4.42,2,2,4.64,2,7.99c0,4.12,3.4,7.48,8.55,12.58L12,22l1.45-1.44C18.6,15.47,22,12.11,22,7.99 C22,4.64,19.58,2,16.5,2L16.5,2z M11.33,10.86c0.2,0.14,0.53,0.26,1,0.36c0.47,0.1,0.86,0.22,1.18,0.35 c0.99,0


Tree();
bst.addChild(10);
bst.addChild(3);
bst.addChild(0);
bst.addChild(8);
bst.addChild(6);
bst.addChild(15);
bst.addChild(11);
bst.addChild(20);

bst.preOrder();
bst.inOrder();
bst.postOrder();

bst.breadthFirstSearchTraversal();
/**
 * Definition for a binary tree node.
 * class TreeNode {
 *     val: number
 *     left: TreeNode | null
 *     right: TreeNode | null
 *     constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) {
 *         this.val = (val===undefined ? 0 : val)
 *         this.left = (left===undefined ? null : left)
 *         this.right = (right===undefined ? null : right)
 *     }
 * }
 */

function maxSumBST(root: TreeNode | null): number {
    let maxSum = 0;
    const traverse = (node: TreeNode | null): [boolean,number, number, number] => {
        if (node === null) return [true, 0, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER];
        const left = traverse(node.left);
        const right = traverse(node.right);
        if (left[0] && right[0] && node.val > left[3] && node.val < right[2]) {
            maxSum = Math.max(left[1] + right[1] + node.val, maxSum)
            return [true, left[1] + right[1] + node.val, Math.min(node.val, left[2]), Math.max(node.val, right[3])];
        }
        return [false, 0, Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER];
    }
    traverse(root)
    return maxSum
};
export class Fragment {
    id: number;
    textId: number;
    content: string;
    fragmentSartIndex: number;
    fragmentEndIndex: number;
    wordStartIndex: number;
    wordEndIndex: number;

    getCntentWithHighlightedWords(words: Array<string>): string{
        // TODO формировать html с подсветкой слов
        return this.content;
    }
}
import { Body, Controller, Get, Header, ParseIntPipe, Post, Put, Query, UseGuards} from '@nestjs/common';
import { UserService } from './user.service';
import {ApiResponse, ApiBearerAuth, ApiQuery} from '@nestjs/swagger';
import { CreateUserDto } from './dto/create-user.dto';
import { JwtAuthGuard } from '../auth/jwt-auth.guard';

@Controller('users')
export class UserController {
  constructor(private readonly usersServices: UserService) {}

//'postUser()' will handle the creating of new User
  @Post('add')
  @ApiBearerAuth()
  @UseGuards(JwtAuthGuard)
  @ApiResponse({ status: 200})
  @ApiResponse({status: 200, description: 'Create user'})
  @Header('Content-Type', 'application/json')
  postUser( @Body() user: CreateUserDto) {
    return this.usersServices.insert(user);
  }
// 'getAll()' returns the list of all the existing users in the database

  @Get()
  @ApiBearerAuth()
  @UseGuards(JwtAuthGuard)
  @ApiResponse({ status: 200})
  getAll() {
    return this.usersServices.getAllUsers();
  }

//'getBooks()' return all the books which are associated with the user
// provided through 'userID' by the request
  @Get('books')
  @ApiBearerAuth()
  @UseGuards(JwtAuthGuard)
  @ApiResponse({ status: 200})
  @ApiQuery({
    name: 'userID',
    required: true,
    type: String
  })
  getBooks( @Query('userID', ParseIntPipe) userID: number ) {
    return this.usersServices.getBooksOfUser(userID);
  }
}import type {} from "./src";
const _l = document.getElementById(
  "l"
) as FixedSizeVirtualListS1Element<HTMLDivElement>;
const l = _l.customItemCountStateManager((index) => {
  const height = _l.itemCoun


-bit overflow in address constant");
  movz(r, imm64 & 0xffff);
  imm64 >>= 16;
  movk(r, imm64 & 0xffff, 16);
  imm64 >>= 16;
  movk(r, imm64 & 0xffff, 32);
}

// Macro to mov replicated immediate to vector register.
// imm64: only the lower 8/16/32 bits are considered for B/H/S type. That is,
//        the upper 56/48/32 bits must be zeros for B/H/S type.
// Vd will get the following values for different arrangements in T
//   imm64 == hex 000000gh  T8B:  Vd = ghghghghghghghgh
//   imm64 == hex 000000gh  T16B: Vd = ghghghghghghghghghghghghghghghgh
//   imm64 == hex 0000efgh  T4H:  Vd = efghefghefghefgh
//   imm64 == hex 0000efgh  T8H:  Vd = efghefghefghefghefghefghefghefgh
//   imm64 == hex abcdefgh  T2S:  Vd = abcdefghabcdefgh
//   imm64 == hex abcdefgh  T4S:  Vd = abcdefghabcdefghabcdefghabcdefgh
//   imm64 == hex abcdefgh  T1D:  Vd = 00000000abcdefgh
//   imm64 == hex abcdefgh  T2D:  Vd = 00000000abcdefgh00000000abcdefgh
// Clobbers rscratch1
void MacroAssembler::mov(FloatRegister Vd, SIMD_Arrangement T, uint64_t imm64) {
  assert(T != T1Q, "unsupported");
  if (T == T1D || T == T2D) {
    int imm = operand_valid_for_movi_immediate(imm64, T);
    if (-1 != imm) {
      movi(Vd, T, imm);
    } else {
      mov(rscratch1, imm64);
      dup(Vd, T, rscratch1);
    }
    return;
  }

#ifdef ASSERT
  if (T == T8B || T == T16B) assert((imm64 & ~0xff) == 0, "extraneous bits (T8B/T16B)");
  if (T == T4H || T == T8H) assert((imm64  & ~0xffff) == 0, "extraneous bits (T4H/T8H)");
  if (T == T2S || T == T4S) assert((imm64  & ~0xffffffff) == 0, "extraneous bits (T2S/T4S)");
#endif
  int shift = operand_valid_for_movi_immediate(imm64, T);
  uint32_t imm32 = imm64 & 0xffffffffULL;
  if (shift >= 0) {
    movi(Vd, T, (imm32 >> shift) & 0xff, shift);
  } else {
    movw(rscratch1, imm32);
    dup(Vd, T, rscratch1);
  }
}

void MacroAssembler::mov_immediate64(Register dst, uint64_t imm64)
{
#ifndef PRODUCT
  {
    char buffer[64];
    snprintf(buffer, sizeof(buffer), "0x%" PRIX64, imm64);
    block_comment(buffer);
  }
#endif
  if (operand_valid_for_logical_immediate(false, imm64)) {
    orr(dst, zr, imm64);
  } else {
    // we can use a combination of MOVZ or MOVN with
    // MOVK to build up the constant
    uint64_t imm_h[4];
    int zero_count = 0;
    int neg_count = 0;
    int i;
    for (i = 0; i < 4; i++) {
      imm_h[i] = ((imm64 >> (i * 16)) & 0xf


//line sql.y:2781
		{
			yyVAL.statement = &Show{Type: ShowCreateTableStr, Table: yyDollar[4].tableName}
		}
	case 318:
		yyDollar = yyS[yypt-5 : yypt+1]
//line sql.y:2785
		{
			yyVAL.statement = &Show{Type: ShowCreateDatabaseStr, Database: yyDollar[4].tableName}
		}
	case 319:
		yyDollar = yyS[yypt-3 : yypt+1]
//line sql.y:2789
		{
			yyVAL.statement = &Show{Type: ShowDatabasesStr}
		}
	case 320:
		yyDollar = yyS[yypt-3 : yypt+1]
//line sql.y:2793
		{
			yyVAL.statement = &Show{Type: ShowEnginesStr}
		}
	case 321:
		yyDollar = yyS[yypt-5 : yypt+1]
//line sql.y:2797
		{
			yyVAL.statement = &Show{Full: yyDollar[2].str, Type: ShowTablesStr, Database: yyDollar[4].tableName, Filter: yyDollar[5].showFilter}
		}
	case 322:
		yyDollar = yyS[yypt-6 : yypt+1]
//line sql.y:2801
		{
			yyVAL.statement = &Show{Full: yyDollar[2].str, Type: ShowColumnsStr, Table: yyDollar[5].tableName, Filter: yyDollar[6].showFilter}
		}
	case 323:
		yyDollar = yyS[yypt-3 : yypt+1]
//line sql.y:2805
		{
			yyVAL.statement = &Show{Type: ShowProcesslistStr}
		}
	case 324:
		yyDollar = yyS[yypt-3 : yypt+1]
//line sql.y:2809
		{
			yyVAL.statement = &Show{Type: ShowQueryzStr}
		}
	case 325:
		yyDollar = yyS[yypt-3 : yypt+1]
//line sql.y:2813
		{
			yyVAL.statement = &Show{Type: ShowStatusStr}
		}
	case 326:
		yyDollar = yyS[yypt-5 : yypt+1]
//line sql.y:2817
		{
			yyVAL.statement = &Show{Type: ShowTableStatusStr, Database: yyDollar[4].tableName}
		}
	case 327:
		yyDollar = yyS[yypt-3 : yypt+1]
//line sql.y:2821
		{
			yyVAL.statement = &Show{Type: ShowTxnzStr}
		}
	case 328:
		yyDollar = yyS[yypt-3 : yypt+1]
//line sql.y:2825
		{
			yyVAL.statement = &Show{Type: ShowVariablesStr}
		}
	case 329:
		yyDollar = yyS[yypt-3 : yypt+1]
//line sql.y:2829
		{
			yyVAL.statement = &Show{Type: ShowVersionsStr}
		}
	case 330:
		yyDollar = yyS[yypt-3 : yypt+1]
//line sql.y:2833
		{
			yyVAL.statement = &Show{Type: ShowWarningsStr}
		}
	case 331:
		yyDollar = yyS[yypt-3 : yypt+1]
//line sql.y:2837
		{
			yyVAL.statement = &Show{Type: ShowUnsupportedStr}
		}
	case 332:


    Inst.setOpcode(Hexagon::A2_paddif);
    Inst.addOperand(MCOperand::createExpr(Zero));
    break;
  }

  case Hexagon::A2_tfrt: {
    const MCConstantExpr *Zero = MCConstantExpr::create(0, OutContext);
    Inst.setOpcode(Hexagon::A2_paddit);
    Inst.addOperand(MCOperand::createExpr(Zero));
    break;
  }

  case Hexagon::A2_tfrfnew: {
    const MCConstantExpr *Zero = MCConstantExpr::create(0, OutContext);
    Inst.setOpcode(Hexagon::A2_paddifnew);
    Inst.addOperand(MCOperand::createExpr(Zero));
    break;
  }

  case Hexagon::A2_tfrtnew: {
    const MCConstantExpr *Zero = MCConstantExpr::create(0, OutContext);
    Inst.setOpcode(Hexagon::A2_padditnew);
    Inst.addOperand(MCOperand::createExpr(Zero));
    break;
  }

  case Hexagon::A2_zxtb: {
    const MCConstantExpr *C255 = MCConstantExpr::create(255, OutContext);
    Inst.setOpcode(Hexagon::A2_andir);
    Inst.addOperand(MCOperand::createExpr(C255));
    break;
  }

  // "$dst = CONST64(#$src1)",
  case Hexagon::CONST64:
    if (!OutStreamer->hasRawTextSupport()) {
      const MCOperand &Imm = MappedInst.getOperand(1);
      MCSectionSubPair Current = OutStreamer->getCurrentSection();

      MCSymbol *Sym = smallData(*this, MI, *OutStreamer, Imm, 8);

      OutStreamer->SwitchSection(Current.first, Current.second);
      MCInst TmpInst;
      MCOperand &Reg = MappedInst.getOperand(0);
      TmpInst.setOpcode(Hexagon::L2_loadrdgp);
      TmpInst.addOperand(Reg);
      TmpInst.addOperand(MCOperand::createExpr(
                         MCSymbolRefExpr::create(Sym, OutContext)));
      MappedInst = TmpInst;

    }
    break;
  case Hexagon::CONST32:
    if (!OutStreamer->hasRawTextSupport()) {
      MCOperand &Imm = MappedInst.getOperand(1);
      MCSectionSubPair Current = OutStreamer->getCurrentSection();
      MCSymbol *Sym = smallData(*this, MI, *OutStreamer, Imm, 4);
      OutStreamer->SwitchSection(Current.first, Current.second);
      MCInst TmpInst;
      MCOperand &Reg = MappedInst.getOperand(0);
      TmpInst.setOpcode(Hexagon::L2_loadrigp);
      TmpInst.addOperand(Reg);
      TmpInst.addOperand(MCOperand::createExpr(HexagonMCExpr::create(
          MCSymbolRefExpr::create(Sym, OutContext), OutContext)));
      MappedInst = TmpInst;
    }
    break;

  // C2_pxfer_map maps to C2_or instruction. Though, it's possible to use
  // C2_or during instruction selection itself but it results
  // into suboptimal code.
  case Hexagon::C2_pxfer_map: {
    MCOperand &Ps = Inst.getOperand(1);
    MappedInst.setOpcode(Hexagon::C2_or);
    MappedInst.addOperand(Ps);
    return;
  }

  // Vector reduce complex multiply by scalar, Rt & 1 map to :hi else :lo
  // The insn is mapped from the 4 operand to the 3 ope


f (results.isEmpty()) error("empty response")
                    rewriteAddress(profile, results, ipv6First)
                } catch (e: Exception) {
                    Logs.d("Lookup ${profile.serverAddress} failed: ${e.readableMessage}", e)
                }
                if (groupId != null) {
                    GroupManager.postReload(groupId)
                }
            })
        }

        lookupJobs.joinAll()
        lookupPool.close()
    }

    protected fun rewriteAddress(
        bean: AbstractBean, addresses: List<InetAddress>, ipv6First: Boolean,
    ) {
        val address = addresses.sortedBy { (it is Inet4Address) xor ipv6First }[0].hostAddress

        with(bean) {
            when (this) {
                is HttpBean -> {
                    if (isTLS() && sni.isBlank()) sni = bean.serverAddress
                }

                is StandardV2RayBean -> {
                    when (security) {
                        "tls" -> if (sni.isBlank()) sni = bean.serverAddress
                    }
                }

                is HysteriaBean -> {
                    if (sni.isBlank()) sni = bean.serverAddress
                }
            }

            bean.serverAddress = address
        }
    }

    /** Force resolve & remove deduplication */
    open suspend fun tidyProxies(
        proxies: List<AbstractBean>,
        subscription: SubscriptionBean,
        proxyGroup: ProxyGroup,
        userInterface: GroupManager.Interface?,
        byUser: Boolean,
    ) {
        var newProxies = if (subscription.filterNotRegex.isNotBlank()) {
            val regex = subscription.filterNotRegex.toRegex()
            proxies.filterNot { regex.containsMatchIn(it.name) }
        } else {
            proxies
        }

        val proxiesMap = LinkedHashMap<String, AbstractBean>()
        for (proxy in newProxies) {
            var index = 0
            var name = proxy.displayName()
            while (proxiesMap.containsKey(name)) {
                println("Exists name: $name")
                index++
                name = name.replace(" (${index - 1})", "")
                name = "$name ($index)"
                proxy.name = name
            }
            proxiesMap[proxy.displayName()] = proxy
        }
        newProxies = proxiesMap.values.toList()

        if (subscription.forceResolve) forceResolve(newProxies, proxyGroup.id)

        val exists = SagerDatabase.proxyDao.getByGroup(proxyGroup.id)
        val duplicate = ArrayList<String>()
        if (subscription.deduplication) {
            Logs.d("Before deduplication: ${newProxies.size}")
            val uniqueProxies = LinkedHashSet<Deduplication>()
            val uniqueNames = HashMap<Deduplication, String>()
            for (_proxy in newProxies) {
                val proxy = Deduplication(_proxy, _proxy.javaClass.toString())
                if (!uniqueProxies.add(proxy)) {
                    val index = uniqueProxies.indexOf(proxy)
                    if (uniqueNames.containsKey(proxy)) {
                        val name = uniqueNames[proxy]!!.replace(" ($index)", "")
                        if (name.isNotBlank()) {
                            duplicate.add("$name ($index)")
                            uniqueNames[proxy] = ""
                        }
                    }
                    duplicate.add(_proxy.displayName() + " ($index)")
                } else {
                    uniqueNames[proxy] = _proxy.displayName()
                }
            }
            uniqueProxies.retainAll(uniqueNames.keys)
            newProxies = uniqueProxies.toList().map { it


level{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-left:45px}.base-info-set .el-form[data-v-7af68058] .el-form-item .results-level .el-form-item{margin-top:0!important}.base-info-set .el-form[data-v-7af68058] .el-form-item .results-level .el-form-item:nth-of-type(2){margin-left:10px}.base-info-set .el-button--text[data-v-7af68058]{color:#0052cc}.base-info-set .el-button--text.is-disabled[data-v-7af68058]{color:#a5adba}[data-v-7dda6e8f]:export{colorPrimary:#0052cc;colorBlack:#172b4d;colorSuccess:#36b37e;colorWarning:#ffab00;colorDanger:#ff5630;colorN40:#dfe1e6;axisLineColor:#dfe1e6;axisLabelFontWeight:500}.base-info-set[data-v-7dda6e8f]{width:100%;height:calc(100% - 60px)}.base-info-set .other[data-v-7dda6e8f]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:12px 12px 0}.base-info-set .moneny-title[data-v-7dda6e8f]{margin-right:10px;font-size:22px}.base-info-set .weight-data-row[data-v-7dda6e8f]{padding-bottom:20px}.base-info-set .weight-data-row .input-number[data-v-7dda6e8f] input::-webkit-inner-spin-button,.base-info-set .weight-data-row .input-number[data-v-7dda6e8f] input::-webkit-outer-spin-button{-webkit-appearance:none}.base-info-set .weight-data-row .input-number[data-v-7dda6e8f] input[type=number]{-moz-appearance:textfield}.base-info-set .weight-data-row .column+.column[data-v-7dda6e8f]{margin-left:20px}.base-info-set .weight-data-row .flex-box[data-v-7dda6e8f],.base-info-set .weight-data-row .flex-box[data-v-7dda6e8f] input{height:34px}.base-info-set .weight-data-row .range[data-v-7dda6e8f]{margin:0 8px 10px}.base-info-set .weight-data-row .el-input[data-v-7dda6e8f]{width:200px}.base-info-set .weight-data-row .el-icon-remove[data-v-7dda6e8f]{display:none;margin-left:8px;color:#ff6767;cursor:pointer}.base-info-set .weight-data-row .el-icon-remove.is-first[data-v-7dda6e8f]{margin-top:40px;margin-bottom:0}.base-info-set .weight-data-row:hover .el-icon-remove[data-v-7dda6e8f]{display:inline-block}.base-info-set .wk-help-tips[data-v-7dda6e8f]{margin-left:3px}.base-info-set .add-bar[data-v-7dda6e8f]{line-height:normal}.base-info-set .add-bar .el-button[data-v-7dda6e8f]{padding-top:0}.base-info-set .wk-text-tips[data-v


ring? = null,
    @get:Schema(title = "数据", required = true)
    val data: CodeScmSvnWebHookTriggerData
) : WebHookTriggerElement(name, id, status) {
    companion object {
        const val classType = "codeScmSvnWebHookTrigger"
    }

    override fun getClassType() = classType

    override fun findFirstTaskIdByStartType(startType: StartType): String {
        return if (startType.name == StartType.WEB_HOOK.name) {
            this.id!!
        } else {
            super.findFirstTaskIdByStartType(startType)
        }
    }

    // 增加条件这里也要补充上,不然代码库触发器列表展示会不对
    override fun triggerCondition(): List<ElementProp> {
        with(data.input) {
            return listOfNotNull(
                vuexInput(name = "relativePath", value = relativePath),
                vuexInput(name = "excludePaths", value = excludePaths),
                vuexInput(name = "includeUsers", value = includeUsers),
                vuexInput(name = "excludeUsers", value = excludeUsers)
            )
        }
    }
}

class CodeScmSvnWebHookTriggerData(
    @get:Schema(title = "ScmSvn事件触发数据", required = false)
    val input: CodeScmSvnWebHookTriggerInput
)

class CodeScmSvnWebHookTriggerInput(
    @get:Schema(title = "仓库ID", required = true)
    val repositoryHashId: String? = null,
    @get:Schema(title = "事件类型", required = false)
    val eventType: CodeEventType? = CodeEventType.POST_COMMIT,
    @get:Schema(title = "路径过滤类型", required = true)
    val pathFilterType: PathFilterType? = PathFilterType.NamePrefixFilter,
    @get:Schema(title = "相对路径", required = true)
    val relativePath: String?,
    @get:Schema(title = "排除的路径", required = false)
    val excludePaths: String?,
    @get:Schema(title = "用户黑名单", required = false)
    val excludeUsers: String?,
    @get:Schema(title = "用户白名单", required = false)
    val includeUsers: String?,
    @get:Schema(title = "新版的svn原子的类型")
    val repositoryType: TriggerRepositoryType? = null,
    @get:Schema(title = "新版的svn代码库名")
    val repositoryName: String? = null
)
/*
 * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
 *
 * Copyright (C) 2019 Tencent.  All rights reserved.
 *
 * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
 *
 * A copy of the MIT License is included in this file.
 *
 *
 * Terms of the MIT License:
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.tencent.devops.common.pipeline.pojo.element


etry shader pipeline stage.
    /// <para>(Also see DirectX SDK: ID3D11DeviceContext::GSSetSamplers)</para>
    /// </summary>
    /// <param name="startSlot">Index into the device's zero-based array to begin setting samplers to (ranges from 0 to D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1).</param>
    /// <param name="samplers">A collection of sampler-state objects (see <see cref="SamplerState"/>)<seealso cref="SamplerState"/>. See Remarks.</param>
    void SetSamplers(UInt32 startSlot, IEnumerable<SamplerState^>^ samplers);

    /// <summary>
    /// Set a geometry shader to the device.
    /// <para>(Also see DirectX SDK: ID3D11DeviceContext::GSSetShader)</para>
    /// </summary>
    /// <param name="geometryShader">A geometry shader (see <see cref="GeometryShader"/>)<seealso cref="GeometryShader"/>. Passing in NULL disables the shader for this pipeline stage.</param>
    /// <param name="classInstances">A collection of class-instance objects (see <see cref="ClassInstance"/>)<seealso cref="ClassInstance"/>. Each interface used by a shader must have a corresponding class instance or the shader will get disabled. Set to NULL if the shader does not use any interfaces.</param>
    void SetShader(GeometryShader^ geometryShader, IEnumerable<ClassInstance^>^ classInstances);

    /// <summary>
    /// Set a geometry shader to the device.
    /// <para>(Also see DirectX SDK: ID3D11DeviceContext::GSSetShader)</para>
    /// </summary>
    /// <param name="shaderAndClasses">
    /// A GeometryShader object and its classes (see <see cref="GeometryShader" />, <see cref="ShaderAndClasses" />)
    /// <seealso cref="GeometryShader" />, <seealso cref="ShaderAndClasses" />.
    /// Passing in null for the shader disables the shader for this pipeline stage.
    /// </param>
    void SetShader(ShaderAndClasses<GeometryShader^> shaderAndClasses);

    /// <summary>
    /// Bind an array of shader resources to the geometry shader stage.
    /// <para>(Also see DirectX SDK: ID3D11DeviceContext::GSSetShaderResources)</para>
    /// </summary>
    /// <param name="startSlot">Index into the device's zero-based array to begin setting shader resources to (ranges from 0 to D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1).</param>
    /// <param name="shaderResourceViews">Collection of shader resource view objects to set to the device.</param>
    void SetShaderResources(UInt32 startSlot, IEnumerable<ShaderResourceView^>^ shaderResourceViews);

protected:

    // REVIEW: why 'protected'?
    GeometryShaderPipelineStage(void)
    { }

internal:

    GeometryShaderPipelineStage(DeviceContext^ parent) : PipelineStage(parent)
    { }
};
} } } }


local tRemove = table.remove;
local tInsert = table.insert;
local tWipe = table.wipe;

TableUtil = {};

TableUtil.Constants =
{
	AssociativePriorityTable = true,
	ArraylikePriorityTable = false,
	IsIndexTable = true,
};

function ipairs_reverse(table)
	local function Enumerator(table, index)
		index = index - 1;
		local value = table[index];
		if value ~= nil then
			return index, value;
		end
	end
	return Enumerator, table, #table + 1;
end

function CreateTableEnumerator(tbl, minIndex, maxIndex)
	minIndex = minIndex and (minIndex - 1) or 0;
	maxIndex = maxIndex or math.huge;

	local function Enumerator(tbl, index)
		index = index + 1;
		if index <= maxIndex then
			local value = tbl[index];
			if value ~= nil then
				return index, value;
			end
		end
	end

	return Enumerator, tbl, minIndex;
end

function CreateTableReverseEnumerator(tbl, minIndex, maxIndex)
	minIndex = minIndex or 1;
	maxIndex = (maxIndex or #tbl) + 1;

	local function Enumerator(tbl, index)
		index = index - 1;
		if index >= minIndex then
			local value = tbl[index];
			if value ~= nil then
				return index, value;
			end
		end
	end

	return Enumerator, tbl, maxIndex;
end

function tDeleteItem(tbl, item)
	local size = #tbl;
	local index = size;
	while index > 0 do
		if item == tbl[index] then
			tRemove(tbl, index);
		end
		index = index - 1;
	end
	return size - #tbl;
end

function tIndexOf(tbl, item)
	for i, v in ipairs(tbl) do
		if item == v then
			return i;
		end
	end
end

function tContains(tbl, item)
	for k, v in pairs(tbl) do
		if item == v then
			return true;
		end
	end
	return false;
end

function TableUtil.ContainsAllKeys(lhsTable, rhsTable)
	for key, _ in pairs(lhsTable) do
		if rhsTable[key] == nil then
			return false;
		end
	end
	-- Check for any keys that are in rhsTable and not lhsTable.
	for key, _ in pairs(rhsTable) do
		if lhsTable[key] == nil then
			return false;
		end
	end
	return true;
end

function TableUtil.CompareValuesAsKeys(lhsTable, rhsTable, valueToKeyOp)
	local lhsKeys = CopyTransformedValuesAsKeys(lhsTable, valueToKeyOp);
	local rhsKeys = CopyTransformedValuesAsKeys(rhsTable, valueToKeyOp);
	return TableUtil.ContainsAllKeys(lhsKeys, rhsKeys)
end

-- This is a deep compare on the values of the table (based on depth) but not a deep comparison
-- of the keys, as this would be an expensive check and won't be necessary in most cases.
function tCompare(lhsTable, rhsTable, depth)
	depth = depth or 1;
	for key, value in pairs(lhsTable) do
		if type(value) == "table" then
			local rhsValue = rhsTable[key];
			if type(rhsValue) ~= "table" then
				return false;
			end
			if depth > 1 then
				if not tCompare(value, rhsValue, depth - 1) then
					return false;
				end
			end
		elseif value ~= rhsTable[key] then
			return false;
		end
	end

	-- Check for any keys that are in rhsTable and not lhsTable.
	for key, value in pairs(rhsTable) do
		if lhsTa


)
  String title;

  /// desc
  @JsonKey(name: 'desc')
  String desc;

  /// total
  @JsonKey(name: 'total')
  int total;

  /// stat
  @JsonKey(name: 'stat')
  BangumiStat stat;

  /// created_at
  @JsonKey(name: 'created_at')
  String createdAt;

  /// updated_at
  @JsonKey(name: 'updated_at')
  String updatedAt;

  /// creator
  @JsonKey(name: 'creator')
  BangumiCreator creator;

  /// nsfw
  @JsonKey(name: 'nsfw')
  bool nsfw;

  /// constructor
  BangumiIndex({
    required this.id,
    required this.title,
    required this.desc,
    required this.total,
    required this.stat,
    required this.createdAt,
    required this.updatedAt,
    required this.creator,
    required this.nsfw,
  });

  /// from json
  factory BangumiIndex.fromJson(Map<String, dynamic> json) =>
      _$BangumiIndexFromJson(json);

  /// to json
  Map<String, dynamic> toJson() => _$BangumiIndexToJson(this);
}

/// IndexSubject
@JsonSerializable(explicitToJson: true)
class BangumiIndexSubject {
  /// id
  @JsonKey(name: 'id')
  int id;

  /// type
  @JsonKey(name: 'type')
  BangumiSubjectType type;

  /// name
  @JsonKey(name: 'name')
  String name;

  /// images
  @JsonKey(name: 'images')
  BangumiImages images;

  /// infobox
  @JsonKey(name: 'infobox')
  List<BangumiInfoBoxItem> infobox;

  /// date
  @JsonKey(name: 'date')
  String date;

  /// comment
  @JsonKey(name: 'comment')
  String comment;

  /// added_at
  @JsonKey(name: 'added_at')
  String addedAt;

  /// constructor
  BangumiIndexSubject({
    required this.id,
    required this.type,
    required this.name,
    required this.images,
    required this.infobox,
    required this.date,
    required this.comment,
    required this.addedAt,
  });

  /// from json
  factory BangumiIndexSubject.fromJson(Map<String, dynamic> json) =>
      _$BangumiIndexSubjectFromJson(json);

  /// to json
  Map<String, dynamic> toJson() => _$BangumiIndexSubjectToJson(this);
}

/// IndexBasicInfo
/// 新增或修改条目的内容
@JsonSerializable()
class BangumiIndexBasicInfo1 {
  /// title
  @JsonKey(name: 'title')
  String title;

  /// description
  @JsonKey(name: 'description')
  String description;

  /// constructor
  BangumiIndexBasicInfo1({
    required this.title,
    required this.description,
  });

  /// from json
  factory BangumiIndexBasicInfo1.fromJson(Map<String, dynamic> json) =>
      _$BangumiIndexBasicInfo1FromJson(json);

  /// to json
  Map<String, dynamic> toJson() => _$BangumiIndexBasicInfo1ToJson(this);
}

/// IndexBasicInfo
/// 新增某条目到目录的请求信息
@JsonSerializable()
class BangumiIndexBasicInfo2 {
  /// subject_id
  @JsonKey(name: 'subject_id')
  int subjectId;

  /// sort
  @JsonKey(name: 'sort')
  int sort;

  /// comment
  @JsonKey(name: 'comment')
  String comment;

  /// constructor
  BangumiIndexBasicInfo2({
    required this.subjectId,
    required this.sort,
    required this.comment,
  });

  /// from json
  factory BangumiIndexBasicInfo2.fromJson(Map<String, dynamic> json) =>
      _$


a0, 0x0020($sp)
/* 0164C 8096B11C 0C25A94A */  jal     func_8096A528
/* 01650 8096B120 8FA50024 */  lw      $a1, 0x0024($sp)
/* 01654 8096B124 8FA40020 */  lw      $a0, 0x0020($sp)
/* 01658 8096B128 0C25AAE3 */  jal     func_8096AB8C
/* 0165C 8096B12C 8FA5001C */  lw      $a1, 0x001C($sp)
/* 01660 8096B130 8FBF0014 */  lw      $ra, 0x0014($sp)
/* 01664 8096B134 27BD0020 */  addiu   $sp, $sp, 0x0020           ## $sp = 00000000
/* 01668 8096B138 03E00008 */  jr      $ra
/* 0166C 8096B13C 00000000 */  nop


)
            p_sys->crossbar_routes[i].AudioInputIndex = i_val;
        i_val = var_GetInteger( p_this, CFG_PREFIX "audio-output" );
        if( i_val >= 0 )
            p_sys->crossbar_routes[i].AudioOutputIndex = i_val;

        IAMCrossbar *pXbar = p_sys->crossbar_routes[i].pXbar;
        LONG VideoInputIndex = p_sys->crossbar_routes[i].VideoInputIndex;
        LONG VideoOutputIndex = p_sys->crossbar_routes[i].VideoOutputIndex;
        LONG AudioInputIndex = p_sys->crossbar_routes[i].AudioInputIndex;
        LONG AudioOutputIndex = p_sys->crossbar_routes[i].AudioOutputIndex;

        if( SUCCEEDED(pXbar->Route(VideoOutputIndex, VideoInputIndex)) )
        {
            msg_Dbg( p_this, "crossbar at depth %d, routed video "
                     "output %ld to video input %ld", i, VideoOutputIndex,
                     VideoInputIndex );

            if( AudioOutputIndex != -1 && AudioInputIndex != -1 )
            {
                if( SUCCEEDED( pXbar->Route(AudioOutputIndex,
                                            AudioInputIndex)) )
                {
                    msg_Dbg(p_this, "crossbar at depth %d, routed audio "
                            "output %ld to audio input %ld", i,
                            AudioOutputIndex, AudioInputIndex );
                }
            }
        }
        else
            msg_Err( p_this, "crossbar at depth %d could not route video "
                     "output %ld to input %ld", i, VideoOutputIndex, VideoInputIndex );
    }

    /*
    ** Show properties pages from other filters in graph
    */
    if( var_GetBool( p_this, CFG_PREFIX "config" ) )
    {
        for( int i = p_sys->i_crossbar_route_depth-1; i >= 0 ; --i )
        {
            IAMCrossbar *pXbar = p_sys->crossbar_routes[i].pXbar;
            IBaseFilter *p_XF;

            if( SUCCEEDED( pXbar->QueryInterface( IID_IBaseFilter,
                                                  (void **)&p_XF ) ) )
            {
                ShowPropertyPage( p_XF );
                p_XF->Release();
            }
        }
    }

    /* Initialize some data */
    p_sys->i_current_stream = 0;

    if( !p_sys->i_streams ) return VLC_EGENERIC;

    return VLC_SUCCESS;
}

/*****************************************************************************
 * DemuxOpen: open direct show device as an access_demux module
 *****************************************************************************/
static int DemuxOpen( vlc_object_t *p_this )
{
    demux_t      *p_demux = (demux_t *)p_this;
    access_sys_t *p_sys;

    p_sys = (access_sys_t*)calloc( 1, sizeof( access_sys_t ) );
    if( !p_sys )
        return VLC_ENOMEM;
    p_demux->p_sys = (demux_sys_t *)p_sys;

    if( CommonOpen( p_this, p_sys, true ) != VLC_SUCCESS )
    {
        CommonClose( p_this, p_sys );
        return VLC_EGENERIC;
    }

    /* Everything is ready. Let's rock baby */
    msg_Dbg( p_this, "Playing...");
    p_sys->p_control->Run();

    p_demux->pf_demux   = Demux;
    p_demux->pf_control = DemuxControl;
    p_demux->info.i_title = 0;
    p_demux->info.i_seekpoint = 0;

    for( int i =


 that can be attached to hosing or resolving processes
    interface CloudAnchorListener {
        // Callback to invoke when cloud anchor task finishes
        fun onCloudTaskComplete(anchorName: String?, anchor: Anchor?)
    }

    private val TAG: String = CloudAnchorHandler::class.java.simpleName
    private val pendingAnchors = HashMap<Anchor, Pair<String?, CloudAnchorListener?>>()
    private val session: Session = arSession

    @Synchronized
    fun hostCloudAnchor(anchorName: String, anchor: Anchor?, listener: CloudAnchorListener?) {
        val newAnchor = session.hostCloudAnchor(anchor)
        // Register listener so it is invoked when the operation finishes
        pendingAnchors[newAnchor] = Pair(anchorName, listener)
    }

    @Synchronized
    fun hostCloudAnchorWithTtl(anchorName: String, anchor: Anchor?, listener: CloudAnchorListener?, ttl: Int) {
        val newAnchor = session.hostCloudAnchorWithTtl(anchor, ttl)
        // Register listener so it is invoked when the operation finishes
        pendingAnchors[newAnchor] = Pair(anchorName, listener)
    }

    @Synchronized
    fun resolveCloudAnchor(anchorId: String?, listener: CloudAnchorListener?) {
        val newAnchor = session.resolveCloudAnchor(anchorId)
        // Register listener so it is invoked when the operation finishes
        pendingAnchors[newAnchor] = Pair(null, listener)
    }

    // Updating function that should be called after each session.update call
    @Synchronized
    fun onUpdate(updatedAnchors: Collection<Anchor>) {
        for (anchor in updatedAnchors) {
            if (pendingAnchors.containsKey(anchor)) {
                if (anchor.cloudAnchorState != CloudAnchorState.NONE && anchor.cloudAnchorState != CloudAnchorState.TASK_IN_PROGRESS){
                    val element: Pair<String?, CloudAnchorListener?>? = pendingAnchors.remove(anchor)
                    element!!.second!!.onCloudTaskComplete(element.first, anchor)
                }
            }
        }
    }

    // Remove all listeners
    @Synchronized
    fun clearListeners() {
        pendingAnchors.clear()
    }

}
@file:Suppress("NOTHING_TO_INLINE")

package me.carleslc.kotlinextensions.number

import com.google.common.math.DoubleMath
import com.google.common.math.LongMath
import strings.toFixed
import java.math.BigDecimal
import java.math.RoundingMode

inline fun Long.even() = this % 2L == 0L
inline fun Number.even() = toLong().even()

inline fun Long.odd() = !even()
inline fun Number.odd() = toLong().odd()

inline fun Number.isInteger() = when (this) {
    is Double -> DoubleMath.isMathematicalInteger(this)
    is Float -> DoubleMath.isMathematicalInteger(toDouble())
    is BigDecimal -> signum() == 0 || scale() <= 0 || stripTrailingZeros().scale() <= 0
    else -> true
}

inline fun Double.floor(): Long = Math.floor(this).toLong()
inline fun Double.ceil(): Long = Math.ceil(this).toLong()

inline fun Float.floor(): Long = toDouble().floor()
inline fun Float.ceil(): Long = toDouble().ceil()

inline fun Double.clamp(min: Double, max: Double): Double = Math.max(min, Math.min(this, max))
inline fun Float.clamp(min: Float, max: Float): Float = Math.max(min, Math.min(this, max))
inline f


 panic!("Attempted to get a number from a non-object!"),
        }
    }

    pub fn Equals(self, b: Value) -> bool
    {
        match (self.ValueType, b.ValueType)
        {
            (ValueType::ValBool(ValueOfA), ValueType::ValBool(ValueOfB)) => return ValueOfA == ValueOfB,
            (ValueType::ValNil, ValueType::ValNil) => return true,
            (ValueType::ValNumber(ValueOfA), ValueType::ValNumber(ValueOfB)) => return ValueOfA == ValueOfB,
            (ValueType::ValObj(ValueOfA), ValueType::ValObj(ValueOfB)) =>
            {
                match (ValueOfA.typeOfObject, ValueOfB.typeOfObject)
                {
                    (ObjType::ObjString(valA), ObjType::ObjString(valB)) => return valA.str.eq(&valB.str),
                    _ => return false,
                }
            }
            _ => return false,
        }
    }

    pub fn IsFalsey(self) -> bool
    {
        return self.clone().IsNil() || (self.clone().IsBool() && !self.clone().GetBool());
    }
}

impl From<bool> for Value
{
    fn from(boolean: bool) -> Self
    {
        Value { ValueType: ValueType::ValBool(boolean) }
    }
}

pub fn BoolAsValue(boolean: bool) -> Value
{
    Value { ValueType: ValueType::ValBool(boolean) }
}

pub fn NilAsValue() -> Value
{
    Value { ValueType: ValueType::ValNil}
}

pub fn InternalNil() -> Value
{
    Value { ValueType: ValueType::ValInternalNil}
}

pub fn NumberAsValue(number: f64) -> Value
{
    Value { ValueType: ValueType::ValNumber(number)}
}

pub fn ObjAsValue(obj: Obj) -> Value
{
    Value { ValueType: ValueType::ValObj(Box::from(obj)) }
}

pub fn init_value_array() -> ValueArray
{
    return ValueArray {values: Vec::with_capacity(0) };
}

pub fn write_value_array(value_array: &mut ValueArray, value: Value)
{
    value_array.values.push(value);
}

pub fn print_value(value: Value)
{
    match value.ValueType
    {
        ValueType::ValBool(_) =>
        {
            if value.GetBool()
            {
                print!("true");
            }
            else
            {
                print!("false");
            }
        }
        ValueType::ValNil => print!("nil"),
        ValueType::ValNumber(_) => print!("{}", value.GetNumber()),
        ValueType::ValObj(_) =>
        {
            match value.GetObject().typeOfObject
            {
                ObjType::ObjString(val) => print!("{}", val.str),
                _ => print!("Unknown object type!"),
            }
        }
        _ => print!("ValueType not matched!"),
    }
}<gh_stars>1-10
#![no_main]
#![no_std]

use blackpill_exp as _; // global logger + panicking-behavior + memory layout

#[cortex_m_rt::entry]
fn main() -> ! {
    defmt::info!("Hello, world!");

    blackpill_exp::exit()
}
use bytecodec::json_codec::{JsonDecoder, JsonEncoder};
use bytecodec::null::NullDecoder;
use cannyls_rpc::DeviceId;
use fibers_http_server::{HandleRequest, Reply, Req, ServerBuilder as HttpServerBuilder, Status};
use fibers_rpc::client::ClientServiceHandle as RpcServiceHandle;
use futures::future::Either;
use futures::Future;
use httpcodec::{BodyDecoder, BodyEncoder};
use libfr


SET)
  }

  @Test
  fun operation_toOperation_removeFromSet() {
    assertThat(DUMMY_OP_REMOVE_FROM_SET_PROTO.toOperation()).isEqualTo(DUMMY_OP_REMOVE_FROM_SET)
  }

  @Test
  fun operation_toOperation_clearAll() {
    assertThat(DUMMY_OP_CLEAR_ALL_PROTO.toOperation()).isEqualTo(DUMMY_OP_CLEAR_ALL)
  }

  @Test
  fun operation_toOperation_operationNotSet() {
    assertFailsWith<UnsupportedOperationException> {
      DUMMY_OPERATION_NOT_SET_PROTO.toOperation()
    }.also {
      assertThat(it).hasMessageThat().contains("Unknown CrdtEntity.Operation type:")
    }
  }

  @Test
  fun operation_toProto_setSingleton() {
    assertThat(DUMMY_OP_SET_SINGLETON.toProto()).isEqualTo(DUMMY_OP_SET_SINGLETON_PROTO)
  }

  @Test
  fun operation_toProto_clearSingleton() {
    assertThat(DUMMY_OP_CLEAR_SINGLETON.toProto()).isEqualTo(DUMMY_OP_CLEAR_SINGLETON_PROTO)
  }

  @Test
  fun operation_toProto_addToSet() {
    assertThat(DUMMY_OP_ADD_TO_SET.toProto()).isEqualTo(DUMMY_OP_ADD_TO_SET_PROTO)
  }

  @Test
  fun operation_toProto_removeFromSet() {
    assertThat(DUMMY_OP_REMOVE_FROM_SET.toProto()).isEqualTo(DUMMY_OP_REMOVE_FROM_SET_PROTO)
  }

  @Test
  fun operation_toProto_clearAll() {
    assertThat(DUMMY_OP_CLEAR_ALL.toProto()).isEqualTo(DUMMY_OP_CLEAR_ALL_PROTO)
  }

  @Test
  fun operation_roundTrip_operationToProto_setSingleton() {
    roundTripFromOperation(DUMMY_OP_SET_SINGLETON)
  }

  @Test
  fun operation_roundTrip_operationToProto_clearSingleton() {
    roundTripFromOperation(DUMMY_OP_CLEAR_SINGLETON)
  }

  @Test
  fun operation_roundTrip_operationToProto_addToSet() {
    roundTripFromOperation(DUMMY_OP_ADD_TO_SET)
  }

  @Test
  fun operation_roundTrip_operationToProto_removeFromSet() {
    roundTripFromOperation(DUMMY_OP_REMOVE_FROM_SET)
  }

  @Test
  fun operation_roundTrip_operationToProto_clearAll() {
    roundTripFromOperation(DUMMY_OP_CLEAR_ALL)
  }

  @Test
  fun operation_roundTrip_protoToOperation_setSingleton() {
    roundTripFromOperationProto(DUMMY_OP_SET_SINGLETON_PROTO)
  }

  @Test
  fun operation_roundTrip_protoToOperation_clearSingleton() {
    roundTripFromOperationProto(DUMMY_OP_CLEAR_SINGLETON_PROTO)
  }

  @Test
  fun operation_roundTrip_protoToOperation_addToSet() {
    roundTripFromOperationProto(DUMMY_OP_ADD_TO_SET_PROTO)
  }

  @Test
  fun operation_roundTrip_protoToOperation_removeFromSet() {
    roundTripFromOperationProto(DUMMY_OP_REMOVE_FROM_SET_PROTO)
  }

  @Test
  fun operation_roundTrip_protoToOperation_clearAll() {
    roundTripFromOperationProto(DUMMY_OP_CLEAR_ALL_PROTO)
  }

  companion object {
    fun roundTripFromOperation(op: CrdtEntity.Operation) {
      assertThat(op.toProto().toOperation()).isEqualTo(op)
    }

    fun roundTripFromOperationProto(proto: CrdtEntityProto.Operation) {
      assertThat(proto.toOperation().toProto(


.also { meetingTeamRepository.save(it) }

                every { getUser.getById(any()) } returns currentUser

                // act
                sut.invoke(meetingTeam.id)

                // assert
                val savedMeetingTeam = meetingTeamRepository.getById(meetingTeam.id)
                savedMeetingTeam.members.none { it.userId == currentUser.id } shouldBe true
            }
        }

        context("[실패] 유저가 해당팀의 멤버가 아닐때") {
            it("팀원이 아니라는 예외를 발생시킨다.") {
                // arrange
                val meetingTeam = MeetingTeamFixtureFactory.create()
                meetingTeamRepository.save(meetingTeam)

                val user = UserFixtureFactory.create()
                val userAuthentication = UserAuthenticationFixtureFactory.create(user)
                SecurityContextHolder.setContext(UserSecurityContext(userAuthentication))

                every { getUser.getById(any()) } returns user

                // act, assert
                shouldThrow<IllegalArgumentException> {
                    sut.invoke(meetingTeam.id)
                }
            }
        }

        context("[실패] 유저가 팀장일때") {
            it("팀장은 나갈 수 없다는 예외를 발생시킨다.") {
                // arrange
                val currentUser = UserFixtureFactory.create()
                every { getUser.getById(any()) } returns currentUser

                val meetingTeam = MeetingTeamFixtureFactory
                    .create(leader = currentUser)
                    .also { meetingTeamRepository.save(it) }

                val userAuthentication = UserAuthenticationFixtureFactory.create(currentUser)
                SecurityContextHolder.setContext(UserSecurityContext(userAuthentication))

                // act, assert
                shouldThrow<IllegalArgumentException> {
                    sut.invoke(meetingTeam.id)
                }
            }
        }
    }

})
package com.studentcenter.weave.application.chat.service

import com.studentcenter.weave.application.chat.outbound.ChatRoomRepositorySpy
import com.studentcenter.weave.domain.chat.entity.ChatRoom
import com.studentcenter.weave.domain.meeting.entity.MeetingFixtureFactory
import com.studentcenter.weave.domain.meeting.enums.MeetingStatus
import com.studentcenter.weave.domain.meeting.event.MeetingCompletedEvent
import io.kotest.core.annotation.DisplayName
import io.kotest.core.spec.style.DescribeSpec
import io.kotest.matchers.shouldBe

@DisplayName("[서비스] 채팅방 생성")
class CreateChatRoomServiceTest : DescribeSpec({

    val chatRoomRepositorySpy = ChatRoomRepositorySpy()
    val sut = CreateChatRoomService(
        chatRoomRepository = chatRoomRepositorySpy,
    )

    afterEach {
        chatRoomRepositorySpy.clear()
    }

    describe("채팅방 생성") {
        context("매칭된 미팅 정보가 주어졌을때") {
            it("채팅방을 생성한다") {
                // arrange
                val meeting = MeetingFixtureFactory.create(status = MeetingStatus.COMPLETED)
                val event = MeetingCompletedEvent(meeting)

                // act
                sut.invoke(event)

                // assert
                val savedChatRooms: List<ChatRoom> = chatRoomRepositorySpy.findAll()
                savedChatRooms.size shouldBe 1

                val savedChatRoom = savedChatRooms.first()
                savedChatRoom.meetingId shouldBe meeting.id
                savedChatRoom.requestingTeamId shouldBe meeting.requestingTeamId
                savedChatRoom.receivingTeamId shouldBe meeting.receivingTeamId
            }
        }


 lowLevel.toDouble())
				else (lowLevel.toDouble() / highLevel)
			is BigInteger -> {
				val l = getLevel(lowLevel)
				when {
					l <= 4 ->
						// int
						if (!reverse) highLevel / BigInteger(lowLevel.toString())
						else BigInteger(lowLevel.toString()) / highLevel
					l == 7 ->
						// both are big integer
						if (!reverse) highLevel / lowLevel as BigInteger
						else lowLevel as BigInteger / highLevel
					else ->
						// low is Float/Double, and high is BigInteger
						// should return a big decimal
						if (!reverse) BigDecimal(highLevel) / BigDecimal(lowLevel.toString())
						else BigDecimal(lowLevel.toString()) / BigDecimal(highLevel)
				}
			}
			is BigDecimal ->
				highLevel / BigDecimal(lowLevel.toString())
			else -> typeMisMatch("Numberic", lowLevel, meta)
		}
	}

}
package site.notion.timothypro.service

import cn.hutool.json.JSONObject
import okhttp3.MediaType
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Service
import site.notion.timothypro.bean.PageObj

/**
 * @author gefangshuai
 * @createDate: 2021/10/7
 */
@Service
class NotionService {
    @Value("\${app.notion.notion-version}")
    private lateinit var notionVersion: String

    @Value("\${app.notion.notion-url}")
    private lateinit var notionApiUrl: String

    private var client: OkHttpClient? = null
    private val logger = LoggerFactory.getLogger(NotionService::class.java)

    companion object {
        val JSON: MediaType = "application/json; charset=utf-8".toMediaType()
    }

    private fun getClient(): OkHttpClient {
        if (client == null) client = OkHttpClient()
        return client!!
    }

    private fun initPostRequest(url: String, token: String): Request.Builder {
        return Request.Builder()
            .header("Authorization", "Bearer $token")
            .header("Notion-Version", notionVersion)
            .header("Content-Type", "application/json")
            .url(url)
    }

    fun createPage(page: PageObj, token: String, parentId: String): Response {
        page.parent = PageObj.Parent(parentId)
        val data = JSONObject(page).toString()
        val request = initPostRequest(notionApiUrl, token)
            .post(
                data.toRequestBody(JSON)
            ).build()
        logger.debug("Post JSON: $data")
        return this.getClient().newCall(request).execute()
    }

}/*
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.example.plasma

import android.app.Activity
import android.os.Bundle
import android.content.Context
import android.view.View
import android.graphics.Bitmap
import android.


be von Saron",
        ["esES"] = "Foso de Saron",
        ["esMX"] = "Foso de Saron",
        ["frFR"] = "Fosse de Saron",
        ["koKR"] = "사론의 구덩이",
        ["ptBR"] = "Fosso de Saron",
        ["ruRU"] = "Яма Сарона",
        ["zhCN"] = "萨隆矿坑",
        ["zhTW"] = "薩倫之淵",
    },
    ["Halls of Reflection"] = {
        ["enUS"] = true,
        ["deDE"] = "Hallen der Reflexion",
        ["esES"] = "Cámaras de Reflexión",
        ["esMX"] = "Cámaras de Reflexión",
        ["frFR"] = "Salles des Reflets",
        ["koKR"] = "투영의 전당",
        ["ptBR"] = "Salões da Reflexão",
        ["ruRU"] = "Залы Отражений",
        ["zhCN"] = "映像大厅",
        ["zhTW"] = "倒影大廳",
    },
    ["Transport: Alliance Gunship (IGB)"] = {
        ["enUS"] = true,
        ["deDE"] = "Transport: Kanonenschiff der Allianz (IGB)",
        ["esES"] = "Transporte: Nave de Guerra de la Alianza",
        ["esMX"] = "Transporte: Nave de Guerra de la Alianza",
        ["frFR"] = "Transport: canonnière de l'Alliance (IGB)",
        ["koKR"] = "수송: 얼라이언스 비행포격선",
        ["ptBR"] = "Transporte: Belonave da Aliança (IGB)",
        ["ruRU"] = "Транспорт: боевой корабль Альянса (IGB)",
        ["zhCN"] = "Transport: Alliance Gunship (IGB)",
        ["zhTW"] = "傳送:聯盟砲艇(IGB)",
    },
    ["Transport: Horde Gunship (IGB)"] = {
        ["enUS"] = true,
        ["deDE"] = "Transport: Kanonenschiff der Horde (IGB)",
        ["esES"] = "Transporte: Nave de Guerra de la Horda",
        ["esMX"] = "Transporte: Nave de Guerra de la Horda",
        ["frFR"] = "Transport : canonnière de la Horde(IGB)",
        ["koKR"] = "수송: 호드 비행포격선",
        ["ptBR"] = "Transporte: Belonave da Horda (IGB)",
        ["ruRU"] = "Транспорт: боевой корабль Орды (IGB)",
        ["zhCN"] = "Transport: Horde Gunship (IGB)",
        ["zhTW"] = "傳送:部落砲艇(IGB)",
    },
    ["The Frost Queen's Lair"] = {
        ["enUS"] = true,
        ["deDE"] = "Der Hort der Frostkönigin",
        ["esES"] = "La Guarida de la Reina de Escarcha",
        ["esMX"] = "La Guarida de la Reina de Escarcha",
        ["frFR"] = "Le repaire de la reine du Givre",
        ["koKR"] = "서리 여왕의 둥지",
        ["ptBR"] = "Covil da Rainha Gélida",
        ["ruRU"] = "Логово Королевы Льда",
        ["zhCN"]


/********************************************************************************************************
 * @file    usbkb.c
 *
 * @brief   This is the source file for usbkb
 *
 * @author  Driver & Zigbee Group
 * @date    2021
 *
 * @par     Copyright (c) 2021, Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK")
 *          All rights reserved.
 *
 *          Licensed under the Apache License, Version 2.0 (the "License");
 *          you may not use this file except in compliance with the License.
 *          You may obtain a copy of the License at
 *
 *              http://www.apache.org/licenses/LICENSE-2.0
 *
 *          Unless required by applicable law or agreed to in writing, software
 *          distributed under the License is distributed on an "AS IS" BASIS,
 *          WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *          See the License for the specific language governing permissions and
 *          limitations under the License.
 *
 *******************************************************************************************************/

#include "usbkb.h"

#if (MODULE_KEYBOARD_ENABLE)

u8 usbkb_hid_report_normal(u8 ctrl_key, u8 *keycode){
	if(usbhw_is_ep_busy(USB_EDP_KEYBOARD_IN))
		return 0;

	reg_usb_ep_ptr(USB_EDP_KEYBOARD_IN) = 0;

	// please refer to keyboard_report_desc
	reg_usb_ep_dat(USB_EDP_KEYBOARD_IN) = ctrl_key;
	reg_usb_ep_dat(USB_EDP_KEYBOARD_IN) = 0;//resv
	foreach(i, KEYBOARD_REPORT_KEY_MAX){
	    reg_usb_ep_dat(USB_EDP_KEYBOARD_IN) = keycode[i];
	}
	reg_usb_ep_ctrl(USB_EDP_KEYBOARD_IN) = FLD_EP_DAT_ACK;		// ACK
	return 1;
}

#endif


/*-------------------------------------------------------------------------
   _itoa.c - integer to string conversion

   Copyright (c) 1999, Bela Torok, bela.torok@kssg.ch

   This library is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this library; see the file COPYING. If not, write to the
   Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
   MA 02110-1301, USA.

   As a special exception, if you link this library with other files,
   some of which are compiled with SDCC, to produce an executable,
   this library does not by itself cause the resulting executable to
   be covered by the GNU General Public License. This exception does
   not however invalidate any other reasons why the executable file
   might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/

#include <stdlib.h>

/*-------------------------------------------------------------------------
 usage:

 __uitoa(unsigned int value, char* string, int radix)
 __itoa(int value, char* string, int radix)

 value  ->  Number to be converted
 string ->  Result
 radix  ->  Base of value (e.g.: 2 for binary, 10 for decimal, 16 for hex)
---------------------------------------------------------------------------*/

void __uitoa(unsigned int value, char* string, unsigned char radix)
{
  signed char index = 0, i = 0;

  /* generate the number in reverse order */
  do {
    string[index] = '0' + (value % radix);
    if (string[index] > '9')
        string[index] += 'A' - '9' - 1;
    value /= radix;
    ++index;
  } while (value != 0);

  /* null terminate the string */
  string[index--] = '\0';

  /* reverse the order of digits */
  while (index > i) {
    char tmp = string[i];
    string[i] = string[index];
    string[index] = tmp;
    ++i;
    --index;
  }
}

char *uitoa(unsigned int value, char *string, unsigned char radix) OLDCALL
{
    __uitoa(value, string, radix);
    return string;
}

char* itoa(int value, char* string, unsigned char radix) OLDCALL
{
  char* s = string;
  if (value < 0 && radix == 10) {
    *string++ = '-';
    value = -value;
  }
  __uitoa(value, string, radix);
  return s;
}


models/projects.dart';
import 'package:transparent_image/transparent_image.dart';
import 'package:share_plus/share_plus.dart';
import 'package:mobile_app/gen_l10n/app_localizations.dart';

class FeaturedProjectCard extends StatefulWidget {
  const FeaturedProjectCard({
    required this.project,
    required this.onViewPressed,
    super.key,
  });

  final Project project;
  final VoidCallback onViewPressed;

  @override
  _FeaturedProjectCardState createState() => _FeaturedProjectCardState();
}

class _FeaturedProjectCardState extends State<FeaturedProjectCard> {
  Widget _buildPreview() {
    final hasImage = widget.project.attributes.imagePreview.url.isNotEmpty;
    final isDefaultServerImage = widget.project.attributes.imagePreview.url
        .contains('/assets/empty_project/default-');

    return (hasImage && !isDefaultServerImage)
        ? FadeInImage.memoryNetwork(
          height: 160,
          width: double.infinity,
          fit: BoxFit.cover,
          placeholder: kTransparentImage,
          image: _getImageUrl(),
          imageErrorBuilder:
              (context, error, stackTrace) => _buildDefaultImage(),
        )
        : _buildDefaultImage();
  }

  Widget _buildDefaultImage() {
    return Image.asset(
      'assets/images/projects/default_project_image.png',
      height: 160,
      width: double.infinity,
      fit: BoxFit.cover,
      errorBuilder: (context, error, stackTrace) => _buildPlaceholderImage(),
    );
  }

  Widget _buildPlaceholderImage() {
    return Container(
      height: 160,
      width: double.infinity,
      color: Color.lerp(CVTheme.primaryColorLight, Colors.white, 0.95),
      child: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Icon(
              Icons.bolt,
              size: 48,
              color: Color.lerp(CVTheme.primaryColor, Colors.white, 0.7),
            ),
            const SizedBox(height: 8),
            Text(
              'CircuitVerse Project',
              style: TextStyle(
                color: Color.lerp(CVTheme.primaryColor, Colors.white, 0.4),
                fontSize: 14,
                fontWeight: FontWeight.w500,
              ),
            ),
          ],
        ),
      ),
    );
  }

  String _getImageUrl() {
    final base = Uri.parse(
      EnvironmentConfig.CV_API_BASE_URL,
    ).replace(pathSegments: []).toString().replaceAll(RegExp(r'\/+$'), '');
    return '$base${widget.project.attributes.imagePreview.url}';
  }

  String _stripHtml(String htmlString) {
    return htmlString
        .replaceAll(RegExp(r'<[^>]*>'), '')
        .replaceAll(' ', ' ')
        .replaceAll('&', '&')
        .replaceAll('<', '<')
        .replaceAll('>', '>')
        .replaceAll('"', '"')
        .replaceAll(''', "'")
        .trim();
  }

  String _getProjectUrl() {
    final base = Uri.parse(
      EnvironmentConfig.CV_API_BASE_URL,
    ).replace(pathSegments: []).toString().replaceAll(RegExp(r'\/+$'), '');
    return '$base/simulator/embed/${widget.project.id}';
  }

  void _shareProject() async {
    final projectUrl = _getProjectUrl();

    try {
      final box = context.findRenderObject() as RenderBox?;
      await SharePlus.instance.share(
        ShareParams(
          text: projectUrl,
          sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
        ),
      );
    } catch (e) {
      debugPrint('Error sharing project: $e');
    }
  }

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(8.0),
      child: Card(
        shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
        clipBehavior: Clip.antiAliasWithSaveLayer,
        elevation: 5,
        shadowColor:
            Theme.of(context).brightness == Brightness.dark
                ? Colors.white.withValues(alpha: 0.1)
                : CVTheme.boxShadow(context),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            _buildPreview(),
            Container(


#!/usr/bin/env python

# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import einops
import numpy as np
import torch
from torch import Tensor

from lerobot.common.envs.configs import EnvConfig
from lerobot.common.utils.utils import get_channel_first_image_shape
from lerobot.configs.types import FeatureType, PolicyFeature

def preprocess_observation(observations: dict[str, np.ndarray]) -> dict[str, Tensor]:
    # TODO(aliberts, rcadene): refactor this to use features from the environment (no hardcoding)
    """Convert environment observation to LeRobot format observation.
    Args:
        observation: Dictionary of observation batches from a Gym vector environment.
    Returns:
        Dictionary of observation batches with keys renamed to LeRobot format and values as tensors.
    """
    # map to expected inputs for the policy
    return_observations = {}
    if "pixels" in observations:
        if isinstance(observations["pixels"], dict):
            imgs = {f"observation.images.{key}": img for key, img in observations["pixels"].items()}
        else:
            imgs = {"observation.image": observations["pixels"]}

        for imgkey, img in imgs.items():
            # TODO(aliberts, rcadene): use transforms.ToTensor()?
            img = torch.from_numpy(img)

            # sanity check that images are channel last
            _, h, w, c = img.shape
            assert c < h and c < w, f"expect channel last images, but instead got {img.shape=}"

            # sanity check that images are uint8
            assert img.dtype == torch.uint8, f"expect torch.uint8, but instead {img.dtype=}"

            # convert to channel first of type float32 in range [0,1]
            img = einops.rearrange(img, "b h w c -> b c h w").contiguous()
            img = img.type(torch.float32)
            img /= 255

            return_observations[imgkey] = img

    if "environment_state" in observations:
        return_observations["observation.environment_state"] = torch.from_numpy(
            observations["environment_state"]
        ).float()

    # TODO(rcadene): enable pixels only baseline with `obs_type="pixels"` in environment by removing
    # requirement for "agent_pos"
    return_observations["observation.state"] = torch.from_numpy(observations["agent_pos"]).float()
    return return_observations

def env_to_policy_features(env_cfg: EnvConfig) -> dict[str, PolicyFeature]:
    # TODO(aliberts, rcadene): remove this hardcoding of keys and just use the nested keys as is
    # (need to also refactor preprocess_observation and externalize normalization from policies)
    policy_features = {}
    for key, ft in env_cfg.features.items():
        if ft.type is FeatureType.VISUAL:
            if len(ft.shape) != 3:
                raise ValueError(f"Number of dimensions of {key} != 3 (shape={ft.shape})")

            shape = get_channel_first_image_shape(ft.shape)
            feature = PolicyFeature(type=ft.type, shape=shape)
        else:
            feature = ft

        policy_key = env_cfg.features_map[key]
        policy_features[policy_key] = feature

    return policy_features


ff104da0e0fe486"),
			new FingerBean("","/templets/default/images/logo.gif","","bdd886e11bb936803232fef8dfe6c2a1"),
			new FingerBean("","/member/space/person/header.htm","","a7a79405fccfcd7d9e949c9bdd1a7661"),
			new FingerBean("","/data/admin/ver.txt","","00f2e7ba5cdd5129b55c6805c214743d"),
			new FingerBean("","/dede/img/admin_top_logo.gif","","1e78c168da8271af6538b00e4baf53d5"),
			new FingerBean("","/plus/carbuyaction.php","","f2f63580e59ebe950d72329b64982567"),
			new FingerBean("","/data/admin/allowurl.txt","","dda6f3b278f65bd77ac556bf16166a0c"),
			new FingerBean("","/favicon.ico","","93cc5f5b4c2d22841e3f5c952db5116a"),
			new FingerBean("","/images/loadinglit.gif","","0ceba25d8d8e384791e857391eb71e2a"),
			new FingerBean("","/data/cache/inc_catalog_base.inc","","b780f6325717b238bb2cd9c9544a49e7"),
			new FingerBean("","/member/images/member.gif","","9e41920b6e9a04a55e886589ac12146a"),
			new FingerBean("","/member/templets/images/login_logo.gif","","15e2e455b176f7b1d49e5ca3a4f79f5d"),
			new FingerBean("","/plus/img/wbg.gif","","6e8b9b8af42923fa0ecf89c0054e4091"),
			new FingerBean("","/data/cache/index.htm","","736007832d2167baaae763fd3a3f3cf1"),
			new FingerBean("","/member/space/person/common/css/css.css","","4f8fbb4cc1bec8f6adef5af0bfa9e4d6"),
			new FingerBean("","/member/space/person/common/css/css.css","","18d1c80fed83a6f849ad72f882a5bc51"),
			new FingerBean("","/plus/carbuyaction.php","","c0bfcc65d13187d1f8cd950ab42ee505"),
			new FingerBean("","/member/images/dzh_logo.gif","","412f80bbedc1e3c62b7f5a5038a550e6"),
			new FingerBean("","/data/admin/allowurl.txt","","324b52fafc7b532b45e63f1d0585c05d"),
			new FingerBean("","/templets/default/style/dedecms.css","","d02a1fb2710a28077507473ef0734c90"),
			new FingerBean("","/member/images/base.css","","25a56fa7119fd0792f0eb3e4749b86c9"),
			new FingerBean("","/dede/templets/article_coonepage_rule.htm","","371fe4fd4c3085b112867d54d531ea6c"),
			new FingerBean("","/templets/default/style/dedecms.css","","cb4ff97d66bbaa15b2fcd4f5ba473449"),
			new FingerBean("","/templets/default/style/dedecms.css","","17680cec


("  -ssh-connection\n");
    printf("                 强制只使用SSH连接协议\n");
    printf("  -P 端口        连接到指定端口\n");
    printf("  -l 用户名      用指定的用户名连接\n");
    printf("  -batch         禁用所有交互式提示\n");
    printf("  -proxycmd 命令\n");
    printf("                 使用'命令'作为本地代理\n");
    printf("  -sercfg        设置字符串(比如 19200,8,n,1,X)\n");
    printf("                 指定串口配置(仅限串口)\n");
    printf("以下选项仅适用于SSH连接:\n");
    printf("  -pwfile 文件   从指定文件读取登陆密码\n");
    printf("  -D [IP地址]:端口号\n");
    printf("                 基于动态SOCKS的端口转发\n");
    printf("  -L [IP地址]:端口号:远端主机:端口\n");
    printf("                 将本地端口转发到远端地址\n");
    printf("  -R [IP地址]:端口号:远端主机:端口\n");
    printf("                 将远程端口转发到本地地址\n");
    printf("  -X -x          启用/禁用X11转发\n");
    printf("  -A -a          启用/禁用代理转发\n");
    printf("  -t -T          启用/禁用putty转发\n");
    printf("  -1 -2          强制使用特定的SSH协议版本\n");
    printf("  -4 -6          强制使用IPv4或IPv6\n");
    printf("  -C             启用压缩\n");
    printf("  -i 私钥        用于用户认证的私钥文件\n");
    printf("  -noagent       禁用Pageant身份认证代理\n");
    printf("  -agent         启用Pageant身份认证代理\n");
    printf("  -no-trivial-auth\n");
    printf("                 仅连接无密码或密钥验证，则断开连接\n");
    printf("  -noshare       禁用连接共享\n");
    printf("  -share         启用连接共享\n");
    printf("  -hostkey 密钥ID\n");
    printf("                 手动指定主机密钥(可重复)\n");
    printf("  -sanitise-stderr, -sanitise-stdout, "
           "-no-sanitise-stderr, -no-sanitise-stdout\n");
    printf("                 是否从标准输出/错误中去除控制字符\n");
    printf("  -no-antispoof  认证后忽略反欺骗提示\n");
    printf("  -m 文件        从文件中读取远程命令\n");
    printf("  -s             远程命令式作为SSH子系统(仅SSH-2)\n");
    printf("  -N             不启动shell/命令(仅SSH-2)\n");
    printf("  -nc 主机:端口\n");
    printf("                 打开隧道代替会话(仅SSH-2)\n");
    printf("  -sshlog 文件\n");
    printf("  -sshrawlog 文件\n");
    printf("                 将协议详细信息记录到文件\n");
    printf("  -logoverwrite\n");
    printf("  -logappend\n");
    printf("                 日志文件已存在时是覆盖还是追加到日志\n");
    printf("  -shareexists\n");
    printf("                 测试是否存在连接共享上游\n");
}

static void version(void)
{
    char *buildinfo_text = buildinfo("\n");
    printf("plink: %s\n%s\n", ver, buildinfo_text);
    sfree(buildinfo_text);
    exit(0);
}

size_t stdin_gotdata(struct handle *h, const void *data, size_t len, int err)
{
    if (err) {
        char buf[4096];
        FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0,
                      buf, lenof(buf), NULL);
        buf[lenof(buf)-1] = '\0';
        if (buf[strlen(buf)-1] == '\n')
            buf[strlen(buf)-1] = '\0';
        fprintf(stderr, "无法从标准输入读取: %s\n", buf);
        cleanup_exit(0);
    }

    noise_ultralight(NOISE_SOURCE_IOLEN, len);
    if (backend_connected(backend)) {
        if (len > 0) {
            backend_send(backend, data, len);
            return backend_sendbuffer(backend);
        } else {
            backend_special(backend, SS_EOF, 0);
            return 0;
        }
    } else
        return 0;
}

void stdouterr_sent(struct handle *h, size_t new_backlog, int err, bool close)
{
    if (close) {
        CloseHandle(outhandle);
        CloseHandle(errhandle);
        outhandle = errhandle = INVALID_HANDLE_VALUE;
    }

    if (err) {
        char buf[4096];
        FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0,
                      buf, lenof(buf), NULL);
        buf[lenof(buf)-1] = '\0';
        if (buf[strlen(buf)-1] == '\n')
            buf[strlen(buf)-1] = '\0';
        fprintf(stderr, "无法写入标准输出 %s: %s\n",
                (h == stdout_handle ? "输出" : "错误"), buf);
        cleanup_exit(0);
    }

    if (backend_connected(backend)) {
        backend_unthrottle(backend, (handle_backlog(stdout_handle) +
                                     handle_backlog(stderr_handle)));
    }
}

const bool share_can_be_downstream = true;
const bool share_can_be_upstream = true;

const unsigned cmdline_tooltype =
    TOOLTYPE_HOST_ARG |
    TOOLTYPE_HOST_ARG_CAN_BE_SESSION |
    TOOLTYPE_HOST_ARG_PROTOCOL_PREFIX |
    TOOLTYPE_HOST_ARG_FROM_LAUNCHABLE_LOAD;

static bool sending;

static bool plink_mainloop_pre(void *vctx, const HANDLE **extra_handles,
                               size_t *n_extra_handles)
{
    if (!sending && backend_sendok(backend)) {
        stdin_handle = handle_input_new(inhandle, stdin_gotdata, NULL,
                                        0);
        sending = true;
    }

    return true;
}

static bo


uct(Module.VULKAN, "VkExternalMemoryProperties", mutable = false) {
    VkExternalMemoryFeatureFlags("externalMemoryFeatures")
    VkExternalMemoryHandleTypeFlags("exportFromImportedHandleTypes")
    VkExternalMemoryHandleTypeFlags("compatibleHandleTypes")
}

val VkPhysicalDeviceExternalImageFormatInfo = struct(Module.VULKAN, "VkPhysicalDeviceExternalImageFormatInfo") {
    Expression("#STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO")..VkStructureType("sType")
    nullable..opaque_const_p("pNext")
    VkExternalMemoryHandleTypeFlagBits("handleType")
}

val VkExternalImageFormatProperties = struct(Module.VULKAN, "VkExternalImageFormatProperties", mutable = false) {
    Expression("#STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES")..VkStructureType("sType").mutable()
    nullable..opaque_p("pNext").mutable()
    VkExternalMemoryProperties("externalMemoryProperties")
}

val VkPhysicalDeviceExternalBufferInfo = struct(Module.VULKAN, "VkPhysicalDeviceExternalBufferInfo") {
    Expression("#STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO")..VkStructureType("sType")
    PointerSetter(
        "VkBufferUsageFlags2CreateInfo", "VkBufferUsageFlags2CreateInfoKHR",
        prepend = true
    )..nullable..opaque_const_p("pNext")
    VkBufferCreateFlags("flags")
    VkBufferUsageFlags("usage")
    VkExternalMemoryHandleTypeFlagBits("handleType")
}

val VkExternalBufferProperties = struct(Module.VULKAN, "VkExternalBufferProperties", mutable = false) {
    Expression("#STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES")..VkStructureType("sType").mutable()
    nullable..opaque_p("pNext").mutable()
    VkExternalMemoryProperties("externalMemoryProperties")
}

val VkPhysicalDeviceIDProperties = struct(Module.VULKAN, "VkPhysicalDeviceIDProperties", mutable = false) {
    javaImport("static org.lwjgl.vulkan.VK10.*")
    javaImport("static org.lwjgl.vulkan.VK11.*")
    Expression("#STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES")..VkStructureType("sType").mutable()
    nullable..opaque_p("pNext").mutable()
    uint8_t("deviceUUID")["VK_UUID_SIZE"]
    uint8_t("driverUUID")["VK_UUID_SIZE"]
    uint8_t("deviceLUID")["VK_LUID_SIZE"]
    uint32_t("deviceNodeMask")
    VkBool32("deviceLUIDValid")
}

val VkExternalMemoryImageCreateInfo = struct(Module.VULKAN, "VkExternalMemoryImageCreateInfo") {
    Expression("#STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO")..VkStructureType("sType")
    nullable..opaque_const_p("pNext")
    VkExternalMemoryHandleTypeFlags("handleTypes")
}

val VkExternalMemoryBufferCreateInfo = struct(Module.VULKAN, "VkExternalMemoryBufferCreateInfo") {
    Expression("#STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO")..VkStructureType("sType")
    nullable..opaque_const_p("pNext")
    VkExternalMemoryHandleTypeFlags("handleTypes")
}

val VkExportMemoryAllocateInfo = struct(Module.VULKAN, "VkExportMemoryAllocateInfo") {
    Expression("#STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO")..VkStructureType("sType")
    nullable..opaque_const_p("pNext")
    VkExternalMemoryHandleTypeFlags("handle